5 ms·
> You want to learn how computers think, pick up an assembly language. For which you'd need to be familiar with a low-level language like C.
by antegamisou 4y ago
> You want to learn how computers think, pick up an assembly language.
For which you'd need to be familiar with a low-level language like C.
- Filligree 4y agoAssembly was my first language. I had no trouble picking that up, and in fact didn't meet a compiler until ten years later. They were much too expensive at the time.
- ImprobableTruth 4y ago... no? In fact I think learning assembly before C makes a lot more sense than the other way around.
- orobinson 4y agoThis. The computer science degree I did started off in the first term with us building computers on an FPGA by mapping out the logic gates, then programming it in assembly. Learning how to program in C followed this. It's a good way of helping people with no programming knowledge get past the stage of "what are those magic colourful words you type that somehow make the computer do things?".
- stjohnswarts 4y agoI think this is an awful way of learning for beginning CS students. It will scare off too many good kids who think this is all that CS will ever be. Top down is better. Bottom up is only going to be good for people who adore computer architecture guts and want to start at the bottom from first principals. Most kids want to use computers as a tool and not learn it's atomic structure.
- stjohnswarts 4y agoUnless you're experienced well in some other language then assembly is going to scare you off. I learned assembly by looking at -O0 output from c compiler code. Then I went ahead and dived in. Just doing bare assembly is not somewhere a beginner should start unless they are just absolutely in love with low level programming.
- jcranmer 4y agoNo, you don't. In the curriculum I've taught, assembly was taught before C. As long as you have any programming language experience, you should be fine with assembly--I've explained it in terms of even MATLAB before.
- HideousKojima 4y agoI learned CHIP-8 asm and Gameboy asm before ever touching C
- pwpw 4y agoI want to learn how to build emulators for CHIP-8 and Gameboy and am having the person tug-of-war over assembly, C, or Rust. With hindsight, do you recommend doing them in assembly? And what resources did you use to get started?
- HideousKojima 4y agoI wrote my CHIP-8 emulator in C#, actually. I used the Godot game engine for rendering and sound (though I never actually got around to implementing sound). The language you write it in really doesn't matter too much unless you really care about performance, or if you want to do something fancier than an interpreter (like a JIT recompiler). I used this guide: https://tobiasvl.github.io/blog/write-a-chip-8-emulator/ https://tobiasvl.github.io/blog/write-a-chip-8-emulator/ I haven't made a Gameboy emulator, just learned the assembly so I could modify some roms.
- gotlou 4y agoI wrote a CHIP-8 emulator[0] a while back in C using SDL2 for rendering everything. It still has a couple issues with the timers and taking input. I was new to C back then so I did this project to become more familiar with it. You can check out my blog post[1] if you're interested how I went about it (there are a couple resources at the bottom I used to build it, including the one that HideousKojima recommended). As for language, in hindsight, C was fine. CHIP-8 is so basic that you don't really need to worry about performance or to implement a JIT compiler unless you want to learn how to do those things specifically. Just pick any one out of the three (assembly is a bit of a weird choice though, why not write a CHIP-8 emulator and then a brand new program to run on that emulator in CHIP-8 assembly if you want to learn assembly?) As for Gameboy, it would have more instructions, a different graphics system, sound etc. and overall be more complicated than CHIP-8. Try it out if you either feel a bit more adventurous or have implemented CHIP-8. [0](https://sr.ht/~gotlou/chip8-emulator https://sr.ht/~gotlou/chip8-emulator) [1](https://gotlou.srht.site/chip8-emulator.html https://gotlou.srht.site/chip8-emulator.html)