Esolang framework written in Rust.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
.travis.yml
Cargo.toml
LICENSE
README.md

README.md

Whitebase

Build Status

This project provides infrastructure for implementing esolang.

Features

  • The virtual machine having the instruction set based on Whitespace's specification.
  • Parsers and code generators for some languages (e.g. Whitespace, Ook!, etc.)
  • Simple assembly language

Rust v0.12.0-pre support.

Usage

Compile and execute

extern crate whitebase;

use std::io::{BufReader, MemReader, MemWriter};
use whitebase::machine;
use whitebase::syntax::{Compiler, Whitespace};

fn main() {
    let src = "   \t\t \t  \t\n   \t  \t   \n\t\n  \t\n  \n\n\n";
    let mut buffer = BufReader::new(src.as_bytes());
    let mut writer = MemWriter::new();
    let ws = Whitespace::new();
    match ws.compile(&mut buffer, &mut writer) {
        Err(e) => fail!("{}", e),
        _ => {
            let mut reader = MemReader::new(writer.unwrap());
            let mut machine = machine::with_stdio();
            match machine.run(&mut reader) {
                Err(e) => fail!("{}", e),
                _ => (),
            }
        },
    }
}

Application using Whitebase

License

This project distributed under the MIT License. http://opensource.org/licenses/MIT