LightAndLight / eden

Experimenting with GHC's Backpack technology to create modular programming language representations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eden

I'm experimenting with GHC's Backpack mechanism to write "polymorphic code"

Requires cabal2+ and GHC8.2+, or nix.

nix-build . && ./result/bin/eden-demo

or

cabal sandbox init 
cabal install --only-dependencies
cabal new-build
# then find the executable and run it, since new-run seems to be broken

eden-demo

Here's the file, and this is what it outputs:

My program...

...As Javascript:
function (x) { return x; }
function (x) { return function (y) { return x; }; }
(function (x) { return x; })(function (x) { return function (y) { return x; }; })

...As Python:
lambda x: x
lambda x: lambda y: x
(lambda x: x)(lambda x: lambda y: x)

Python translated from JavaScript via lambda calculus
lambda x: x

JavaScript translated from Python via lambda calculus
function (x) { return function (y) { return x; }; }

About

Experimenting with GHC's Backpack technology to create modular programming language representations

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Haskell 92.5%Language:Nix 7.5%