- Bril creation and purpose: Created for a PhD-level compilers course to support implementation projects. It's not very interesting from a compiler engineering perspective but good for teaching. It's the only compiler IL designed specifically for education.
Bril features:
- JSON-based: Programs are JSON documents. It allows students to use any programming language and has no required framework. Can be composed with Unix pipelines.
- Instruction-based: An assembly-like, typed, ANF language. Prioritizes fast start, easy component mixing, simple semantics, and regular syntax over code size, compiler speed, and generated code performance.
Language design:
- Good:
print
is a core opcode for easy examples. Extensible with loosey-goosey additions like new opcodes and data types. - Bad: Extremely ANF with constants in separate instructions. No systematic way to manage extensions.
- Ugly: Does not require SSA initially but has caused headaches with undefinedness and correctness problems in the aftermarket SSA retrofit.
- Good:
- The Bril ecosystem: A lot of tools have been contributed by CS 6120 students since its creation. There are various language extensions and a sampling of tools in the monorepo. One customer built a web playground. Many more random tools can be found on GitHub.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。