Basis is like C++ meets Python, plus a flexible grammar. These are all valid Basis programs:
module main
import sys.console as console
tellPrime : (n)
n ≤ 1 : 'bad'
for i = 2, i * i ≤ n, i++
n % i == 0 : 'bad'
return 'good'
main :
print = console.writeLine
print(tellPrime(17))
module main
import sys.object.*
import sys.console as console
tellPrime : (int n) ⇒ string
if n ≤ 1
return 'bad'
for i = 2, i * i ≤ n, i++
if n % i == 0
return 'bad'
return 'good'
main : void
print = console.writeLine
print(tellPrime(17))
module main
import sys.object.*
import sys.console as console
tellPrime(int n) : string {
if n ≤ 1 { return 'bad' }
for i = 2, i * i ≤ n, i++ {
if n % i == 0 { return 'bad' }
}
return 'good'
}
void main() {
print = console.writeLine
print(tellPrime(17))
}
. It's still at a very early stage, and contributions are welcome. License: MIT.