Skip to content

🧙‍♂️A small programming language with static typing and native compilation, selfhosted

Notifications You must be signed in to change notification settings

kengorab/abra-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

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 for historical reference.

Test Release

This project is very much a work in progress: you can check the documentation site for more information

Getting Started

Download the latest abra binary from the Releases 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

// example.abra
println("Hello world")
$ 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:

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 page of the language documentation site.