News for hackers. Stuff that matters.
Re:Toml: Tom's Obvious, Minimal Language by mojombo on Friday July 13, 2018 @11:06AM (#17523526)
1. How would the file path type differ from a regular string? Would you want specific semantic validation for each platform?

2. This is still a big question, and we've been having a robust argument about it on GitHub [1]. It's a problem that so far has evaded an elegant solution, but usually when that's the case, it just means we haven't been creative enough about it yet! Or did you mean versioning of the data IN the config file? Can you elaborate?

[1] https://github.com/toml-lang/toml/issues/522

Re:Toml: Tom's Obvious, Minimal Language by nixpulvis on Friday July 13, 2018 @11:22AM (#17523680)
1. Yea the goal would be some kind of validation at parsing time. I'm not super familiar with TOML parsing, but there must be error cases in the implementations, so it seems like using `\` on UNIX systems, for example could return an error. The only hard part about this I see is distinguishing paths from strings syntactically without making TOML overly complex.

2. So basically, the majority of people don't want to type version numbers (I see where they are coming from, but respectfully disagree). I'm not sure if there exists a solution in that case. As for my comment, I was really talking about both kinds of versioning. Mainly that, if my data is version 2.3.1, I'd expect that to also lock the version of TOML, requiring a new version of my data for bumps to the underlying data structure. Again syntax is the hard part, as I'm having trouble imagining a way to actually do this. Furthermore I've seen data formats in the past that let you version "parts" of a format, I personally like this, but don't think it's a good fit for TOML.

Re:Toml: Tom's Obvious, Minimal Language by bqe on Friday July 13, 2018 @12:55PM (#17524603)
Backslashes are valid characters in a POSIX filesystem, but they don't indicate a directory.
Re:Toml: Tom's Obvious, Minimal Language by curun1r on Friday July 13, 2018 @03:21PM (#17525883)
Yeah...rather than validating paths, the better use case is probably normalizing them so that you don't need platform-specific configuration files. Being able to write:

static-files = path/to/static/files

And have it work on all platforms gives a distinct advantage over specifying paths as strings.

Re:Toml: Tom's Obvious, Minimal Language by Stratoscope on Friday July 13, 2018 @10:12PM (#17528395)
Every modern operating system accepts forward slash paths. It's been a long time since there was any need for things like Python's os.path.join() or special file path knowledge in config files to convert slashes to backlashes on Windows. You can just use forward slashes everywhere and not worry about it.

The one exception on Windows may be paths in a CMD.EXE command line, where / may be confused for a switch character, but I would think a config file should not be passing paths on a command line but instead passing them directly into a program - and then the forward slash will work fine.

Re:Toml: Tom's Obvious, Minimal Language by earenndil on Friday July 13, 2018 @08:40PM (#17528032)
That was my first thought, but imo such a functionality belongs in the language's file access library.