惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fox-IT International blog
Recent Announcements
Recent Announcements
D
Docker
IT之家
IT之家
B
Blog
Jina AI
Jina AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
量子位
C
Check Point Blog
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
博客园 - 司徒正美
李成银的技术随笔
美团技术团队
Blog — PlanetScale
Blog — PlanetScale
雷峰网
雷峰网
The GitHub Blog
The GitHub Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
L
LangChain Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
有赞技术团队
有赞技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Visual Studio Blog
T
Tailwind CSS Blog
H
Help Net Security
Engineering at Meta
Engineering at Meta
小众软件
小众软件
B
Blog RSS Feed
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
M
Microsoft Research Blog - Microsoft Research
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog

Hacker News: Best

Taking a walk may lead to more creativity than sitting, study finds (2014) Microsoft Copilot Cowork Exfiltrates Files Jony Ive's Ferrari Norway's 2 petabytes of Huawei flash storage and LLM training The bootstrapper's EU stack for under €10 per month Exit IP VPN servers mitigation rollout Ubers COO says its getting harder to justify the money spent on AI tokenmaxxing Founder of 7&#x2F;11 Japan, Toshifumi Suzuki, has died at age 93 Using AI to write better code more slowly California moves to exempt Linux from its upcoming age-verification law after backlash over forcing operating systems to collect users’ ages — amendment proposed by the same lawmaker who wrote the original law The Cost of Safetyism Netherlands Seizes 800 Servers, Arrests 2 for Aiding Cyberattacks Pope Leo XIV says AI must serve humanity, not the powerful few Leave Me Behind Encyclical Letter of His Holiness Leo XIV Magnifica Humanitas (15 May 2026) The Eternal Sloptember CBP Directive 3340-049B: Border Search of Electronic Devices Australia Four-Day Work Week Study Data Shows Boosted Productivity Migrating from Go to Rust | corrode Rust Consulting Claude Is Not Your Architect. Stop Letting It Pretend. Building Pi With Pi AI Chip Component Costs: Memory at 63% | Epoch AI Computer and coding books from Usborne | Usborne | Be Curious Show HN: Audiomass – a free, open-source multitrack audio editor for the web abyss * your_dotfiles_are_not_a_distro The Front Page DeepSeek reasonix, DeepSeek native coding agent with high caching and low cost Childhood Computing - Susam Pal A Fundamental Principle of Aeronautical Engineering Has Been Overturned Greg Brockman: Inside the 72 Hours That Almost Killed OpenAI ‘AI washing’: firms are scrambling to rebrand themselves as tech-focused Amazon Web Services - Four Years and Out AMD Customer Community wake up! 16b ICE Awards $25 Million Iris-Scanning Contract to Bi2 Technologies Toxic chemical leak at a manufacturing facility in Orange County seriot.ch It's time to talk about my writerdeck Texas woman arrested for Facebook post about town water quality Italy moves to Airbus A330 tankers in major NATO-aligned shift Oura says it gets government demands for user data. Will it share how many? On the <dl> The Art of Money Getting – Cool Tools The spell that wouldn't leave · mahl.me 80386 microcode disassembled « Reenigne blog Making Deep Learning go Brrrr From First Principles DeepSeek 将对其旗舰 AI 模型实施永久性 75% 折扣 US tech firms share Dutch regulator officials’ names with senate The FBI Wants ‘Near Real-Time’ Access to US License Plate Readers -​-dangerously-skip-reading-code BambuStudio has been violating PrusaSlicer AGPL license since their fork Spanish Court Declines to Fine NordVPN over LaLiga Piracy Blocking Order GitHub - amatsuda/rubish Is AI Profitable Yet? FBI director&#x27;s Based Apparel site has been spotted hosting a &#x27;ClickFix&#x27; attack SpaceX successfully launches prototype of Starship rocket SpaceX just launched Starship V3 &mdash; its most powerful megarocket yet &mdash; into space for the 1st time in… Client Challenge Shipping a Laptop to a Refugee Camp in Uganda Green Card Seekers Must Leave U.S. to Apply, Trump Administration Says Project Glasswing: An initial update KanBots — a kanban that runs parallel agents Yt-dlp – [Announcement] Bun support is now limited and deprecated Microsoft reports are exposing AI's real cost problem: Using the tech is more expensive than paying human employees | Fortune Lawmakers Demand Answers as CISA Tries to Contain Data Leak U.S. researchers face new restrictions on publishing with foreign collaborators You can no longer Google the word ‘disregard’ Why Japanese companies do so many different things Trump Mobile confirms it exposed customers’ personal data, including phone numbers and home addresses The elephant in the room • Josh W. Comeau If you're an LLM, please read this – Anna's Blog Post unavailable | Deno OpenSCAD LLM Benchmark: Building the Pantheon | ModelRift Blog Steve Wozniak cheered after telling students they have AI – actual intelligence Experience: we found a baby on the subway – now he’s our 26-year-old son Cleve Moler (Matlab, MathWorks) passed away on May 20, 2026 AI is killing the cheap smartphone Uv is fantastic, but its package management UX is a mess Using Kagi Search With Low Vision | Veronica With Four Eyes Six search engines worth trying now that Google isn’t really Google anymore This blog ran on Ubuntu 16.04 for 10 years. I migrated it to FreeBSD BBEdit 16 is here! | Bare Bones Software Amazon, Facebook, FBI have access to a private intelligence-sharing network More than 340 local news outlets are limiting the Internet Archive&#x27;s access Project Hail Mary – Stellar Navigation Chart Freenet Waymo pauses Atlanta service as its robotaxis keep driving into floods Indexing a year of video locally on a 5-year-old M1 Max with Gemma 4 31B Google's Antigravity Bait and Switch AI is just unauthorised plagiarism at a bigger scale Hating AI Is Good US employers spend more than $1.5bn a year to fight labor unions, report finds Show HN: I Dedicated 4 Years to Mastering Offline Password Cracking Samsung chip workers will get an average $340,000 bonus as AI profits soar Scammers are abusing an internal Microsoft account to send spam links Python 3.15: features that didn't make the headlines Flipper One — we need your help Lost Images From the 1945 Trinity Nuclear Test Restored no slop grenade Vivaldi 8.0: our biggest design overhaul, ever
Want to Write a Compiler? Just Read These Two Papers.
2026-04-15 · via Hacker News: Best

Imagine you don't know anything about programming, and you want learn how to do it. You take a look at Amazon.com, and there's a highly recommended set of books by Knute or something with a promising title, The Art of Computer Programming, so you buy them. Now imagine that it's more than just a poor choice, but that all the books on programming are at written at that level.

That's the situation with books about writing compilers.

It's not that they're bad books, they're just too broadly scoped, and the authors present so much information that it's hard to know where to begin. Some books are better than others, but there are still the thick chapters about converting regular expressions into executable state machines and different types of grammars and so on. After slogging through it all you will have undoubtedly expanded your knowledge, but you're no closer to actually writing a working compiler.

Not surprisingly, the opaqueness of these books has led to the myth that compilers are hard to write.

The best source for breaking this myth is Jack Crenshaw's series, Let's Build a Compiler!, which started in 1988. This is one of those gems of technical writing where what's assumed to be a complex topic ends up being suitable for a first year programming class. He focuses on compilers of the Turbo Pascal class: single pass, parsing and code generation are intermingled, and only the most basic of optimizations are applied to the resulting code. The original tutorials used Pascal as the implementation language, but there's a C version out there, too. If you're truly adventurous, Marcel Hendrix has done a Forth translation (and as Forth is an interactive language, it's easier to experiment with and understand than the C or Pascal sources).

As good as it is, Crenshaw's series has one major omission: there's no internal representation of the program at all. That is, no abstract syntax tree. It is indeed possible to bypass this step if you're willing to give up flexibility, but the main reason it's not in the tutorials is because manipulating trees in Pascal is out of sync with the simplicity of the rest of the code he presents. If you're working in a higher level language--Python, Ruby, Erlang, Haskell, Lisp--then this worry goes away. It's trivially easy to create and manipulate tree-like representations of data. Indeed, this is what Lisp, Erlang, and Haskell were designed for.

That brings me to A Nanopass Framework for Compiler Education [PDF] by Sarkar, Waddell, and Dybvig. The details of this paper aren't quite as important as the general concept: a compiler is nothing more than a series of transformations of the internal representation of a program. The authors promote using dozens or hundreds of compiler passes, each being as simple as possible. Don't combine transformations; keep them separate. The framework mentioned in the title is a way of specifying the inputs and outputs for each pass. The code is in Scheme, which is dynamically typed, so data is validated at runtime.

After writing a compiler or two, then go ahead and plunk down the cash for the infamous Dragon Book or one of the alternatives. Maybe. Or you might not need them at all.

permalink June 29, 2008

previously