-
Notifications
You must be signed in to change notification settings - Fork 485
Description
The way Rust currently organizes modules seems unnecessarily verbose: creating a directory and then creating a file with the same name as the directory, in which you manually need to specify the children. Would be really convenient for a Rust developer if a file-folder hybrid was introduced into Linux Kernel, so that Rust compiler can capitalize on it to eliminate the redundancy.
Benefits:
- no need to duplicate the same file/folder name => cleaner/simpler/streamlined file tree
- No need to write "pub mod X", because compiler would be able to figure it out automatically
This idea is inspired by Notion, which supports file-folder hybrids.
Here's how the filesystem works today:
apple
├──pear
│ ├──kiwi.rs
│ ├──potato.rs
│ └──cucumber.rs
├──guava
│ ├──tomato.rs
│ ├──orange.rs
│ └──banana.rs
├──pineapple
│ ├──blueberry.rs
│ ├──strawberry.rs
│ └──lemon.rs
├──pear.rs
├──guava.rs
└──pineapple.rs
The following files can have child files but cannot directly be written to or read from:
- pear
- guava
- pineapple
The following files can be directly written to and read from but cannot have child files:
- pear.rs
- guava.rs
- pineapple.rs
- kiwi.rs
- potato.rs
- cucumber.rs
- tomato.rs
- orange.rs
- banana.rs
- blueberry.rs
- strawberry.rs
- lemon.rs
Here's what I'd like the filesystem to be capable of:
apple
├──pear.rs
│ ├──kiwi.rs
│ ├──potato.rs
│ └──cucumber.rs
├──guava.rs
│ ├──tomato.rs
│ ├──orange.rs
│ └──banana.rs
└──pineapple.rs
├──blueberry.rs
├──strawberry.rs
└──lemon.rs
The following can be read from, written to, and have child files:
- [every single file above]
The following are read from, written to and have child files all simultaneously:
- pear.rs
- guava.rs
- pineapple.rs
The following have all 3 abilities but are using only the abilities to be written to and be read from (but aren't using their ability to have child files):
- kiwi.rs
- potato.rs
- cucumber.rs
- tomato.rs
- orange.rs
- banana.rs
- blueberry.rs
- strawberry.rs
- lemon.rs