8
$\begingroup$

From Simon Peyton Jones (recent Royal Society member) we read the paper: Implementing lazy functional languages on stock hardware: the Spineless Tagless G-Machine.

Now this paper is part of how they made Haskell a lazy language when they were implementing it, and solved some problems they had at the time.

The only comparable paper seems to be: Compiling Lazy Functional Programs Based on the Spineless Tagless G-machine for the Java Virtual Machine but there doesn't appear to be an implementation available.

One tangentially related is: Compiling Haskell to Java. However in this approach they leave the implementation of the Spineless Tagless G-Machine in GHC and just read the output.

My question is: Are there any implementations of the spineless tagless G-machine other than in GHC?

$\endgroup$

3 Answers 3

3
$\begingroup$

I used this Google search:

"spineless tagless g-machine" site:github.com

and found 2 repos that (try?) to implement the STG in non-Haskell languages:

PHP: lechimp-p/php-stg

RPython ("restricted" subset of Python developed for Pypy): cgswords/laurens

$\endgroup$
1
$\begingroup$

Here is a good one with nice visualisations: https://github.com/quchen/stgi

$\endgroup$
0
0
$\begingroup$

There is an online hosted visual demonstration here with an explanation here.

Typelead was a briefly funded startup that attempted to fork GHC to the JVM (before they ran out of money). Etalang was the result and it contains a STG. You can read the code of the STG here.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.