Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xor-bits/zap

a scripting language (primarily) for games written in Rust
https://github.com/xor-bits/zap

interop jit llvm-frontend scripting-language strongly-typed type-inference

Last synced: 26 days ago
JSON representation

a scripting language (primarily) for games written in Rust

Awesome Lists containing this project

README

        

# Zap

a programming language for (game) scripting

strongly typed, type inference, scripting language, interop, LLVM JIT

## Hello world + Fibonacci sequence

```go
prints("Fibonacci sequence:");
a := 0;
b := 1;
for {
printi(a);
a, b = b, a + b;
}
```

## Usage from Rust

```rust
let mut compiler = Compiler::new();
compiler.add("sum", |a: i32, b: i32| a + b).unwrap();
compiler.add("print", |a: i32| println!("{a}")).unwrap();
compiler.run(r#"
print(sum(40, 2));
"#).unwrap();

```