https://github.com/ehsanmok/create-your-own-lang-with-rust
Create your own programming language with Rust
https://github.com/ehsanmok/create-your-own-lang-with-rust
book compiler compiler-design language-design programming-language rust-lang teaching-materials
Last synced: about 2 months ago
JSON representation
Create your own programming language with Rust
- Host: GitHub
- URL: https://github.com/ehsanmok/create-your-own-lang-with-rust
- Owner: ehsanmok
- License: other
- Created: 2020-06-07T02:27:00.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-26T23:22:17.000Z (11 months ago)
- Last Synced: 2025-05-10T04:52:00.907Z (about 2 months ago)
- Topics: book, compiler, compiler-design, language-design, programming-language, rust-lang, teaching-materials
- Language: Rust
- Homepage: https://createlang.rs
- Size: 1.41 MB
- Stars: 779
- Watchers: 35
- Forks: 44
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-list - ehsanmok/create-your-own-lang-with-rust - your-own-lang-with-rust?style=social"/> : Create your own programming language with Rust. [createlang.rs](https://createlang.rs/). (Summary)
- awesome-rust-list - ehsanmok/create-your-own-lang-with-rust - your-own-lang-with-rust?style=social"/> : Create your own programming language with Rust. [createlang.rs](https://createlang.rs/). (Summary)
README
# Create your own programming language with Rust

This repository contains the codes and the contents for [createlang.rs](https://createlang.rs)
## Why am I writing this book?
The book arises from my frustration of not finding modern, clear and concise teaching materials that are readily accessible to beginners like me who wants to learn a bit on how to create their own programming language.
The following are my guidelines
> "If you don't know how *compilers* work, then you don't know how computers work" [1](http://steve-yegge.blogspot.com/2007/06/rich-programmer-food.html?)
> "If you can’t explain something in simple terms, you don’t understand it" [2](https://skeptics.stackexchange.com/questions/8742/did-einstein-say-if-you-cant-explain-it-simply-you-dont-understand-it-well-en)
## Requirements
Make sure you have
1. [Rust toolchain installed](https://www.rust-lang.org/tools/install)
2. Cloned this repository (follow the instructions in each chapter)
3. LLVM installed to run and test locally `cargo test --tests`
* Easiest option is LLVM v14.0 ([Debian/Ubuntu](https://apt.llvm.org/) or [macOS](https://formulae.brew.sh/formula/llvm))
* Otherwise, in `Cargo.toml` you'd need to change the `inkwell = { ..., branch = "master", features = ["your-llvm-version"] }` with LLVM version on your system (output of `llvm-config --version`)To build the book locally, navigate to the `book` subdirectory and follow the instructions in [mdbook](https://github.com/rust-lang/mdBook).
## Roadmap
Checkout the [roadmap to the 1st edition](https://github.com/ehsanmok/create-your-own-lang-with-rust/projects).
## Donation
If you have found this project useful, please consider donating to any of the organizations below
* [Child Foundation](https://mycf.childfoundation.org/s/donate)
* [Black Lives Matter](https://blacklivesmatter.com/)
* [Food Bank of Canada](https://www.foodbankscanada.ca/)