3 ms·
I thought the OP was a little bit self-undermining, because as the author points out, C feels "close to the metal" but at this point it's actually virtual metal
by decasia 7y ago
I thought the OP was a little bit self-undermining, because as the author points out, C feels "close to the metal" but at this point it's actually virtual metal.
But I think "getting close to the lower levels" is still great. The only time I write C-like code is for an Arduino. Turns out that even if your electronics is rusty, you can do some very useful things in the real world by automating a simple motor and a few LEDs. And whenever you have to interface with individually numbered output pins, it feels pretty low level.
tldr: if you want to get close to the metal, it's really useful to start by switching to hardware that facilitates this.
- saagarjha 7y agoEven assembly goes through a number of layers before it’s run. With microcode, virtual memory, and privilege rings there’s a number of things between the code and what it’s running on.
- decasia 7y agoYeah, that's why I used expressions like "closer to the lower levels" — you can descend in orders of abstraction/layers of reality, but it's more asymptotic or directional than anything else. It's not like playing with an Arduino is getting me closer to understanding the underlying chemistry and physics. Which are also interesting to learn about... But personally I think it's for the best that reality is inexhaustibly complex (from the perspective of human individuals).
- almindor 7y agoWhen you said rusty i thought you meant Rust for a moment :)
- klingonopera 7y ago> C feels "close to the metal" but at this point it's actually virtual metal. Since you mention the Arduino, when you start out with it, you're most likely turning on digital pin e.g. D7 with digitalWrite(7, true), it's easy to understand and quick to implement. But spend enough time on the Arduino (or C or Assembly or embedded in general) and you'll soon realize that all that function call is doing is basically the same as doing PORTD |= 0x80. That's a bit tougher to understand, but even quicker to implement, and once you've understood how that all works together, a lot of everything about computers and digital electronics becomes so much easier to understand. Here's a more detailed guide for the Arduino example: https://www.instructables.com/id/Fast-digitalRead-digitalWrite-for-Arduino/ https://www.instructables.com/id/Fast-digitalRead-digitalWri...