upvote
I think if you need to get so close to the bare metal that you'd need unsafe Rust then the equivalent Zig is also too dangerous to use "infrequently". Stuff like writing raw assembly, pointer twiddling, volatile stores or fetches - I would hire somebody with lots more experience to do that properly once if you need it.

On the other hand if safe Rust is an option that's way more handholding than you're getting in Zig. Lots of "Whoops I forgot" mistakes won't even compile in safe Rust because it couldn't see why they're OK and that's required but in Zig now you've written a bug.

reply
For clarity in this dual programming language scenario I'm talking about, I'm writing a user facing app that's mostly a lot of business logic.

It's running slow so I profile it and I see my math function in pure Dart (or whatever language you are writing in) is the hot spot, and pressures the garbage collector too much, so I rewrite the function in a lower level language that doesn't have as much overhead, to speed things up. Then I just call it from the higher level language through the FFI.

The benefit of Zig is the syntax is simple, and the build steps are simple, so it doesn't slow down app development too much

reply
Looking at it from an existing knowledge base and error checking point of view, I feel like C++ smart pointers or Rust is a better option for someone doing a dangerous low level thing rarely. I'm not sure Zig is really all that favorable a choice in your given scenario.
reply