https://github.com/kengorab/abra-lang
🧙♂️A small programming language with static typing and native compilation, selfhosted
https://github.com/kengorab/abra-lang
compiler pratt-parser programming-language qbe self-hosted
Last synced: 3 days ago
JSON representation
🧙♂️A small programming language with static typing and native compilation, selfhosted
- Host: GitHub
- URL: https://github.com/kengorab/abra-lang
- Owner: kengorab
- Created: 2019-03-15T01:02:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2026-01-10T01:13:43.000Z (8 days ago)
- Last Synced: 2026-01-10T23:13:29.957Z (7 days ago)
- Topics: compiler, pratt-parser, programming-language, qbe, self-hosted
- Language: JavaScript
- Homepage: https://abra.kengorab.dev
- Size: 7.87 MB
- Stars: 51
- Watchers: 3
- Forks: 3
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Abra
A small statically-typed compiled programming language.
Originally written in Rust, but now self-hosted (the compiler is written in itself). The original Rust-based implementation
has been extracted out and can be found [here](https://github.com/kengorab/abra-lang-old) for historical reference.


This project is very much a work in progress: you can check the [documentation site](https://abra.kenrg.co) for more information
## Getting Started
Download the latest `abra` binary from the [Releases](https://github.com/kengorab/abra-lang/releases/latest) page, and
place it wherever you want on your system (e.g. `~/.abra`). You will then need to export an `$ABRA_HOME` environment
variable which points to the `~/.abra/std/` directory.
You should then be able to run
```swift
// example.abra
println("Hello world")
```
```sh
$ abra example.abra
Hello world
```
## What's it look like?
It should look familiar, a lot of inspiration was drawn from modern languages like Swift and Kotlin:
```swift
func fib(n: Int): Int {
if n == 0 {
0
} else if n == 1 {
1
} else {
fib(n - 2) + fib(n - 1)
}
}
println(fib(10))
```
You can also see and play with more examples on the [Try It Out](https://abra.kengorab.dev/try) page of the language documentation site.