If you have any ideas (syntax / features / improvement), please leave them here, I would really appreciate that.
Hello and welcome to Hadron 👋, an early-stage language development project! We're thrilled that you've stopped by our project and hope you'll consider contributing to help us speed up development.
We welcome any ideas, feedback, and contributions from the community. Whether you're a seasoned developer or just starting out, we'd love to hear from you.
Hadron is a custom programming language written in C. It is designed to be a versatile language that can be transcompiled to other languages or interpreted. It aims to provide a simple and intuitive syntax, while still being powerful and flexible.
- Simple and intuitive syntax
- Static type system
- On-demand garbage collection
- Support for closures and anonymous functions
- First-class functions
- Modules and namespaces
- Interoperability with C code
- Transcompilation to C, JavaScript, Python, and other languages
To build Hadron, you need to have clang
installed on your system. You can build Hadron by running the following commands:
git clone https://github.com/hadron-lang/hadron.git
cd hadron
make
To run the interpreter, you can use the following command:
./hadron
To transcompile to C, you can use the following command:
./hadron -l c input.hdn -o output.c
To transcompile to other languages, you can replace c with the target language. For example:
./hadron -l js input.hdn -o output.js
Please note that the syntax may change in the future.
Here is an example of a "Hello, world!" program in Hadron:
fx main {
IO:out("Hello, world!")
}
And here is an example of a function that calculates the nth Fibonacci number:
fx fib(i32 n) {
if n < 2 { return n; }
else { return fib(n-1) + fib(n-2); }
} i32
fx main() {
IO:out(fib(10));
}
We welcome contributions to Hadron! If you find a bug or have an idea for a new feature, please open an issue on our GitHub repository. If you would like to contribute code, please submit a pull request. Before submitting a pull request, please make sure your code follows our coding style and passes our tests.
Hadron is released under the MIT License. See LICENSE for details.