Linked by Thom Holwerda on Wed 7th Nov 2007 10:09 UTC, submitted by Chris Lattner
Thread beginning with comment 283412
To view parent comment, click here.
To read all comments associated with this story, please click here.
To view parent comment, click here.
To read all comments associated with this story, please click here.
No, I have seen tutorials that are small scale but what they show have real value.
If his purpose was only to show LLVM, he would have skipped lexing and parsing and AST and he would have gone straight to how LLVM is used to produce code.
His tutorial can be summarized into the following simple phrases:
step 1: LLVM has a library which contains classes which can be used to represent a program; LLVM knows how to interpret the instances of these classes to assembly code.
step 2: In order to provide optimizations, you tell the compiler engine which optimizations you require and then you call the engine to optimize the objects produced in step 1.





Member since:
2006-04-05
Have you ever seen any tutorial that describes every aspect of building a real-life implementation of whatever the tutorial subject is?
Tutorials are simply things that point you to the direction of how things are done under a given environment. It won't give you a step-by-step breakdown on how to write your own operating system, or to build your own your own Gothic cathedral.
The sole purpose of tutorials is to present concepts you're familiar with on ways that match the environment you're working with at the moment. If you need to go beyond that, then you need a "For Dummies" book, then there's a natural progression to books named after the subject, then books named after the subject with an "Advanced Topics" subtitle, then "Subject: the reference manual", then after half a decade or so "Subject: becoming more productive", "Subject: a modern approach", and finally you manage your way around a simple cheat sheet.
See, tutorials are polar opposites of "cheat sheets".
(and yes, it gives me the creeps when I see newbie Python programmers using cheat sheets and coming up with sloppiest solution ever for a given problem, coated with the shiniest syntactic sugar...)
Edit: I'm past the edit time for my previous message, but I just found the link to Dragon Book, 2nd ed. on Amazon, and I think it's worth sharing:
http://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/...
Edited 2007-11-07 18:16