Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
Manually constructed STG programs compiled with the standard GHC codegen backend.
Haskell C
Branch: master
Clone or download
Latest commit 73ec3df Feb 2, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md Update README.md Feb 2, 2020
StgLoopback.hs initial version Feb 1, 2020
StgSample.hs initial version Feb 1, 2020
manual-stg-experiment.cabal initial version Feb 1, 2020
my_lib.c initial version Feb 1, 2020
stack.yaml initial version Feb 1, 2020

README.md

manual-stg-experiment

Manually constructed STG programs compiled with the standard GHC codegen backend.

The samples show various use cases i.e. (de)construction of (un)boxed tuples and (un)lifted ADTs and using FFI.

This experiment suggests that GHC codegen and RTS can be used as generic compiler backend for strict and lazy functional languages.

Build

stack setup
stack build

Usage

stack ghci StgSample.hs

Run a sample in GHCi. i.e.

*StgSample> sampleADT2

It will generate an executable named a.out also will generate the intermediate output files (out.ll, out.s, out.o).

You can’t perform that action at this time.