Folders

From Esolang
Jump to navigation Jump to search
Not to be confused with Folder.
Folders
Paradigm(s) imperative
Designed by Daniel Temkin
Appeared in 2015
Computational class Turing complete
Reference implementation Folders
Influenced by Whitespace
File extension(s) No files used

Folders is a language where the program is encoded into a directory structure. All files within are ignored.

Folders relies on the hierarchical structure of directories to mimic that of a parse-tree. As a Folders program runs, variables are stored as another set of folders (each holding name, type, and value), this one in the user's appdata folder. Folders, as the most Windows of languages, opted to encode a C-style structure rather than something LISPier. The code is entirely mapped to the nesting of folders themselves, allowing any names to be used, with the exception that they still are read in alphabetical order.

Instructions

Commands are read in alphabetical order.

The number of folders within the first sub-folder are read as the type, command, or expression. The second and sometimes third folder are read as the content (in the case of If or While statements).

The number of folders in the first sub-folder determines the expression, type, or command:

Commands

Command # of Folders Details
if 0 folders Second sub-folder holds expression, third holds list of commands
while 1 folder Second sub-folder holds expression, third holds list of commands
declare 2 folders Second sub-folder holds type, third holds var name (in number of folders)
let 3 folders Second holds var name (in number of folders), third holds expression
print 4 folders Second sub-folder holds expression
input 5 folders Second sub-folder holds var name

Expressions

Type # of folders Details
Variable 0 folders Second sub-folder holds var name
Add 1 folder Second sub-folder holds first expression to add, third holds second expression
Subtract 2 folders Second sub-folder holds first expression to subtract, third holds second expression
Multiply 3 folders Second sub-folder holds first expression to multiply, third holds second expression
Divide 4 folders Second sub-folder holds first expression to divide, third holds second expression
Literal Value 5 folders Second sub-folder holds the type of the value (eg two folders for a string, third holds the value
Equal To 6 folders Second and third folders hold expressions to compare
Greater Than 7 folders Second and third folders hold expressions to compare (returns true if the second folder holds a larger value than the third folder)
Less Than 8 folders Second and third folders hold expressions to compare

Types

Type # of Folders
int 0 folders
float 1 folder
string 2 folders
char 3 folders

Literals

All literals are represented in hex. A group of four folders is a single hex digit. Each of the four folders either contains a sub-folder, marking it as a 1, or is empty, marking it as 0.

Ints and Chars

A folder holding a series of folders, each of which is a hex digit, as described under literal above.

Strings

Strings are made up of Unicode characters. Each string has a series of folders, one per character. Each character has a series of sub-folders for each hex digit, as described above.

Examples

Hello World

Hello World


FoldersOS

Folders are barely considered content by Windows; right-mouse click on the largest Folders program and it's still 0 bytes. Try to check them in to GitHub and go through the ridiculous effort of adding .gitignores all over the place.

Since the Folders language can store data in foldernames, read and write to folders, and use folders for temporary storage as it runs, it can act as a parallel system, with its own data and its own concerns. For a tidy, nearly file-free OS, reorganize your C drive so that all your data storage is made up of a catacomb of empty folders.

Previous Versions

An early version of Folders had a second dialect, allowing the name of the folder to also be used, called Concise Folders. Commands were represented by the most common folder names in Windows:

Command Alternate Name
if New Folder
while Temp
declare Images
let Downloads
print Setup
input Logs

It is no longer considered valid and will likely be dropped by future interpreters. One can see it as a draft as the concept of the Folders language was developing.

See also

External resources