News for hackers. Stuff that matters.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming by anonymoushn on Thursday June 02, 2022 @11:43PM (#31604021)
never allocating memory can be and should be simple.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming by bpye on Friday June 03, 2022 @12:36AM (#31604344)
What language actually makes it simple?
Re:Rust Is Hard, Or: The Misery of Mainstream Programming by anonymoushn on Friday June 03, 2022 @02:07AM (#31604805)
In Zig, we are writing a moderately complex application that calls mmap many times in the first few seconds and never thereafter. We can use every part of the stdlib and most libraries because we can pass in allocators backed by the memory we reserved at startup.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming by ncmncm on Friday June 03, 2022 @04:18AM (#31605636)
This is very commonly done in C++. My programs do a flurry of mmaps in the first second, then run for, sometimes, years without allocating again.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming by bpye on Friday June 03, 2022 @01:14PM (#31611020)
I was thinking about C and C++ and whilst they allow you to be very careful about allocations, they also give you every opportunity to get it wrong.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming by ncmncm on Friday June 03, 2022 @07:33PM (#31615132)
We need not act on the opportunity.

All that is actually needed is for it to be more work to get it wrong than to get it right.

Re:Rust Is Hard, Or: The Misery of Mainstream Programming by jedisct1 on Friday June 03, 2022 @02:17AM (#31604879)
Zig, definitely.