Repository navigation
Mojoler loads Mojo as an OTP NIF. An Elixir function call runs a Mojo body. Version 0.1.0 is the first Hex release.
Package: https://hex.pm/packages/mojoler/0.1.0
Docs: https://mojoler.hexdocs.pm/0.1.0
Source: https://github.com/thanos/mojoler
Install
def deps do
[
{:mojoler, "~> 0.1.0"}
]
endmix compile builds priv/native/*.so. Mojo 1.1.0 must be on PATH, or in a .venv at the project root. The Hex package does not include the Mojo runtime.
Requires Elixir ~> 1.20 and OTP 28.3.1. CPU code does not need MAX.
What is in this release
Mojoler.POC.add/2does checked signed 64-bit addition. Overflow and values that do not fit raiseArgumentError.Mojoler.Termconverts integers, floats, a fixed set of atoms, binaries, UTF-8 text, tuples, proper lists, and maps. Domain failures return{:error, reason}.Mojoler.Owncovers a synchronized counter, a copied blob that can be borrowed and frozen into a resource binary, a pin, and a retained term that outlives its process.Mojoler.Sched.burn/1andhold/2run on a dirty CPU scheduler.io_ping/0runs on a dirty I/O scheduler. An Elixir timeout does not cancel the native work.Mix.Tasks.Compile.Mojolerbuilds the libraries, skips a rebuild when the fingerprint matches, and will not replace a library this VM has already loaded.- The OTP 28 ABI is generated from the host
erl_nif.h. Other OTP majors are refused.
License
Apache-2.0.