Gabriella439 / Gabriella439/Haskell-Morte-Library

Awesome Idea for the our todo list: Core -> Morte Compiler

Open
#48 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
384
Forks
25
PR merge metrics
No merged PRs in 30d

Description

Haskell has gotten to be a large language, thanks to GHC. One thing that hasn't grown very much though is GHC's [core](https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/CoreSynType). Core is a small functional language, like morte, that already has compilers and can be compiled from Haskell :smile:!

If we make a Core to Morte compiler, we can then compile the morte interpreter to core and then morte to make a morte interpreter in morte. And that's awesome!

Another nice side bonus in being able to compile Haskell and any language that compiles into Haskell into morte.

Note that since morte interpreting itself directly [is impossible](http://cstheory.stackexchange.com/a/24994/36422), it would actually have to be some sort of partiality monad within morte that the core gets compiled to (sort of like the type `data Lazy a = exists s. Lazy s (s -> Either s a)`). We would then have a function that take this partiality thing and turns into a Morte-IO action.

This would go a long way towards the eventual goal a of a morte to machine code compiler written in morte.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the linked GHC Core description and the issue's discussion of compiling Core to Morte, including the proposed partiality monad. Define the compiler boundary and how the resulting representation would connect to the Morte interpreter; completion criteria are not specified in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.