Elixir Blog Posts

Building a Ragnarok Online Server in Elixir, parts 1 and 2

https://medium.com/@ygorcastor/building-a-ragnarok-online-server-in-elixir-4c6d75a61d74

2 Likes

If you ever wanted to throw a payload to a light storage without any setup or configuration, now is the time :smile:

2 Likes

Learning Elixir: Structs

New article in my Elixir learning series exploring Structs - Elixir’s powerful tool for creating structured data with compile-time guarantees and pattern matching capabilities.

Key topics covered:

  • Defining and using structs with defstruct
  • Field defaults and required fields
  • Pattern matching and data validation
  • Structs vs Maps - when to choose each
  • Best practices for domain modeling
  • Common patterns and pitfalls to avoid

With practical examples and IEx sessions to help you build more robust Elixir applications.

Check it out: Learning Elixir: Structs

2 Likes

Oh hey, here’s a couple of new posts that may be relevant to people here:

1 Like

Caller tracking has been a thing in Elixir for a while, but still is a relatively obscure topic. Here’s a very short 5 minute guide that omits all the details and just gives you just one example to keep at the back of your head.

2 Likes

This is a post that describes how I used Elixir to add automations to the Hue Tap Dial Switch via MQTT and Zigbee2mqtt.

2 Likes

This blog post shows how I set up Cursor Background Agents to work on Elixir code.

2 Likes

Hi, all! I’ve just published a blog post covering how to clean up Elixir code using ast-grep: Cleaning up code using ast-grep | Ievgen Pyrogov

It’s a step-by-step tutorial that starts with a naive “find-and-replace” rule that fails with an error, then progresses to build a handful of useful rules to fix the code style in tests, in a large codebase.

4 Likes

You beat me to it, nice.

1 Like

@dimitarvp comments are welcome btw :slight_smile: also, I’ll gladly read your piece on ast-grep too when publish one!

Hey, just wanted to let you know that my talk about Permit and authorization is now public on YouTube. and to celebrate this I wrote an article covering my impressions from the conference as well as reflecting on the talk’s content and what’s been going on since.

Enjoy the watch & read!

1 Like

My OCaml-flavoured Elixir style - a personal take on Elixir code style which, for me, produces slightly better results than regular Elixir code conventions.

7 Likes

Pretty good article! And thanks a lot for the Fey library. I have looked for similar libraries and found several but they never quite went all the way. You have put attention to detail in yours and I love it. I will use it. Thanks!

Responding to your three main points in the article:

  1. Self-containing

This is fine and I understand it and somewhat like it but I think it has to be said that it’s also a bit of a forced point. With modern IDE tooling – including in the terminal with Neovim – you can jump backwards and forwards between function definitions all day long without losing focus. I get the appeal of everything being in one place and I also prefer it but have compromised on it long time ago because it’s not very often that we can get away with such small self-contained units. Private functions help a lot.

  1. Follows prepare-execute-format flow

This is kind of the same as item 1 IMO and same points apply; I do like it but it’s not often that I can practice it in my paid work.

  1. Using OCaml-like helpers

Should have also added Rust. :wink:

I love that item. I tried introducing libraries or home-grown macros but work teams were always adamant that they don’t want it. I see their point; the corresponding Elixir code is not difficult to grasp and is 100% explicit – this is a solid argument and I have yielded upon hearing it almost every time.

BUT.

Sometimes you can get away with a shorter function if you use stuff like Fey, and the code fits on a single screen and is more understandable.

I’ve met an awful lot of programmers who shrug and say “I’ll not forget what it does” which of course they do but various ego factors prevent them from ever connecting the dots, plus they often don’t account for future programmers and onboarding. The amount of senior devs onboarding me and looking embarrassed when we went through some particularly gnarly code pieces can fill an entire 12-hour comedy marathon.

I am not judging though. I understand how they arrive at that situation. But I would have avoided it by making use of such convenient wrappers like yours.

Again, thanks for Fey. I will absolutely use it.

Learning Elixir: Binaries and Bitstrings

New article in my Elixir learning series exploring Binaries and Bitstrings - fundamental data types for efficient binary data manipulation and low-level operations.

Key topics covered:

  • Understanding the difference between binaries and bitstrings
  • Binary syntax and pattern matching
  • Working with UTF-8 strings and raw bytes
  • Bitstring operations and bit-level manipulation
  • Performance considerations and memory efficiency
  • Common use cases in real-world applications
  • Best practices for binary data processing

With practical examples and IEx sessions to help you master binary data handling in Elixir.

Check it out: Learning Elixir: Binaries and Bitstrings

2 Likes

PostHog Elixir SDK 2.0 dropped, and I wrote a post about how it came to be.

3 Likes
4 Likes

Hi all, since this thread is getting long and less usable now (and as we’re running late with our custom platform) you can now post dedicated threads for blog posts directly in this section. The system will add a blogs-by-YOURNAME tag to each thread posted to make it easy for people to follow (or mute) blogs.

If you’ve posted a blog post in this thread in the last two months then please feel free to repost it as a dedicated thread in this section :023:

6 Likes

This topic was automatically closed after 4 days. New replies are no longer allowed.