Cyber is a programming language created in 2022.
git clone https://github.com/fubark/cyber
#1011on PLDB | 2Years Old |
Cyber is a new language for fast, efficient, and concurrent scripting.
import m 'math'
worlds = ['World', '世界', 'दुनिया']
worlds.append(m.random())
for worlds each w:
print 'Hello, {w}!'
func fib(n int) int:
coyield
if n < 2:
return n
return fib(n - 1) + fib(n - 2)
count = 0 -- Counts iterations.
fiber = coinit fib(30)
while fiber.status() != #done:
res = coresume fiber
count += 1
print '{res} {count}'
Feature | Supported | Token | Example |
---|---|---|---|
While Loops | ✓ | while fiber.status() != #done: res = coresume fiber count += 1 |
|
Integers | ✓ | count = 0 |
|
Line Comments | ✓ | -- Counts iterations. |
|
Assignment | ✓ | count = 0 |
|
Print() Debugging | ✓ | print '{res} {count}' |
|
Functions | ✓ | func fib(n int) int: coyield if n < 2: return n return fib(n - 1) + fib(n - 2) |
|
Semantic Indentation | ✓ | ||
hasForEachLoops | ✓ | for worlds each w: print 'Hello, {w}!' |
|
Strings | ✓ | 'World' |
|
File Imports | ✓ | import m 'math' |