Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manyoso/hof
Hof is a new language based on the SKI calculus named after Douglas Hofstadter.
https://github.com/manyoso/hof
Last synced: 29 days ago
JSON representation
Hof is a new language based on the SKI calculus named after Douglas Hofstadter.
- Host: GitHub
- URL: https://github.com/manyoso/hof
- Owner: manyoso
- License: mit
- Created: 2015-11-07T01:43:55.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-04T19:51:58.000Z (about 9 years ago)
- Last Synced: 2024-10-14T12:49:20.304Z (2 months ago)
- Language: C++
- Size: 79.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Introduction
Hof is a new language based on the SKI calculus named after Douglas Hofstadter.
Syntax: Semantics: Meaning:
T -> I λx.x I combinator from SKI calculus
T -> K λx.λy.x K combinator from SKI calculus
T -> S λx.λy.λz.xz(yz) S combinator from SKI calculus
T -> P λx.x Print x to stdoutT -> R λx.λy.(x|y) Randomly return either x or y with Bernoulli
probability distributionT -> A (T₁T₂) Form a new term out of the application of
terms T₁ and T₂The interpreter for the language is written in C++ and features lazy evaluations
implemented with memoized thunks. The optimizations found in D. A. Turner's
paper, "Another Algorithm for Bracket Abstraction" including B, C, S′, B′, C′
combinators are included.The interpreter also contains a full Lambda Calculus lexer/parser which
transcompiles the untyped Lambda Calclulus into the SKI calculus, including
η-reduction simplification, which is then transcompiled into Hof.Another feature is verbose mode which shows the full evaluation cycle in
colorized terminal output. Combined with a good debugger, verbose mode can
reveal the entire combinator application execution by stepping through with
breakpoints in the eval/apply cycle.