Skip to main content

Implementation of the Folders📂 esoteric programming language, a language with no code and just folders.

Project description

Folders.py

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

pip install Folders

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

Folders sample_programs/HelloWorld
# => Hello, World!

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

Folders -l sample_programs/HelloWorld
# => print("Hello, World!", end='', flush=True)

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 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, ex. zero folders becomes "var_0")
let 3 folders Second sub-folder hold variable name (in number of folders), third holds an expression
print 4 folders Second sub-folder holds expression
input 5 folders Second sub-folder holds variable name

Expressions:

Expression folders take the following form:

Type # of folders Details
Variable 0 folders Second sub-folder holds variable name
Add 1 folder Second sub-folder holds the first expression to add, third holds second expression
Subtract 2 folders Second sub-folder holds the first expression to subtract, third holds second expression
Multiply 3 folders Second sub-folder holds the first expression to multiply, third holds second expression
Divide 4 folders Second sub-folder holds the first expression to divide, third holds second expression
Literal Value 5 folders Second sub-folder holds the type of the value (as described by types below, ex. two folders for a string)
Equal To 6 folders Second and third folders hold expressions to compare
Greater Than 7 folders Second 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
int 0 folders
float 1 folder
string 2 folders
char 3 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Folders-0.0.8.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

Folders-0.0.8-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file Folders-0.0.8.tar.gz.

File metadata

  • Download URL: Folders-0.0.8.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for Folders-0.0.8.tar.gz
Algorithm Hash digest
SHA256 f0114c94b00f827b1fd9a6daf832792ca7360aaa0e391862fca04b7d3a060862
MD5 5d75269ed98f976133bd99443e703e55
BLAKE2b-256 aa60aac480de7e35cd9ae1f9e8d5a1d5bb2c0aa11588c8e6e42e11513b94df6c

See more details on using hashes here.

File details

Details for the file Folders-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: Folders-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for Folders-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a29eb4f59c0432d30323cd4708f5bee5bdb3baeb82502f675ef23c7e2a065d9e
MD5 dede9a06846415ec9409490334e3b884
BLAKE2b-256 11aa41e0400b93244439fb6f1459c13907d7f449a89a2db21602a12ae389966a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page