3 ms·
Can you elaborate what you don’t like about this one, LC-3, in particular? I’m not familiar with it, but just had a look at it on Wikipedia. After your comic, I
by anyfoo 2y ago
Can you elaborate what you don’t like about this one, LC-3, in particular? I’m not familiar with it, but just had a look at it on Wikipedia. After your comic, I was expecting something weird, but upon a quick glance, it doesn’t seem too jarring. A bit like a mixture of s/360, some x86, and a tiny bit of ARM (or other RISCy architectures). With lots of omissions and some weirdness of course, but the goal seems to be to quickly come to a working implementation. I’m curious what exactly you think makes it “worse than useless” for teaching.
- saithound 2y agoI'm not talking about the instruction set, or teaching basic assembly (probably anything except Malbolge is suitable for that). Let's look at just one thing every programmer has to deal with, memory. On an LC-3, the address space is exactly 64KiB. There is no concept of missing memory, all addresses are assumed to exist, no memory detection is needed or possible, and memory mapped IO uses fixed addresses. There are no memory management capabilities on the LC-3, no MMU, no paging, no segmentation. In turn there are no memory-related exceptions, page faults or protection faults. When an x86 machine boots with 1MB of RAM, the 4GB address space still exists in full, but accessing certain addresses will cause bus timeouts, crashes. One must track and manage available memory. There's a BIOS, and manually probing memory locations may trash its critical structures. There's INT 0x15. I picked memory arbitrarily but you run into the same limitations no matter what you pick. Would a students who was educated on LC-3 know how a computer keeps time? Of course not, there's no PIT, there's no CMOS clock. Would they have thought about caches? Nope. Oh, but wouldn't a student who implements a timer emulation extension for LC-3 learn more about timers than somebody who just learned to use an x86 PIT? Alas, no. There are 20 equally easy and reasonable mathematical ways to implement a timer abstraction. A good 15 of these are physically impossible on real hardware, out of the remaining 5 two would be prohibiitively expensive due to electrical engineering reasons, one has never been implemented in real hardware due to historical accidents, and two are designs that are actually in use. So to write timer emulation that teaches you anything at all about how actual timers work, you'll have to look at and understand a real architecture anyway. That's why educational architectures are so contraproductive. They abstract away exactly the things that make modern computers modern computers. One comes away with fundamentally wrong ideas about what computers do and how they actually work, or could work. It's like learning to drive in GTA: in principle, there could be plenty of skills that transfer to the real thing, but in practice you'll prefer to teach how to drive to the person who didn't play GTA at all.
- upghost 2y agoInteresting. How would you advocate actually gaining that knowledge then? It seems like a student would need to know a significant amount of coding in order to learn those abstractions in an interactive manner. And by learn them I mean learn them (not just following a tutorial), organizing the code for a fully working x86 architecture is no joke. But a student with that level of skill probably doesn't need to learn the x86 architecture so intensively, they are probably already employable. I am asking this seriously, by the way, not trying to nitpick. I'm trying to put together a free course based on the video game Turing Complete[1] but from what you're saying it sounds like it might not be very effective. (to be clear the goal is to teach programming, not Computer Engineering) [1]: https://store.steampowered.com/app/1444480/Turing_Complete/ https://store.steampowered.com/app/1444480/Turing_Complete/
- deleted 2y ago[deleted]
- saithound 2y agoVery good question. My working assumption throughout was that the people in a computer architecture class already had 1 or 2 semesters of other programming courses where they worked in a high-level language, and are looking to learn how computers work "closer to the hardware". And educational architectures create a completely false impression in this domain. If I had to teach assembly programming to people who never programmed before, I'd _definitely_ not want to start with x86 assembly. I'd start by teaching them JavaScript so that they can program the computers that they themselves, and other people, actually use. At that point they'd be ready to learn computer architechture through an x86 deep dive, but would no longer need to learn it, since, as you said, they'd probably already be employable. But the same goes for learning LC-3, and much more so. To be honest, my opinion is only that educational architectures are a poor way to learn what modern computers actually do, and while I think I have good reasons for holding that particular opinion, I don't have the breadth of experience to generalize this specific observation into an overarching theory about teaching programming and/or compsci. I hope your course will be a useful resource for many people, but I doubt listening to me will make it better: my experience does not generalize to the domain you're targeting.