Cyber v0.3

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

Install Release Notes

At a glance.

use math

var worlds = ['World', '世界', 'दुनिया']
worlds.append(math.random())
for worlds -> w:
    print "Hello, $(w)!"

-- Optional static typing.
func fib(n int) int:
    coyield
    if n < 2:
        return n
    return fib(n - 1) + fib(n - 2)

-- Counts fib calls.
var count = 0
var fiber = coinit(fib, 30)
var res any = 0
while fiber.status() != .done:
    res = coresume fiber
    count += 1
print "$(res) $(count)"

Use cases.

Cyber wants to provide fast and delightful scripting.

  • The compiler and VM can be embedded into applications, games, and engines.
  • The CLI app can run scripts on desktops and servers.
  • Performance.

    Cyber is fast on various benchmarks. The language was designed with performance in mind from the start. See more Benchmarks or read more about Performance.

    Recursive Fibonacci (VM) source
    This tests how fast function calls are with a growing call stack.
    cyber
    19ms
     
    2.9 MB
    luajit
    21ms
     
    1.4 MB
    wasm3
    31ms
     
    1.4 MB
    luau
    34ms
     
    2.1 MB
    lua
    39ms
     
    1.3 MB
    quickjs
    57ms
     
    1.9 MB
    wren
    71ms
     
    1.5 MB
    java
    44ms
    31ms
    35.2 MB
    python3
    70ms
    15ms
    10.2 MB
    ruby
    54ms
    31ms
    29.6 MB
    node
    56ms
    39ms
    31.9 MB
    Recursive Fibonacci (JIT) source
    cyber
    5ms
     
    2.9 MB
    luajit
    5ms
     
    1.6 MB
    luau
    20ms
     
    2.3 MB
    java
    3ms
    31ms
    38.3 MB
    node
    6ms
    35ms
    34.0 MB
    ruby-yjit
    13ms
    30ms
    30.1 MB
    Showing script time (orange), load time (gray), and peak memory usage.

    Features.

    To get a comprehensive overview of the language and its features, see the Documentation.

    Interop.

    libcyber allows Cyber to be embedded into your applications. Cyber's CLI and core library were built using libcyber.

    The FFI API allows your scripts to use any C-ABI compatible library. cbindgen.cy was also created as a tool to automatically generate full bindings from just a C header file. Some example bindings include Raylib and LLVM.

    Support us.

    Cyber is still evolving so ideas are always welcome! Feel free to file issues on GitHub or hop on over to our Discord.

    If you're feeling generous, consider supporting the project via Github Sponsors or Patreon!