3 ms·
Why not write things you might write in gleam in Rust, too?
by sadness3 6y ago
Why not write things you might write in gleam in Rust, too?
- ch4s3 6y agoProbably because you're looking for simplicity, the BEAM, and access to the Erlang ecosystem. Or maybe it just like speaks to you.
- lpil 6y agoRust is great but it’s a very different experience writing Gleam. Rust is much faster but more complex and more challenging to learn, Gleam is designed to be more approachable. It is like Go vs C++
- rkangel 6y agoThey have a different runtime model (and therefore present a different concurrency/parallelism API). Rust (usually) compiles to a single standalone binary, that includes any runtime needed. Concurrency is now usually provided via sync with something like Tokio underneath. You can absolutely do actor programming (see Riker and Actix), but it's not the primary way Rust is intended to be used, and it doesn't offer the same set of management capabilities that the BEAM does Erlang/Elixir/Gleam run on the BEAM. This is a standalone runtime (VM) that then executes code. Deployment involves a lot more pieces, but once done you get a lot more tooling built in (e.g. the observer to see what actors are running). It is designed from the ground up for actor model concurrency, and concepts like supervisor trees have been proven to be best-in-class for managing code running over long periods of time and handling errors in a self-healing way. Plus the separate VM means you can do things like zero-downtime update ("hot code loading").