Skip to content
forked from AnyDSL/MimIR

The Higher ORder INtermediate representation - next gen

License

Notifications You must be signed in to change notification settings

NeuralCoder3/thorin2

This branch is 31 commits ahead of, 1871 commits behind AnyDSL/MimIR:master.

Folders and files

NameName
Last commit message
Last commit date
Oct 31, 2022
Dec 6, 2022
Dec 23, 2022
Dec 6, 2022
Feb 16, 2023
Dec 1, 2022
Dec 1, 2022
Feb 13, 2023
Sep 14, 2022
Dec 23, 2022
Jul 25, 2022
Oct 24, 2022
Mar 30, 2022
Nov 3, 2022
Feb 11, 2022
Dec 12, 2022
Feb 17, 2022
Nov 29, 2022

Repository files navigation

Introduction

[TOC]

Support Documentation Discord
License License
Requirements CMake C++ LLVM/Clang Submodules
Tests Linux Windows MacOS Doxygen

Thorin is an extensible compiler intermediate representation that is based upon the Calculus of Constructions (CoC). This means:

In contrast to other CoC-based program representations such as Coq or Lean, Thorin is not a theorem prover but focuses on generating efficient code. For this reason, Thorin explicitly features mutable state and models imperative control flow with continuation-passing style (CPS).

You can use Thorin either via it's C++-API or the command-line utility.

Building

If you have a GitHub account setup with SSH, just do this:

git clone --recurse-submodules [email protected]:AnyDSL/thorin2.git

Otherwise, clone via HTTPS:

git clone --recurse-submodules https://github.com/AnyDSL/thorin2.git

Then, build with:

cd thorin2
mkdir build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j $(nproc)

For a Release build simply use -DCMAKE_BUILD_TYPE=Release.

Install

If you want to install Thorin, specify an install prefix and build the target install:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/my/local/install/prefix
cmake --build build -j $(nproc) -t install

Build Switches

CMake Switch Options Default Comment
CMAKE_BUILD_TYPE Debug | Release | RelWithDebInfo Debug Build type.
CMAKE_INSTALL_PREFIX /usr/local Install prefix.
THORIN_BUILD_DOCS ON | OFF OFF If ON, Thorin will build the documentation
(requires Doxygen).
THORIN_BUILD_TESTING ON | OFF OFF If ON, Thorin will build all of Thorin's own tests.
THORIN_ENABLE_CHECKS ON | OFF ON If ON, enables expensive runtime checks
(requires CMAKE_BUILD_TYPE=Debug).

Dependencies

In addition to the provided submodules:

  • Recent version of CMake

  • A C++20-compatible C++ compiler.

  • While Thorin emits LLVM, it does not link against LLVM.

    Simply toss the emitted *.ll file to your system's LLVM toolchain. But techincally, you don't need LLVM.

About

The Higher ORder INtermediate representation - next gen

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 95.4%
  • CMake 2.4%
  • Rust 1.5%
  • Other 0.7%