QFM010: Elixir Reading List - March 2024
Source: Photo by Michael Dziedzic on Unsplash
Here is everything I found interesting about the Elixir programming ecosystem during March 2024.
The March Edition Quantum Fax Machine's Elixir Reading List starts with a discussion on the Doctest Formatter plugin for enhancing code readability, then dives into practical solutions for developers, such as managing environment-specific configurations efficiently without external dependencies as discussed in Simple .env-like configuration in Elixir.
We then look at Elixir's GenServer in What is Elixir GenServer?, reflecting on the language's capabilities handling complex asynchronous operations. We also take a look at architectural principles, comparing the Phoenix and Rails frameworks in "Phoenix is not your application (unlike Rails)".
We also look at error handling within Elixir projects as well as integration with large language models (LLMs) through the thmsmlr / instructor_ex library, which makes generating regular and programmatically workable output from LLMs much easier.
Security practices and tools like Semgrep are discussed, offering insights into protecting Elixir code, highlighted by a Fireside chat with Holden Oullette on secure coding practices. We take a quick look at Credo for static analysis, linting, and code quality improvements in "Credo rules you've been sleeping on".
Among other links, this month's collection also looks at a very practical guide for integrating GraphQL with the Phoenix Framework via Absinthe.
As always, the Quantum Fax Machine Propellor Hat Key will guide your browsing. Enjoy!

See the Slideshare version of the post or read on:
Links
The article contrasts the architectural philosophies of Ruby on Rails and Phoenix, highlighting that while Rails often becomes tightly coupled with applications, Phoenix encourages a clear separation between the web layer and the core business logic. This distinction allows developers to build more modular, maintainable applications with Phoenix.
This is an Elixir library that offers a simple, extendable full-text search engine, facilitating the creation and management of search indexes with customisable fields and storage, and enabling easy querying of those indexes.
The article outlines a method for managing environment-specific configurations in Elixir projects without external dependencies, by leveraging plain Elixir scripts (.exs files) for setting environment variables, thereby simplifying the development and testing process.
This article describes Elixir's GenServer as a behavior module for building concurrent and stateful processes in a more idiomatic and user-friendly way than its Erlang counterpart. It provides an overview of implementing GenServer with practical examples and discusses when to use or not use it for specific applications.
This webinar features Holden Oullette, a key member of the Elixir community and maintainer of Sobelow, discussing secure coding practices in Elixir, his contributions to Semgrep for Elixir, and his visions for the language and community's future. Semgrep is highlighted as a scalable code security tool for organizations.
This article discusses improving error handling in Elixir by merging the clarity of strings with the simplicity of atoms for more manageable and insightful errors, and introduces the `ErrorMessage` library to standardise and simplify error representation, making debugging and user experience better.
This article details the author's efforts to improve a conversational agent named Nero by implementing an "always on" recording feature and refining the end-to-end conversation flow using Elixir, focusing on natural interaction and reducing latency for a more seamless user experience. Part 1 where Sean builds the first version of his _Nero_ home assistant is [here](https://seanmoriarity.com/2024/02/25/nero-part-1-home-automations/){:target="_blank"}.
This article is a comprehensive tutorial on setting up a GraphQL server using the Elixir Phoenix Framework with Absinthe, covering everything from basic setup and configuration to defining queries, mutations, and subscriptions. It assumes basic knowledge of Phoenix and GraphQL.
This article discusses optimising Elixir projects by adjusting Credo settings for better code quality, highlighting enabling strict mode, disabling certain checks like `AliasOrder`, and activating others like `MixEnv` and `PassAsyncInTestCases`. It suggests a balanced approach to using Credo for linting/static analysis in Phoenix projects.
`instructor_ex` is an Elixir library designed for structured, Ecto-based outputs with OpenAI and other open-source large language models (LLMs), facilitating JSON mapping to Ecto schemas for more structured responses than traditional unstructured text outputs. It highlights ease of use, adaptability to various models, and potential for automated prompt retrying upon validation failure. This library adds a missing layer that makes working with LLMs much more controllable, robust, and reliable. Here is a really good video that explains Instructor in practice: [Thomas Millar, Instructor - The bridge between Elixir and AI](https://www.youtube.com/watch?v=RABXu7zqnT0&ab_channel=Paraxial){:target="_blank"}.
Regards,
M@
Originally published by M@ on Medium.
Was this useful?