Elixir Blog Posts

Network optimization (4x WS message size reduction) for sending lot of data from LiveView to client using push_event

Why choose between Elixir and Python when you can have the best of both? Read about the tricks to borrowing Python libraries for your Elixir applications.

A post was split to a new topic: How to install Elixir 1.16.1 on WIndows 11

Thank you very much, it was exactly what I was looking for!

I would appreciate if you could continue with more examples :slight_smile:

When simple bash scripts start to become unwieldy, you may consider reaching out for something ā€œhigherā€ level, like Perl, Ruby or Python. Iā€™m reaching out for Elixir.

3 Likes

Published an article about Composite ā€“ a small utility for writing dynamic queries.

1 Like

How integrating Alpine.js with LiveView can significantly enhance the user experience in your applications.

:arrow_right: Enhancing user experience in LiveView applications with Alpine.js | Curiosum

1 Like

Iā€™ve been working a lot with WebAssembly/Rust and Typescript and I realized, setting up both is a bit confusing at times. I wrote a couple of blog posts on both topics:

Setting up TypeScript: WF

Setting up Rust/WASM in Liveview: WF (Just finished Chapter 2!)

1 Like

The Elixir ecosystem has very strong abstractions. One of these is Telemetry, which decouples instrumentation from an appā€™s main code.

Telemetry is synchronous by default, but with a little GenServer magic itā€™s possible to collect analytics without a major performance hit.

1 Like

Tips and techniques to make Oban job errors easier to identify, differentiate, and diagnose in monitoring tools like Sentry.

2 Likes

After some recent experimental work with LiveView (related to what I discussed with you, @bcd765), I was inspired to write an article about distributed systems design. In doing so, I found a critical flaw in modern browser architecture that, when fixed, is sufficient to serve as a universal interface for self-executing code for AGI.

https://medium.com/@imkleats/fear-and-loathing-in-dom-vegas-abea2a21774e

If you enjoy this article, Iā€™ve written a follow-up article. That article summarizes the findings of a thought experiment in which I asked this AGI to ā€œmaximize peopleā€™s enjoyment of apples, while minimizing wasted applesā€ as its kernel code, and then thought of which questions it would ask itself in response.

As I built out its physics engine using the distributed systems architecture, I found the AGI would likely wonder what this ā€œsecondā€ thing is because time is very much important to apple production.

https://medium.com/@imkleats/a-computers-theory-of-time-84c13dceb1a5

If you can find a flaw in either of these, please let me know. I am not a physicist, and I am very startled by the conclusions my thought experiment has reached. I would appreciate someone, anyone being able to give me a sanity check.

(edit: If you canā€™t find an obvious flaw, please share. I donā€™t mind being roasted if itā€™s hot garbage, but the more eyes on it will lead me to knowing sooner rather than later.)

1 Like

I recently gave a talk in school, introducing the fundamentals of functional programming and an introduction to Elixir with applications with Phoenix.

Wrote up a comprehensive guide for it that I would love to share as a learning resource for those interested in learning more about Elixir and Phoenix: https://practical-elixir.woojiahao.com/

I also have the accompanying talk on YouTube: https://youtu.be/-VHBMXxCee0?si=us88VL8HFl75fokp

Do let me know your thoughts on these as I would love to continue expanding on these resources for future uses :smiley: I would greatly appreciate any feedback!

3 Likes

A new article on our Curiosum blog that goes in-depth on the Absinthe topic :slight_smile:

I wrote an article on what Iā€™m calling ā€œThe BEAM Spectrumā€. Enjoy!

https://medium.com/@kkmvv/the-beam-spectrum-75035dcd92f9

I buried the lede about my first article, but I canā€™t figure out how to edit it again. It contains a complete solution to Fieldingā€™s Code-on-Demand constraint for REST architecture that is arrived at via inductive proof. Itā€™s written in gonzo style because I believe that the experience of the investigator is as essential to understanding their conclusions as the methodology itself, and we do ourselves a disservice when we are lazily spoon-fed ā€œfactsā€.

The argument is actually highly structured, but you have to go along for the ride. It lays out definitions, satisfies those definitions, and then uses the newly-available properties of the thing defined to continue the inquiry. If you disagree with my initial definition, you should relax a bit because youā€™re probably trying to impose constraints that donā€™t matter; when placed in a separate layer, it becomes the rigid concept you might have had in mind.

The article is written from a front-end perspective, but when I say ā€œDOMā€ in the article, you can read that to mean ā€œany possible representation of a hypermedia resourceā€ and ā€œhypermediaā€ is in the eye of the beholder. This architecture could broadly solve network-related and distributed systems-related issues if it were used on the backend, and I imagine it could also ā€œscale downā€ to orchestrate at the GPU level for parallelizable computation-intensive tasks.

Enabling CRUD on the hypermedia representation in the way proposed, while supporting the ā€œephemeralā€ networking between hypermedia representation nodes, may actually constitute a wholly new architecture that happens to satisfy REST, thus getting all the advantages of REST while being supremely flexible - the abstraction is the abstraction at that point.

I had this blogpost open in a tab for ages. Finally read it. I must say, this is a magnificent write-up! Both in style and content. It deserves more praise. I am type-averse (or better: type-scared), but this was a great summary of everything type-related in Elixir.

Thanks for sharing! I see itā€™s your first post, but hope to read more. Keep it up!

Thank you very much, Iā€™m glad you liked it!

Iā€™ve been a bit in the weeds for the last few months building a product (with LiveView!), but Iā€™m starting to see the light at the end of that tunnel so Iā€™ll probably start publishing again soon (itā€™s certainly given me a lot to write about).

Indeed, as Iā€™ve written even more Elixir in the time since I wrote that article, Iā€™ve become all the more convinced that most of their value comes from serving as a form of documentation. Dialyzer does surface the occasional bug, though, which is convenient, but I probably wouldnā€™t use typespecs so heavily if it wasnā€™t for the nice popups I get from them in nvim (courtesy of ElixirLS).

In the same vein I go out of my way to write a full @doc with an example for basically every internal function in my applications, even though (at least for the time being) Iā€™m the only one who reads them. Eventually I forget how my own code works (donā€™t we all?), and having a little example pop up when I autocomplete the function makes all the difference.

I forgot to reply to this at the time, but many thanks to you as well! Indeed, Erlang style pattern matching is probably much more intutive for those with a background in math - something I hadnā€™t considered. I really do think the pattern matching is probably the most confusing part of learning Elixir, more so than immutability. Probably because immutability/recursion are still taught and used in C-style code even if they are not the focus.

Ironically, j = j + 1 is perfectly valid in Elixir (though not in Erlang)!

1 Like

the title should be something like:

How to measure memory used by a process and its descendants

This is by no means exhaustive, and some values may be not completely accurate, so its very possible that you find something not completely right. If so, please correct anything in the comments (or here)
https://joez99.medium.com/calculate-the-memory-used-by-a-process-and-its-descendants-e0bcc93d4652

1 Like

After my previous livestream I went ahead and made a text version of what we covered. If you want to learn about S3-compatible Object Storage and cool things you can do to it with Elixir, read on. Basics as well as presigning, chunked uploads and range requests.

2 Likes

Iā€™ve been working with Livebook much more extensively over the last few months and thereā€™s a lot to love about it.

So I wrote a blog post about why I think every Elixir developer should add it to their toolkit.

2 Likes