4 ms·
From memory, a thing i've implemented in C++ that its basically impossible in almost any other languages (with few exceptions). Represent a data table in memor
by oscargrouch 6y ago
From memory, a thing i've implemented in C++ that its basically impossible in almost any other languages (with few exceptions).
Represent a data table in memory where the columns are from different types, where the data is backed by a arena allocator and represented contiguously in memory.
Of course you can do a data table representation in almost any language, but once you benchmark the implementations, the languages that gives you full control of memory and are good at moving bytes are the ones that lead in performance.
Lars Bak once said that C++ is a great "byte chunker" (if i recall the term correctly), explaining why its a good language to create a compiler or a VM in it.
- jnxx 6y ago> Of course you can do a data table representation in almost any language, but once you benchmark the implementations, the languages that gives you full control of memory and are good at moving bytes are the ones that lead in performance. The thing is, once you need even more performance, you might need parallel evaluation. And in C++, there are plenty of opportunities to shoot yourself with which even very experienced programmers have sometimes extreme difficulty doing it correctly: https://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html https://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedL... https://preshing.com/20130930/double-checked-locking-is-fixed-in-cpp11/ https://preshing.com/20130930/double-checked-locking-is-fixe... And this is the area which Rust, while being as performant as C++, is heavily improving on.
- eru 6y agoSounds like Rust should handle this case just fine?
- oscargrouch 6y agoYes, Rust is one of those languages now. (C, C++ and the newcomers Rust and Zig)