MSG

From Esolang
Jump to navigation Jump to search

MSG is an esoteric programming language/virtual machine by User:Twistle. It depends entirely on three things: messages, objects, and wires.

Grammar

There is one object initiated at the beginning, named main. There is also an engineer object, which we'll get to later. The form of a command is as follows:

<object> '<message>' <wire>

this sends <message> to <object> along <wire>.
There are three built in wires, named stdin, stdout, and stderror. These all hook up to main

Messages

Messages have two parts: the general, and the specific. These are the messages that main respond to:

create <object>
passon <object> <message>

These are the messages that engineer respond to:

wire <id> <object1> <object2>
exit
delete <object>

create creates an object named <object>
passon passes <message> to <object>
wire creates a wire refered to as <id> which connects <object1> to <object2>
exit closes everything up.
delete deletes <object>

Example

main 'passon stdout 'Hello, world!' '
main 'passon engineer 'exit' '