logoalt Hacker News

pjmlpyesterday at 1:32 PM2 repliesview on HN

Arenas are also available in languages with automatic memory management, e.g. D, C# and Swift, to use only modern languages as example.

Thus I don't consider that a reason good enough for using Zig, while throwing away the safety from modern languages.


Replies

pronyesterday at 2:18 PM

First, Zig is more modern than any of the languages you mention. Second, I'm not aware that any of those languages offer arenas similar in their power and utility to Zig's while offering UAF-freedom at the same time. Note that "type-safe" arenas are neither as powerful as general purpose arenas nor fully offer UAF-freedom. I could be wrong (and if I am, I'd really love to see an arena that's both general and safe), but I believe that in all these languages you must compromise on either safety or the power of the arena (or both).

show 2 replies
defenyesterday at 5:29 PM

Wouldn't C# and Swift make it tough to integrate with other languages? Whereas something written in Zig (or Rust) can integrate with anything that can use the C ABI?

show 1 reply