logoalt Hacker News

IshKebabtoday at 12:32 PM3 repliesview on HN

Zig has so many compelling features, and I'd even be willing to give up Rust's near-perfect memory safety in some cases. But the one thing that really put me off is string handling. It's just so super tedious. I like being able to finely manage individual string memory allocations, but I really don't want to have to do it all the time. RAII is great; I wish they'd use some light (optional) RAII for strings and containers etc.


Replies

metaltyphoontoday at 2:31 PM

For me it’s string handling, no private, unused variable is compilation error, and having to implement interfaces myself.

onlyrealcuzzotoday at 3:07 PM

> RAII is great; I wish they'd use some light (optional) RAII for strings and containers etc.

Is it not possible to build a wrapper that does this? It seems like it should be.

show 1 reply
nusarutoday at 2:39 PM

Why not use an arena allocator?

show 1 reply