Folders

From Esolang
Jump to: navigation, search

Folders is a language by User:Rottytooth 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.

In version 2.0, a folder name-agnostic syntax (Pure Folders) is introduced; 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). Pure Folders sometimes requires many more folders to build programs, particularly when using strings. However, it better encapsulates the sense of a dematerialized language.

Instructions[edit]

Commands are read in alphabetical order.

In Pure Folders, 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).

In Concise Folders, the folder names are read ignoring line numbers, " - Copy" at the end of a folder name or " - Copy (2)" etc are also ignored. For While and If statements, the first sub-folder is the condition, the following sub-folders are commands to be executed inside of the loop or conditional.

Pure Folders[edit]

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

Commands[edit]

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[edit]

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
Equal To 6 folders Second and third folders hold expressions to compare
Greater Than 7 folders Second and third folders hold expressions to compare
Less Than 8 folders Second and third folders hold expressions to compare

Types[edit]

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


Concise Folders[edit]

Keywords can be replaced with the most common folder names in Windows:

Commands[edit]

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

Types[edit]

Type Alternate Name
int Vacation photos
float Lang
string Img
char User

Examples[edit]

Hello World using Pure Folders syntax[edit]

This example uses no semantic file names

Hello World

Hello World using Concise Folders syntax[edit]

Here the "Hello, World!" output is split into four strings, which further obscures what this directory structure is for.

Hello, World program

99 bottles of beer[edit]

This example uses default names ("print", "while") instead of the alt names

99 Bottles program

FoldersOS[edit]

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.

External resources[edit]