Triton is a statically typed experimental programming language for the JVM.
- Functional Programming
- JVM Interoperability
- Simplified Syntax
- String templates
- Type inference
- Scripting
- Generics
-
triton-compiler - triton code compilation
-
triton-maven-plugin - build triton during maven compile phase
-
triton-stdlib - The standard library
-
triton-examples - Example triton projects built using the maven plugin
git clone https://github.com/BradleyWood/Triton-Lang.git
mvn clean install
package test
fun main(String[] args) {
for (var arg : args) {
println(arg)
}
}
fun add(int a, int b): int {
return a + b
}
fun sub(int a, int b) = a - b
Foreach
fun display(String[] array) {
for (var a : array) {
println(a)
}
}
For-I
fun count(int[] array): int {
var count = 0
for (var i = 0; i < array.length; i++) {
count += array[i]
}
return count
}
Infinite for loop
for println("Infinte Loop")
for {
println("Infinite loop")
}
While loop
while(a + b < 100) {
println("$a + $b < 100")
a += 3
b -= 2
}