Hacker News new | past | comments | ask | show | jobs | submit login
Folders.py: a language with no code and just folders (github.com/sinakhalili)
109 points by tentacleuno 7 days ago | hide | past | favorite | 27 comments

Here is the original Folders esolang: https://danieltemkin.com/Esolangs/Folders/

> Folders is a Windows language. In Windows, folders are entirely free in terms of disk space!

They can’t be entirely free, can they? Doesn’t the structure have to be persisted on disk somewhere?

The metadata for the file do take space on the disk, but are never taken into account when mentioning the file size.

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

> The ultimate code golf!

In code golf competition the shortest program (in bytes) wins. I don't think anyone ever included there the bytes taken by the metadata of the files, so in theory any solution implemented in this language is the best possible: 0 bytes.

This reminds me of back in high school in the late nineties where we had a disk quota and I created a Word Macro to create empty folders on the network share in the computer lab.

Although it it did not count against my quota, it certainly was not free :)

All folders use at least 1024 bytes of MFT space on NTFS. More if they have lots of subfolders/files. The UI just doesn't account for it properly.

It seems to be a common misconception. When you right click an empty folder in Windows Explorer, it says the size is 0KB.

If that means 0 kb in terms of sectors allocated, I would believe it. But the name has to be stored somewhere, right? It's just that the dialog doesn't account for that (and the acl, I'd guess).

Or am i missing that this is a joke?

They only count file sizes. The folders still take up space, it's just not accounted for properly.

Maybe it displays 0kb because an empty folder is only a few bytes?

I think NTFS stores the names in a block at the beginning of the partition, with a reference to another block in the back which holds the contents. And it only reads those contents for size.

I'm going to guess that git is not your VCS of choice for this language

“Linter Warning: .keep file not included at /…/“

The sample programs all have ".keep" all over so I guess they made it work.

Perforce seems ideal.

The type of expression is determined by the number of subfolders in a folder?

That seems like the brainfuck equivalent of this idea. I was thinking that you'd create a tree of folders to represent the abstract syntax tree of the program, with folder names being the actual syntactic elements/atoms of the program.

The best way to generate code in this language is with a shell script :)

Coming next: a Vscode compiler/transpiler extension that converts JavaScript to mkdir commands.

Probably Turing Complete. Good enough for me.

Imagine writing malware with this!

So, what would a quine look like

I'm disappointed that it is not using inode ordering

The perfect language for Plan9

already exists it's called terraform modules


Finally ;)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact