ityonemo
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!
Trending in Announcing
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
I released Doggo, a collection of unstyled Phoenix components.
https://github.com/woylie/doggo
Features
Unstyled Phoenix components....
New
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Hi everyone,
I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
Hey folks,
I just published a post about Hologram’s funding and where the project goes next - the short version:
Curiosum as Main Spons...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 56 to 47- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
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.
zookzook
Many thanks for the great work on Zigler — it really opens up exciting new possibilities!
Up to now, I’ve been using Rustler and Rust to offload certain tasks.
Rust is powerful, but I often found it a bit tricky and more complicated than I’d like.
That’s why I recently started exploring Zig and Zigler.
As a little learning exercise, I built an IPv4 trie in Zig. It can be used in Phoenix, for example, to block or allow specific host addresses.
Here’s the link to the repo: ZigDemo
ityonemo
https://github.com/E-xyza/zigler/issues/420
jeremy_c
Just a FYI, when I tried the
pub usingnamespacetrick, I get:It’s OK if the feature is coming in 0.11. Thanks for giving it a shot!
ityonemo
actually in the meantime, you can probably (haven’t tried it, kinda guessing) get the result you want by doing:
ityonemo
It was an oversight that I didn’t build it in 0.10. this feature will come in 0.11
jeremy_c
It seems that with that method, you write your code in a .zig file, but then still have to wrap every function you wish to expose to Elixir in that external .zig file within the Elixir module?
I was looking for a method that didn’t require that duplication of effort. Or did I misunderstand how it works?
krasenyp
Very quick search in the docs tell me you can - Zig — zigler v0.16.0.
jeremy_c
Is there a way to write the zig code in a .zig file so I can get all the goodness of an editor w/LSP, syntax highlighting, etc… for my zig code?
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