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

Overview

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

You might also like...
sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character.
sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character.

ꦱꦮ sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character. sawa iku

Eros is an expiremental programming language built using simple Python code.

Eros is an expiremental programming language built using simple Python code. Featuring an easy syntax and unique features like type slicing, the language remains an expirement that grows in down time.

lets learn Python language with basic examples. highly recommended for beginners who just start coding.
lets learn Python language with basic examples. highly recommended for beginners who just start coding.

Lets Learn Python 🐍 Learn python from basic programs. learn python from scratch. 1.Online python compiler: https://www.onlinegdb.com/online_python_co

Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls
Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls

guess-the-numbers Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls Number guessing game

Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls
Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls

password-generator Built with Python programming language and QT library and Guess the number in three easy, medium and hard rolls Password generator

This repository containing cross-section cut and fill calculations using Python programming language.

cross-section This repository is containing cut and fill calculations for cross-section using Python programming language. This codes is made to calcu

The worst and slowest programming language you have ever seen

VenumLang this is a complete joke EXAMPLE: fizzbuzz in venumlang x = 0

A complex language with high level programming and moderate syntax.

zsq a complex language with high level programming and moderate syntax.

Short, introductory guide for the Python programming language
Short, introductory guide for the Python programming language

100 Page Python Intro This book is a short, introductory guide for the Python programming language.

Comments
  • Why no no work

    Why no no work

    i typed "Folders helloworld"

    Traceback (most recent call last):
      File "C:\Users\jerem\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "C:\Users\jerem\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "C:\Users\jerem\AppData\Local\Programs\Python\Python39\Scripts\Folders.exe\__main__.py", line 4, in <module>
    ModuleNotFoundError: No module named 'folders'
    
    opened by Jeremy5909 6
  • I just found out a bug

    I just found out a bug

    If you type your program named "Hello, World!" then the "Folders [-l] <Folder's name>" will not work

    It will say: "Folders: error: unrecognized arguments: World!

    Picture will maybe make everything clearer

    @SinaKhalili @georgewoodall82 Capture

    opened by TryHardCode1 2
  • Why does the info about commands in FOLDERS so confusing

    Why does the info about commands in FOLDERS so confusing

    I have a problem when making a program in FOLDERS

    Basically, if you want to print a string, you'll need 4 Folders inside a command folder to work. But the picture from https://danieltemkin.com/Esolangs/Folders/ shows that the print command actually needs 5 Folders. How is that possible???

    opened by TryHardCode1 0
  • more features

    more features

    folders is an epic programming language already so why not make it better? suggestion - make a v2 or just build onto the existing version where there are more commands and expressions examples - boolean data type, logic expressions (and/or/not), else/elif, etc.

    opened by ProfessorDragon 4
Releases(v0.0.5)
  • v0.0.5(Dec 13, 2021)

    • Thanks to @georgewoodall82 for integer number input support
    • Added github action workflow so now PyPI should update on new tag pushes 🚀

    👉🏽 https://pypi.org/project/Folders/0.0.5/

    Source code(tar.gz)
    Source code(zip)
Unofficial Python Library to communicate with SESAME 3 series products from CANDY HOUSE, Inc.

pysesame3 Unofficial Python Library to communicate with SESAME 3 series products from CANDY HOUSE, Inc. This project aims to control SESAME 3 series d

Masaki Tagawa 18 Dec 12, 2022
Team Hash Brown Science4Cast Submission

Team Hash Brown Science4Cast Submission This code reproduces Team Hash Brown's (@princengoc, @Xieyangxinyu) best submission (ee5a) for the competition

3 Feb 02, 2022
Быстрый локальный старт

Быстрый локальный старт

Anton Ogorodnikov 1 Sep 28, 2021
(Pre-)compromise operations for MITRE CALDERA

(Pre-)compromise operations for CALDERA Extend your CALDERA operations over the entire adversary killchain. In contrast to MITRE's access plugin, cald

Diederik Bakker 3 Aug 22, 2022
Static bytecode simulator

SEA Static bytecode simulator for creating dependency/dependant based experimental bytecode format for CPython. Example a = random() if a = 5.0:

Batuhan Taskaya 23 Jun 10, 2022
Location of public benchmarking; primarily final results

CSL_public_benchmark This repo is intended to provide a periodically-updated, public view into genome sequencing benchmarks managed by HudsonAlpha's C

HudsonAlpha Institute for Biotechnology 15 Jun 13, 2022
python for windows extensions

This is the readme for the Python for Win32 (pywin32) extensions source code. See CHANGES.txt for recent changes. 'setup.py' is a standard distutils

27 Dec 08, 2022
Search and Find Jobs in Ethiopia

✨ EthioJobs ✨ Search and Find Jobs in Ethiopia Easy start critical warning Use pycharm No vscode No sublime No Vim No nothing when you want to use

Abdimk 12 Nov 09, 2022
creates a batch file that uses adb to auto-install apks into the Windows Subsystem for Android and registers it as the default application to open apks.

wsa-apktool creates a batch file that uses adb to auto-install apks into the Windows Subsystem for Android and registers it as the default application

Aditya Vikram 3 Apr 05, 2022
Sudo type me a payload

payloadSecretary Sudo type me a payload Have you ever found yourself having to perform a test, and a client has provided you with a VM inside a VDI in

7 Jul 21, 2022
OpenSea NFT API App using Python and Streamlit

opensea-nft-api-tutorial OpenSea NFT API App using Python and Streamlit Tutorial Video Walkthrough https://www.youtube.com/watch?v=49SupvcFC1M Instruc

64 Oct 28, 2022
The Google Assistant on a rotary phone

Google Assistant Rotary Phone Shoutout to my dad who had this idea a year ago and I'm only now getting around to doing it. Notes This is the code used

rydercalmdown 10 Nov 04, 2022
Python library for creating PEG parsers

PyParsing -- A Python Parsing Module Introduction The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the t

Pyparsing 1.7k Jan 03, 2023
Better Giveaways is a bot that will change the experience of using a giveaway bot forever.

Better-Giveaways Better Giveaways is a bot that will change the experience of using a giveaway bot forever. VoxelBotUtils/Novus, latest PyPi releases

Lightning 2 Jan 12, 2022
Convert Photoshop curves (acv) to xmp presets for Lightroom

acv2xmp Convert Photoshop curves (acv) to Lightroom preset (xmp) acv2xmp.py Basic command prompt that relies on standard library only and can be used

5 Feb 06, 2022
A Puzzle A Day Keep the Work Away

A Puzzle A Day Keep the Work Away No moyu again!

P4SSER8Y 5 Feb 12, 2022
A collection of python exercises to help your learning path!

How to use Step 1: run this command git clone https://github.com/TechPenguineer/Python-Exercises.git Step 2: Run this command cd Python-Exercises You

Tech Penguin 5 Aug 05, 2021
This is a batch script created to WEB-DL.

widevine-L3-WEB-DL-Script This is a batch script created to WEB-DL. Works well with .mpd files , for m3u8 please use n_m3u8 program (not included in t

Paranjay Singh 312 Dec 31, 2022
An Embedded Linux Project Build and Compile Tool -- An Bitbake UI Extension

Dianshao - An Embedded Linux Project Build and Compile Tool

0 Mar 27, 2022
Make after-work Mending More flexible In Python

Mending Make after-work Mending More flexible In Python A Lite Package focuses on making project's after-post mending pythonic and flexible. Certainly

2 Jun 15, 2022