> it looks esoteric and interesting.
Esoteric maybe, interesting definitely, mainly because:
Elixir compiles to Erlang bytecode, executed by the BEAM (the Erlang VM).
The BEAM provides an implementation of the Actor Model, and Erlang/Elixir embed that model in their syntax.
Erlang's processes are actors, and they can send messages to each other, even if they are not on the same node, this is totally transparent.
On top of that, the OTP framework provides abstractions like:
- Supervisor: to handle failure of your processes (actors)
- Application: what you would call today a "microservice"
- GenServer: to provide RPC to the rest of your application
- Mnesia: to provide a replicated database to your application
- and many more
An Erlang/Elixir node runs multiple applications, and they can talk to each other, making your applications aware of their distributed aspect (which enables complex logic that would not easily be done in another language).
Also *hot code reloading*. Whenever you call a function from another module, the BEAM will try to load the most recent version of that module, so you don't need to restart your application (this is not a very common use case, but you don't want to shutdown your flying drone during an upgrade, do you?). Therefore, every function is "async", and every function call (to another module) have an implicit "await".
> let's say Erlang/Elixir -- it's super-duper great
At that point, it's not an hypothesis anymore to me :)
And I did not talk about pattern matching...
> could we not just 'bolt on' a new language?
> maybe create a typescript-for-erlang?
> maybe it already exists and it's called go/rust/etc.
Typescript/Javascript async model (Promises and the NodeJS event loop) does not translate well to the actor model.
Go & Rust are faaaaaaaaaar behind in term of distributed computing. Maybe because it's not their target?
Erlang provides an interface to build nodes without the BEAM, that can still talk with BEAM nodes:
- C/C++: https://erlang.org/doc/apps/erl_interface/ei_users_guide.html
- Java: https://erlang.org/doc/apps/jinterface/jinterface_users_guide.html
- Python: https://github.com/Pyrlang/Pyrlang
But it's nowhere near perfect IMHO.