3 ms·
> people with prior knowledge, yet disliked by actual students This is the key!. I was about to say SICP was great then, yeah, I read it only when get interest
by mamcx 8y ago
> people with prior knowledge, yet disliked by actual students
This is the key!. I was about to say SICP was great then, yeah, I read it only when get interest in build compilers and after 20 years on the craft.
I think you need a progression on material:
1- Start with a highly practical book more alike build little experiments/programs
"Build a pacgam game" "Make a calculator", etc... ie, do a single pass for the minimal amount of info necessary to build a practical yet rewarding project.
2- Now the student have accomplished their first success, slowdown a little and put a small amount of theory here and there, but put focus on:
"Discipline and follow good practices" then re-do the projects right this time.
To build a analytic mindset move to:
3- How a computer think, using debuggers, disassembles, etc.
You get your hands dirty and see the magic behind the magic
And at the final step (is necessary to put some more steps before, just wanna get to the point):
4- Finish with a well round, deep and wide treaty about the field like SICP, so with some practique behind you can actually see what you have done and how it relate to the new info you are getting now.
Also, this will broad your horizons and open the appetite to get in the deep more.
----
I think is to be like how is learn to cook. You start doing simple yet good dishes, without worry to learn first the theory. You move to more challenge, learn techniques tools and tricks of the trade. Finally, move to see the theory behind, round your mental framework and challenge yourself in come with exotic, new dishes...
- _hardwaregeek 8y agoThat’s very well put. I’ve actually really wanted a “cookbook” for compilers. Basically small, self contained lessons for writing a particular part of a compiler. I.e. here’s how to write a typechecker, or how to write a garbage collector. The closest to that I’ve found is Crafting Interpreters. A lot of the compilers textbooks focus on the theory or general concepts, which is great, but I want to get my hands dirty. I’m not reading the book to learn the theory of compilers; I’m reading to book to write a compiler.
- mamcx 8y agoI agree for the cookbook. I'm building a lang I have scavenged so much info from so many places, but all is kind of disconnected. Or worse, all stop at generate the AST, and barely interpret the AST at the level of a calculator and maybe simple functions. For example, I need like 5 different sources to finally have a grasp in how pattern match, and build a solution that later found in another paper.
- mepian 8y agoThere is a great paper by Abdulaziz Ghuloum, An Incremental Approach to Compiler Construction, that is pretty much the cookbook you want: http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf "We show that building a compiler can be as easy as building an interpreter. The compiler we construct accepts a large subset of the Scheme programming language and produces assembly code for the Intel x86 architecture, the dominant architecture of personal computing. The development of the compiler is broken into many small incremental steps. Every step yields a fully working compiler for a progressively expanding subset of Scheme. Every compiler step produces real assembly code that can be assembled then executed directly by the hardware." There is also a work-in-progress effort to write a more extensive textbook that follows the same approach to teaching compiler development, using Racket instead of R5RS Scheme: https://github.com/IUCompilerCourse/Essentials-of-Compilation https://github.com/IUCompilerCourse/Essentials-of-Compilatio...
- _hardwaregeek 8y agoI was recommended that paper by someone else. Just need to get around to reading it :) The main roadblock I'm having right now is typechecking. I've implemented Hindley Milner in Haskell and played around with Turnstile, but I still don't know enough theory to invent my own type rules for an imperative language. Something like "Type Theory for the Working Programmer" would be excellent. I just got a copy of TaPL, so maybe I'll just use that.
- krig 8y agoThis made me think about how I learned to program on the Commodore 64: By typing in listings from magazines on little games, like Snake or a little text adventure game etc. When teaching kids I think that could be a great method: Usually, kids are also not afraid to start experimenting and tweaking what they typed in, while perhaps adults lack the patience needed to just copy an example. Now that I typed that out, I guess the thing about trying to come up with the one perfect teaching method is that students vary so widely in what experiences they bring to the table. There just isn't one method that could possibly work for everyone.
- _hardwaregeek 8y agoI was thinking of making a product like that. Essentially it'd be like a typing program such as Mavis Beacon in that you'd have a snippet of code that you'd have to type out in its entirety, after which, you'd be asked to tweak it in some fashion. Not sure if it'd be effective, but worth a shot.