dergraf

dergraf

Shower Thought: Would Parameterized Modules have changed how Elixir (and its libraries) are designed?

Here’s a bit of a geeky thought experiment: Parameterized Modules (aka “Abstract Modules”) were an experimental feature in Erlang that never left the experimental stage and were ultimately abandoned in R16.

It got me thinking—if Elixir had such a feature, could it have influenced the way libraries like Ecto, Phoenix, or Ash were implemented, particularly when it comes to component-building abstractions?

Additionally, I wonder if Parameterized Modules might have offered interesting alternatives for implementing Protocols in Elixir. Their dynamic dispatch nature seems like it could align with what parameterized modules were designed to address.

Would this feature have simplified certain patterns, or would it have introduced unnecessary complexity?

I’m curious to hear thoughts, especially from those who’ve used both Elixir and Erlang and can reflect on how parameterized modules might (or might not) fit into Elixir’s design philosophy.

First Post!

binarytemple

binarytemple

I experimented with parameterized modules when they were available. In practice, they were simpler than they might have appeared at first glance. When you ‘initialized’ a module with a constructor argument, it merely created a reference with that initial value. Subsequent function calls on that module would automatically receive this initial value as their first argument - functionally similar to how Elixir’s pipe operator (|>) works today. While you could achieve comparable functionality using Erlang parse transforms, they were (and remain) significantly more cumbersome compared to Elixir’s elegant macro system.

Where Next?

Popular in Discussions Top

bartblast
With the core component system and HTTP/WebSocket infrastructure solid, it’s time to tackle Pub/Sub support. What We Have vs What’s Miss...
New
jdumont
I could write forever about this, but I’ll do my best to keep it succinct. For anyone familiar with event sourcing, what is your opinion...
New
Morzaram
Hey everyone. I’m feeling a bit conflicted. I’ve learned Flutter and built a somewhat MVP of this app. I’m a solo dev and throughout this...
New
bartblast
Hey there! :slight_smile: I’m working on updating the Hologram website home page and would love to get your input. Current situation: ...
New
ashkan117
I’m wondering how do people structure their JSON Api’s with Phoenix. Using the blogs example, let’s say I have a blogs view like the foll...
New
garrison
I have been thinking about how I might write a new web framework in Elixir. (Not committing to anything, just thinking about it.) One th...
New
bartblast
Some great comments in the home page thread shifted toward what you’d like to see in Hologram’s future, particularly standalone mode. I’v...
New
AstonJ
A remark @Garrison made… ..has already inspired a thread for the technical side of reclaiming our internet, but there is of course anot...
New
matreyes
I haven’t seen this paper being discussed by the community, but I think this makes Elixir more relevant than ever. TLDR; The paper...
New
PragTob
:wave: I’m currently extracting the statistics calculation part from benchee and stumbled upon how to present error conditions. In the c...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New

We're in Beta

About us Mission Statement