6 ms·
That's not what I would teach first. I'd start with a simple assembly language, like 8080A. After that C, and then lisp. The problem with starting students o
by tsotha 15y ago
That's not what I would teach first. I'd start with a simple assembly language, like 8080A. After that C, and then lisp. The problem with starting students on lisp is they have a hard time grasping what's going on under the hood.
- danso 15y agoEr...depends on why the students want to program, right? I studied assembly and I may be taking for granted the computer science foundations that it gave me, but it has almost no bearing in what I do in my current day programming. And I had learned C, C++ and Basic before my assembly classes. Teaching students assembly as their very first language seems akin to teaching students Latin before they can learn French, German, Spanish, etc. Sure, it's helpful and...IF they get pass that first dry session.
- rbanffy 15y agoAn simpke, elegant 8-bit microprocessor is very simple to hold in one's brain. That said, the 8080 and its offspring would never be my choice. I'd suggest the 6502, the 6809 or the 32032 (which is not 8-bit, but very easy to understand)
- twstws 15y agoThere's a big difference between 'simple to hold in your brain' and 'simple to do something useful with'. For someone just starting out programming, the second is arguably much more important. The article mentions Land of Lisp presenting a simple web server in 15 pages of text. What would you be able to explain in 15 pages of text for assembly?
- RodgerTheGreat 15y agoWell, JonesForth manages to explain a self-hosting Forth compiler/interpreter (as well as the language itself) in about 30 pages of assembly, including extensive references and ASCII-art diagrams: http://git.annexia.org/?p=jonesforth.git;a=blob_plain;f=jonesforth.S;hb=66c56998125f3ac265a3a1df9821fd52cfeee8cc http://git.annexia.org/?p=jonesforth.git;a=blob_plain;f=jone... Seems like that should qualify as comparable.
- RodgerTheGreat 15y agoI agree the 6502 would be a nice choice, but I'd be more tempted to go with a modern RISC architecture like MIPS or ARM- MIPS is extremely clean and simple, but it has the additional advantage of being something students are more likely run into in the wild someday.
- orthecreedence 15y agoAgreed. As an electronics hobbyist, learning 6502 was almost stupidly easy (this was with past experience programming x86 assembly). Once I decided to actually implement a motherboard with an 8080 processor, I gave up after a few hours tearing my hair out over the datasheet. The timings are horrid, and the fact that memory locations intersect each other based on seemingly random equations...too complicated. I'm sure given enough time I could have figured it out, but all the external chips needed to deal with memory locations and IO would have been a nightmare.
- tsotha 15y agoI think you really are taking your own knowledge for granted. My sense in working with green programmers over the years is that the ones who never did assembly never have a feel for how everything fits together. They have real trouble understanding implementation details that matter to their day-to-day work. That's not to say you couldn't learn lisp first and assembly later. But that seems like the hard way to me.
- _delirium 15y agoI suppose it depends on which hood you want to look under. :) I see CS as basically dual-grounded: everything is ultimately just syntactic sugar on machine code, and everything is ultimately just syntactic sugar on lambda calculus. Which reduction makes more sense depends on what you care about; the bare-metal view comes into play more when you're talking about low-level performance, while the mathematical view comes into play more when you're talking about algorithms and correctness. I guess it can get into some philosophical debate about which reduction is more "real"... I'm not entirely sure which way is easier to start from. The argument you make here, that students have trouble going from mathematical abstraction to bare-metal implementation, is probably true; but I think students who first learn on asm and C also have trouble going the other way, from thinking about executing a series of instructions to thinking about enacting computations. That's one reason there's been some experimentation at places like MIT and UT-Austin with not starting with an imperative language, which they feel is very hard to get people off of once they've started with it.
- sjm 15y agoI agree. Speaking as someone about to graduate in CS, having started with C, a simple assembly language (LC-3), and later focusing on C++, I've found picking up new languages fairly easy with the stronger understanding of what's going on underneath. Obviously I'll never know what it's like learning higher level languages first, but I'm definitely happy with the path my school uses. For example, learning manual memory management and instilling habits around needing to worry about this made learning Java and C# a breeze. I can't imagine moving from a language with garbage collection to C would be as easy or smooth.
- sedachv 15y agoI completely disagree with that statement. The execution model behind Lisp is trivially simple compared to C which makes the corresponding mental model of what your program is doing simpler. As for what goes on "under the hood," SICP builds a virtual register machine and a Scheme compiler for it in one chapter. Find me a C book that does the same. But you don't even need a chapter. Abdulaziz Ghuloum shows how to build a Scheme to x86 native code compiler in 10 pages: http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf