Skip to content

Releases: thanos/mojoler

Release list

Mojoler v0.1.0

Choose a tag to compare

@thanos thanos released this 24 Oct 19:09

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"}
  ]
end

mix 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/2 does checked signed 64-bit addition. Overflow and values that do not fit raise ArgumentError.
  • Mojoler.Term converts integers, floats, a fixed set of atoms, binaries, UTF-8 text, tuples, proper lists, and maps. Domain failures return {:error, reason}.
  • Mojoler.Own covers 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/1 and hold/2 run on a dirty CPU scheduler. io_ping/0 runs on a dirty I/O scheduler. An Elixir timeout does not cancel the native work.
  • Mix.Tasks.Compile.Mojoler builds 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.