Skip to content

A statically typed experimental programming language

License

Notifications You must be signed in to change notification settings

BradleyWood/Triton-Lang

Repository files navigation

Triton-Lang

Triton is a statically typed experimental programming language for the JVM.

Goals

  • Functional Programming
  • JVM Interoperability
  • Simplified Syntax
  • String templates
  • Type inference
  • Scripting
  • Generics

Project Layout

Build

git clone https://github.com/BradleyWood/Triton-Lang.git
mvn clean install

Examples

package test

fun main(String[] args) {
    for (var arg : args) {
        println(arg)
    }
}

Functions

fun add(int a, int b): int {
    return a + b
}

fun sub(int a, int b) = a - b

For

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
}

About

A statically typed experimental programming language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published