* . *
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Sunday, July 6, 2025
Earth-News
  • Home
  • Business
  • Entertainment
    Magicians and Battlebots light up Las Vegas entertainment scene – KSNV

    Magicians and Battlebots Take Las Vegas Entertainment by Storm

    Max-Matching Entertainments & Longhua District form partnership for new entertainment complex – Blooloop

    Max-Matching Entertainments and Longhua District Unite to Launch Thrilling New Entertainment Complex

    Kennedy Publishing, MGA Entertainment Launch Yummiland Magazine – License Global

    Kennedy Publishing, MGA Entertainment Launch Yummiland Magazine – License Global

    MAY HER SOUL REST IN PEACE 🙏 Veteran entertainment columnist and talent manager Lolit Solis has passed away. She was 78 years old. https://tinyurl.com/6kumarkx | LatestChika.com – Facebook

    Beloved Entertainment Icon Lolit Solis Passes Away at 78 – A Life Remembered with Love and Respect 🙏

    Neil Young Plays Rare Full-Band ‘Ambulance Blues’ With The Chrome Hearts – Yahoo

    Neil Young Stuns Fans with Rare Full-Band Performance of ‘Ambulance Blues’ Alongside The Chrome Hearts

    BTS Announce Their Big Return and Yes, They Already Have Some Major Plans in the Works – Yahoo

    BTS Announce Their Big Return and Yes, They Already Have Some Major Plans in the Works – 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
    Column: Teach kupuna new technology skills – Honolulu Star-Advertiser

    Empowering Kupuna: Unlocking New Technology Skills for a Connected Future

    EIFO invests $5 million in D3, the Ukraine-focused defence technology venture fund – sUAS News

    EIFO Pledges $5 Million to Supercharge Ukraine-Focused Defense Technology Fund

    New Technology for Water Efficiency and Working with Mexico on Screwworm – AG INFORMATION NETWORK OF THE WEST

    Revolutionary Water Efficiency Technology and Cross-Border Collaboration to Defeat Screwworm

    Environmental cognitive distance, R&D capability distance, and supply chain green technology innovation – Nature

    Bridging Gaps: How Environmental and R&D Differences Drive Green Technology Innovation in Supply Chains

    LG Innotek CEO Moon Hyuksoo: “Our Next-gen Substrate Technology Will Change the Industry Paradigm” – TechPowerUp

    LG Innotek CEO Moon Hyuksoo: “Our Next-Gen Substrate Technology Will Revolutionize the Industry” Revolutionizing the Future: LG Innotek’s CEO Unveils Game-Changing Next-Gen Substrate Technology

    Inspira Technologies Secures Landmark $22.5M Deal: Major Revenue Breakthrough After FDA Clearance – Stock Titan

    Inspira Technologies Secures Landmark $22.5M Deal: Major Revenue Breakthrough After FDA Clearance – Stock Titan

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
No Result
View All Result
  • Home
  • Business
  • Entertainment
    Magicians and Battlebots light up Las Vegas entertainment scene – KSNV

    Magicians and Battlebots Take Las Vegas Entertainment by Storm

    Max-Matching Entertainments & Longhua District form partnership for new entertainment complex – Blooloop

    Max-Matching Entertainments and Longhua District Unite to Launch Thrilling New Entertainment Complex

    Kennedy Publishing, MGA Entertainment Launch Yummiland Magazine – License Global

    Kennedy Publishing, MGA Entertainment Launch Yummiland Magazine – License Global

    MAY HER SOUL REST IN PEACE 🙏 Veteran entertainment columnist and talent manager Lolit Solis has passed away. She was 78 years old. https://tinyurl.com/6kumarkx | LatestChika.com – Facebook

    Beloved Entertainment Icon Lolit Solis Passes Away at 78 – A Life Remembered with Love and Respect 🙏

    Neil Young Plays Rare Full-Band ‘Ambulance Blues’ With The Chrome Hearts – Yahoo

    Neil Young Stuns Fans with Rare Full-Band Performance of ‘Ambulance Blues’ Alongside The Chrome Hearts

    BTS Announce Their Big Return and Yes, They Already Have Some Major Plans in the Works – Yahoo

    BTS Announce Their Big Return and Yes, They Already Have Some Major Plans in the Works – 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
    Column: Teach kupuna new technology skills – Honolulu Star-Advertiser

    Empowering Kupuna: Unlocking New Technology Skills for a Connected Future

    EIFO invests $5 million in D3, the Ukraine-focused defence technology venture fund – sUAS News

    EIFO Pledges $5 Million to Supercharge Ukraine-Focused Defense Technology Fund

    New Technology for Water Efficiency and Working with Mexico on Screwworm – AG INFORMATION NETWORK OF THE WEST

    Revolutionary Water Efficiency Technology and Cross-Border Collaboration to Defeat Screwworm

    Environmental cognitive distance, R&D capability distance, and supply chain green technology innovation – Nature

    Bridging Gaps: How Environmental and R&D Differences Drive Green Technology Innovation in Supply Chains

    LG Innotek CEO Moon Hyuksoo: “Our Next-gen Substrate Technology Will Change the Industry Paradigm” – TechPowerUp

    LG Innotek CEO Moon Hyuksoo: “Our Next-Gen Substrate Technology Will Revolutionize the Industry” Revolutionizing the Future: LG Innotek’s CEO Unveils Game-Changing Next-Gen Substrate Technology

    Inspira Technologies Secures Landmark $22.5M Deal: Major Revenue Breakthrough After FDA Clearance – Stock Titan

    Inspira Technologies Secures Landmark $22.5M Deal: Major Revenue Breakthrough After FDA Clearance – Stock Titan

    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

Column: Teach kupuna new technology skills – Honolulu Star-Advertiser

Empowering Kupuna: Unlocking New Technology Skills for a Connected Future

July 6, 2025
Ben Shelton’s sister booed by Wimbledon crowd when job revealed – Yahoo Sports

Wimbledon Crowd Booes Ben Shelton’s Sister Following Shocking Job Reveal

July 6, 2025
New book digs into Indigenous cuisine through archaeology, culture, ecology – Gander Newsroom

Unveiling Indigenous Cuisine: Exploring the Rich Tapestry of Archaeology, Culture, and Ecology

July 6, 2025
BANG! James Webb telescope catches stray galaxies in the Bullet Cluster: Space photo of the week – Live Science

BANG! James Webb Telescope Unveils Breathtaking Image of Stray Galaxies in the Bullet Cluster

July 6, 2025
How Do You Teach Computer Science in the A.I. Era? – The New York Times

Unlocking Success: Mastering Computer Science Education in the Age of A.I

July 6, 2025
If you want to be younger looking in 60 days, start practicing these 8 daily habits – VegOut

If you want to be younger looking in 60 days, start practicing these 8 daily habits – VegOut

July 6, 2025
Real Madrid vs Borussia Dortmund 3-2: FIFA Club World Cup – as it happened – Al Jazeera

Real Madrid vs Borussia Dortmund 3-2: FIFA Club World Cup – as it happened – Al Jazeera

July 6, 2025

Israel’s economy can’t survive a long war with Iran – and Trump knows it – Middle East Eye

July 6, 2025
The long-term health risks as extreme heat becomes a new normal – PBS

Uncovering the Silent, Long-Term Health Risks of Life in Extreme Heat

July 6, 2025
Trump Says He Will Start Talks With China on TikTok Deal – The New York Times

Trump Says He Will Start Talks With China on TikTok Deal – The New York Times

July 6, 2025

Categories

Archives

July 2025
MTWTFSS
 123456
78910111213
14151617181920
21222324252627
28293031 
« Jun    
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 (707)
  • Economy (732)
  • Entertainment (21,621)
  • General (15,741)
  • Health (9,770)
  • Lifestyle (737)
  • News (22,149)
  • People (733)
  • Politics (741)
  • Science (15,949)
  • Sports (21,232)
  • Technology (15,717)
  • World (713)

Recent News

Column: Teach kupuna new technology skills – Honolulu Star-Advertiser

Empowering Kupuna: Unlocking New Technology Skills for a Connected Future

July 6, 2025
Ben Shelton’s sister booed by Wimbledon crowd when job revealed – Yahoo Sports

Wimbledon Crowd Booes Ben Shelton’s Sister Following Shocking Job Reveal

July 6, 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