abreujp
I’ve published a new article in my Elixir learning series on dev.to exploring module attributes - the compile-time annotations and constants that describe and configure our modules.
The article covers:
- The three roles of module attributes: annotations, temporary storage, and compile-time constants
- Setting and reading attributes, and how compile time differs from runtime
- Using attributes as constants, including inside patterns and guards
- Precomputing values at compile time and exposing them through functions
- Documenting modules and functions with @moduledoc and @doc
- Describing function contracts with @spec and typespecs
- Defining custom types with @type, @typep, and @opaque
- The @vsn, @derive, @behaviour, and @impl attributes
- Registering custom attributes with Module.register_attribute/3 and accumulating values across the module
- Practical guidelines for when to reach for an attribute instead of a plain function
With complete working examples you can copy into IEx, you’ll learn how module attributes become the glue between documentation, configuration, and compile-time behavior - and how they shape the Elixir code you read every day.
Check it out:
Trending in Blog Posts
TL;DR: Give https://cure-lang.org a try—perhaps you will like it.
New
I finally found time to write down my journey away from ExMachina, including the workaround I tried first and the API experiments that fo...
New
An automated trigger fired every two minutes for 8 hours. 243 agent runs. 31M tokens. $63 wasted. The problem: nobody noticed until morni...
New
The words are insufficient to describe what transpired. What we tried to do met what the people wanted it to be. It became beautiful.
Th...
New
Hi everyone,
I’ve been building BetterTyping (https://bettertyping.org) on and off since 2021. It’s a free typing game: practice alone, ...
New
Turns out a 1ms network hiccup is enough to silently lose broadcasts for a node and that node is just quietly wrong forever
Wrote it up ...
New
If you’ve found an interesting or cool Elixir related blog post and think it’s worth sharing please add it to this thread :icon_biggrin: ...
New
Other Trending Topics
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #performance









