Live data from Hacker News

I let LLMs write an Elixir NIF in C; it mostly worked

overbring.com

61–70 of 73 posts

Re: I let LLMs write an Elixir NIF in C; it mostly worked

#61
post #2

"it mostly worked" is just a more nuanced way of saying "it didn't work". Apparently the author did eventually get something working, but it is false to say that the LLMs produced a working project.

I'd say 98% people who say they are programmer in market can't produce good as good as LLM can.

Re: I let LLMs write an Elixir NIF in C; it mostly worked

#62
post #37

I would never ever let an LLM anywhere near C code. If you need help from LLM to write a NIF that performs basic C calls to the OS, you probably can’t check if it’s safe. I mean, it needs at least to pass valgrind.

You can use something like Claude Code or Codex CLI and tell it to run valgrind as part of iterating on the code.

how does it work? does it shell out to subagent? or it has full access to cli? what makes it not perform rm -rf /

Re: I let LLMs write an Elixir NIF in C; it mostly worked

#63
post #2

"it mostly worked" is just a more nuanced way of saying "it didn't work". Apparently the author did eventually get something working, but it is false to say that the LLMs produced a working project.

the mostly-er it works, the harder it is to find out which tiny part does not work.

Re: I let LLMs write an Elixir NIF in C; it mostly worked

#64
post #37

Earlier quoted context omitted.

You can use something like Claude Code or Codex CLI and tell it to run valgrind as part of iterating on the code.

how does it work? does it shell out to subagent? or it has full access to cli? what makes it not perform rm -rf /

> full access to cli?

yes

> what makes it not perform rm -rf /

by default -- regexes and prayers, but you're expected to use sandboxing

Re: I let LLMs write an Elixir NIF in C; it mostly worked

#65
post #2

"it mostly worked" is just a more nuanced way of saying "it didn't work". Apparently the author did eventually get something working, but it is false to say that the LLMs produced a working project.

Well, yeah. It’s a more nuanced way of saying that because “it didn’t work” isn’t very useful nor descriptive.

What if it wrote all of the boilerplate and just let you focus on the important bit that deserves your scrutiny?

You could say I failed every single project I ever built because it took many iterations to get to the final deliverable stage with lots of errors along the way. So more nuance would be needed.

But when it comes to LLMs suddenly we get all gleeful about how negatively we can frame the experience. Even among HN tech scholars.

Re: I let LLMs write an Elixir NIF in C; it mostly worked

#67
post #2

"it mostly worked" is just a more nuanced way of saying "it didn't work". Apparently the author did eventually get something working, but it is false to say that the LLMs produced a working project.

I'd say 98% people who say they are programmer in market can't produce good as good as LLM can.

I think they can. They steal from GitHub and strip the license, same as an LLM.

Re: I let LLMs write an Elixir NIF in C; it mostly worked

#68

Earlier quoted context omitted.

It's because the most familiar thing to me that uses a NIF was Exqlite, so that was my starting point. Using Rust and Rustler turned out to be way easier and it also now works across Elixir versions 1.14 to 1.18.

Great outcome :)

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!

Re: I let LLMs write an Elixir NIF in C; it mostly worked

#69

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.

Well, it's in Rust now, thanks to your and someone else's comments! https://github.com/waseigo/disk_space

Re: I let LLMs write an Elixir NIF in C; it mostly worked

#70
post #37

Earlier quoted context omitted.

You can use something like Claude Code or Codex CLI and tell it to run valgrind as part of iterating on the code.

how does it work? does it shell out to subagent? or it has full access to cli? what makes it not perform rm -rf /

It works really well IMO.
Post reply on HN