4 ms·
You can pull from the Rust ecosystem when you need something that Elixir might not have or might not be the best at. For example, I use it to parse XML files w
by impulser_ 3y ago
You can pull from the Rust ecosystem when you need something that Elixir might not have or might not be the best at.
For example, I use it to parse XML files while this can be done in Elixir and there are libraries for it. Being able to use the Rust library serde and quick_xml makes life so much easier.
Another example would be the Elixir library Explorer which is built using the Polars library in Rust for fast dataframes.
Rustler is also pretty easy to use. I never coded Rust before and I had working code very quickly and build is easy as running your normal mix commands.
You can also use the rustler-precompiled library so users of your library dont have to worry about building the library.
It's essential the PyO3 of the Elixir ecosystem, excluding the Python to Rust part .
- kamma4434 3y agoPet peeve of mine: whenever that’s possible, avoid writing libraries in one language that references something that has to be compiled in a different language. If you do, do you end up with Perl/CPAN - installing anything becomes a pain. It’s nice to have a quicker XML parser, but it would be real nice if it was a plug-in and there was a slower, but easy install version that required no external things to be compiled.
- pjmlp 3y agoUnless one can do like in Java,.NET and nodejs, package the libraries alongside the bindings, for all major target platforms.
- impulser_ 3y agoYou can with Rustler using rustler precompiled. You write a workflow in GitHub that builds for all the supported targets and the precompiled library will download the correct one when a user downloads your library.
- peoplefromibiza 3y agonot anymore, Elixir community as usual delivers some great tool for their beloved developers and users https://dashbit.co/blog/rustler-precompiled https://dashbit.co/blog/rustler-precompiled (it's similar to pre-compiled Python wheels, but it's better developers' side in my opinion)
- impulser_ 3y agoIt's not a pain because of https://github.com/philss/rustler_precompiled https://github.com/philss/rustler_precompiled The users of your library doesn't have to install anything. The library will seem like any Elixir library when they use it. It safe because when you upload your project to Hex.pm you include a file with all the checksum of the latest version of your library and when you install the library it will use those to download the library from GitHub.