Systems | Development | Analytics | API | Testing

Elixir

Parser Combinators in Elixir: A Deeper Dive

In our last post, we wrote a basic parser for phone numbers using Elixir. It was a bit simplistic since it didn't really respect the format phone numbers are expected to have, but it was a great start. We'll now improve the parser to ensure we only accept phone numbers that fit the spec and make our return type an instance of structured data. Let's dive straight in!

Parser Combinators in Elixir: Taming Semi-Structured Text

The need to manipulate strings comes up quite often, whether it's to validate user-provided values or transform text into structured data that can be used programmatically. Most often, we'll reach for regular expressions to accomplish this task, but sometimes there's a better solution to the problem: parser combinators. In this two-part article, we'll explore how they work. Before moving on, let's define what 'parsing' is: Source: Wikipedia.

Phoenix LiveView 0.18: New Special HTML Attributes

Phoenix LiveView 0.18 just shipped, with lots of new goodies to make developing LiveView an even better experience. In this post, I'll take you through a lesser-known new feature - LiveView's new special HTML attributes - and show you how to write cleaner HTML with :if, :for, and :let. When we're done, you'll have an eloquent, ergonomic, and dynamic function component you can use to render a list anywhere in your LiveView app. Let's dive in!

Faster XML Parsing with Elixir

The XML data format has been around since 1996. It was first envisioned as a lingua franca (bridging language) for data to be serialized and read into completely disparate systems (with different programming languages, operating systems, and even hardware). It has been wildly successful in that goal. In software, though, 26 years is like a lifetime — and in hardware, it's an eternity.

Fix Process Bottlenecks with Elixir 1.14's Partition Supervisor

Elixir v1.14 shipped earlier this month with a bunch of new goodies. In this post, we'll explore Elixir's new PartitionSupervisor. We'll take a look at some code that suffers from the exact bottleneck issue that partitions supervisors are designed to solve. Then, we'll fix that bottleneck. Along the way, you'll learn how partition supervisors work under the hood to prevent process bottlenecks. Let's get started!

Elixir 1.14: Better Debugging with dbg/2 and More

The latest Elixir release introduces new features to improve your developer and debugging experience. In this post, we'll take a look at the new dbg() functionality, along with some improvements to Inspect and binary evaluation error messaging. All these changes come together to make you an even more productive Elixirist. Let's get started!

Benchmark Your Elixir App's Performance with Benchee

At some point, every software engineer will find themselves in a situation where they need to benchmark system performance and test the limits of what a given system can handle. This is a common problem in software engineering, and even more so in the applications that are well suited for Elixir. Finding bottlenecks early on in an application can save a lot of time, money, and effort in the long run, and give developers confidence in the upper limit of a system.

Predictable Code in Elixir: Expressions as Reducers and Macros

In the first part of this series on maintainable Elixir code, we started by applying rules for code predictability in our code design. We immediately saw an emerging pattern: a series of transformations on state. In this part, we'll explore this pattern further. We'll first learn how to write expressions as reducers. Then we'll use metaprogramming to make use of reducers and enforce code style seamlessly. Finishing up, we'll see an example where all the pieces fit together. Let's get going!

Write a Standalone CLI Application in Elixir

While Elixir is frequently associated with web development, this is not where its capabilities end. As a general-purpose language, it can be used for virtually anything. You don't have to take my word for it — projects such as Nerves, Nx, Scenic, or LiveBook speak for themselves. But today, we will focus on something different: writing a command-line application in Elixir and preparing it for distribution.