Skip to content

hadron-lang/hadron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hadron

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.

Please take a look at our documentation and feel free to reach out to us if you have any questions.


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.

Planned Features

  • 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

Getting Started

To build Hadron, you need to have gcc 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.hadron -o output.c

To transcompile to other languages, you can replace c with the target language. For example:

./hadron -l javascript input.hadron -o output.js

Examples

Please note that the syntax may change in the future.

Here is an example of a "Hello, world!" program in Hadron:

func main {
  log("Hello, world!")
}

And here is an example of a function that calculates the nth Fibonacci number:

func fib(n) {
  if (n < 2) return n;
  else return fib(n-1) + fib(n-2);
}

func main() {
  log(fib(10));
}

Contributing

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.

License

Hadron is released under the MIT License. See LICENSE for details.

About

Hadron is a language that can be transcompiled or interpreted, prioritizing efficiency and readability. It aims to be easy-to-use and expressive.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published