I highly recommend this playlist where someone builds an 8-bit computer from scratch starting at digital logic circuits and ending at assembly (which is one layer below C). Beutifully explains every step of the way: https://youtube.com/playlist?list=PLowKtXNTBypGqImE405J2565dvjafglHU
Dullsters
Inspired by the Dull Men’s Club.
1. Relevant commentary on your own dull life. Posts should be about your own dull, lived experience. This is our most important rule. Direct questions, random thoughts, comment baiting, advice seeking, many uses of “discuss” rarely comply with this rule.
2. Original, Fresh, Meaningful Content.
3. Avoid repetitive topics.
4. This isn't an advice forum
Use a search engine, a tradesperson, Reddit, friends, a specialist Facebook group, apps, Wikipedia, an AI chat, a reverse image search etc. to answer simple questions or identify objects. Also see rule 1, “comment baiting”.
There are a number of content specific communities with subject matter experts who can help you.
Some other communities to consider before posting:
5. Keep it dull. If it puts us to sleep, it’s on the right track. Examples of likely not dull: jokes, gross stuff (including toes), politics, religion, royalty, illness or injury, killing things for fun, or promotional content. Feel free to post these elsewhere.
6. No hate speech, sexism, or bullying No sexism, hate speech, degrading or excessively foul language, or other harmful language. No othering or dehumanizing of anyone or negativity towards any gender identity.
7. Proofread before posting. Use good grammar and punctuation. Avoid useless phrases. Some examples: - starting a post with “So” - starting a post with pointless phrases, like “I hope this is allowed” or “this is my first post” Only share good quality, cropped images. Do not share screenshots of images; share the original image.
This is basically a study in layers of abstraction.
At the very fundamental layer you just have a semi-conductor... Special sand that can either allow electricity to pass, or block electricity...
Then when you arrange multiple of these semi conductors in special ways, you get logic gates.
When you arrange the logic gates in special ways you can make more complex operations that can essentially do math with the electric signals.
Then you introduce even more of there bits to be able to perform many different instructions, and some form of memory that can store instructions and execute then in sequence.
With the right set of instructions you now have what is know as a "Turing machine". Essentially a super basic computer that understands machine code.
You extend the list of instructions and, and you arrive at Assembly.
Then you decide to make a simpler more human readable language and write the assembly to translate this language to Assembly, this is basically C with a compiler.
Then you start building languages with higher and higher levels of abstraction to make them easier for humans to express their intentions with.
If you want to start at the very bottom layer and try to build some of those abstraction layers yourself to understand what's going on. I can warmly recommend trying out https://www.nandgame.com/
Come to think of it... Even the semi-conductor layer is an abstraction on top electricity, and electricity in turn is an abstraction on top of electron movements...
Pkowfwoom is the sound of a mind being blown.
Might as well learn ASM.
Buy a little microcontroller kit. It gives you all sorts of inputs and outputs to play with, and the tiny brain is honestly much easier to understand and reason about than the monstrosity in your laptop.
Don't give up, OP. It can be very rewarding to know how basic things in the C standard library such as printf() work, at a lower level.
The hardest concept when I first learned C, so many many years ago, was pointers. But understanding memory access at the low level opens up insights into computer architecture in a very powerful manner.
Sadly computers these days are very, very complex and modern operating systems and 'frameworks' abstract away the inner workings to such a high level that it can be hard to understand. If you really want to learn the fundamentals it might actually be a good (and fun!) exercise to work on a small microcontroller project (such as the Atmel AVR series) or an 8 or 16-bit retro system. If you don't have real hardware it can be done via emulation.
Just my opinion, but: don't study x86 CPU architecture until you've looked at others like the 6502, z80 or 68000, or I suppose ARM). Though, they'll probably ruin you for x86 since it's the ugliest and most confusing of the bunch, yet ironically won the "CPU wars" years ago.
If it's any comfort, I get paid six figures for my knowledge of computers and electronics. And I feel like I know fuckall about why either work.
Sounds like what you really want is to study computer science. That should be able to explain how it actually works.
cries in BASIC and HTML 1.0
Standard C library is not the place to learn from or an example of good programming. This particular piece would not only fail every code review, but would make your colleagues point fingers at you and laugh:
#define ... (repeated 10 times)
#include ...
#undef ... (repeated another 10 times)
In every sane codebase this piece of code would be replaced with some Python script that generates C source file that, while not pretty, does not make you want to commit an arson in your office room.
No. Standard C library is a pile of legacy code from 1980 that still includes pieces to support obscure OSes with the last version released in 1990, using a massive unreadable mess of #ifdef. It's only purpose is to work exactly as described in the documentation, pass unit tests, and maybe follow POSIX standard when it has the mood.
you need PERL
that is the biggest case of the "needs the camel book" if i ever saw it
I don't understand the reference 🥲
Perl is one of the worst to read programming languages. It uses every symbol you can enter on your keyboard as an operator for something. It can stuff regex string manipulation in totally random places. 93% of Paint Splatters are Valid Perl Programs