Readit News logoReadit News
overbring_labs commented on I let LLMs write an Elixir NIF in C; it mostly worked   overbring.com/blog/2025-0... · Posted by u/overbring_labs
weatherlight · 17 days ago
Why C instead of Rust or Zig? Rustler and Zigler exist. I feel like a Vibecoded NIF in C is the absolute last thing I would want to expose the BEAM to.
overbring_labs · 16 days ago
Well, it's in Rust now, thanks to your and someone else's comments! https://github.com/waseigo/disk_space
overbring_labs commented on I let LLMs write an Elixir NIF in C; it mostly worked   overbring.com/blog/2025-0... · Posted by u/overbring_labs
abrookewood · 17 days ago
Great outcome :)
overbring_labs · 16 days ago
Truly, way better than before: https://github.com/waseigo/disk_space

And it now runs on everything, across more Elixir and Erlang/OTP versions than before!

overbring_labs commented on I let LLMs write an Elixir NIF in C; it mostly worked   overbring.com/blog/2025-0... · Posted by u/overbring_labs
Zxian · 17 days ago
I'd also recommend having a look at the Zig library for Elixir. For simple stuff, you can just inline, but support for pretty complex setups too.

Also comes with a built-in BEAM allocator so the runtime properly reports NIF memory consumption.

https://hexdocs.pm/zigler/Zig.html

overbring_labs · 17 days ago
Thanks, one day I'll look into Zig too, because I've been impressed with what Tigerbeetle has achieved with it! For now, I'm all-in on Elixir.
overbring_labs commented on I let LLMs write an Elixir NIF in C; it mostly worked   overbring.com/blog/2025-0... · Posted by u/overbring_labs
SweetSoftPillow · 17 days ago
It's interesting why the author used weaker models (like Grok 3 when 4 is available, and Gemini 2.5 Flash when Pro is), since the difference in coding quality between these models is significant, and results could be much better.
overbring_labs · 17 days ago
Holy moly, you weren't kidding. Grok 4 is so much better. Thanks!
overbring_labs commented on I let LLMs write an Elixir NIF in C; it mostly worked   overbring.com/blog/2025-0... · Posted by u/overbring_labs
weatherlight · 17 days ago
Why C instead of Rust or Zig? Rustler and Zigler exist. I feel like a Vibecoded NIF in C is the absolute last thing I would want to expose the BEAM to.
overbring_labs · 17 days ago
Given the amount of issues the code had when I ran splint on the C file, I agree. The question was for me whether I can get something working to get over the "speed bump" of lacking such a function for the API client I'm writing.

I'm now re-vibe-coding it into Rust with the same process, but also using Grok 4 to get better results. It now builds and passes the tests on Elixir 1.14 to 1.18 on macOS and Ubuntu, but I'm still trying to get Grok 3 and 4 to fix the Windows-specific parts of the Rust code.

overbring_labs commented on I let LLMs write an Elixir NIF in C; it mostly worked   overbring.com/blog/2025-0... · Posted by u/overbring_labs
brokencode · 17 days ago
Ok. But what are you even reacting to? Who is saying that it produced a working product?

As you said, the very title of the article acknowledged that it didn’t produce a working product.

This is just outrage for the sake of outrage.

overbring_labs · 17 days ago
Amen, thank you for noticing. The goal here was not to produce something of stellar quality, which is anyway out of the question as I don't have the skills/knowledge to evaluate anything other than "it returns the Elixir map I wanted". It was to see if this is feasible at all.
overbring_labs commented on I let LLMs write an Elixir NIF in C; it mostly worked   overbring.com/blog/2025-0... · Posted by u/overbring_labs
SweetSoftPillow · 17 days ago
It's interesting why the author used weaker models (like Grok 3 when 4 is available, and Gemini 2.5 Flash when Pro is), since the difference in coding quality between these models is significant, and results could be much better.
overbring_labs · 17 days ago
It's just that Grok 3 is faster than 4, so I've set it by default. But point taken, I'll try out the newer ones now that I'm converting it to Rust.

u/overbring_labs

KarmaCake day57January 29, 2025View Original