Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bradleywood/triton-lang
A statically typed experimental programming language
https://github.com/bradleywood/triton-lang
compiler jvm jvm-languages programming-language
Last synced: 3 months ago
JSON representation
A statically typed experimental programming language
- Host: GitHub
- URL: https://github.com/bradleywood/triton-lang
- Owner: BradleyWood
- License: mit
- Created: 2018-05-07T23:40:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-22T02:00:32.000Z (over 2 years ago)
- Last Synced: 2023-03-04T15:53:04.409Z (almost 2 years ago)
- Topics: compiler, jvm, jvm-languages, programming-language
- Language: Java
- Homepage:
- Size: 561 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
- [triton-compiler](/triton-compiler/src/main/java/org/bw/tl) - triton code compilation
- [triton-maven-plugin](/triton-maven-plugin/src/main/java/com/github/bradleywood) - build triton during maven compile phase
- [triton-stdlib](/triton-stdlib/src/main/triton/triton) - The standard library
- [triton-examples](/triton-examples/src/main/triton/example) - Example triton projects built using the maven plugin
## Build
```
git clone https://github.com/BradleyWood/Triton-Lang.git
``````
mvn clean install
```## Examples
```kotlin
package testfun main(String[] args) {
for (var arg : args) {
println(arg)
}
}
```### Functions
```kotlin
fun add(int a, int b): int {
return a + b
}fun sub(int a, int b) = a - b
```### For
Foreach
```kotlin
fun display(String[] array) {
for (var a : array) {
println(a)
}
}
```For-I
```kotlin
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")
``````kotlin
for {
println("Infinite loop")
}
```While loop
```kotlin
while(a + b < 100) {
println("$a + $b < 100")
a += 3
b -= 2
}
```