the-super-tiny-compiler README

The project's README from github.com/jamiebuilds/the-super-tiny-compiler. As one markdown file: README.md.

The Super Tiny Compiler

Welcome to The Super Tiny Compiler!

This is an ultra-simplified example of all the major pieces of a modern compiler written in easy to read JavaScript.

Reading through the guided code will help you learn about how most compilers work from end to end.

Want to jump into the code? Click here

You can also check it out on Glitch


Why should I care?

That's fair, most people don't really have to think about compilers in their day jobs. However, compilers are all around you, tons of the tools you use are based on concepts borrowed from compilers.

But compilers are scary!

Yes, they are. But that's our fault (the people who write compilers), we've taken something that is reasonably straightforward and made it so scary that most think of it as this totally unapproachable thing that only the nerdiest of the nerds are able to understand.

Okay so where do I begin?

Awesome! Head on over to the the-super-tiny-compiler.js file.

I'm back, that didn't make sense

Ouch, I'm really sorry. Let me know how it can be improved.

Tests

Run with node test.js


cc-by-4.0

the-super-tiny-compiler (jamiebuilds/the-super-tiny-compiler)

Searching Database…

这是什么?Super Tiny Compiler 是一个极度简化、注释详尽的示例,涵盖现代编译器的所有主要组成部分,用纯 JavaScript 编写,方便初学者真正了解编译器的工作原理。
这是需要安装的库,还是只需要阅读的东西?它不是可复用的库,而是一个单独的引导式源代码文件,用于逐行阅读,以理解编译器的内部原理。
我该怎么开始阅读?在仓库中打开 the-super-tiny-compiler.js,通读带注释的代码;如果你想先在浏览器里试一试,也有 Glitch 版本。
跟着学需要先安装什么东西吗?只需要 Node.js 即可运行随附的测试;没有列出其他依赖项。
这个东西是用来在项目中当作真正的编译器使用的吗?不是,它明确是一个教学示例,旨在揭开编译器的神秘面纱,而不是用于生产环境的编译器工具。
如果工作中不编写编译器,学习编译器有什么用?该项目认为,即使你从未亲自构建过编译器,编译器的概念也经常出现在日常开发工具中,因此了解其基础知识是值得的。
如果读完代码还是看不懂怎么办?作者明确欢迎反馈,表示如果第一次没有看懂,请告诉他们该如何改进讲解。
不克隆仓库也能试用吗?可以,README 中有一个 Glitch 链接,可以让你直接在浏览器中查看并运行代码。
Size
<0.1 MB
Stars
28.6K
Updated
CommitJan 07
Age
10y
Commits · 90 Days