https://github.com/acutmore/prog-lang-play
toy compiler that outputs lambda calculus style JavaScript
https://github.com/acutmore/prog-lang-play
compiler lambda-calculus programming-language
Last synced: about 2 months ago
JSON representation
toy compiler that outputs lambda calculus style JavaScript
- Host: GitHub
- URL: https://github.com/acutmore/prog-lang-play
- Owner: acutmore
- Created: 2018-01-14T23:01:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-06T21:22:32.000Z (almost 8 years ago)
- Last Synced: 2025-01-17T03:29:44.364Z (over 1 year ago)
- Topics: compiler, lambda-calculus, programming-language
- Language: Rust
- Homepage: https://acutmore.github.io/prog-lang-play/
- Size: 900 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# prog-lang-play
A place where I can play around with implementing programming languages
https://acutmore.github.io/prog-lang-play/
# 'lc-rust' directory
Currently implements a 'lamba calculus based language' to 'javascript' transpiler written in Rust. [Originally implemented in Javascript](https://github.com/acutmore/prog-lang-play/blob/9656699caf15e3bb010e67ca239423c0427f7ee1/lc/index.js#L14).
To build a loadable [WASM](https://webassembly.org) file:
```bash
# requires rust to be installed
cd lc-rust
./build-wasm.sh
```
To run a REPL:
```js
node ./lc-rust/repl.js
loading...
ready
> 0
f => x => x
> 1
f => x => f(x)
> let identity = \x.x in identity 2
(identity => identity(f => x => f(f(x))))(x => x)
>
```
# 'GUI' directory
A basic website which allows a user to enter 'lc', see the generated javascript, run the program and see the result
```bash
cd gui
npm install
npm start
open http://localhost:8080
```