Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sshine/rfun
A subset of RFUN, a reversible functional language with algebraic types
https://github.com/sshine/rfun
Last synced: 14 days ago
JSON representation
A subset of RFUN, a reversible functional language with algebraic types
- Host: GitHub
- URL: https://github.com/sshine/rfun
- Owner: sshine
- Created: 2013-07-02T23:26:53.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-09-05T12:07:38.000Z (about 11 years ago)
- Last Synced: 2024-10-04T15:43:13.156Z (about 1 month ago)
- Language: Logos
- Size: 168 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
rfun
====A compiler for a subset of RFUN, a reversible functional language with algebraic
types. It supports functions, the two datatype constructors Nil/0 and Cons/2,
giving way to construct binary trees, let-bindings and case-of expressions that
match only one level deep using one case (for correct programs) or two cases (in
either order). RFUN's first-match policy is upheld by simplicity.The subset is discussed in the article: ``Reversible representation and
manipulation of constructor terms in the heap'' by Holger Bock Axelsen and
Robert Glück, 2013. The present compiler is an attempt at implementing most of
this subset.The compiler currently skips type checking and emphasis has been put on code
generation. The code generator targets PISA, described in ``The Pendulum
instruction set architecture'', an instruction set summary by Holger Bock
Axelsen from 2006.As an aid, inspiration was drawn from the article, ``Clean translation of an
imperative reversible programming language'' by Holger Bock Axelsen, 2011, in
particular the overall program structure and calling convention code is copied,
and translation of conditionals has been repurposed.Writing this compiler has been an experience in reversible machine code and
structuring a compiler from scratch using monad transformers.