When Elixir 1.8 was released, I wrote an article sharing my thoughts. Unfortunately, they didn't gain enough traction...
The great thing about tech is you don't need someone else's buy-in to run with your own idea.
So I forked.
The next step was to open it my editor. When I inspected
elixir/lib, I saw 6 subdirectories. It turns out they are all independent Mix packages. (Notably,
elixir--the root directory--has no
The first question this raises is: Why bundle them together?
The 6 packages are:
elixir is a must.
iex starts an Elixir shell in one's terminal.
logger produces those useful Elixir-related messages in one's terminal, and is automatically included in a new Mix project.
mix generates a minimal Elixir project-environment.
ex_unit provides macros for basic testing.
The only one that doesn't belong is
eex, Elixir's templating language. This would be better suited as an independent package because a basic Mix project won't ever use it.
There is an argument to be made to remove
ex_unit: Why lock devs into this particular testing framework? Whatever the performance footprint, I agree with its inclusion in the core for the sake of new devs.
Figuring out how to get Elixir setup is already a lot, psychologically (logistically, it is simple). Wrapping one's head around Mix packages is too big a leap for someone who simply wants to start writing Elixir code.
ex_unit is the dominant testing framework for Elixir and has a ton of functionality.
This actually leads into a separate thread. While I believe
elixiris bloated and in need of revision, I think
ex_unitcan be more powerful.
However, a flag should be added to exclude
ex_unit from one's project.
For completeness on this topic: Property-based testing is not included by default in Elixir. I think this makes sense because it is more advanced. I.e. if you know what it is, you're willing to go the extra mile, psychologically, to install it. By contrast, for someone who's never written a test before, the
assert/1-2 macros are extremely intuitive. The hardest part is realizing there is a place to write tests because most languages don't provide it for you so seamlessly.