Re:Pkl, a Programming Language for Configuration
by Fischgericht on Saturday February 03, 2024 @08:17PM
(#39246542)
Yes, agreed. On the other hand, there are quite a few people using Javascript, a language where this distinction also isn't really done in a clean way.
If you would de-serialize an ini-file into Objects in memory you would typically have meta-data about your object (RTTI/Reflection for compiled languages, given for scripting languages).
But yes, INI isn't without flaws. Parsers typically will need to accept everything from "true", "True", True, true, 1, "1" for boolean fields.
Re:Pkl, a Programming Language for Configuration
by mixmastamyk on Saturday February 03, 2024 @08:01PM
(#39246438)
Schemas are often better than syntax typing. In other words the program decides what the type is, not the file.
Re:Pkl, a Programming Language for Configuration
by Silphendio on Saturday February 03, 2024 @10:14PM
(#39247187)
If the schema allows union types, I don't want to deal with unquoted strings.
Re:Pkl, a Programming Language for Configuration
by mixmastamyk on Sunday February 04, 2024 @01:34AM
(#39248120)
You don’t deal with syntax period. Union types are not desirable with configuration with the exception of |null perhaps, which should receive a default.
INI is hard to parse because without quotes the parser would not know whether it’s a “True” as a string or True as Boolean value. Formal parser that can be included into a program as a library and would reliably generate internal config representation (e.g., read config file into an object in application memory that will be used to modify the behaviour) is a good thing and TOML helps with that while INI does not.