Hacker News new | ask | show | jobs
by _virtu 732 days ago
I will say that it’s nice that you need explicit imports in Gleam. Elixir does not require this and a lot of code in our codebase suffers from unspecified imports which can be difficult to follow.
1 comments

It’s a double edged sword.

After mucking around with import paths in so many languages for so long, I like that elixir is like “all the namespaces everywhere”

I thought I would love "all the namespace everywhere" (which would be a _great_ name for a tech talk at a conf, but it just feels too much like magic to me.

One thing I've never thought about, but you could potentially just make a single file with all the imports and that would make it easier to check, but it still just feels too much like magic and loss of control.

Doesn’t seem like magic to me.

I’d assume elixir looks at every file in the lib directory and compiles them. They all then get loaded into the beam vm with their respective module names

Oh absolutely,

But that isn't how I was using the term “magic”, I was using it as a generic descriptor similar to how the Zig language refers to things that are done in the background, or hidden, without control from the user. I prefer knowing everything a file requires, that way I never double up, or have too many deps without my knowledge of everything that is in a system.