Super Tiny Compiler

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

  • Owner: jamiebuilds/the-super-tiny-compiler
  • Platform: Linux, Mac, Windows
  • License:: Creative Commons Attribution 4.0 International
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

欢迎来到 Super Tiny Compiler!

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

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

想要跳到代码?点击这里

您也可以在 Glitch 上查看

我为什么要在乎?

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

但是编译器很可怕!

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

好的,我从哪里开始?

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

我回来了,这说不通

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

测试

运行 node test.js

(First edition: vz edited at 2019.08.25)

Main metrics

Overview
Name With Ownerjamiebuilds/the-super-tiny-compiler
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
PlatformLinux, Mac, Windows
License:Creative Commons Attribution 4.0 International
所有者活动
Created At2016-03-11 04:19:18
Pushed At2024-02-19 12:33:21
Last Commit At2020-01-07 09:01:32
Release Count1
Last Release Namev1.0.0 (Posted on 2016-12-31 15:34:48)
First Release Namev1.0.0 (Posted on 2016-12-31 15:34:48)
用户参与
Stargazers Count28.3k
Watchers Count473
Fork Count2.9k
Commits Count13
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count20
Pull Requests Open Count11
Pull Requests Close Count29
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

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