TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Let’s Build a Compiler (1995)

196 点作者 aycangulez超过 14 年前

6 条评论

barrkel超过 14 年前
Dated, but simple, and more importantly, concrete, using almost no abstractions (like lex and yacc), so there's no magic. Since the compiler described is for a subset of Pascal, and the compiler is itself written in Pascal, even the magic of the compiler itself is explained away.<p>This series is a large part of how I got started in the compiler business; and today I help maintain probably the most used Pascal compiler, in Delphi.<p>If anyone is interested in actually following along, TP 5.5 is freely available, though you'll need DosBox or similar if you're not running a 32-bit install of Windows:<p><a href="http://edn.embarcadero.com/article/20803" rel="nofollow">http://edn.embarcadero.com/article/20803</a>
评论 #1728973 未加载
评论 #1728789 未加载
aycangulez超过 14 年前
Liked the philosophy behind the text:<p>"A word about style and efficiency. As you will see, I tend to write programs in _VERY_ small, easily understood pieces. None of the procedures we'll be working with will be more than about 15-20 lines long. I'm a fervent devotee of the KISS (Keep It Simple, Sidney) school of software development. I try to never do something tricky or complex, when something simple will do. Inefficient? Perhaps, but you'll like the results. As Brian Kernighan has said, FIRST make it run, THEN make it run fast. If, later on, you want to go back and tighten up the code in one of our products, you'll be able to do so, since the code will be quite understandable. If you do so, however, I urge you to wait until the program is doing everything you want it to.<p>I also have a tendency to delay building a module until I discover that I need it. Trying to anticipate every possible future contingency can drive you crazy, and you'll generally guess wrong anyway. In this modern day of screen editors and fast compilers, I don't hesitate to change a module when I feel I need a more powerful one. Until then, I'll write only what I need."
jacquesm超过 14 年前
Wow, what a great article compared to more 'angelgate' stuff.<p>Interesting how something from 1988 can still be applicable today, even if pascal is 'mostly dead' the principles are valid.<p>It would be neat if someone took this as a base and used it to implement - and document - a language that people are more familiar with today.<p>If not for Borland Pascal would have died out long ago, but even today a fairly large number of people still hold on to the modern incarnation of it.
评论 #1727338 未加载
评论 #1727505 未加载
pietrofmaggi超过 14 年前
Forth Edition: <a href="http://home.iae.nl/users/mhx/crenshaw/tiny.html" rel="nofollow">http://home.iae.nl/users/mhx/crenshaw/tiny.html</a><p>Haskell Edition: <a href="http://alephnullplex.appspot.com/blog/view/2010/01/12/lbach-1-introduction" rel="nofollow">http://alephnullplex.appspot.com/blog/view/2010/01/12/lbach-...</a><p>Any other?
评论 #1728262 未加载
评论 #1729227 未加载
statictype超过 14 年前
Excellent set of articles for someone trying to figure out bare basics of compilers without taking it in college.  For a long time (before going to college) I was fascinated with the idea  of how languages are implemented. I found this tutorial and followed along. About 3 articles in, the light bulb went on over my head and I finally 'got' recursive descent parsing and how simple and elegant it was. I didn't learn much else from the articles but it was worth it for that. 
评论 #1727471 未加载
jessejmc超过 14 年前
Is it possible to build a compiler in a high level language, such as Python, Ruby, Clojure, etc...?<p>Note: This may be an obvious question, but compilers are so far out of my area of experience that I don't even know what questions to ask.
评论 #1730753 未加载