rbino

rbino

Ash Core Team

build_dot_zig - Use the Zig build system from Elixir to build your NIFs

build_dot_zig is a Mix compiler that allows you to use the Zig build system and compiler from Elixir. This lets you to easily build C, C++ and Zig NIFs without a system toolchain on Linux, MacOS and Windows. You can think of it as an alternative to elixir_make with some more goodies.

The library also features a handy mix generator, mix build_dot_zig.gen.c_nif, that bootstraps all that is needed for a NIF written in C. The only thing left to do is to write the implementation of the NIF.

In the future (or possibly right now, I have yet to experiment with it) it could also leverage the Zig package manager to retrieve C, C++ or Zig dependencies, without the need of having them installed system-wide.

Here you can find a blog post with some more details about the library features.

https://github.com/rbino/build_dot_zig

Most Liked

LostKobrakai

LostKobrakai

I would love to give more hearts to this than one. I had been hoping this would become a thing for some time. I might even have a usecase for it at work. Does this work with nerves and their targets?

LostKobrakai

LostKobrakai

As someone not experienced in systems level languages I found zig quite a bit more approachable than rust. I also really like that they actually want to make things like cross compilation simpler. I once tried to cross compile a rust project we have at work and just gave up after a bit, because I couldn’t figure out what was going wrong. Doing it with a toolchain in the handful of MB makes zig even more appealing in that regard.

LostKobrakai

LostKobrakai

This was about a proposal for zig to gain more indepenance from third parties it currently depends on. I’ll link to the comment, which should ultimately give some perspective to the initial proposal: make the main zig executable no longer depend on LLVM, LLD, and Clang libraries · Issue #16270 · ziglang/zig · GitHub

Last Post!

rbino

rbino

Ash Core Team

Not sure I understand the usecase, can you detail a little more what you’re able to achieve with Rustler? Are you talking about precompiled NIFs?

Where Next?

Popular in Announcing Top

jakub-zawislak
Hi everyone, I’m coming from the Symfony (PHP) framework. I like Phoenix, but it has a one thing that was build much better in the Symfo...
New
mspanc
I am pleased to announce an initial release of the Membrane Framework - an Elixir-based framework with special focus on processing multim...
New
Qqwy
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects. Core ideas Type- and function specifications are const...
336 14703 100
New
nikokozak
Hello all, I’ve been working on Svonix - a library for quickly integrating Svelte components into Phoenix views. It’s a much-needed succ...
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New
Flo0807
Hello everyone! I am excited to share our heart project Backpex with you. After building several Phoenix applications, we realized that...
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31494 112
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40042 209
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement