Cyber v0.2

Cyber is a new language for
fast, efficient, and concurrent scripting.

Install Release Notes

At a glance.

NOTE: Cyber is currently at (v0.2) and is unstable. Multithread features are still in the design phase.

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}'

Who's it for.

Cyber wants to provide fast and delightful scripting. You can embed Cyber into your applications, games, and engines on desktop or the web. Cyber also comes with a CLI so you can do scripting on your computer.

Performance.

Cyber is fast on various benchmarks. See more Benchmarks. The fast performance is due to careful design of the compiler, bytecode, and interpreter. Read about Performance.

Bench Test: Fibers Start/Resume source
This tests spawning fibers and context switching. Cyber does well since it's execution context requires very few save/restore ops. Some languages like ruby and php are left out since they allocate large initial stack memory for fibers.
cyber
25ms
 
21.0mB
wren
59ms
 
34.1mB
luajit(jit)
73ms
 
51.0mB
node(jit)
119ms
54ms
75.3mB
node
146ms
60ms
71.2mB
quickjs
175ms
 
33.8mB
lua
178ms
 
113.3mB
python3
202ms
13ms
28.8mB
Showing total time (orange), startup time (gray), and peak memory usage.

Concurrency.

Cyber provides granular control over script execution with fibers. Cyber plans to add multithread support with actors and channels. Read about Concurrency.

Memory safety.

Cyber achieves memory safety through automatic reference counting instead of a tracing garbage collector. This gives Cyber scripts reliable performance in realtime applications. Read about Memory safety.

Gradual types.

Cyber is dynamically typed by default with gradual typing to provide type checks and guarantees. Using types also helps the compiler create more efficient bytecode resulting in faster script execution.

FFI and embedding.

Cyber supports calling into C ABI compatible libraries. You can also embed Cyber into your application, game, or engine.

Support the Project.

If you like Cyber, please consider supporting the project via Github Sponsors or Patreon!

You can also hop over to our Discord if you have any questions about Cyber.