9 ms·
If you don't understand C, C++, or one could argue Rust these days you're sitting at an abstraction level much higher than where the "systems" domain tends to b
by vvanders 3y ago
If you don't understand C, C++, or one could argue Rust these days you're sitting at an abstraction level much higher than where the "systems" domain tends to be. ABI, cache misses, page tables and memory mapping, restrict, all of that stuff is at an arm's length in a managed language.
One of the best courses I had was taught by Bruce Dawson, it was an entry-level "image processing" course but really it was a tour-de-force on cache hierarchies, modern computer architecture and how to build efficient real-world algorithms and not things that just scored well on the complexity scale. The first assignment was a simple bit-blit, he grabbed a random assignment from the class and in about ~30 minutes walked us through a multi-order-of-magnitude performance improvement with just small adjustments that made the program more cache-aware and also showed how you empirically test for performance improvements instead of doing it in a theoretical manner.
Back when I was in college(which was admittedly a long while back now) those sorts of things just weren't taught and that class was by-and-far an outlier from traditional coursework. My experience has been that even though there's a lot of talk about "fundamentals" in a CS degree it's touched at such a shallow layer that practical application of any of those fundamentals are missing and it doesn't "stick".
I've met all of a handful of people who can tell me what restrict does(much less how to use it), what a cache-aware data structure is or why we care about value types. ABI is just a 3-letter word to a large majority of people because they just don't have to deal with it(but are then oblivious when it blows up, I.E the number of times I've seen STL in what are supposed to be ABI-safe boundaries). That stuff is all foundational at the systems level. I've had much better luck with breaking people of their assumptions(I.E. Big-O) and working up from first-principals of how computer architecture works and structuring systems in such a way that take advantage of that instead of a theoretical ideal.
- madsbuch 3y ago> If you don't understand C, C++, or one could argue Rust these days you're sitting at an abstraction level much higher than where the "systems" domain tends to be. ABI, cache misses, page tables and memory mapping, restrict, all of that stuff is at an arm's length in a managed language. To me, this is a bit muddy: Yes, when doing systems level development, you need to understand the system you are targeting. Not all CPUs have a concept of cache misses or page tables. At my uni this was taught through computer architecture and operating systems classes. These courses incidentally also included C, though they didn't need to. The reason that did was because they were precedents for the compiler course and prepared the students to understand compilers (I TAed in said courses). Later courses at my uni would be algorithms engineering that taught students how to make, well, cache aware implementations. Understanding how a given hardware architecture works on how to most efficiently utilise it has nothing to do with C / C++. Many courses at most (European?) universities will happily teach you everything you need to know, but C / C++ are probably not even mentioned in the teaching material. Actually, I just checked: https://kursuskatalog.au.dk/en/course/117933/Computer-Architecture-Networks-and-Operating-Systems https://kursuskatalog.au.dk/en/course/117933/Computer-Archit... and no: No mentions of C or C++ So I do understand you would be disappointed if you went for courses on C / C++.
- vvanders 3y agoThere are always exceptions, programming for the PS3 was... interesting given the SPUs didn't have any caches, although one could argue they were closer to DSPs with the manual DMA required. I'm not really interested in arguing semantics but more that those languages tend to be what you see modern, battle-tested OSes developed in. My point is if you're not using C/C++/Rust what are you using that exposes those concepts? Not saying you can't do those things in other languages(I've shipped cache-aware datastructures at scale in Java using ByteBuffers + flatbuffers) however you're having to reach through abstractions and/or other limitations. Say nothing that on most OSes that C tends to be the OS ABI as well.
- madsbuch 3y ago> My point is if you're not using C/C++/Rust what are you using that exposes those concepts? Assembly? Why bother with a language and a compiler, when you can instruct your CPU directly. Obviously you also learn to compile C to assembly and inspect the code.
- mcguire 3y agoHow do those European (?) universities deal with the difference between theory and practice? I have a hard time imagining how you would understand how to "most efficiently utilize" a given architecture without writing code and trying things out.