3 ms·
Can't wait to read a copy. The title is great. I knew exactly what this was about before I clicked through. I've also enjoyed your blog over the past few month
by _vvhw 5y ago
Can't wait to read a copy. The title is great. I knew exactly what this was about before I clicked through.
I've also enjoyed your blog over the past few months, especially your post on the Eytzinger Layout [1], which we've implemented for TigerBeetle's new deterministic LSM-forest [2].
I can also understand your decision to write the examples in C++ given all the legacy code that's out there and given the easy access to std lib examples which are often not optimal. However, if I may make one suggestion it would be to take the extra time now to rewrite the examples in Zig — it's a clearer, simpler, newer language that makes sense for high performance coding for the next 10-20 years. It has a great approach to SIMD intrinsics and shares many of the same performance values as your book. For example, the std lib ships with SoA that can be used to generate SoA layouts at comptime.
As an orthogonal language, it's also brilliant for book examples, notably very readable, and also guaranteed to compile on the first attempt—it will make the examples more engaging and accessible, to bring the cool performance ideas across cleanly to your readers, without abstraction overhead, unnecessary complexity or usability issues.
From a community point of view, I think that this change would also find you a very engaged, supportive and concentrated systems community right from the get go.
[1] https://algorithmica.org/en/eytzinger https://algorithmica.org/en/eytzinger
[2] https://www.youtube.com/watch?v=LikJDDhwmXA https://www.youtube.com/watch?v=LikJDDhwmXA
- erwincoumans 5y agoC/C++ is a good choice, today. Perhaps have Zig, Rust and Julia (etc) as a companion chapter, on other languages?
- _vvhw 5y agoSure, C is a fine choice today. However, since the subject matter in this book can potentially have a half life of 10-20 years, perhaps a more modern C in the same performance space with easy compilation and quick learning curve might be better?
- adgjlsfhk1 5y agoI think Julia would be a great choice for this. It's features like @code_native to get machine code are great for doing this sort of performance analysis. Also, it has many of the algorithms mentioned already implemented in the language, so it would be relatively easy to translate.