d3dc / Mmmm

A fantasy VM and javascript transpiler for Mmmm()

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mmmm

Mmmm() is an esoteric "microlanguage" by 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.

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)

  • $ Mmmm mmm.mmmmm -o mmm.js

Background

SuperJedi224's entire implementation can be found here.

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

  • Script executes in private context
  • Script can re-enter private context for REPL use
  • 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 😕

About

A fantasy VM and javascript transpiler for Mmmm()

License:Apache License 2.0


Languages

Language:JavaScript 99.2%Language:Shell 0.8%