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

4 months ago 7

At a glance.

  • Easy to learn.
  • Dynamic and static types.
  • Concurrency with fibers.
  • Memory safe.
  • FFI and Embeddable.
  • Fast VM and JIT.
  • Cross platform.
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.

    Recursive Fibonacci (JIT) source

    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!

    Read Entire Article