Skip to content

Fork of Taro Sako's esolang framework written in Rust

License

Notifications You must be signed in to change notification settings

wspace/faultier-whitebase

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Fork of Taro Sako's esolang framework written in Rust

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Rust 100.0%