User:Puxlit/Configuration DSL Proposal

Motivation

 * we'd like to move script configuration out of Common.js/Wikia.js and into custom MediaWiki pages, to make things easier for new wikis (where custom JS is not enabled by default)
 * we'd like to avoid having to create multiple custom MediaWiki pages (like with DiscordIntegrator), as it gets messy when configuration gets complex
 * we'd like to use a syntax similar to Gadgets-definition (example)/Titleblacklist (example)/Wiki-navigation (example) instead of JSON, as it's more familiar/intuitive to editors familiar with wikitext

TODO

 * figure out what types we support
 * linkish:  where   is the value and   is the label
 * sequences via nested lists
 * do we strictly need sets and maps, or should such validation be left up to the consumer?
 * objects comprising scalars can be accomplished with pipes as parameter delimiters (similar to syntax for template parameters)
 * we'd consequently have the notion of positional and named parameters
 * however, we wind up being ambiguous with linkish constructs
 * compact vs. verbose formatting? canonical formatting?

Design Requirements

 * the DSL must provide syntax for commenting out values to the end of the line (e.g. with )
 * the DSL may provide syntax for sectioning (like INIs) via wikitext headers (like Gadgets-definition)
 * the library should provide an interface which, given a schema (including constructors and default values) and custom MediaWiki page name, returns some root configuration object
 * the library may treat all parse errors as fatal or the library may warn about parse errors on a line-by-line basis, and leave it up to the consumer (via its constructors) to throw fatal parse errors
 * the library may cache requests for its consumers
 * the library should provide a mechanism for bypassing the cache
 * the library may be configured to fetch the custom MediaWiki page via a  with PST (i.e.  ), to facilitate constructions like

Implementation Considerations

 * invalid title characters make for good delimiters, especially,   and  ,   and  , and