Super Tiny Compiler

可能是有史以来最小的编译器。(Possibly the smallest compiler ever)

  • 所有者: jamiebuilds/the-super-tiny-compiler
  • 平台: Linux, Mac, Windows
  • 許可證: Creative Commons Attribution 4.0 International
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

欢迎来到 Super Tiny Compiler!

这是一个用易于阅读的 JavaScript 编写的现代编译器的所有主要部分的超简化示例。

阅读指导代码将帮助您了解大多数编译器是如何从头到尾工作的。

想要跳到代码?点击这里

您也可以在 Glitch 上查看

我为什么要在乎?

公平地说,大多数人在日常工作中并不需要考虑编译器。然而,编译器就在您身边,您使用的大量工具都是基于从编译器借来的概念。

但是编译器很可怕!

对,他们是。但这是我们的错(编写编译器的人),我们采取了一些相当直接的东西并使它变得如此可怕,以至于大多数人认为这是完全无法接受的事情,只有书呆子的书呆子才能理解。

好的,我从哪里开始?

真棒!转到 the-super-tiny-compiler.js 文件。

我回来了,这说不通

哎哟,我真的很抱歉。让我知道如何改进它。

测试

运行 node test.js

(First edition: vz edited at 2019.08.25)

主要指標

概覽
名稱與所有者jamiebuilds/the-super-tiny-compiler
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台Linux, Mac, Windows
許可證Creative Commons Attribution 4.0 International
所有者活动
創建於2016-03-11 04:19:18
推送於2024-02-19 12:33:21
最后一次提交2020-01-07 09:01:32
發布數1
最新版本名稱v1.0.0 (發布於 2016-12-31 15:34:48)
第一版名稱v1.0.0 (發布於 2016-12-31 15:34:48)
用户参与
星數28.3k
關注者數473
派生數2.9k
提交數13
已啟用問題?
問題數0
打開的問題數0
拉請求數20
打開的拉請求數11
關閉的拉請求數29
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

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