Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

The Basil Programming Language

println "Welcome to Basil!"

def greetings = ["Hello" "Nice to meet you" "Salutations"]

def greet name? greeting? =
    println greeting + ", " + name + "!"

println "What's your name?"
greet (read String) greetings[1]

For more examples, see the example/ directory located in this project's root!

Basil is a fast and flexible language for expressing complex problems in natural terms without compromising readability, simplicity, or performance.


  • A novel context-sensitive parser that allows seamless manipulation of language syntax.
  • Homoiconicity, supporting Lisp-style metaprogramming via quotations and eval.
  • A "first-class everything" approach - Basil has no keywords, and almost no rigid syntax, so even primitive types and operations can be extended and manipulated.
  • A static, structural type system that permits expressive type-level programming.
  • Evaluation is compile-time by default, with the compiler capable of evaluating arbitrary Basil code.
  • Partial evaluation allows the compiler to "lower" expensive or effectful code, compiling it to efficient native code instead of evaluating it ahead-of-time.
  • Our home-grown compiler backend compiles Basil code quickly, and applies competitive optimizations.
  • Finally, the whole compiler and runtime fits in under a megabyte and depends only on libc.

*Note: Basil is highly WIP! The language is unstable, and these claims may or may not apply on all platforms or for all applications.


Currently, we only support building the Basil compiler from source. You'll need a C++17-conformant C++ compiler, a Python 2.7 or Python 3 interpreter, and maybe a bit of resourcefulness...

$ git clone
$ ./ --help             # lists all build options (compiler to use, additional flags, etc)
$ ./ basil-release
$ bin/basil help

Basil's language runtime can be compiled separately, as either a statically or dynamically linked library.

$ ./ librt-static       # to build a statically-linked library
$ ./ librt-dynamic      # to build a dynamically-linked library

Supported Platforms

Operating Systems:

  • Linux
  • Windows
  • MacOS


  • x86_64
  • AArch64
  • RISC-V
  • LLVM
  • WASM


Basil is distributed under the 3-Clause BSD License. See LICENSE for details.


Fast and flexible language exploring partial evaluation, context-sensitive parsing, and metaprogramming. Compiles JIT or AOT to native code.