← docs.speechwave.live
The Old Sock introduction to Elixir & Speechwave
For Ruby developers who need to read and modify the codebase
Why "Old Sock"?
Like a well-worn sock, this guide may have a few holes in it. It was built lesson-by-lesson to get a Ruby developer productive in the Speechwave codebase as fast as possible, not to be a comprehensive Elixir textbook. Where coverage is thin, you'll find links to authoritative external resources. Following those links and filling in the gaps yourself is part of the learning.
Who this is for
You're an experienced programmer with Ruby background. You've probably used Rails. You may have never touched a functional language. You need to read, understand, and modify a Phoenix LiveView application, specifically Speechwave.
This guide won't teach you what a variable is or how a for-loop works. It will teach you how Elixir thinks differently from Ruby, and how those differences show up in every file of this project.
How it's organized
Eight lessons, each grounded in real Speechwave code. Every example is pulled from the actual codebase, with no toy examples and no abstract exercises. Ruby comparisons are used where they clarify, but the goal is to think in Elixir, not to translate.
- Pattern Matching: the
= operator isn't assignment, and that changes everything
- The Pipe Operator: how
|> replaces method chaining with something more flexible
- Modules & Structs: how Elixir organizes code without classes
- The LiveView Lifecycle: mount, handle_event, assigns, and real-time updates
- Ecto Queries: reading and writing database code (Ecto vs ActiveRecord)
- Testing with ExUnit: test structure, assertions, LiveView testing, PubSub testing
- GenServer: stateful processes, supervision, and "let it crash"
- Debugging: IO.inspect, dbg, IEx.pry, and the runtime console
Each lesson includes interactive quizzes or hands-on exercises, and ends with a suggested next step, usually reading a specific Speechwave file with fresh eyes.
How to get the most out of it
- Keep the public Speechwave repo open alongside each lesson. The examples reference specific files and line numbers, and every file reference links straight to the source. Reading real code while you learn is the whole point.
- Do the exercises. Reading about pattern matching is not the same as recognizing it in code. The quizzes are designed to build that recognition.
- Follow the primary source links. Each lesson links to the official documentation for deeper coverage. The lessons teach you enough to be productive; the docs fill in the rest.
- Use the reference pages. They're designed as quick-reference cheat sheets you can print or keep open while working. The glossary in particular maps every Elixir term to its Ruby equivalent.
- Don't read all eight lessons in one sitting. Each one introduces a paradigm shift. Let each one settle before moving on. Ideally, spend some time reading Speechwave code between lessons.
The underlying premise: You don't need to master Elixir to be productive in this codebase. You need to recognize about a dozen patterns that appear everywhere, understand how Phoenix wires things together, and know where to look when something is unfamiliar. That's what these lessons deliver.
Prerequisites
- Elixir and Erlang installed (
elixir -v should work)
- The Speechwave project cloned and dependencies fetched (
mix setup)
- A terminal and a code editor
- Familiarity with Ruby and ideally Rails (for the comparison points)
Ready? Start with Lesson 1: Pattern Matching.