4 ms·
Show HN: VirtualStorageLibrary – .NET Tree solutions for items, dirs, symlinks
repository: https://github.com/shimodateakira/VirtualStorageLibrary https://github.com/shimodateakira/VirtualStorageLibrary
Hello HN, I'm excited to share a project I've been working on called VirtualStorageLibrary. It's a .NET library designed to manage in-memory tree structures, including items, directories, and symbolic links.
VirtualStorageLibrary is a .NET library that operates entirely in-memory and provides a tree-structured collection. This library offers a foundation for managing hierarchical data structures, supporting items, directories, and symbolic links that encapsulate user-defined types <T> (generic types defined by the user). This library is not a file system. Instead, it was redesigned from scratch to create a more flexible and user-friendly tree structure. The library aims to make it intuitive to reference, traverse, and manipulate nodes by specifying paths.
The collections provided by .NET are linear, including types like hash sets, arrays, lists, and dictionaries, which inherently have a linear structure (such as arrays and lists). In contrast, common file systems can be viewed as tree-shaped collections, where elements are managed as nodes in a hierarchical structure. While there are existing libraries that support tree-shaped collections, I couldn’t find one that models a file system-like structure. Therefore, I conceptualized a logical interpretation of a file system and asked, "Can we implement a tree collection purely as objects?" The goal was to create a system that can flexibly manage hierarchical and allow intuitive access.
Key Features:
Flexible Tree Structure Hierarchical structure based on parent-child relationships, enabling flexible node management.
Various Nodes Items, directories, and symbolic links, including user-defined types <T>.
Intuitive Node Operations via Paths API for referencing, searching, adding, deleting, renaming, copying, and moving nodes using paths.
Link Management Symbolic links managed with a link dictionary, tracking changes in target paths.
Circular Reference Prevention Detects and prevents circular references in paths involving symbolic links by throwing an exception.
Flexible Node List Retrieval Retrieves node lists within directories, filtered, grouped, and sorted by specified node types and attributes.
Anticipated Use Cases:
Natural Language Processing (NLP)
Knowledge Base Systems
Game Development
Hierarchical Clustering
Education and Learning
Development Status and Future Plans:
The current version is 0.8.0 (prerelease). As of 2024/08, all essential features for version 1.0.0 have been implemented. However, some bug fixes, around 30 feature improvements, and refactoring tasks remain. With version 0.8.0, we aim to gather user feedback, including bug reports and feature enhancement suggestions. Simultaneously, we plan to work through the remaining tasks for version 0.9.0, targeted for release in October 2024. During this period, class names, method names, property names, and other elements in the library may change, merge, or be deprecated without notice. Detailed information will be provided in the release notes, so please check them for updates.
For more detailed information on the current issues and planned improvements, please visit the following page (content in Japanese):
https://github.com/users/shimodateakira/projects/3/views/3 https://github.com/users/shimodateakira/projects/3/views/3
Thank you for your interest, and I look forward to your feedback.
- Akira Shimodate, AkiraNetwork
- cxr 2y agoIt looks like you did the sensible thing and used U+002F for path separator. Snover got this right when he did PowerShell and it stayed that way up through the open source releases. More recently someone fucked it up and started prescribing backslash for no good reason when you're using it on Windows, so now it goes so far as aggressively rewriting any paths you've typed in when you use Tab to autocomplete, replacing U+002F with U+005C. I had a look at the project, and it doesn't look like anything like `if (os.platform.name().includes("Windows")) separator = '\'` is going on here, but I haven't done an exhaustive audit. How do you the relationship between VirtualStorageLibrary and the relevant/analogous PowerShell subsystem(s)?
- shimodateakira 2y agoHello, Akira here. Thank you so much for taking an interest in this project and for your thoughtful comments. First, regarding the use of \, VirtualStorageLibrary is designed to be platform-agnostic, and there are no plans to tie it to any specific OS in the future. Therefore, you won't find any code like os. in this library. It’s a purely logical hierarchical object model inspired by file systems. While the default separator is /, it's fully customizable. You can set it to any character you like, such as : or -, and of course, you can also use \. Regarding the relationship with PowerShell subsystems, as of now, there is no functional integration between VirtualStorageLibrary and PowerShell. That means there’s no capability to import or export data handled by cmdlets—yet. However, there are indeed ideas for future versions that could involve collaboration with PowerShell. Although this is not yet detailed in the roadmap, I believe that being able to manipulate VirtualStorageLibrary via cmdlets would be a highly useful and interesting feature. When designing VirtualStorageLibrary, I carefully examined the culture surrounding file systems both in Linux and in PowerShell. Although I’ve primarily been a Windows user, I’m also familiar with Linux, and I’ve always found its file system to be simple and elegant. That’s why I chose / as the default separator for this library. For more information on customizing separators, please refer to the documentation here: https://shimodateakira.github.io/VirtualStorageLibrary/introduction.html https://shimodateakira.github.io/VirtualStorageLibrary/intro... Please feel free to reach out if you have any more questions or feedback!
- deleted 2y ago