Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/xor-bits/zap
- Owner: xor-bits
- Created: 2024-01-15T14:55:21.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-11-05T02:51:10.000Z (2 months ago)
- Last Synced: 2024-11-05T03:27:15.304Z (2 months ago)
- Topics: interop, jit, llvm-frontend, scripting-language, strongly-typed, type-inference
- Language: Rust
- Homepage:
- Size: 183 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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();```