https://github.com/d3dc/mmmm
A fantasy VM and javascript transpiler for Mmmm()
https://github.com/d3dc/mmmm
compiler esoteric-language fantasy-computer repl vm
Last synced: 3 months ago
JSON representation
A fantasy VM and javascript transpiler for Mmmm()
- Host: GitHub
- URL: https://github.com/d3dc/mmmm
- Owner: d3dc
- License: apache-2.0
- Created: 2018-04-28T00:47:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-01T23:53:02.000Z (almost 7 years ago)
- Last Synced: 2025-01-04T03:29:13.179Z (5 months ago)
- Topics: compiler, esoteric-language, fantasy-computer, repl, vm
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mmmm
> Mmmm() is an esoteric "microlanguage" by [SuperJedi224](https://github.com/SuperJedi224), inspired in part by Brainf***.
This repo currently provides a javascript runtime and repl for Mmmm(). It provides a `Script` type that creates a sandboxed environment bound to the Mmmm micro-VM.
The `Script` type should be able to be bound to different micro-machines and sub-classed to extend the interface.
In the future this repo will also provide a transpiler to compile simple ES5 javascript according to a micro-machine spec so you never actually have to write it.
```Mmmm
Mmm=m[m.m()].m(m.m());Mmmm=m[mm].m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();Mmmmm=mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();mmm.m();mmm.m();mmm.m();
mmm.m();m[mmmm].m(mmm.m());
m[mmmm].m(mmm.m());
```## Quick Start
- `$ npm install Mmmm`
*Repl*
- `$ Mmmm`
*Compile to node module* (see [babel-cli](https://babeljs.io/docs/usage/cli/))
- `$ Mmmm mmm.mmmmm -o mmm.js`
## Background
SuperJedi224's entire implementation can be found [here](http://jsfiddle.net/SuperJedi224/uLawt0jm/).
## Goal
I wanted to learn how to write a babel plugin for another gaming-related project.
After playing with this and seeing how haskell or lisp-like it is, these micro-vms started to make sense.
I've basically built a tiny hypervisor for sh*tty in-javascript VMs with a fun way to address them. I plan to integrate this concept into my gaming-related project.## TODO
- [x] Script executes in private context
- [x] Script can re-enter private context for REPL use
- [x] Find a lightweight way to wrap a node repl
- [ ] restrict character usage
- [ ] interactive loop editing
- [ ] transform-mmmm
- [ ] Emit Mmmm for nodetypes
- [ ] Literals
- [ ] Object
- [ ] Array
- [ ] Variables
- [ ] Statements
- [ ] Expressions
- [ ] Polyfill core emcascript features 😕