https://github.com/v-pan/do-compiler
Experimenting with creating a data oriented compiler, inspired by Carbon
https://github.com/v-pan/do-compiler
compiler data-oriented
Last synced: 6 months ago
JSON representation
Experimenting with creating a data oriented compiler, inspired by Carbon
- Host: GitHub
- URL: https://github.com/v-pan/do-compiler
- Owner: v-pan
- Created: 2023-08-18T01:25:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T16:44:10.000Z (about 1 year ago)
- Last Synced: 2025-03-13T13:22:52.093Z (11 months ago)
- Topics: compiler, data-oriented
- Language: Rust
- Homepage:
- Size: 141 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# do-compiler
Experimenting with creating a data oriented compiler, inspired by [this talk](https://youtu.be/ZI198eFghJk) about Carbon.
As the current purpose of this compiler implementation is mostly to learn, this is a "half-blind" implementation.
This means that features are first implemented using as little research as possible to begin with, to as high of a standard as I'm currently able.
I then research and implement more standard techniques, with my prior implementation serving as a comparison point for my own learning.
Despite being a basis to learn about compilers, this project is intended to seriously strive to reach a pair of goals:
1. Compilation should be fast.
- Specifically I'm aiming for the same average runtime goals as mentioned in [the above talk](https://youtu.be/ZI198eFghJk) of:
- Lexing and parsing at 100 ns/line.
- Semantic analysis at 1 μs/line.
2. Compilation should be descriptive. Error diagnostics should be clear, reference related code as precisely as possible, and suggest context sensitive helpful changes.
While inspiration will inevitably be taken from Carbon's toolchain, I expect this project to diverge in approach with time as the above goals are reconsidered, and I learn about other language/compiler's approaches (eg. Zig).
Currently there is no specific language syntax being implemented, and this is intentional.
I expect that this approach to writing a compiler will impose restrictions on, or benefit greatly from language design that is aware of compiler internals.
Currently the syntax is being heavily inspired by Rust, Kotlin and Crystal.