4 ms·
I question the top answer as being a good habit at all. It's like saying "there's probably some magic going on that I'll never understand". There's a reason why
by emptytheory 12y ago
I question the top answer as being a good habit at all. It's like saying "there's probably some magic going on that I'll never understand". There's a reason why you're wrong. You should probably find out and absorb the reason instead of pretending like the world operates in some mysterious way.
- deleted 12y ago[deleted]
- sklogic 12y agoIf you really want to understand how things work from the very bottom, you can build a toy computer running on FPGA, there are some very cheap boards available now. To make things even more interesting, you can write your own HDL compiler (into netlist, of course, anything lower level is, unfortunately, too proprietary). From this point you can build up your abstractions. The shortest route to the high level you're already comfortable with is to implement Forth first, since it's very easy to build a simple stack-oriented machine on FPGA, see ( http://www.excamera.com/sphinx/fpga-j1.html http://www.excamera.com/sphinx/fpga-j1.html ). Running your own Forth on top of such a CPU is easier than on something like x86. Next step is to implement a Scheme compiler and runtime in Forth. Garbage collection can be somewhat tricky, but if you go for something trivial, like stop-and-copy, it won't take long to implement, especially if you have some assistance from your hardware. Three totally manageable steps from the very bottom of the abstraction ladder - and you've got Scheme, an extensible, powerful meta-language, from which you can grow anywhere. I recently wrote this bit on bootstrapping a Lisp-like language using the most trivial interpreter possible: https://combinatorylogic.wordpress.com/2015/01/14/bootstrapping-a-compiler/ https://combinatorylogic.wordpress.com/2015/01/14/bootstrapp... - you can find this approach useful, I did a similar thing on top of Forth and it was very easy, much easier than trying to implement a "proper" interpreter. And once you know how to build the whole thing from the bare silicon, there won't be any place for "magic" in your understanding.
- deleted 12y ago[deleted]
- ido 12y agoIf you really want to understand how things work from the very bottom, you can build a toy computer running on FPGA, there are some very cheap boards available now. You don't even have to go that far, you can build something resembling the cheap early 80s/late 70s computers from off the shelf chips and 8 bit CPUs that are still sold (z80, i8051, 6502). e.g. http://www.grappendorf.net/projects/6502-home-computer http://www.grappendorf.net/projects/6502-home-computer These chips are simple enough that you can basically hold the whole thing in your head.
- sklogic 12y agoOf course, it's also a very useful experience. It'll just be a bit hard then to go all the way to the high level - i.e., memory-hungry, garbage-collected, with elaborate, computationally intensive compilation. For this you'd need a bit more modern device with enough memory attached. At least something around 16Mb would be nice if you want to implement a decent Lisp. With z80 you'd likely be forced to stay at around C or Basic level of abstraction.
- ido 12y agoPretty sure a 10mhz z80 with 64kb ram can handle a small forth or scheme dialect just fine (You'll have to program those interpreters in asm or c though!) :) It won't be useful/"pragmatic" but I don't think that's what we're after here anyway.
- sklogic 12y agoYes, but this way you'd need some magic - an external C compiler or at least an assembler. Instead of implementing everything from scratch, with most of the code developed on a board itself.
- icebraining 12y agoI don't think that's what he's saying at all. It's closer to following a scientific approach; what you "know" is simply a more or less wrong model of the reality. You may study something "magical" until you understand it completely, but you still must be prepared to revise your knowledge if suddenly you learn something new that goes against it.
- emptytheory 12y agoProgramming systems can be treated scientifically, but they can also be treated deductively (like math). It's possible to have full knowledge of what's going on if you treat it like a deductive system. If your primary way of learning is through experiment, then yes, you will be wrong a lot of the time. But then I would never claim you had a good reason for believing anything. I can't view the stackoverflow link right now, but the top answer basically claimed "I feel strongly about my reasoning, but nevertheless, I could be wrong". How could that be unless you made a mistake? The system is logical!