ityonemo

ityonemo

Zigler - Zig nifs for Elixir

Currently just starting out on a new mini-project - getting zig NIFs to run in elixir.

https://github.com/ityonemo/zigler

The idea here is to make the zig NIFs be “embedded” in the elixir code, much like an “asm” call in C. It also makes the bridge between the zig function call and the elixir “basically transparent”. Several adapters are provided: i64, f64, string (as a c string or a zig slice), i64 arrays, f64 arrays. Of course it’s not terribly hard to do the unmarshalling of the erlang terms yourself inside the NIF.

Haven’t started documenting yet, but if you want to see how it works, the test/ directory has quite a few instructive examples which are all passing as of zig 0.4.0

Comments and criticism appreciated!

Most Liked

ityonemo

ityonemo

Updated to 0.8.1

Zig version is bumped to 0.8.1

Major highlights:

  • Supports cancellation of threaded and yielding nifs by killing the owning process.
  • When compiled with debug symbols, zig “error return traces” are merged with elixir exception stacktraces.
  • Supports idiomatic "std.testing.*’ zig stdlib functions for running zig tests
ityonemo

ityonemo

Zigler version 0.10.1 is released, with a redone API, fully updated documentation and guides.

Big highlight is “easy_c” which lets you mount a c library (or supplied c code) and allows you to integrate C libraries as nifs in an intuitive fashion without having to write error-prone glue code by hand.

https://hexdocs.pm/zigler/6-c_integration.html

ityonemo

ityonemo

Version 0.9.1 is released!

Zig version updated to 0.9.1:

Major highlights: Support for c and c++ compilation using the sources option:

Last Post!

venkatd

venkatd

We’ve been using Zigler/Zig in production and I love how seamless the experience is.

We opted for Zig over Rust for personal preferences. I think Zig is closer to C while Rust is closer to C++. We’re more C-kind of personality.

It also comes in handy when trying to integrate with 3rd party C libraries.

Where Next?

Popular in Announcing Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36654 110
New
mischov
import Meeseeks.CSS html = HTTPoison.get!("https://news.ycombinator.com/").body for story <- Meeseeks.all(html, css("tr.athing")) do...
New
treble37
Just looking for a little feedback on a tiny helper library I built - Sometimes I find the need to convert maps with atom keys to maps w...
New
josevalim
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below. Hi everyone, We a...
New
tmbb
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps: bureaucrat - which contains a bunch ...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
zachdaniel
Ash Framework What is Ash? Ash Framework is a declarative, resource-oriented application development framework for Elixir. A resource can...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 130286 1222
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54006 488
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New

We're in Beta

About us Mission Statement