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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Have any of you ever wanted to write a compiler or interpreter?

8 点作者 ncarlson超过 15 年前
Hi everyone,<p>I'm looking for feedback on a project I would like to start. Basically, I would like to start an educational project built around compiler and interpreter design.<p>I remember wanting to learn how to write a compiler for the longest time. However, each time I'd approach the subject to learn more, I would run into some kind of hurdle and eventually get distracted by other projects. The hurdle usually came in the form of poor access to good educational information.<p>There are books available like the famous Dragon book. However, I feel that there needs to be an alternative entry vector into the field of compiler and interpreter design. The project I'm considering would consist of a simple yet fully functioning compiler (or interpreter) with a heavy amount of documentation. Beyond this trivial implementation, subjects like JIT, stack vs register, dispatching methods, and compiler frameworks could be explored.<p>I have a small interpreter half written for a compiler design class I took at university. But I also plan on building a web site to hold all the documentation and educational material.<p>Would any of you benefit from a project like this? I'm willing to go it alone for quite a while, but eventually I would need help from the open source community.<p>Thanks, Nick

3 条评论

bdfh42超过 15 年前
I have had a go at writing both a small interpreter and a small compiler. I found both exercises intellectually rewarding and will probably come back to this at some time in the future.<p>I used the .NET platform and the IL assembler language as my output so I suppose I kept some distance from the "metal" but otherwise explored the challenges.<p>I was reminded of the sheer pleasure of this activity When I recently re-read Douglas Crockford's chapter in the "Beautiful Code" book. In it he describes a short but elegant interpreter written in Javascript.
alanthonyc超过 15 年前
This sounds interesting. It's been a while, but the compiler I built for a project class I in college was the most satisfying thing I've ever built.<p>What language are you thinking of implementing?
MaysonL超过 15 年前
Take a look at OMeta and Factor.