Show HN: Catfs – Cache AnyThing Filesystem Written in Rust
github.com
github.com
Two shortcomings that I noticed building my first rust project:
* many lifetimes that are easy for humans to reason about are difficult/impossible to express to the compiler, so I had to use unsafe hacks.
* the std library does not feel complete or well thought out. For example too many string types with different sets of functions. Also many IO functions are too abstracted away.
Happy to elaborate more and hear what others think about catfs or rust!
2 is necessary, unfortunately, in a systems language. Well, regarding strings anyway. Most people complain that IO isn't abstracted enough; could you give some specifics? Thanks!
Or any time you want to use thread and closure. I know I am joining the threads before the references go away but it's not possible to express that. There's scoped threadpools but sometimes it's at a higher level than scope.
2: Can't get the return value for close(). readdir doesn't return the offset. I ended up wrapping libc myself: https://github.com/kahing/catfs/blob/master/src/catfs/rlibc....
I guess wrt string, it's extra frustrating because on unix, OsStr is really CStr but I get former (from command line) and often need latter for interacting with libc. Also when you learn Rust you first learn about str and String even though in my case I actually want to avoid them. Admittedly that's probably rare. Having every type duplicated (a ref type and a storage type) also increases the complexity.