alexslade

alexslade

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.

Showing Posts 1 to 10

josevalim

josevalim

Creator of Elixir

We are working on a package for precompiling Rustler. It should be available within the next two weeks or so. :slight_smile:

28
Post #1
dimitarvp

dimitarvp

Awesome news!!! :heart::blue_heart::purple_heart::yellow_heart::green_heart:

OvermindDL1

OvermindDL1

Ooo this sounds interesting! Where is this being worked on?

josevalim

josevalim

Creator of Elixir

There is a proof of concept in the html5ever project that is being ported to a stand-alone library.

OvermindDL1

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

sorentwo

Oban Core Team

If anybody else is curious, here is the package: GitHub - rusterlium/html5ever_elixir: NIF wrapper of html5ever using Rustler · GitHub

dimitarvp

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

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

alexslade OP

Well, that’s an awesome response that I wasn’t expecting. Thanks for the heads up @josevalim :slight_smile:

I’ll be around in the first people to help test it if needed.

dimitarvp

dimitarvp

Much appreciated, thanks for the link.

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews