Re:Why Zig when there is already C++, D, and Rust?
by mmastrac on Friday January 15, 2021 @06:31PM
(#25798070)
Do you have a link to the RFC for this? This sounds awesome.
EDIT: thanks to the links below I found this [1] and this [2]
Re:Why Zig when there is already C++, D, and Rust?
by swsieber on Friday January 15, 2021 @06:34PM
(#25798099)
While I don't have an RFC your you (I'm not the same person), here's an interesting thread on maybe tweaking the interface: https://internals.rust-lang.org/t/is-custom-allocators-the-r...
Re:Why Zig when there is already C++, D, and Rust?
by troutwine on Friday January 15, 2021 @07:50PM
(#25798734)
And here's the working group's repo: https://github.com/rust-lang/wg-allocators
Re:Why Zig when there is already C++, D, and Rust?
by nynx on Friday January 15, 2021 @06:35PM
(#25798105)
I'm not sure there's an up-to-date RFC, but here's what it looks like: https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#...
Re:Why Zig when there is already C++, D, and Rust?
by secondcoming on Friday January 15, 2021 @08:18PM
(#25798943)
Will they avoid the Transparent Comparator fudge that C++ has because the allocator is part of the type?
https://stackoverflow.com/questions/20317413/what-are-transp...
Re:Why Zig when there is already C++, D, and Rust?
by nynx on Saturday January 16, 2021 @12:56AM
(#25800415)
Could you elaborate on what this is, exactly?
Re:Why Zig when there is already C++, D, and Rust?
by secondcoming on Saturday January 16, 2021 @06:08AM
(#25801523)
In short, it allows a std::map<K, V> to be queried with a type that isn't K. For example,
std::map<std::string, int> m;
std::string_view sv = "mykey";
auto&& iter = m.find(sv);
There are also a few people who want to rethink the design of allocators to allow for inline storage. It definitely sounds interesting, but may end up being too complicated.