152 karma · joined December 20, 2014
unsafe is a necessary escape hatch, but the temptation to use it to write C-style code is strong.
I'd be interested in reading that. There's still a lot of FUD around using C++ for new projects.
It does pretend to work for a while, often failing in another function, in another file, with a cryptic message. All preventable by a simple type check.
https://github.com/scylladb/seastar/wiki/Memcached-Benchmark
http://csl.stanford.edu/~christos/publications/2015.heracles...
And to be fair, some people are pretty productive in modern C++. It's a shame the JNI isn't better so you can have the best of both worlds.
(for the record, Quasar is #1 on my list of libraries to try if I go back to Java)
That's good though. Compiler freedom is better for everyone.
And yes, you can write high performance Java, but for whatever reasons the Cassandra codebase isn't an example of that. They just did a big storage engine rewrite and the result is slower.
My "online search" found Walter Bright, who knows a thing or two about C compilers, wondering the same thing:
For the record, there seem to be a lot of bounds checking independent of indexing:
https://github.com/rust-lang/rust/blob/master/src/libcollect...
https://github.com/rust-lang/rust/blob/master/src/libcollect...
https://github.com/rust-lang/rust/blob/master/src/libcollect...
https://github.com/rust-lang/rust/blob/master/src/libcollect...
But until then, Rust's approach is runtime bounds checking.