* . *
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Sunday, January 18, 2026
Earth-News
  • Home
  • Business
  • Entertainment

    Exciting Mid-Michigan Entertainment Highlights for the Weekend of January 16-18 and Beyond

    Weekly Entertainment Report, Jan. 15-18: Get your fill of music and lively arts – Manchester Ink Link

    The Must-See Reality Show You’ve Never Heard of, ‘The Boyfriend’ – PureWow

    Return of the Willis Richardson Players, and your Wilmington weekend – Wilmington Star-News

    Your Complete 2026 BTS World Tour Ticket Guide: Presale Dates, Times, and Insider Tips

    Alliance Entertainment Lands Major North American Distribution Deal with Amazon MGM Studios

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology

    NYS DMV to Unveil Exciting New Streamlined Technology Systems This February

    Is the Pay-Off of Technology Well Understood? – ai-cio.com

    California Slashes Food and Cash Benefit Theft by 83% Using Cutting-Edge Technology

    HCSO Unveils Game-Changing Real-Time Translation Technology Success

    GigaCloud Technology Boosts Growth with Two Dynamic New Sales VPs

    Revolutionizing Supercar Performance with Cutting-Edge 3D-Printed Heat Transfer Technology

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
  • Home
  • Business
  • Entertainment

    Exciting Mid-Michigan Entertainment Highlights for the Weekend of January 16-18 and Beyond

    Weekly Entertainment Report, Jan. 15-18: Get your fill of music and lively arts – Manchester Ink Link

    The Must-See Reality Show You’ve Never Heard of, ‘The Boyfriend’ – PureWow

    Return of the Willis Richardson Players, and your Wilmington weekend – Wilmington Star-News

    Your Complete 2026 BTS World Tour Ticket Guide: Presale Dates, Times, and Insider Tips

    Alliance Entertainment Lands Major North American Distribution Deal with Amazon MGM Studios

  • General
  • Health
  • News

    Cracking the Code: Why China’s Economic Challenges Aren’t Shaking Markets, Unlike America’s” – Bloomberg

    Trump’s Narrow Window to Spread the Truth About Harris

    Trump’s Narrow Window to Spread the Truth About Harris

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    Israel-Gaza war live updates: Hamas leader Ismail Haniyeh assassinated in Iran, group says

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    PAP Boss to Niger Delta Youths, Stay Away from the Protest

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Court Restricts Protests In Lagos To Freedom, Peace Park

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Fans React to Jazz Jennings’ Inspiring Weight Loss Journey

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Science
  • Sports
  • Technology

    NYS DMV to Unveil Exciting New Streamlined Technology Systems This February

    Is the Pay-Off of Technology Well Understood? – ai-cio.com

    California Slashes Food and Cash Benefit Theft by 83% Using Cutting-Edge Technology

    HCSO Unveils Game-Changing Real-Time Translation Technology Success

    GigaCloud Technology Boosts Growth with Two Dynamic New Sales VPs

    Revolutionizing Supercar Performance with Cutting-Edge 3D-Printed Heat Transfer Technology

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
Earth-News
No Result
View All Result
Home General

Write Elixir NIFs in Rust

August 6, 2023
in General
Write Elixir NIFs in Rust
Share on FacebookShare on Twitter

Documentation | Getting Started | Example

Build Status
Hex.pm package version
Crates.io package version
Last Updated

Rustler is a library for writing Erlang NIFs in safe Rust code. That means
there should be no ways to crash the BEAM (Erlang VM). The library provides
facilities for generating the boilerplate for interacting with the BEAM,
handles encoding and decoding of Erlang terms, and catches rust panics before
they unwind into C.

The library provides functionality for both Erlang and Elixir, however Elixir
is favored as of now.

Features:

Safety – The code you write in a Rust NIF should never be able to crash the BEAM.
Interop – Decoding and encoding rust values into Erlang terms is as easy as a function call.
Type composition – Making a Rust struct encodable and decodable to Erlang or Elixir can be done with a single attribute.
Resource objects – Enables you to safely pass a reference to a Rust struct into Erlang code. The struct will be automatically dropped when it’s no longer referenced.

Getting started

The easiest way of getting started is the rustler elixir library.

Add the rustler elixir library as a dependency of your project.
Run mix rustler.new to generate a new NIF in your project. Follow the instructions.
If you’re already using serde, consider using serde_rustler to easily encode and decode your data types into and from Elixir terms.

NOTE: If you have previously used Rustler, you need to run mix archive.uninstall rustler_installer.ez to remove it before generating the NIF.

What it looks like

This is the code for a minimal NIF that adds two numbers and returns the result.

#[rustler::nif]
fn add(a: i64, b: i64) -> i64 {
a + b
}

rustler::init!(“Elixir.Math”, [add]);

Minimal Supported Rust Version (MSRV)

Rustler currently has a minimal supported Rust version (MSRV) of 1.56.1. This
is the configured version in .clippy.toml.

Supported OTP and Elixir Versions

Rustler aims to support the newest three major OTP versions as well as newest three minor Elixir versions.

Supported NIF version

The minimal supported NIF version for a library should be defined via Cargo
features. The default is currently 2.14 (Erlang/OTP 21). To use features from
NIF version 2.16 (Erlang/OTP 24), the respective feature flag has to be
enabled on the dependency:

[dependencies]
rustler={ version=”…”, features=[“nif_version_2_16”] }

For compatibility reasons, this can be defined (and overridden) by setting the
RUSTLER_NIF_VERSION environment variable during build.

Community

You can find us in the #rustler:matrix.org channel on Matrix
or in the #rustler channel in the Elixir lang Slack.

License

Licensed under either of

Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.

>>> Read full article>>>
Copyright for syndicated content belongs to the linked Source : Hacker News – https://docs.rs/crate/rustler/latest

Previous Post

People who’ve received a black bar on Hacker News

Next Post

Euros Bills Drawn Not to Represent Real Bridges. He Built Them All on This River

Unveiling a Mud-Covering Cephalopod: Revealing Complex Life Habits in the Abyss

January 18, 2026

A huge iceberg becomes a deadly trap for penguins – Popular Science

January 18, 2026

Science Museum confirms it will leave Center in the Square by end of 2026 – WFIR News

January 18, 2026

Melissa Gilbert’s lifestyle brand cancels Q&A event amid husband Timothy Busfield’s child sex abuse case – AOL.com

January 18, 2026

NYS DMV to Unveil Exciting New Streamlined Technology Systems This February

January 18, 2026

Buffalo Bills Devastated After Thrilling Overtime Loss to Broncos

January 18, 2026

Girl Scouts of Gulfcoast Florida Celebrate a Century of World Thinking Day!

January 18, 2026

Exciting Mid-Michigan Entertainment Highlights for the Weekend of January 16-18 and Beyond

January 18, 2026

Introducing ChatGPT Health – OpenAI

January 18, 2026

What’s Driving the Growing Connection Between Canada and China?

January 18, 2026

Categories

Archives

January 2026
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  
« Dec    
Earth-News.info

The Earth News is an independent English-language daily published Website from all around the World News

Browse by Category

  • Business (20,132)
  • Ecology (1,028)
  • Economy (1,043)
  • Entertainment (21,922)
  • General (19,391)
  • Health (10,086)
  • Lifestyle (1,059)
  • News (22,149)
  • People (1,053)
  • Politics (1,060)
  • Science (16,261)
  • Sports (21,546)
  • Technology (16,029)
  • World (1,035)

Recent News

Unveiling a Mud-Covering Cephalopod: Revealing Complex Life Habits in the Abyss

January 18, 2026

A huge iceberg becomes a deadly trap for penguins – Popular Science

January 18, 2026
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

No Result
View All Result

© 2023 earth-news.info

Go to mobile version