Hadron
Pre-Alpha Development Stage

Code with Power and Simplicity

Hadron is a powerful and easy-to-use programming language with simple syntax, ideal for both scripting and large-scale applications. Transcompile to various languages or run it interpreted for adaptable software solutions.

Why Choose Hadron?

Simple and Intuitive Syntax

Write clean and readable code without sacrificing performance.

1
2
3
4
5
6
7
8
9
10
import IO

fx main {
IO:out("Hello, World!")
}

// Adding two numbers
fx add(i32 a, i32 b) {
return a + b
} i32

Static Type System

Catch errors at compile-time, ensuring robust and reliable applications.

1
2
3
4
5
fx main {
i32 x = 10
str y = "Hello"
x = y // error
}

Modular Architecture

Organize your code with namespaces for better maintainability

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
namespace mathUtils

fx add(i32 a, i32 b) {
return a + b
} i32

fx subtract(i32 a, i32 b) {
return a - b
} i32

// Using modules
import mathUtils

fx main {
i32 sum = mathUtils:add(10, 5)
i32 diff = mathUtils:subtract(10, 5)
IO:out("Sum: ", sum)
IO:out("Difference: ", diff)
}

NEW Flexible Control Flow

The select expression provides a streamlined way to branch logic based on conditions. It evaluates an expression and returns the corresponding value for the matched case.

1
2
3
4
5
6
7
8
9
10
fx main {
i32 x = 2
str result = select x (
1 => "One"
2 => "Two"
3 => "Three"
else => "Unknown"
)
IO:out(result) // Output: Two
}