Last semester, I was fascinated by the compiler design subject. I didn't want to delay, so I wanted to build a compiler, but not just any compiler. Developers are skyrocketing with their skills, so development tools must also be compatible with devs. Here I present TheCompiler I didn't put much thought into the name, beacause this repository is just an early-stage component of my "Dream Compiler(Project)". With time, I will upgrade it to what it's truly meant to be.
Hydrogen ? 🧐
Because Hydrogen programming language will be simple, lightweight, and scientifically accurate but also Hydrogen is known to be flammable so if you don't handle it properly, it might kill you.
- Matthew Oros
Hydrogen is currently under development, but hopping it will grow in the near future.
Yes TheCompiler is build upon Rust. Here is the most important reason why we chose Rust over C++: Because C++ is too mainstream. I mean, come on, everyone is using C++. It's like the Justin Bieber of programming languages. So I thought, "Why not? Let's do it!"
I believe that Rust is the best language for this project. I am excited to see what I will accomplish with Rust!
To use the TheCompiler, you will need to have Rust installed on your computer. Once you have Rust installed, you can compile your Hydrogen code by running the following command:
- Clone this repository using this command 👇
git clone https://github.com/p21nc3/TheCompiler.git
- Get into the src(source directory).
cd src
-
Finally compile, Nah Drop your hydrogen code(.hy) in the src directory.
-
Now can be compiled into assembly language by running the following command:
hydro hello.hy
This will create an executable file called hydrogen
. You can then run this executable file to compile your Hydrogen code into assembly language.
For example, the following Hydrogen code:
fn main() {
println!("Hello, world!");
}
This will create an assembly language file called hello.asm
.
TheCompiler uses Cargo, the Rust package manager, to manage its dependencies and build process. Here are some of the most important Cargo commands:
cargo build
: Builds the Hydrogen Compiler.cargo test
: Runs the Hydrogen Compiler's tests.cargo doc
: Generates documentation for the Hydrogen Compiler.cargo run
: Runs the Hydrogen Compiler on a specific file.
Welcoming contributions to this project. If you would like to contribute, please fork the repository and submit a pull request. And Follow the Code Of Conduct
The Hydrogen Compiler is licensed under the Apache 2.0 License.
- Name: Prince Bhardwaj
- Email: [email protected]