OOLANG

Crates.ioOOLANG
lib.rsOOLANG
version0.1.1
sourcesrc
created_at2022-02-26 22:26:13.299694
updated_at2022-02-27 12:11:41.894506
descriptionAn esoteric stack-based programming language, where all instructions are different variations of the character 'O'
homepage
repositoryhttps://github.com/RNM-Enterprises/oolang
max_upload_size
id540132
size21,617
Joey Harrison (Joeyh021)

documentation

README

OOLANG

GitHub Workflow Status (branch) GitHub Crates.io Crates.io

OOLANG is an esoteric stack-based programming language where all instructions/commands are differnet unicode O characters

Usage

We have a custom Web IDE at https://oolang.tech, for experimenting in the browser.

You can also install OOLANG on your system with Cargo:

cargo install oolang

OOLANG files end in .oo, and consist of a number of commands specified each by a single unicode glyph. Any other character is ignored. Comments are supported using the # character, which comments out up to the end of the line.

oorun file.oo will execute your OOLANG program, reading from stdin and outputting to stdout.

Language Specification

OOLANG emulates a stack machine, not dissimilar to how the JVM or Python's bytecode interpreter works.

The virtual machine consists of a stack of bytes, and 256 bytes of addressable memory. A valid OOLANG program may consist of any combination of the the following 10 commands:

Command Unicode Character Name Command Name Description
O Latin Capital Letter O PUSH Push the value 1 onto the top of the stack
0 Digit Zero POP Pop the value from the top of the stack, discarding it
วพ Latin Capital Letter O with Stroke and Acute INC Pop the top stack value, increment it, push the result
แซ Cherokee Letter Wi DEC Pop the top stack value, decrement it, push the result
โญ• Heavy Large Circle ADD Pop the top two stack values, add them, push the result
๐‰ Gothic Letter Othal JNZ Jump to the address at the top of the stack, if the 2nd-top value is non-zero
๊Œ Latin Capital Letter O with Loop JZ Jump to the address at the top of the stack, if the 2nd-top value is zero
โ—Ž Bullseye LOAD Pop from the stack, and push the value at the memory address specified
โ—ฏ Large Circle STORE Pop the top two values from the stack, storing the 2nd at the address specified by the 1st
โ’ช Parenthesized Latin Small Letter O READ Read the next byte from stdin, pushing it to the top of the stack, or 0 if stdin is empty
โ‚’ Latin Subscript Small Letter O WRITE Pop from the stack and write the value to stdin as an ascii character

Architecture

The language and interpreter are written in Rust. The compiled binary executable acts as a command line program, but the interpreter crate also exposes a public API. When compiled to webassembly, this API is used to provide functionality for the Web IDE within the browser.

Commit count: 85

cargo fmt