I personally do not like type systems, and still code in JS, not TS. Any JS artifacts I produce are untyped. Yet even my Elixir-code is nearly type ready.
So while TS is fighting an uphill battle, I think Elixir is working downhill.
For me some serious elixir adventure is high up in my todo list. But I remain suspicious if I can ever fully enjoy myself with a dynamic language - I think gleam and elixir do cater to different crowds. Gleam is pure minimalism (just pattern matching really), but elixir doesn't seem bloated either.
I am so happy that both languages exist and give alternatives in times of hundreds of node deps for any basic slob webapp.
- A language (Elixir/Erlang) and runtime (BEAM) - The concurrency standard library (OTP)
The language and runtime give you the low level concurrency primitives - spawn a process, send a message etc. But to build actual applications, you rarely use those primitives directly - instead you use GenServers and supervisors. That gives yo a way to manage state, turns message passing into function calls, restarts things when they crash etc.
Gleam compiles to the same runtime, but doesn't provide OTP in the same way - static types aren't easy to make work with the freely message passing world of OTP. They are implementing a lot of the same concepts, but that's work that Gleam has to do.
(Elixir provides some thin API wrappers over the Erlang OTP APIs, and then also provides some additional capabilities like Tasks).
It's never been a wat-language in the style of JavaScript.
in case it wasnt clear: a zero share tx being a tombstone is a stock accounting convention, not a choice of that particular software project.
type Record {
NShares(n: Int)
ZeroTheAccount()
}
fn parse_record(n: Int) -> Record {
case n {
0 -> ZeroTheAccount()
_ -> NShares(n)
}
}
Then you don't have to worry about mixing up the two :)to wit: anything that calculates an average over non-fixed data cardinality for business logic is potentially at risk for a seroious logic error in gleam.
what's worse is this is a nonobvious error. llms will likely make it a lot. a code review is likely to miss it.
what's even worse is that the author refuses to acknowledge this and digs deeper in (because, well, its a "principled" choice that got made and now to change is breaking and it breaks a core "feature" of the language). 1/0 = 0 is fine for a language like idris which is used for theorem proving but never used for real world things. It's inappropriate for deploying when, for example, real money might be at stake.
My last team wanted to port all remaining Java code to Kotlin, because they just enjoyed working with it so much more.
While porting I've regularly replaced 5-8 lines of Java with a single line of Kotlin.
Kotlin needs Java like Ruby needs C or Elixir needs Erlang.
Granted, it's alpha software and it's currently embedded in the Hologram framework, but still.