I wrote a file path library for Rome where you construct a FilePath instance. It memoizes work, and you use methods to create derivative paths. eg. adding on an extension (useful for module resolution) etc.
-
-
Show this thread
-
It understands the mutations and can efficiently create a variant with the previous memoized work.
Show this thread
End of conversation
New conversation -
-
-
I understand the sentiment, but disagree with the proposed solution. A string is the purest representation of a file path. It is human readable, stateless and can be processed using pure functions. Don't abstract it; build better utilities.
-
I don't really understand. Pure representations aren't the most efficient. I'm talking about code that processes file paths. Unclear how you can create better utilities if the input type is not efficiently cachable.
- 5 more replies
New conversation -
-
-
also paths are not necessarily utf8, rust uses special OsString for that https://doc.rust-lang.org/std/ffi/struct.OsString.html …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
what’s a good representation? did you find noteworthy libs? Dart’s path lib has documented rationale on Path objects vs Strings that I found interestinghttps://pub.dev/packages/path
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
This is so true it's painful. I wish modern file systems used non-C arrays of segments (all names legal) and stored file types as MIME types. It's hardly any overhead (256 worst-case per spec). I ought to write up a blog post of what I wish file systems were like at some point.
-
Paths are just paths into tree modes. Now if OS devs would maybe quit trying to make them look so much like names, creating arbitrary restrictions and conventions because they can't process them as pure string names internally, it'd be way easier to manage them.
- 1 more reply
New conversation -
-
This Tweet is unavailable.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 