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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Bcompiler – Bootstrapping a simple compiler from nothing (2002)

42 点作者 adg001超过 10 年前

3 条评论

vidarh超过 10 年前
My first compiler wasn&#x27;t bootstrapped in nearly that extreme fashion.<p>I started with an assembler, and the first version was written in M68k assembly and was very simple:<p>It supported pretty much function calls with no arguments, and function definitions, and inline M68k assembly and that it for the first iteration. Then I &quot;rewrote&quot; the compiler using those facilities, and iterated, adding support for variables, function arguments, etc.. Over time I had a relatively decent object oriented language.<p>One of the &quot;fun&quot; parts of the language was that you could use M68k registers in any expression (with some caveats about having to avoid the ones the compiler used). So you might have things like &quot;foo := D0.w + bar&quot; where foo and bar where regular variables, and D0.w indicated 16 bits of the D0 register.<p>I spent a lot of time in high-school working on it on paper during breaks (if you want to come across as a geek, spending breaks reading piles of assembly printouts works wonders), and occasionally lessons.
CarolineW超过 10 年前
This doesn&#x27;t scroll vertically on the Blackberry browser. You have to sweep right to find the special scroll bar, click on that (hoping you don&#x27;t miss), and then sweep back left to read the new text. A few iterations and I gave up. Maybe I&#x27;ll read it later, maybe not, but the page is, for me, a usability disaster.<p>Designers - please consider using widely tested techniques and systems so you are at least aware of the people you exclude.
评论 #8576397 未加载
_almosnow超过 10 年前
Awesome post. Can&#x27;t wait to try something similar.