FileSys

From Esolang
Jump to navigation Jump to search

Overview

FileSys is a language which stores and manipulates all of its variables as files on the file system instead of in memory locations in the traditional sense.

Syntax

Files

There are four valid file types in the FileSys language

  • .a - String data in ascii format
  • .n - Numeric data in arbitrary precision decimal data
  • .b - Block, an empty file used for signalling between threads or processes
  • .f - A script of FileSys commands to be executed

Operations

Operation Explanation Syntax Example
mkdir Makes a new directory for storing variable files mkdir <path> mkdir /var/data
out Write data to file out > <path> out 12345.67 > /var/data/bank.n
in stub stub stub
mv stub stub stub
chmod stub stub stub
watch stub stub stub
exec stub stub stub
add stub stub stub
sub stub stub stub
mul stub stub stub
div stub stub stub
jumpz stub stub stub
halt stub stub stub

Script Format

:<label>:
<command> <args>+

Examples

Hello World

 mkdir /var
 out "Hello World" > /var/message.a
 echo /var/message.a

Grammar

<line> ::= <label> | <statement>
<label> ::= ":" <string> ":"
<statement> ::= IN | OUT | MKDIR | MV | CHMOD | EXEC | WATCH | ADD | SUB | MUL | DIV | JUMPZ | HALT
<string> ::= <char> | <char> <string>
<char> ::= (a-zA-Z0-9)

See also