Folders.py: a language with no code and just folders

3
Folders.py: a language with no code and just folders

Folders.py

A deep folders zoom

Folders is an esoteric programming language, created by Daniel Temkin in 2015, which encodes the program entirely into the directory structure.

All names of the folders as well as their contents are completely ignored. Instead, the commands
are encoded in the nesting of folders within folders.

Let me say that again: THE SOURCE CODE IS THE DIRECTORY STRUCTURE. Lol.

This is a Python implementation of Folders for all to enjoy!

Folders is (was originally) implemented in C#.

Usage

Install from pip

Simply install the Folders command line interpreter

Give the folder of the program you wish to run as an command line argument

If instead you would like list the Python code to stdout, use the -l option

Run python

The implementation is just the python file, folders.py and has no dependencies, so if you’d like you can clone the repo and run python ./folders/folders.py instead of pip installing and use it the same as in the examples above.

Language details

The language details are on the esolangs wiki, but I’ve put it here for reference.

For example, take a look at the Fibonacci sample program.

The root folder contains a list of command folders – in this case labelled Nf1.., Nf2.., but the names don’t actually matter except the alphabetical ordering – the first folder (which I’ve labelled with an init) is the first “sub-folder”, the next is the second, etc.

Commands:

Commands take the following form

Command# of foldersDetails
if0 foldersSecond sub-folder holds expression, third holds list of commands
while1 folderSecond sub-folder holds expression, third holds list of commands
declare2 foldersSecond sub-folder holds type, third holds var name (in number of folders, ex. zero folders becomes “var_0”)
let3 foldersSecond sub-folder hold variable name (in number of folders), third holds an expression
print4 foldersSecond sub-folder holds expression
input5 foldersSecond sub-folder holds variable name

Expressions:

Expression folders take the following form:

Type# of foldersDetails
Variable0 foldersSecond sub-folder holds variable name
Add1 folderSecond sub-folder holds the first expression to add, third holds second expression
Subtract2 foldersSecond sub-folder holds the first expression to subtract, third holds second expression
Multiply3 foldersSecond sub-folder holds the first expression to multiply, third holds second expression
Divide4 foldersSecond sub-folder holds the first expression to divide, third holds second expression
Literal Value5 foldersSecond sub-folder holds the type of the value (as described by types below, ex. two folders for a string)
Equal To6 foldersSecond and third folders hold expressions to compare
Greater Than7 foldersSecond and third folders hold expressions to compare (takes the form : second folder > third folder)

Types

And finally type folders take the following form:

Type# of folders
int0 folders
float1 folder
string2 folders
char3 folders

Note on this implemementation

The int, float, and char types are 8-bit only. But, you can add into their variables to arbitrary length, so to get a very large number you can simply multiply it a bunch of times.

This is what the fibonacci program does.

The absolute power of folders

Behold, the mighty Truth Machine program:

truth_machie

A mighty meme-worthy point

All Folders programs are 0 bytes if you’re on windows as it interprets an empty folder as 0 bytes.

The ultimate code golf!

Links

NOW WITH OVER +8500 USERS. people can Join Knowasiak for free. Sign up on Knowasiak.com
Read More

Leave a Reply

2 thoughts on “Folders.py: a language with no code and just folders

  1. Aditya avatar

    The best way to generate code in this language is with a shell script ๐Ÿ™‚