by DarkNova6 · 3y ago · 0 comments
The immeasurable success of Rust certainly lies in its clear communication and forcing developers to learn about the basics of hardware.
I can't help but to feel validated in thinking that every developer worth its salt should know about these basics anyway. But I have to admit that not everybody comes with a CS background.
Something doesn't sit quite right with me to describe the "basics of hardware" as being something that comes with a "CS background".
I come from a formal CS background, and we spent more time dealing with finite state automatons, programming language theory, and other aspects of abstract computation. Getting down and dirty with data sizes, system components, and bit fiddling was an available, but optional path. We all spent one or two courses dealing with the practical nature of computers, but it was largely drowned out by theory, at least in my program.
But the reality is, I still can't tell you what Computer Science actually is. Is it:
- About understanding how to control computers (which are fast electronic machines)
- About inventing programming, from the ground up. (A weird sub-discipline of mathematics and category theory)
or
- Learning to make software in order to improves the lives of humans
We sort of need to learn all three aspects. Haskell programs run slower than C++ programs because haskell isn't written in harmony with the physical CPU cores we've made. Making fast programs is pointless if our software doesn't solve user needs. And solving user needs are impossible if we can't express ourselves clearly to the computer - which programming language theorists are obsessed with.
I think the basics of hardware is part of CS, but maybe a CS undergraduate degree doesn't give anyone enough time to really go broad in the field. I dunno!
Computer Systems Engineering
> About inventing programming, from the ground up. (A weird sub-discipline of mathematics and category theory)
Computer Science
> Learning to make software in order to improves the lives of humans
Software Engineering
Otherwise, where do operating systems fall? Are they systems engineering? They don't seem to be entirely about the hardware to me, and they were a core part of my CS program. What about SeL4 - which is a formally verified operating system project?
How about programming languages like C or Rust? Is that computer science, or systems engineering? How about Excel - the world's most popular programming language - that happens to be functional? Are financial planners doing computer science when they program a spreadsheet?
The lines are blurry everywhere. My CS program offered 3 different degrees, like you said - Computer engineering, Computer Science and Software Engineering. The only difference was the CS degree had a lot of electives, and the other two filled those electives in with (different) required subjects.
Maybe CS is just "lets play with some cool things on computers!". And there's a big playpen of things to explore. Thats more or less how it feels to me.
Computer Science is about understanding what computation can and cannot achieve, and more importantly, how to achieve it (that is where it differs from Mathematics, where mathematicians are usually not interested in the how part). Under this definition, we can put typical college subjects into consideration:
* Data Structures and Algorithms: about studying how to manipulate data to solve a task efficiently.
* Complexity Theory: about formal classification of hardness of problems. What makes a computational problem "hard" or "easy"?
* Computer System: about how to construct a software system to achieve certain purposes. What are the constraints in a system (performance, security, privacy, correctness, fault tolerance, etc), and how to design a system to address such constraints? What tradeoffs to be made when you cannot meet all the desired requirements?
* Distributed System: how to design system with a few to massive number of computers that are connected in a network? How do you reason about fault tolerance, consistency, sharding, and so on?
* Operating System: about how to create abstraction to the hardware, that allows for other softwares to interact with it without having to explicitly deal with the hardware?
The list could go on, but I just give a couple of examples.
This is not a discipline that I am aware of
- Learning to make software in order to make the lives of humans miserable
This is a discipline, but not quite Computer Science
- Learning to make software so that great engineers become average engineers, and incompetent engineers become managers
This is software engineering
The lines between academic fields are primarily administrative. Their main purpose is to facilitate undergraduate education. They are also fuzzy and vary between institutions. A person working in a CS department could find their home in the mathematics department at another university. Or physics. Or economics. Or biology. Or somewhere else. No matter what CS was at your university, it can be something very different at another.
But manually managing memory lifetimes you only learn from a lot of exposure to C/asm.
In my first 3 months of Rust, I spent an equal amount of time with the type-checker and the borrow-checker. A year in and I don’t really have a separate phase of resolving borrow-check errors before I can compile.
People with more C exposure tend to think that way already.
Why C? It is not any lower than Rust, one might even argue that Rust is lower-level than C due to it having control over SIMD and the like without non-portable compiler extensions.
Memory management in C was too high level at that time ;)
You can get very far writing software without even being aware that your language is even doing something called garbage collection for you, or without even having a basic concept of memory being tied to values, sizes, etc. If you lack this context a borrow checker just seems like a pointless nuisance.
Once you get your head around the borrow checker, Rust takes a lot of that cognitive load off you, by tracking things for you at compile time and dinging you on it if you get something wrong.
I'm not convinced Rust & C++ have as much in common as you think. Rust is really familar to OCaml or Haskell users.
their salt