Crates.io | lolcode |
lib.rs | lolcode |
version | 0.3.1 |
source | src |
created_at | 2022-07-08 20:57:54.642608 |
updated_at | 2022-07-09 22:23:03.386434 |
description | A simple Lolcode to C compiler. |
homepage | |
repository | https://github.com/hobbsbros/lolcode.git |
max_upload_size | |
id | 622098 |
size | 44,005 |
A simple Lolcode to C compiler. Written in Rust.
lolc
requires an up-to-date installation of Cargo.
cargo install lolcode
Lolcode is an esolang, or esoteric programmming language. Its syntax is intentionally humorous and makes it difficult to use in production use. Subsequently, Lolcode is used exclusively as a joke in the software development community.
I developed this Lolcode compiler to help solidify an understanding of Pratt parsing. The parser for Lolcode is based on the principles of Pratt parsing.
Credit to Bob Nystrom at Stuff With Stuff for a really great article that helps explain Pratt parsers. Nystrom uses Java in his implementation (and I use Rust here) but he explains every step very clearly.
Credit to Austin Henley for a great guide on writing compilers.
Credit to Revanth Pothukuchi (GitHub user Hacker007) for explaining to me the parser in his language Envious's compiler, envyc
.
I decided to write this in Rust for a few reasons: