Nothing can salvage C++ at this point. It needs to be EOLed and put to rest.
Nothing can salvage C++ at this point. It needs to be EOLed and put to rest.
Otherwise C++ is going to continue filling the space for large, performance sensitive applications.
Edit(since I can't reply yet to child):
By in-place loading I don't mean placement new(which untyped arena covers). Usually in-place loading means constructing an object(usually just by reinterpret_cast<T*>(data)) over a block of memory read in from disk/network such that all data members "line up" with data as it was serialized.
This also includes the ability to mutate the in-place data but have initialized to some sane values. 99% of the time this is paired with either some sort of preprocessor(usually written in the same compiler as the reader to guarantee data matching).
Quite a few games use this technique to allocate levels/fixed entities such that once you've pulled them disk you just need to do some trivial pointer fixup and away you go. There's some pretty incredible speed increases(100-200x) but obviously it's incredibly fragile and complex to get right.
Flatbuffers does a good job of trading off fragility for usability by encoding offsets in the placement data. Reading data is slightly slower due to needing to calculate the offset into the data but on the plus side it doesn't depend on compiler specific layouts :).
And while Rust does have restrictions for safety, unsafe should give you the power to do anything equivalent C or C++ can do. Of course, many idioms are different, especially for safe Rust.
> Edit(since I can't reply yet to child):
HN #protip: if you click on comment link itself, it will let you comment earlier.Ah, I see. This isn't my area of specialty, but it _sounds_ like what Cap'n Proto does? Anyway, it doesn't sound impossible, though it might not be the most ergonomic. I'll check out that library, thanks.
Yeah, Cap'n Proto is very similar, FlatBuffers has the advantage in that it compiles against almost all versions of Visual Studio where Cap'n Proto unfortunately decided to use some C++14 features.
FWIW I think I've seen some ports of FlatBuffers into Rust since it's much easier to handle due to the offsets and translation on return value. The former(matching compiler layout) was the part that I was mentioning that seems like something a bit gnarlier than rust would like.
Realistically, I don't see C++ going away for a looong time (if ever), simply because of the huge amounts of code written in it. But if one were looking for an alternative that matches C++ both in performance and control over memory layout, Ada is where I would start. It has generics, you can do OOP, it avoids many of the syntactic pitfalls of C++... As a bonus, the language standard and the rationale are available for free.
Concurrency / tasking in Ada is simple and beautiful, however. One of the most compelling features of the language, especially coming from C++.
I guess you could say that is even less reliance on GC than C++ has, with smart pointers being part of the standard.
Even if I'm not using Lisp for the end product, whose SLA may not permit a runtime with garbage collection, I always find it invaluable to define low-level structures with a Lisp whose machine code compiler is available at runtime for experimental interactive development.
A free and open source Lisp that you might enjoy experimenting with is SBCL, available from http://www.sbcl.org.
Load up the REPL, and follow the manual available here http://sbcl.org/manual/index.html#Foreign-Function-Interface.
SBCL also allows you to interactively augment the machine code compiler, install new intrinsics, and disassemble any function interactively.
Even if you never use it for production code directly, it might become an invaluable tool in your low level development process.
Just stick with C if you need low level control.
I think that they'll get there but it's going to take a bit.
Also, I'm not aware of anything that has a wider set of compile targets(all the way to some larger uC up to web via emscripten).