alexslade
Is there a supported way to compile + cache a rust dependency?
Hi folks,
On of my team’s projects has a rust dependency, via a library that uses rustler to wrap a rust function. It hasn’t changed in a while, and it’s a pain to have an entire rust runtime dependency for this single lib.
We’re trying to find a way to remove the runtime from our deploy pipeline, and I’m wondering if there is a way to locally compile the dependency ahead of time and just include some kind of version-fixed binary.
Grateful for any suggestions, thanks.
Trending in Questions
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated!
To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead.
Sta...
New
Hello !
We want new/edit form pages to POST/PUT to their own URL rather than the resources REST defaults (post /things, put /things/:id)...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
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
- #elixirconf-us
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










First 10 of 15 Posts!
josevalim
We are working on a package for precompiling Rustler. It should be available within the next two weeks or so.
dimitarvp
Awesome news!!!




OvermindDL1
Ooo this sounds interesting! Where is this being worked on?
josevalim
There is a proof of concept in the html5ever project that is being ported to a stand-alone library.
OvermindDL1
What I would find really fascinating is embedding a wasm engine, like wasmer or so, and expose the BEAM API to it (perhaps with a bit of massaging), and then you could easily compile native apps to WASM and load them in that instead. Something like wasmer could run it either fully interpreted, cranelift JIT compiled, or even LLVM native compiled for near native speed, without needing to compile it for each individual platform and beam bindings needed, especially if a more version independent API were exposed to it… This is an interesting idea… You’d probably want to precompile the wasm engine library for NIF access for each combination of beam VM and arch but that’s only one thing you’d need to do instead of every single possible library… Hmm…
Standalone process communicated via Ports or something similar is doable as well and honestly probably fine for many libraries, but most things made for NIF’s are because they want that speed, and WASM could probably get that close enough (at the very least for dev)…
sorentwo
If anybody else is curious, here is the package: GitHub - rusterlium/html5ever_elixir: NIF wrapper of html5ever using Rustler · GitHub
dimitarvp
Not seeing a PR or a branch t hat contains this new project Jose mentioned, I presume it’s being developed somewhere else.
ImNotAVirus
If I understood correctly, Jose is porting this module to a library : https://github.com/rusterlium/html5ever_elixir/blob/master/lib/html5ever/precompiled.ex
alexslade
Well, that’s an awesome response that I wasn’t expecting. Thanks for the heads up @josevalim
I’ll be around in the first people to help test it if needed.
dimitarvp
Much appreciated, thanks for the link.
Last Post!
alexslade
Thanks Jose, we’re giving this a try in our team this week, we’ll report back if as we learn more.