* . *
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Thursday, October 9, 2025
Earth-News
  • Home
  • Business
  • Entertainment
    Israel’s Entertainment Industry Is Being Targeted by the Left in Hollywood and the Right at Home – The Wall Street Journal

    Inside the Fierce Clash Shaping Israel’s Entertainment Industry: Hollywood vs. Local Voices

    Offset Is Ready To Finalize Divorce With Cardi B for a Major Reason – Yahoo

    Offset Poised to Finalize Divorce from Cardi B for a Major Reason

    Beyond the Stage: 8 Performing Arts Centers Driving Entertainment and Education – Livability.com

    Beyond the Stage: 8 Performing Arts Centers Transforming Entertainment and Education

    Row K Entertainment Emerges as Major New Hollywood Buyer With Splashy TIFF Shopping Spree – TheWrap

    Row K Entertainment Emerges as Major New Hollywood Buyer With Splashy TIFF Shopping Spree – TheWrap

    Charlie Hunnam Reflects on Playing a Serial Killer in Monster: The Ed Gein Story – Yahoo

    Charlie Hunnam Reveals the Dark Challenges of Playing a Serial Killer in Monster: The Ed Gein Story

    “Reba” cast, then and now: See the stars 24 years later (and who’s reunited for another show) – Yahoo

    “Reba” cast, then and now: See the stars 24 years later (and who’s reunited for another show) – Yahoo

  • 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

    Wisconsin Dairy Leads the Way with Cutting-Edge Technology Systems

    ENERCON and Biome collaborate for wind turbine noise reduction technology – Yahoo Finance

    ENERCON and Biome Join Forces to Revolutionize Wind Turbine Noise Reduction

    US and investors gambling on unproven nuclear technology, warn experts – Financial Times

    US and investors gambling on unproven nuclear technology, warn experts – Financial Times

    Is Light-Speed Analog Computing the Future of Technology? – BIOENGINEER.ORG

    Could Light-Speed Analog Computing Transform the Future of Technology?

    ARM Institute opens technology project call to speed submarine manufacturing – The Robot Report

    ARM Institute Unveils Cutting-Edge Technology Project to Revolutionize Submarine Manufacturing

    Forget Cowbells. Cows Wear High-Tech Collars Now. – The New York Times

    Ditch the Cowbells: Discover the High-Tech Collars Transforming Cattle Care

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
  • Home
  • Business
  • Entertainment
    Israel’s Entertainment Industry Is Being Targeted by the Left in Hollywood and the Right at Home – The Wall Street Journal

    Inside the Fierce Clash Shaping Israel’s Entertainment Industry: Hollywood vs. Local Voices

    Offset Is Ready To Finalize Divorce With Cardi B for a Major Reason – Yahoo

    Offset Poised to Finalize Divorce from Cardi B for a Major Reason

    Beyond the Stage: 8 Performing Arts Centers Driving Entertainment and Education – Livability.com

    Beyond the Stage: 8 Performing Arts Centers Transforming Entertainment and Education

    Row K Entertainment Emerges as Major New Hollywood Buyer With Splashy TIFF Shopping Spree – TheWrap

    Row K Entertainment Emerges as Major New Hollywood Buyer With Splashy TIFF Shopping Spree – TheWrap

    Charlie Hunnam Reflects on Playing a Serial Killer in Monster: The Ed Gein Story – Yahoo

    Charlie Hunnam Reveals the Dark Challenges of Playing a Serial Killer in Monster: The Ed Gein Story

    “Reba” cast, then and now: See the stars 24 years later (and who’s reunited for another show) – Yahoo

    “Reba” cast, then and now: See the stars 24 years later (and who’s reunited for another show) – Yahoo

  • 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

    Wisconsin Dairy Leads the Way with Cutting-Edge Technology Systems

    ENERCON and Biome collaborate for wind turbine noise reduction technology – Yahoo Finance

    ENERCON and Biome Join Forces to Revolutionize Wind Turbine Noise Reduction

    US and investors gambling on unproven nuclear technology, warn experts – Financial Times

    US and investors gambling on unproven nuclear technology, warn experts – Financial Times

    Is Light-Speed Analog Computing the Future of Technology? – BIOENGINEER.ORG

    Could Light-Speed Analog Computing Transform the Future of Technology?

    ARM Institute opens technology project call to speed submarine manufacturing – The Robot Report

    ARM Institute Unveils Cutting-Edge Technology Project to Revolutionize Submarine Manufacturing

    Forget Cowbells. Cows Wear High-Tech Collars Now. – The New York Times

    Ditch the Cowbells: Discover the High-Tech Collars Transforming Cattle Care

    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

Research team explores inclusion at conferences – EurekAlert!

Research team explores inclusion at conferences – EurekAlert!

October 9, 2025
If you feel you don’t really belong, here is some science-based advice – New Scientist

If you feel you don’t really belong, here is some science-based advice – New Scientist

October 9, 2025
Opinion | The most important Nobel prizes – The Washington Post

Opinion | The most important Nobel prizes – The Washington Post

October 9, 2025
Video: Owner Lists Shih Tzu’s ‘Toxic Traits’ & Internet Can’t Relate to It Enough – Yahoo

Watch: Owner Reveals Hilarious ‘Toxic Traits’ of Their Shih Tzu That Have Everyone Talking

October 9, 2025

Wisconsin Dairy Leads the Way with Cutting-Edge Technology Systems

October 9, 2025
What Ibrahima Konate wants from Liverpool contract talks – Yahoo Sports

Ibrahima Konate’s Ambitious Goals in His Liverpool Contract Negotiations

October 9, 2025
IRONMAN World Championship Kona 2025: Date, start time and how to watch live – TRI247

IRONMAN World Championship Kona 2025: Date, start time and how to watch live – TRI247

October 9, 2025
Canada’s economy is in serious trouble. Now Mark Carney is coming to Washington to talk tariffs – CNN

Canada’s economy is in serious trouble. Now Mark Carney is coming to Washington to talk tariffs – CNN

October 9, 2025
Israel’s Entertainment Industry Is Being Targeted by the Left in Hollywood and the Right at Home – The Wall Street Journal

Inside the Fierce Clash Shaping Israel’s Entertainment Industry: Hollywood vs. Local Voices

October 9, 2025
Better Food, Better Health: Redefining Chronic Disease Care Through Nutrition – The American Journal of Managed Care® (AJMC®)

Better Food, Better Health: Redefining Chronic Disease Care Through Nutrition – The American Journal of Managed Care® (AJMC®)

October 9, 2025

Categories

Archives

October 2025
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  
« Sep    
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 (859)
  • Economy (879)
  • Entertainment (21,752)
  • General (17,497)
  • Health (9,921)
  • Lifestyle (892)
  • News (22,149)
  • People (881)
  • Politics (890)
  • Science (16,090)
  • Sports (21,380)
  • Technology (15,860)
  • World (862)

Recent News

Research team explores inclusion at conferences – EurekAlert!

Research team explores inclusion at conferences – EurekAlert!

October 9, 2025
If you feel you don’t really belong, here is some science-based advice – New Scientist

If you feel you don’t really belong, here is some science-based advice – New Scientist

October 9, 2025
  • 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