Skip to content

Building a tiny compiler in rust from Austin Z. Henley tutorial

License

Notifications You must be signed in to change notification settings

siddarth2810/rust-compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Compiler

This is a compiler for the Teeny Tiny language, implemented in Rust. It compiles .teeny files into C, and then uses GCC to compile the C code into executables.

compiler.webm

Prerequisites

  • Rust and Cargo (Install Rust)
  • GCC (GNU Compiler Collection)

Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/rust-compiler.git
  2. Navigate to the project directory:

    cd rust-compiler
  3. Build the project:

    cargo build --release
  4. Make sure the compile.sh script is executable:

    chmod +x compile.sh

Usage

  1. Write your code and save the file with a .teeny extension.

  2. Compile your .teeny file:

     bash compile.sh your_file.teeny

    This will create an executable with the same name as your .teeny file.

  3. Run the compiled program:

    ./your_file

Example

If you have a file named lol.teeny:

  1. Compile it:

    bash compile.sh lol.teeny
  2. Run it:

    ./lol .
    

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgements

This project was inspired by Austin Henley's tutorial on building a Teeny Tiny compiler.

About

Building a tiny compiler in rust from Austin Z. Henley tutorial

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published