Skip to content

sohnryang/stapl

Repository files navigation

stapl

Simple Type-Annotated Programming Language

Inspired by & started as LLVM Kaleidoscope tutorial implementation here.

CMake

How to Build

Prerequisites:

  • C++ compiler with C++20 support
  • CMake 3.19+
  • Boost
  • LLVM 16+
$ mkdir build
$ cd build
$ cmake -G 'Ninja' ..
$ ninja
$ ctest

The compiled binary is saved to build/bin/staplc.

Example: fibonacci sequence

Note: syntax is subject to change as stapl is in early stage of development.

module fibonacci

def fib(n: int): int {
  if n <= 1 {
    return n
  } else {
    return fib(n - 1) + fib(n - 2)
  }
}

Roadmap

  • Efficient type checking
  • Support for statements: #1
  • Standard library
  • libc interop
  • More types (arrays, strings, structs, ...)
  • Compiler optimizations

Releases

No releases published

Packages

No packages published