QFM010: Elixir Reading List March 2024

Everything that I found interesting last month about the Elixir ecosystem

Matthew Sinclair
6 min readApr 12, 2024
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 below:

How to format Elixir doctests?: The article introduces “Doctest Formatter,” a plugin created to format Elixir doctests within documentation, making it easier to maintain clean and readable code examples. It details installation instructions, usage for formatting .ex files and doctests, and mentions the plugin’s compatibility requirements with Elixir version 1.13.2 or higher. The formatter also standardizes the appearance of iex> prompts in doctests, adhering to best practices recommended in Elixir documentation.

#Elixir #DoctestFormatter #CodeFormatting #ElixirProgramming #DevelopmentTools

Simple .env-like configuration in Elixir: 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.

#Elixir #EnvConfig #DevelopmentBestPractices #ElixirProgramming #NoExternalDependencies

What is Elixir GenServer?: 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.

#Elixir #GenServer #ConcurrentProgramming #ErlangOTP #FunctionalProgramming

Phoenix is not your application (unlike Rails): 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.

#WebDevelopment #PhoenixFramework #RubyOnRails #SoftwareArchitecture #ElixirLang

Safer Error Systems in Elixir: 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.

#ElixirLang #ErrorHandling #CodingBestPractices #ErrorMessageLibrary #SoftwareDevelopment

thmsmlr / instructor_ex: 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.

#Elixir #OpenAI #StructuredData #LanguageModels #EctoSchema

exliris-haystack / Haystack: 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.

#Haystack #ElixirLibrary #FullTextSearch #SoftwareDevelopment #TextIndexing

How to secure Elixir codebases: Fireside chat with Holden Oullette: 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.

#Elixir #CodingSecurity #Sobelow #Semgrep #ElixirCommunity

Credo rules you’ve been sleeping on: 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.

#Elixir #Credo #CodeQuality #PhoenixFramework #SoftwareDevelopment

Absinthe with Phoenix Framework — a guide to properly get started with GraphQL using Elixir: 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.

#Absinthe #PhoenixFramework #GraphQL #Elixir #APIDevelopment

Implementing Natural Conversational Agents with Elixir: 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.

#ConversationalAI #ElixirProgramming #VoiceTech #NaturalLanguageProcessing #TechInnovation

Regards, M@

[ED: If you’d like to sign up for this content as an email, click here to join the mailing list.]

Originally published on quantumfaxmachine.com.

--

--