https://github.com/thezaplang/zap
The Zap Programing Language
https://github.com/thezaplang/zap
compiler programming-language zap
Last synced: 3 days ago
JSON representation
The Zap Programing Language
- Host: GitHub
- URL: https://github.com/thezaplang/zap
- Owner: thezaplang
- License: apache-2.0
- Created: 2025-12-13T18:28:16.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-04-05T19:51:09.000Z (4 days ago)
- Last Synced: 2026-04-05T21:17:07.982Z (3 days ago)
- Topics: compiler, programming-language, zap
- Language: C++
- Homepage: https://zaplang.xyz
- Size: 6.69 MB
- Stars: 27
- Watchers: 2
- Forks: 7
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
Zap Programming Language
> Systems programming that doesn't get in your way.
You want predictable performance. No GC pauses. Real enums.
Error handling that doesn't look like noise.
**Zap is a systems language built for developers who know Go
or are ready to step into systems programming.** ARC memory
model, LLVM backend, modern syntax. Write low-level software
without low-level frustration.
[Discord](https://discord.gg/cVGqffBA6m) · [Roadmap](ROADMAP.md)
---
## Why Zap?
> [!WARNING]
> Early alpha — not everything is implemented yet.
| Problem | Zap's answer |
|---|---|
| GC pauses & unpredictable latency | ARC, memory freed deterministically |
| No real enums | Enums with exhaustive pattern matching |
| Verbose error handling | Failable functions |
| Limited generics | Full static generics |
| Concise conditional expressions | Ternary operator `?:` |
| Single-platform compilers | LLVM: x86, ARM, RISC-V, WASM, embedded |
| No lightweight concurrency | Fibers, like goroutines without the runtime cost |
---
## Error Handling
> [!WARNING]
> Not yet implemented.
Zap uses **failable functions**: functions that can fail declare it explicitly in their return type.
```zap
enum MathError { DivisionByZero, Overflow }
fun divide(a: Int, b: Int) Int!MathError {
if b == 0 { fail MathError.DivisionByZero; }
return a / b;
}
fun main() Int {
// propagate up with ?
var x: Int = divide(10, 2)?;
// fallback value
var y: Int = divide(10, 0) or 0;
// handle locally
var z: Int = divide(10, 0) or err {
return 1;
};
return 0;
}
```
---
## Contributing
Zap is in early alpha. **Your feedback directly shapes the language.**
- open issues
- discuss language design
- implement features
- improve diagnostics
- write documentation
---
## Star History