I actually do small PRs to update deps etc on those kinds of repo and people are usually are OK to merge.
Someone refernced ElixirConf US and some of the news-flow is certainly from that.
Elixir has been building a steady steam pressure for a long time and I think steady is still the case.
As someone writing about Elixir I will say that it has good traction here as a general rule. I think Erlang appeals to the CS-interested, Elixir appeals to a lot of Ruby and startup folks. The ecosystem also innovates a decent bit. I think it punches above its weight on the HN front page.
It is a healthy ecosystem and seems to grow.
(edit: a spelling)
Or some Typescript style front for Elixir?
So maybe Gleam as an easier way to integrate JS and Erlang / Elixir?
For now you have typespecs and dialyzer that tries to infer types and detect incorrect assumptions in code but I found it cumbersome to work with. Testing in Elixir is first class so I prefer that for now. You get doctests (documentation that is also a runnable test), like in Python, which I find very useful when looking at some package source.
(Elixir is strongly typed btw)
Elixir is essentially the functional python.
"Elixir is a dynamically typed language"
[1]: In the sense you mean here, anyhow. It has a selection of atomic types, int, list, tuple, etc., but there's no "user" types as one would have a strong typing system for. It's not an exact match but if you imagined a programming language that had nothing but JSON, not Javascript, Javascript has user types, literally just JSON as your underlying data model, you get pretty close to BEAM/Erlang.
Plenty of use-cases are made easy by the stack, from regular web work, API (https://transport.data.gouv.fr/swaggerui) to proxying (https://github.com/etalab/transport-site/tree/master/apps/un...) to real-time maps (https://transport.data.gouv.fr/explore), clustered maps (https://transport.data.gouv.fr/explore/gtfs-stops), XML queries building (https://transport.data.gouv.fr/tools/siri-querier?endpoint_u...)...
The maintenance story is very good too.
With ML being added (Nx/Axon etc), and mobile apps being in the works (LiveViewNative), it has become my everyday language & stack.
Why I love it:
- The mental model just clicks for me. The syntax is really simple and the semantics are consistent. There is no abstraction. It's all about processing data.
- The REPL (IEX) is way more than a REPL. It's "you inside your running program". You can poke around your code, draft it, debug it, right there. You can fire it on prod to understand a bug. Or use LiveBook, think of it like the Elixir version of Jupyter notebooks that can connect to your application.
- Real life performance is great, not because of speed but because of concurrency.
- The whole developer experience is great. Mix (the build tool, dependency manager, etc.) is simple, awesome. Dependencies are really rarely an issue.
- It's rock solid. In 3 years, I never had one downtime.
- LiveView is a god send. Not having to switch language for UI work is amazing, performance is great, and it's server side HTML which is amazing for SEO. My website is 99 on lighthouse without any crazy work.
- You need heavy computation and performance on some parts? Use rust, via rustler.
- You need to scale to multiple servers? It is distributed. Already. Just make sure to not have anti-patterns in your code.
- But the real kicker it's in its power due to the OTP platform. I think it's quite complex to grasp how much it's powerful when you haven't experienced it. Need to batch insert statements or rate limit api calls to a 3rd party service who can only accept one call per second per channel? A working simple solution is only 20 lines of code. Need to launch many different workflows running concurrently, keeping their state, recovering when crashing? 100 lines.
The exciting developments:
- Elixir NX ecosystem (NX, Bumblebee, etc): running and training AI models directly in Elixir, in a distributed way.
- Liveview Native and Elixir Desktop: two big initiative to bring Elixir to Desktop and Mobile applications.
- Gradual Typesystem. Jose Valim, the creator of Elixir, is working on that right now. I really liked the approach of set-theoretic types and the pragmatism of the approach. Hopefully it will be released in the not too distant future.
The "to improve":
I have the feeling that the platform (OTP) being the killer app per se of Elixir, the whole marketing of the ecosystem if 100% targeted towards developers. Which is good in many ways. But for the ecosystem to grow I think more initiatives towards business-type applications would be welcome. By example, there is only a few payment gateways libraries existing which is for me a sign of the lack of business audience.
Conclusion: Elixir made me a better developer, but most importantly a really productive one.
I obviously have lots of questions but biggest one that relates to other convos I had on HN recently: did you use an off-the-shelf ecomm solution or roll your own?
So I started with a PHP solution ( Craft CMS + Commerce ) that was flexible so I can just focus on front end part.
But then Covid happened and our business boomed super quickly ( in a month we went: from 2 to 10 people and 2 to 450 deliveries ). I needed to build features quickly to handle our fulfillment processes and built a separate stack of tools in Elixir, initially for packaging lists, routing calculations, sticker printing , etc... I still have some very fond memories of these crazy times.
Then I needed to redo our front end. We went from like 50 products to 1000+ products. I needed great search, smarter default sorting, recommendations, etc... and I needed the whole stack to be fast. I rebuilt everything with Phoenix and Liveview, building a weird layer to map Ecto to the super complicated Craft db schema.
We are using Craft just for the cart and payment now. The only pages served by Craft are the payment details and thank you page.
But I'm working slowly on building a complete E-Commerce stack ( a very opinionated one ) that I'd like to open source once clean and proven.
Looking forward to hearing about a new ecomm lib :)
I'm also rolling my own as it's built for a specific use case. Not sure I will ever open source, that isn't on my mind at this point.
The tricky part is that Elixir is compiled, and liveview templates are not "files" but functions.
From here you have two choices:
- You create a set of primitives (blocks), and the layout/arrangement of these primitives is configurable via a config map.
- Or you do a hot-code reload: Call an api, check if new code is available, fetch it, compile it (Code.compile_string), load it (:code.load_binary ), swap it for long running processes ( GenServer.code_change callback by example ), and remove old code ( :code.purge )
The first solution is safer. The second solution is a kind of black magic and you would need a way to authenticate de source code before compiling.