Posts
-
Ash Framework: Calculations and Uncertainty
How Ash calculations work and ways to deal with missing or uncertain data. -
Ash Framework: Diving into Validation
“That’s just, like, your opinion, man.” —The Big Lebowski (1998) -
Ash Framework: A Closer Look at Actions
Time for a closer look at actions. -
Ash Framework: Evaluating Ash for Existing Systems
How difficult is it to incorporate Ash into an existing codebase? -
Ash Framework: Combining Ash Writes with Electric Reads
Exploring how Ash implements Ecto. -
Ash Framework: Why Authorization gets Messy
Where is the mess? -
Ash Framework: Authorization and Monoids
Authorization logic gets messy fast. -
Ash Framework: The Coordination Problem
Not organization but coordination. -
Ash Framework: My Misconceptions
It’s all about the domain. -
What's an Effect?
How do we handle side effects in a pure functional system? -
Can an LLM Tutor?
“I’m not even sure what’s real anymore.” —The Matrix (1999) -
Polymorphism and Behavior Injection
When are two things the same? -
Generate Livebooks with an LLM
So many loops… -
What is going on?
“They found me. I don’t know how, but they found me.” — Dr. Emmett Brown -
Livebook Examples from Advanced Functional Programming with Elixir
It feels a bit impolite to ask readers to download code and type mix commands just to run the examples. We have better tools now. -
What's the point of a polymorphic eq?
Why not keep equality inside the module where it belongs? -
Polymorphism and Structs in Elixir
Polymorphism has always relied on tags. Elixir’s structs make them safer. -
Polymorphism in Elixir
This post walks through the basics of protocols in Elixir. It’s the information I wish I knew five years ago. -
Why Is This So Hard?
-
Advanced Functional Programming with Elixir is now in beta!
-
Elixir Syntax: Functions
Elixir Syntax Series Data Types and Collections Variables Control Flow Functions -
Elixir Syntax: Control Flow
Elixir Syntax Series Data Types and Collections Variables Control Flow Functions -
Elixir Syntax: Variables
Elixir Syntax Series Data Types and Collections Variables Control Flow Functions -
Elixir Syntax: Data Types and Collections
Elixir Syntax Series Data Types and Collections Variables Control Flow Functions -
Elixir and Raft: Running a cluster with state
Elixir Cluster Series Leveraging CRDTs for eventual consistency Elixir: Resilient distributed systems Elixir: Running a cluster of nodes Elixir: Running a cluster of dynamic nodes Elixir and Mnesia: Running a cluster with state Elixir and Raft: Running a cluster with state -
Elixir and Mnesia: Running a cluster with state
Elixir Cluster Series Leveraging CRDTs for eventual consistency Elixir: Resilient distributed systems Elixir: Running a cluster of nodes Elixir: Running a cluster of dynamic nodes Elixir and Mnesia: Running a cluster with state Elixir and Raft: Running a cluster with state -
Elixir: Running a cluster of dynamic nodes
Elixir Cluster Series Leveraging CRDTs for eventual consistency Elixir: Resilient distributed systems Elixir: Running a cluster of nodes Elixir: Running a cluster of dynamic nodes Elixir and Mnesia: Running a cluster with state Elixir and Raft: Running a cluster with state -
Elixir Testing Series
Testing behaviors -
Elixir: Running a cluster of nodes
Elixir Cluster Series Leveraging CRDTs for eventual consistency Elixir: Resilient distributed systems Elixir: Running a cluster of nodes Elixir: Running a cluster of dynamic nodes Elixir and Mnesia: Running a cluster with state Elixir and Raft: Running a cluster with state -
Elixir: Resilient distributed systems
Elixir Cluster Series Leveraging CRDTs for eventual consistency Elixir: Resilient distributed systems Elixir: Running a cluster of nodes Elixir: Running a cluster of dynamic nodes Elixir and Mnesia: Running a cluster with state Elixir and Raft: Running a cluster with state -
Leveraging CRDTs for eventual consistency
Elixir Cluster Series Leveraging CRDTs for eventual consistency Elixir: Resilient distributed systems Elixir: Running a cluster of nodes Elixir: Running a cluster of dynamic nodes Elixir and Mnesia: Running a cluster with state Elixir and Raft: Running a cluster with state -
Ecto Series
Basic setup -
Exploring retrieval-augmented generation (RAG)
I wanted to explore Retrieval-Augmented Generation, so I set up Romeo, a little Flask app that only knows the text from Romeo and Juliet. -
The right tool for the job
I needed a tool that extracts text and text chunks from documents, and I needed it done in a couple of hours, not days. In this scenario, the choice was clear: Python with FastAPI. -
Ollama and running AI on the edge
Running AI on the edge processes data locally, which is beneficial for those concerned about privacy and security. It also allows for a more tailored experience, which is particularly useful for parents wanting to provide their children with AI-powered tools that are age-appropriate. Additionally, AI on the edge operates without... -
Running a home server
Choosing to Run a Home Server -
Phoenix Channels: Tracking presence
Systems that require human intervention, especially in response to emergencies, depend on having accurate information about who is currently available. Phoenix Presence leverages Conflict-free Replicated Data Types (CRDTs) and the BEAM to provide a reliable and scalable presence tracking solution. -
Phoenix Channels: Inverting responsibility
WebSockets facilitate real-time, bi-directional communication with low latency but introduce inherent challenges with concurrency. They lack guaranteed message delivery, where messages can arrive out of sequence or not at all. This can lead to inaccurate data presentations on the client side, which is reasonable in non-critical contexts but unacceptable in... -
Phoenix Channels: Real-time with WebSockets
A Channel creates a separate process for each open WebSocket connection. It utilizes the WebSocket’s heartbeat to monitor the health of the connection, automatically terminating the process when the WebSocket is closed. -
Consumer-Driven Contract Testing: Implementing Postman
Consumer-Driven Contract Testing (CDCT) shifts the responsibility for integration testing from the provider to the consumers. Under this model, providers can freely update their services as long as the changes continue to pass tests defined by consumers. These tests, acting as contracts, specify the conditions the API must meet. If... -
Documenting APIs: Implementing OpenAPI
APIs are contracts that stipulate expectations, responsibilities, and mechanisms for identifying faults as services evolve. To ensure these contracts are effectively implemented, the supporting documentation must be current, precise, and easily navigable. -
APIs as Contracts: Clear expectations and defined responsibilities
APIs (Application Programming Interfaces) establish contracts to enforce expectations, responsibilities, and mechanisms for fault identification as services evolve. These contracts are fundamental in maintaining reliability and accountability in today’s dynamic environments. -
Elixir API: Implementing CRUD operations with Phoenix
Phoenix, like most modern frameworks, has built-in functionality to reduce boilerplate for the common Create, Read, Update, Delete (CRUD) pattern. -
Elixir GenServer: Fault-tolerant services with supervisors
A GenServer is a generic server process in Elixir that abstracts and manages the lifecycle and state of a server process. It handles incoming requests in sequential order, which is particularly useful for stateful operations. -
Elixir Agent: Encapsulating the gen_server state logic
Elixir introduces Agent, a pre-built abstraction of gen_server that simplifies state management. -
Elixir Observability: Using logs, metrics, and traces
Logs are a fundamental component of observability, providing a record of what and when a system event happened. They often contain additional context in the form of metadata, offering insights such as, “This event succeeded” or “This event failed.” Logs help operators and developers understand the sequence of events. -
Elixir and Grafana: Basic logging
Logging is a fundamental tool in software development, providing insights into application operations by recording events as they occur. In Elixir, simple logging can be achieved with the IO module. For instance, IO.puts("This is a log message.") prints messages to the console, aiding in rapid development-phase debugging. -
Elixir and Oban: For mission-critical tasks
When Tasks are mission-critical and require features such as persistence, retry logic, and scheduling, or when they need to be executed in a specific order and are resource-intensive enough to potentially strain the system, a managed queuing system becomes necessary. This is especially true for operations such as batch data... -
Elixir and Task: Managing asynchronous execution
“The real world is concurrent… When you send an email, you have no idea what’s going on at the other end. You don’t share your variables with them or your data tables. They just take the message and do something. That’s how the real world works.” – Joe Armstrong -
Testing in Elixir: Why good testing practices matter
This post is part of the Testing Series, an overview of testing strategies for Elixir applications. -
Elixir Testing: Mocking external services
This post is part of the Testing Series, which provides an overview of testing strategies for Elixir applications -
Elixir: Managing external services with dependency injection
This post is part of the Testing Series, an overview of testing strategies for Elixir applications. -
LiveView Testing: Ensuring real-time synchronization across sessions
This post is part of the Testing Series, an overview of testing strategies for Elixir applications. -
LiveView: Navigating concurrency in real-time applications
Software designed to solve real-life problems must effectively address the issue of concurrency, where the order of operations cannot be trusted due to the unpredictability of timing, distance between interactions, and the potential for missed or delayed messages. To prevent corruption of data or application state, it is crucial to... -
LiveView: The basics
LiveView is an extension of the Phoenix Framework designed for building real-time, lightweight, interactive web views. It processes most of its logic on the server, minimizing the need for JavaScript, thereby reducing code complexity and enhancing performance. -
Elixir: An introduction to GenServer
Elixir runs on the BEAM, the Erlang virtual machine, which allows Elixir to seamlessly interoperate with Erlang code and packages. This enables developers to leverage the extensive ecosystem available in Erlang while writing in Elixir’s modern and expressive syntax. -
Testing in Elixir: Patterns for Phoenix live-view
This post is part of the Testing Series, an overview of testing strategies for Elixir applications. -
Elixir and Ecto: A DSL for testing schemas and changesets
This post is part of the Ecto Series and the Testing Series. -
Elixir and Ecto: Testing behaviors
This post is part of the Ecto Series and the Testing Series. -
Absence in Elixir: Gracefully avoiding `nil`
“I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object-oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with... -
Elixir and Errors: Let it crash
In complex systems, such as those managing millions of concurrent phone calls, some bugs are transient or rare, making them inherently elusive and impractical to trace and resolve. Erlang keeps this in mind, prioritizing robustness to ensure systems can continue operating smoothly despite individual failures. This approach is encapsulated in... -
Elixir: Basic setup series
Publish Your Docs -
Credo and Elixir: Add linting and analysis
This post is part of the Elixir Setup Series, covering essential tools and practices for Elixir projects. -
Dialyzer and Elixir: Add static code analysis
This post is part of the Elixir Setup Series, covering essential tools and practices for Elixir projects. -
Ecto: Basic schemas and changesets
This post is part of the Ecto Series. -
Ecto: Basic setup
This post is part of the Elixir Setup Series, and the Ecto Series. -
Elixir: Publish your docs
This post is part of the Elixir Setup Series, covering essential tools and practices for Elixir projects. -
A functional programming case for Tailwind
Cascading Style Sheets (CSS) separated content from styling, but came with inherent challenges. -
Real-time interactions in Phoenix: LiveView vs. Channels
Phoenix LiveView and Phoenix Channels have benefits and trade-offs. LiveView excels at server-side form management and real-time UI updates within web applications, simplifying development by centralizing logic on the server. Phoenix Channels offer greater modularity and support for non-web applications. -
Socket.IO and Phoenix Channels: A comparative analysis
Socket.IO and Phoenix Channels are two prominent frameworks that facilitate real-time, bi-directional communication between clients and servers. This comparison aims to help developers understand which framework might best fit project requirements. -
Concurrency in high-stakes systems: Why Erlang/Elixir (BEAM) stands out
When it comes to building software for critical applications, reliability is paramount. One misstep can have devastating consequences, making it essential to choose a technology stack that prioritizes fault tolerance and recovery. -
Lessons from writing functional-dart
Functional Dart is a Dart library that encourages functional programming principles. Inspired by fp-ts library in TypeScript, Functional Dart aims to bring a comprehensive set of functional programming (FP) tools to Dart developers. -
Why Jekyll for this blog?
Table of Contents
subscribe via RSS