[KongchangAI]
· 2 min read· 1,335 words

Folders Programming Language: Writing Code with File Directory Structures

Folders Programming Language: Writing Code with File Directory Structures

Folders uses folder hierarchies as program structure units, exploring visual code organization but facing control-flow limits.

Folders is an experimental programming language concept that treats file system folders as the basic units of program structure, using nested directory hierarchies to express module and scope relationships. Its core motivation is to make program structure visible and navigable, leveraging native file managers to lower the barrier to understanding, and it sparked developer discussion on Hacker News. This approach offers potential in readability, tooling, and collaboration, but struggles to elegantly express loops, conditionals, and exceptions, and lacks a textual carrier for type systems and computational logic. The article sees it as an exploration of "making program structure visible" rather than a replacement for general-purpose programming, and notes its reference value for AI-assisted programming and visual development interface design, while flagging engineering limits such as file system constraints and Git's poor support for empty directories and renames.

Programming language design often revolves around syntax, type systems, or runtime behavior, but a radically different approach has emerged—treating the way code is organized as the core abstraction of the language itself. This is why the Folders Programming Language has sparked discussion.

What Is the Folders Programming Language

Folders Programming Language discussion on Hacker News

Folders is an experimental programming language concept that treats "folders" (directories) in the file system as the fundamental units of program structure. In other words, a program is no longer composed of functions and classes inside a bunch of text files, but instead expresses logical relationships through nested directory hierarchies: a folder represents a module or scope, subfolders represent their internal logic, and nesting levels correspond to the program's nested structure.

The project was initially posted on Hacker News and quickly caught the developer community's attention. Its novelty lies in turning the file manager that most people interact with every day into an executable programming medium.

To understand what makes Folders unique, it helps to compare it with existing non-textual programming paradigms. For example, visual programming languages (such as Scratch and LabVIEW) express logic through graphical nodes and connections, while spreadsheets (such as Excel) express computation through cells and formulas. What Folders shares with them is liberating program structure from plain text and entrusting it to a more intuitive, more manipulable external structure. The difference is that Folders chooses the file system as its medium—a hierarchy natively supported by every operating system and already used by people in their daily lives. This means Folders "programs" can be opened, browsed, and dragged around directly in a file manager, without requiring a dedicated IDE or visual editor. This "zero tool dependency" quality is precisely what sets it apart from other visual programming approaches.

Why Use Folders for Programming

Based on available information, the core motivation behind Folders is to make program structure "visible and navigable." In traditional programming languages, code structure is hidden within indentation, brackets, and naming conventions, whereas folders naturally possess hierarchical and visual organizational capabilities.

An intuitive way to understand this: when you open a project directory, the directory tree you see is already quite close to the program's call structure or module dependency relationships. Folders turns this coincidence into a design principle—the directory tree is the program itself. This allows even non-programmers to understand the composition of a program through familiar file management operations.

In traditional programming languages, code structure is typically defined by an abstract syntax tree (AST) or scoping rules, while text files are merely linear representations of those structures. Developers must mentally remap indentation, brackets, and naming conventions back into hierarchical relationships. Folders reverses this process: it makes the file system's physical hierarchy directly become the program's logical hierarchy, eliminating the conversion cost between textual representation and logical structure. From a cognitive science perspective, humans' ability to remember and navigate spatial hierarchies (such as nested folders) tends to be stronger than their ability to parse symbol sequences (such as code indentation). This may explain why many developers, when reading an unfamiliar project, instinctively look at the directory tree rather than the source file contents—Folders turns exactly this instinctive behavior into programming itself.

The Possibilities It Opens Up

Discussions around this kind of design usually focus on several directions: first, readability—hierarchical directory structures are more intuitive than plain text code; second, the tool ecosystem—operating system file managers, search, and drag-and-drop operations can be used directly for programming; third, collaboration—module boundaries are enforced by the file system, reducing naming conflicts.

However, expressing logic with folders also has clear costs. Complex control flow (loops, conditionals, exceptions) is difficult to express elegantly through pure directory hierarchies, and type systems and computational logic lack a natural textual syntax carrier. This is also why such languages tend to remain at the proof-of-concept stage—they are more an exploration of the proposition of "making program structure visible" than a replacement for general-purpose programming.

The point about "control flow being difficult to express through directory hierarchies" touches on a fundamental distinction in programming language theory: declarative structure versus imperative control flow. Directory trees are naturally suited to expressing declarative containment relationships (module A contains submodule B), because hierarchy itself is a static, atemporal containment structure. But loops, conditional branches, and exception handling describe execution order and runtime state; they are dynamic and temporal, creating a fundamental expressive gap with static directory hierarchies. Similar problems appear in other non-textual programming attempts—for example, when describing program logic with JSON or YAML, control flow often needs to be simulated through special key names or external interpreters. If Folders is to move toward practicality, it may need to introduce some kind of hybrid mechanism—such as embedding small script files inside folders to handle control flow—but that would in turn undermine its "pure folder" simplicity.

A Design Signal Worth Watching

The reason Folders gained traction on Hacker News is that it touches on a long-neglected question: is the way we organize code really best suited for human understanding? Mainstream languages solve structural problems with text files plus syntactic sugar, while Folders chooses to let the operating system's native hierarchy take on that responsibility.

For developers interested in AI programming, low-code, and visual development, this line of thinking has reference value. As AI becomes increasingly involved in code generation, the way program structure is expressed may become a new focal point of interface design—folders, as a structure everyone is familiar with, may lower the understanding cost when humans collaborate with AI.

A Few Practical Reminders for Real-World Use

It should be noted that Folders is currently more of a conceptual exploration than a mature toolchain. If you plan to try a similar approach, keep in mind: file systems have natural limits on file count, path length, and special characters; version control (such as Git) does not perfectly support empty directories and renames; and cross-platform differences in filename conventions can also create compatibility issues. These engineering details often determine the boundaries of what such ideas can achieve in practice.

The version control issue mentioned here deserves elaboration. Git is essentially designed for tracking the contents of text files; it records differences in file contents (diffs), not semantic changes in directory structure itself. This leads to two specific problems: first, Git cannot track empty directories because empty directories have no file contents to commit, whereas in Folders an empty folder might represent an empty module or placeholder scope; second, when a folder is renamed or moved, Git usually treats it as "deleting old files + adding new files" rather than as a structural rename operation, which loses historical continuity. For programs centered on directory structure, these limitations mean version control needs additional conventions or tools to compensate—for example, using placeholder files to mark empty directories, or relying on commands like git mv to preserve rename tracking. These engineering details may seem trivial, but they directly affect whether Folders-like approaches can integrate into existing development workflows.

One-line Summary

Folders uses folder hierarchies as program structure units, exploring visual code organization, but has fundamental limitations in expressing control flow.

Paragraph Summary

Folders is an experimental programming language concept that treats file system folders as the fundamental units of program structure, using nested directory hierarchies to express module and scope relationships. Its core motivation is to make program structure visible and navigable, leveraging operating system-native file managers to lower the barrier to understanding, and it sparked developer discussion on Hacker News. This approach offers potential in readability, tool ecosystem, and collaboration, but struggles to elegantly express control flow such as loops, conditionals, and exceptions, and lacks a textual carrier for type systems and computational logic. The article argues that it is more an exploration of "making program structure visible" than a replacement for general-purpose programming, while also offering reference value for interface design in AI-assisted programming and visual development, and warning about engineering boundaries such as file system limitations and Git's shortcomings in supporting empty directories and renames.

#Folders programming language#folder-based programming#visual programming#non-textual programming#program structure visualization#Hacker News#AI programming
Share:

Related articles