3 ms·
If you knew how computers worked.... Websites wouldn’t be 4MB on the front page... Some of you would be ashamed of the choices you make in typed languages...
by SV_BubbleTime 6y ago
If you knew how computers worked....
Websites wouldn’t be 4MB on the front page...
Some of you would be ashamed of the choices you make in typed languages...
Others would be horrified to find out what happens in the back end of not typed languages...
You would constantly find it amazing that single CPU core systems aren’t ever actually doing more than one thing at a time and the concurrency of moving the mouse on the screen and ANYTHING else the system is doing is just an illusion...
You wouldn’t shit on C language... at least less.
... IDK, I’m sure there are a ton more I’m not thinking about. I’ll leave it up to someone else to articulate better... something something FaceTime is usually a massive waste of technology.
These are bad musings from an embedded programmer who is dealing with a 2020 released chip and it’s 4KB of ram.
- giantDinosaur 6y agoI don't think knowing how computers work stops 4MB of JS on websites, just that the kind of person inclined to learn about the foundations of computers is more likely to not want bloated websites in the first place, and is less likely to work as a web developer.
- scollet 6y agoMaybe. I still have an affinity for server-side rendering.
- quattrofan 6y agoThis
- na85 6y ago>You wouldn’t shit on C language... at least less. Anyone who still thinks C is the way computers work is in for a surprise when they realize all modern x86 machines are just emulating x86 in microcode for backward compatibility reasons.
- deathgrips 6y agoUhhh.... C doesn't just compile to x86?
- saagarjha 6y ago> Anyone who still thinks C is the way computers work is in for a surprise when …they read the standard and are introduced to the C abstract machine, where pointers aren’t integers anymore.
- ganzuul 6y agoMicrocode is a defining trait for x86. https://en.wikipedia.org/wiki/Intel_Microcode https://en.wikipedia.org/wiki/Intel_Microcode This is very different from how e.g. ARM architectures work.
- gitgud 6y ago> Some of you would be ashamed of the choices you make in typed languages... Any examples?
- SV_BubbleTime 6y agoSure. I’m working on an IoT-like product. I have extremely limited resources. A serialized packet going to the server can be no more than 20 bytes in this case, it needs to fit in a default size single BLE packet. My app developers came back with a message ID field that uses a UUID. A 256bit store, 16 of my possible 20 bytes. The whole packet as they designed it was only 6x larger than could possibly fit. They used int... not having any idea what a int64_t was or that because the value could only ever be 0-20 that a uint8_t was most appropriate. Oh but the language they’re using doesn’t have 8bit ints I guess so then it was a discussion of “what is but shifting” and who even uses this weird operator >> and << !? I have a hundred examples of the above. Embedded is a different world, I consider that “how computers work” territory.
- oriolid 6y ago> You wouldn’t shit on C language... at least less. Nope. If anything, while programming for microcontrollers I learned C is too remote from hardware and leaves too much implementation-defined. Struct padding? Implementation-defined. Bit field implementation? So implementation-defined you'll have to roll your own with shifts and masks. Accessing anything mapped to memory address? The pointers as defined in C standard aren't what you think, but fortunately the implementation often is. Even standard variable sizes are only 21 years old, which means that there is still legacy code that either doesn't use them or wraps them in layers of typedefs to work with toolchains or libraries that don't. And good luck if you have 24-bit registers. Of course it's frustratingly low level at the same time. I don't know what could be a good choice, and C is what everyone already uses anyway.
- SV_BubbleTime 6y ago> Struct padding? Implementation-defined. Bit field implementation? So implementation-defined you'll have to roll your own with shifts and masks. You must be much more advanced than I am. Because in 20 years I’ve never had an issue with structure padding because I just assume it pads to n basetypes and pad them manually to 4byte intervals in 32bit. As to portability, man, you must be moving from ARM to mips to x86 to 8051 to OLD stuff, I’ve never had an issues here either, I just don’t make assumptions of but order if it might matter. Jh mean, code gets tested right? LE to BE or padding or whatever isn’t going to slip by me typically. The problem with shifts and masks is they don’t typically “automatically” take advantage of the BMF cpu operations like structures definitely will. IDK, like I said, you must be more advanced than I am. I’ve had none of this issues. Ignorance must be bliss! :)
- oriolid 6y agoYes, my most interesting experience is from writing code that was portable between to TI DSPs. One had 16-bit char and 24-bit pointer, the other 8 and 32 bits. Of course, the struct padding, bit field packing, char signedness, etc were also different. By the way, their compilers were very good at two things: optimizing shifts and masks into bit access operations and sticking to the standard where it is the least intuitive. C was originally intended to be a high level systems programming language and this stuff would have been written in assembly, and it shows.
- goto11 6y ago> If you knew how computers worked.... Websites wouldn’t be 4MB on the front page... Websites are 4MB because they want a certain experience and a certain functionality, and developers assemble various common components and libraries to achieve this with the least amount of custom development. A developer knowing assembler will not change the priorities of web site owners.
- wmertens 6y agoI mean, I have several wifi-connected computers in my house whose only task is to flip a relay when I tell them to.