top | item 44915030

(no title)

weatherlight | 6 months 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.

discuss

order

overbring_labs|6 months 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.

qualeed|6 months ago

Why does every post that mentions something other than Rust or Zig get a comment saying "Why not Rust or Zig"?

sodapopcan|6 months ago

Why did you write your comment in English? Why not Rust or Zig?

leansensei|6 months ago

Why not C? It made no difference, we're talking about a few function calls.

weatherlight|6 months ago

because the author self admitted they don't know C! One of the reason why people use the Beam VM is because its robust and fault tolerant.

a lot of the choice here are made at the expense of VM's health.

also why wouldn't anyone just use :disksup.get_disk_info/1. (Thats immediate) calling :disksup.get_disk_info/1 won’t mess with the scheduler in the way a custom NIF or a big blocking port might.

I see the above code/lib and just see reflags all over the place.