Skip to content

A compiler for the Hydrogen programming language that converts Hydrogen code into assembly language.

License

Notifications You must be signed in to change notification settings

p21nc3/TheCompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TheCompiler

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 Programming Language

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.

Why Rust?

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!

How to Use

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:

  1. Clone this repository using this command 👇
git clone https://github.com/p21nc3/TheCompiler.git
  1. Get into the src(source directory).
cd src
  1. Finally compile, Nah Drop your hydrogen code(.hy) in the src directory.

  2. 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.

Cargo Commands

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.

Contributing

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

License

The Hydrogen Compiler is licensed under the Apache 2.0 License.

Maintainer

About

A compiler for the Hydrogen programming language that converts Hydrogen code into assembly language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published