#Elixir
127 notas · última:
Internationalization using Gettext in the Phoenix framework
The post explains i18n and l10n in Phoenix 1.1, shows why Linguist was unwieldy, and walks through using Gettext, .pot and .po files, and a locale-switching plug.
Building a web framework from scratch in Elixir
The article shows how to build a small Sinatra-like web framework in Elixir with Plug, covering requests, routing, macros, templates, Ecto models, testing, and performance.
The Obligatory “Why Elixir?” Personal Take
The author argues that Elixir is appealing because it exposes Erlang’s fault tolerance, isolation, and concurrency model in a more approachable language, while fitting web development alongside Rails and Phoenix.
The UNIX Philosophy and Elixir as an Alternative to Go
The post argues that Go is simple but awkward for web apps, while Elixir fits modern web development better because of its concurrency model, small core, and support for APIs that turn Postgres data into JSON.
Elixir concepts for Go developers
The post sketches Elixir for Go developers by comparing immutability, pattern matching, atoms, processes, supervisors, pipes, macros, OTP, and Phoenix to familiar Go ideas.
Thinking about Stream and Enum in Terms of Function Composition
The post explains Enum and Stream as ways of composing functions in Elixir. Enum builds shortcuts on top of reduce, while Stream delays work by creating a collection-like transformation.
Making Complex Streams Easier to Understand
The post says complicated Elixir pipe chains can become hard to read, and suggests wrapping a Stream composition in a function or variable to make the code easier to understand and reuse.
Phoenix: Templates Are Just Functions
The post explains that Phoenix templates are compiled into render functions injected into views, which made the author understand how `@conn` and pattern matching work during rendering.
Handling TCP connections in Elixir
The article shows how to wrap a TCP client in a GenServer, avoid blocking with queued replies, use active sockets carefully, and add reconnect backoff with Connection.
Stories of Elixir in the Wild: Interview with Johnny Winn
Interview with Johnny Winn about his Elixir projects, a company move toward microservices, what he values in Elixir, the main difficulty he hit, and resources he recommends.
Elixir in times of microservices
The post argues that Elixir and the Erlang VM already provide the abstractions, process isolation, and communication model needed to manage distributed systems and grow applications without premature microservice splits.
Flow-based programming and Erlang style message passing - A Biology-inspired idea of how they fit together
The post compares Flow-based programming and Erlang/Elixir messaging, arguing that FBP suits heavy computation inside services, while Erlang fits control-plane communication across services and distributed systems.
Hacking Elixir's Syntax
The author adds underscore support to Elixir binary literals by locating the tokenizer, adjusting its Erlang patterns, and verifying the change with tests before opening a pull request.
Closures: Elixir vs. Ruby vs. JavaScript
The page compares closure behavior in JavaScript, Ruby, and Elixir. JavaScript shows side effects from mutable state, Ruby is safer with iterators but not perfect, and Elixir benefits from immutability.
Elixir Streams
The post contrasts eager `Enum` operations with lazy `Stream` operations, then shows how streams handle large or infinite data, file and stdin input, and paginated GitHub API results.
Micro Benchmarking in Elixir using Benchfella
The post compares file-hashing approaches in Elixir with Benchfella, showing that larger chunk sizes perform better, while reading a whole file at once can be faster than a single oversized chunk.
Elixir Flow-Based Programming
The author explores implementing flow-based programming in Elixir by using GenServer and Erlang digraphs, then adds initial values, component ports, and multiple processes per component to exploit concurrency.
Introduction to Parallel Computing with Elixir
The article shows how Elixir supports concurrent and parallel computing, then walks through a Fibonacci example that uses tail recursion, spawned processes, message passing, and an escript build.
Introducing reducees
The post traces Elixir’s collection-processing design from recursion to iterators, reducers, and iteratees, then explains reducees as the abstraction that keeps reduce simple, fast, and resource-safe.
Where does Elixir/erlang fit into the microservices approach?
The post asks how Elixir and Erlang relate to microservices, Docker, hot code upgrades, and deployment patterns such as blue/green and canary releases. The accepted answer frames OTP as a distributed-systems platform that already models isolated units, communication, and deployment choices.
Why I’m betting on Elixir
The author argues that Elixir and Phoenix keep Ruby on Rails’ focus on developer happiness while adding fault tolerance, concurrency, speed, and a strong ecosystem backed by Erlang.
A Simple CEP Processor in Elixir
The post shows a simple CEP setup in Elixir that simulates stock ticks, routes them through a broker and worker factory, keeps a timed window per symbol, and prints hourly averages through a sink.
Introduction to Distributed Messaging with Elixir
The article shows how Elixir’s Erlang heritage lets nodes connect, make remote calls, and exchange messages across machines while handling latency and failure in distributed systems.
Understanding Protocols
A question about turning a generic reduce function into an Elixir protocol leads to an explanation of lexical import and why protocol calls must be made explicitly to dispatch across implementations.
See all messages in process's mailbox with pid XY
The thread shows how to inspect a process mailbox with :erlang.process_info(:messages), notes that Observer can display a queue snapshot, and warns that copying messages can be expensive.
Problems dealing with Enumerable protocol
The thread says Enum.take and Enum.at still reduce the whole collection, so a Redis-backed API should expose explicit limit and offset. José Valim distinguishes database and in-memory behavior and suggests count and member? stay explicit too.
Doubts about layers and application's organization
A thread about how to organize Elixir code with Phoenix and Ecto. José Valim and others advise delaying architecture decisions, avoiding premature optimization, and separating database queries into explicit query modules.
Compile issues with Elixir/Phoenix in a Docker container
A Phoenix project compiled in Docker breaks after container restarts because Hex registry data in ~/.hex is not preserved, causing deps like plug to disappear from _build/dev/lib until deps are fetched again.
What are the different OTP supervisor restart strategies useful for?
The post summarizes the four OTP supervisor restart strategies and the situations they fit: fixed hierarchies, same-type process pools, dependent pipelines or registries, and tightly related groups that must restart together.
Simple Sliding Windows in Elixir
The post builds sized and timed sliding windows in Elixir, then refactors them behind a Windowable protocol and Enumerable implementations so both types share a common API.
Elixir Native Interoperability – Ports vs. NIFs
The page compares two Elixir/Erlang interoperability mechanisms for serial device access. NIFs are faster and simpler but can crash the VM; ports are safer and more flexible but use awkward STDIN/STDOUT messaging.
An intro to OTP in Elixir
The post explains OTP as Erlang’s development environment for concurrent programming, then builds a FizzBuzz server with GenServer, client APIs, callbacks, caching, and process-based I/O.
Build and test a blazing fast JSON API with Phoenix, an Elixir framework
The article shows how to build a Phoenix JSON API for contacts, starting with a test, then adding an Ecto model, migration, route, controller, and view until the test passes.
Elixir Stream Patterns
The post surveys how Streams are used in Elixir code, comparing them with Enum and other constructs, and argues for choosing the clearest form while using lazy evaluation only where it saves work.
Accessing the Amazon AWS from Elixir (using erlcloud)
The post explains how to use the Erlang library erlcloud from Elixir to reach AWS, configure credentials, and run basic S3 calls such as creating buckets, listing objects, and reading content.
Elixir: Come for the syntax, stay for everything else
The author says Elixir first appeals through Ruby-like syntax, then keeps developers with functional programming, scalability, memory handling, immutability, fault tolerance, and a community he trusts.
Profiling Elixir
The author profiles an Elixir Game of Life implementation with ExProf and fprof, compares their outputs, and concludes that most time is spent in map lookups through Access.Map.get/2.
Round-up of Elixir Books and Resources
A curated, subjective list of Elixir books and learning resources, ordered from introductory to advanced, with extra recommendations on Erlang, OTP, functional programming, and community channels.
[elixir-talk:7975] A question about global state
The thread explains that Elixir libraries can keep startup-derived state in a supervised process or ETS, and that users should start it through the application rather than manually.
Learn elixir in Y Minutes
The page introduces Elixir as a functional language on the Erlang VM and walks through its core syntax, pattern matching, control flow, modules, structs, exceptions, and message-based concurrency.
