Re:Why Is Google Building a New Operating System from Scratch?
by steveklabnik on Friday August 18, 2017 @01:33AM
(#15043825)
If Rust is significantly slower than C, it's a bug.
Re:Why Is Google Building a New Operating System from Scratch?
by fooker on Friday August 18, 2017 @04:34AM
(#15044520)
Yeah, just one that will take a decade of compiler optimizations to solve.
C and C++ didn't become what they are today overnight.
Re:Why Is Google Building a New Operating System from Scratch?
by steveklabnik on Friday August 18, 2017 @10:37AM
(#15046542)
We share an optimizer with clang thanks to LLVM; we get to take advantages of those decades already.
Re:Why Is Google Building a New Operating System from Scratch?
by fooker on Friday August 18, 2017 @01:08PM
(#15047920)
Clang and LLVM have evolved together for a while.
It is pretty difficult to get similar results with other LLVM frontends.
You don't have to believe me, just write a reasonably complicated algorithm (say.. a naive SAT solver) with both C++ and Rust (or Swift or $NEW_LANG) and compare the speeds.
Re:Why Is Google Building a New Operating System from Scratch?
by steveklabnik on Friday August 18, 2017 @04:08PM
(#15049338)
You don't have to believe me either; if you try it, you should generally see that they have the same performance.
Re:Why Is Google Building a New Operating System from Scratch?
by fooker on Saturday August 19, 2017 @12:32PM
(#15054236)
Here are some fairly realistic examples.
1. Rust : http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...
2. Swift : http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...
As for a SAT solver, I was not speaking out of my ass. Here is one try that got a fair bit of attention. https://github.com/mishun/minisat-rust
Re:Why Is Google Building a New Operating System from Scratch?
by steveklabnik on Saturday August 19, 2017 @02:03PM
(#15054703)
Yeah, we've had some small regressions recently; a few months ago we were usually faster, now we're slightly slower. Still generally close, except for the ones that need explicit SIMD, as that's still being designed.
Re:Why Is Google Building a New Operating System from Scratch?
by javajosh on Friday August 18, 2017 @09:10PM
(#15050980)
When you say "naive SAT solver" do you mean one where you hard-code a boolean formula with N variables and then check every possible solution (from 0 to 2^N)? If so, does this kind of program accurately characterize the kind of work a kernel does?
Re:Why Is Google Building a New Operating System from Scratch?
by fooker on Saturday August 19, 2017 @12:28PM
(#15054213)
No, something like the CDCL algorithm without domain specific heuristics and tweaks. I expect that is fairly representative in terms of ..say.. common data structures needed in most systems.
Remember if you are talking at the HW-level you don't have the luxury of libraries and I doubt Go/Rust would be of any help unless you build the ecosystem for it. Something like the implementation of coreutil binaries can benefit from Go/Rust but not the OS-code itself.