News for hackers. Stuff that matters.
Re:Zig 0.8.0 Release Notes by ncmncm on Saturday June 05, 2021 @05:52PM (#27408724)
What do you imagine is typologically wrong with new std::string("pjmlp")?

Yes, new is itself too low-level, so std::make_unique("pjmlp"s) is the modern idiom; and std::string is limited (expect unicode-aware strings in '23). But a heap-allocated string object is a thing equally easy and useful to express in Rust. (Dunno about Ada: does it have any analog of destructors, yet?)

Re:Zig 0.8.0 Release Notes by masklinn on Sunday June 06, 2021 @09:48AM (#27413122)
> What do you imagine is typologically wrong with new std::string("pjmlp")?

You have to remember to `free` the string explicitely.

> Yes, new is itself too low-level, so std::make_unique("pjmlp"s) is the modern idiom

Is it? Isn't that going to create an `unique_ptr<char*>`?

Re:Zig 0.8.0 Release Notes by ncmncm on Sunday June 06, 2021 @10:48AM (#27413557)
Nope: https://en.cppreference.com/w/cpp/string/basic_string/operat...

> You have to remember to `free` the string explicitly

That is not a type problem. It is far from clear what pjmlp means here. unique_ptr should have been invented in 1985? Time machines have their own problems.