Papillon6814
When to use elixir, when to use Rust?
I’m new to Elixir, and like to use Rust.
When do you use Elixir, and when do you use Rust?
Most Liked
kokolegorille
There is a showcase of using Rust with the BEAM in this post…
Main reason is immutability can be slow when dealing with large collection…
They wrote a mutable sorted set in Rust as Nif, available here.
dimitarvp
If you have extremely performance-sensitive code, adding Rust to an Elixir project might be worth it.
Be warned though: many people regularly underestimate Elixir’s (and thus Erlang’s) speed. They are quite fast and even when they aren’t, you have some options to hand-craft certain pieces of code that can give you a big performance boost.
Don’t try to just use Rust inside an Elixir project before you have factually checked that you absolutely positively need more performance.
praveenperera
I also love both languages.
If you mean what types of projects to use for each language here’s what I find myself doing:
-
For web servers and projects dealing with databases you just can’t beat elixir, Phoenix and ecto (in my opinion). So I always reach for elixir for these types of projects.
-
For CLIs and little utility programs I find myself using Rust. It’s fun to use, you can become pretty productive in it, it’s super fast and it’s really easy to create and distribute binaries for basically every operating system.
To give you an idea, here is a simple CLI I made in rust: GitHub - avencera/rustywind: CLI for organizing Tailwind CSS classes · GitHub
I was able to distribute it quite easily using NPM
Popular in Discussions
Other popular topics
Chat & Discussions>Discussions
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









