All Projects → grin-compiler → Ghc Grin

grin-compiler / Ghc Grin

GRIN backend for GHC

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to Ghc Grin

Haskell Exercises
A little course to learn about some of the more obscure GHC extensions.
Stars: ✭ 492 (+300%)
Mutual labels:  ghc, functional-programming
Ring
Innovative and practical general-purpose multi-paradigm language
Stars: ✭ 716 (+482.11%)
Mutual labels:  compiler, functional-programming
Felix
The Felix Programming Language
Stars: ✭ 609 (+395.12%)
Mutual labels:  compiler, functional-programming
Never
Never: statically typed, embeddable functional programming language.
Stars: ✭ 248 (+101.63%)
Mutual labels:  compiler, functional-programming
Idiolisp
A statically typed functional programming language
Stars: ✭ 78 (-36.59%)
Mutual labels:  compiler, functional-programming
Write You A Haskell
Building a modern functional compiler from first principles. (http://dev.stephendiehl.com/fun/)
Stars: ✭ 3,064 (+2391.06%)
Mutual labels:  compiler, functional-programming
Mlton
The MLton repository
Stars: ✭ 683 (+455.28%)
Mutual labels:  compiler, functional-programming
Potigol
Linguagem Potigol - Linguagem de programação funcional moderna para iniciantes - A Functional Programming Language for Beginners
Stars: ✭ 179 (+45.53%)
Mutual labels:  compiler, functional-programming
Jhc Components
JHC Haskell compiler split into reusable components
Stars: ✭ 55 (-55.28%)
Mutual labels:  compiler, functional-programming
Cfl
a Compileable statically typed Functional programming Language
Stars: ✭ 7 (-94.31%)
Mutual labels:  compiler, functional-programming
Fsharp
The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
Stars: ✭ 2,966 (+2311.38%)
Mutual labels:  compiler, functional-programming
Bqn
An APL-like programming language. Self-hosted!
Stars: ✭ 100 (-18.7%)
Mutual labels:  compiler, functional-programming
Silt
An in-progress fast, dependently typed, functional programming language implemented in Swift.
Stars: ✭ 217 (+76.42%)
Mutual labels:  compiler, functional-programming
Groovy
Apache Groovy: A powerful multi-faceted programming language for the JVM platform
Stars: ✭ 4,359 (+3443.9%)
Mutual labels:  compiler, functional-programming
Mlkit
Standard ML Compiler and Toolkit
Stars: ✭ 183 (+48.78%)
Mutual labels:  compiler, functional-programming
Clio
Clio is a functional, parallel, distributed programming language.
Stars: ✭ 555 (+351.22%)
Mutual labels:  compiler, functional-programming
Grain
The Grain compiler toolchain and CLI. Home of the modern web staple. 🌾
Stars: ✭ 2,199 (+1687.8%)
Mutual labels:  compiler, functional-programming
Typelang
🌳 A tiny language interpreter implemented purely in TypeScript's type-system
Stars: ✭ 149 (+21.14%)
Mutual labels:  compiler, functional-programming
Grin
GRIN is a compiler back-end for lazy and strict functional languages with whole program optimization support.
Stars: ✭ 834 (+578.05%)
Mutual labels:  compiler, functional-programming
Faust
Functional programming language for signal processing and sound synthesis
Stars: ✭ 1,360 (+1005.69%)
Mutual labels:  compiler, functional-programming

GHC-GRIN

Gitter chat

GRIN backend for GHC

Status

The project is under heavy development.

Currently we work on GHC primop and FFI support.

GHC-GRIN can not compile programs yet.

Components

external-stg, external-stg-util

custom AST Data type for GHC Core STG with serialization support and tooling

ghc-8.11.0

modified GHC which serializes the core STG AST of each compiled module using external-stg, and calls an external tool to link them at link-time

lambda-grin

utility (lambda calculus) layer for GRIN frontends

ghc-grin

converts the dumped GHC Core STG to Lambda

ghc-grin-benchmark

sample (stack based) projects to test the modified GHC with the GRIN backend

Setup

Follow these steps to install GHC/GRIN and compile the benchmark programs:

  1. Compile included GHC-8.11.0 (ghc-8.11.0.20200215-src)
    $ ./boot
    $ ./configure
    $ hadrian/build.sh -j --flavour=Quickest
  2. as soon as an error pops up: cannot execute 'grin-ghc' create a shell script with just this content (+ chmod 750):
#!/bin/sh

exit 0
  1. Install llvm-7 (on Mac: brew install llvm-hs/llvm/llvm-7) this will take some time to finish..
  2. Build the executables in directory ghc-grin/:
    stack setup
    stack build
  3. link the compiled binaries to a directory in your path (e.g. ~/.local/bin) and also change the script that the patched GHC will call to:
#!/bin/sh

set -e

echo "GRIN Compiler"

ghc-grin [email protected] | tee ${!#}.out
  1. Build the benchmark programs in directory ghc-grin-benchmark:
    ./c
  • you should see the output of "GRIN Compiler" from the script that calls the grin optimizer

Preliminary Benchmark

Comparison of Boquist PhD results (Sparc, RISC) with GHC 8.2 (x64, CISC) based on the CPU instruction count. This is not an accurate comparison as the CPU architectures differ, instead it gives a rough overview.

Instruction Count Benchmark

  • Boquist GRIN on Sparc (RISC) 1999
  • GHC 4.01 on Sparc (RISC) 1999
  • GHC 8.2 on x64 (CISC) 2018

Instruction Count Benchmark

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].