From: Stefan Sperling Subject: Re: New library config parse.y start To: Tracey Emery Cc: gameoftrees@openbsd.org Date: Sat, 20 Jun 2020 10:27:51 +0200 On Fri, Jun 19, 2020 at 10:34:39AM -0600, Tracey Emery wrote: > This also paves the way for centralized parsing for gotweb and gotd. Sorry about rewinding the discussion, but reading your new diff it occurred to me that having just one parser might not be a good idea. I see a trade-off we have to make between code duplication for parsing config files, and re-usability of our library APIs. Configuration files are by definition application-specific. The library should not actually need to know where configuration information comes from. All required information should be passed in via function parameters. The got_config.h you're adding embeds knowledge about gotweb in files that live in the global include/ directory. These files declare the library APIs which are available to all applications. Why would gotweb's configuration variables need to be known to gotd, got, or tog? Or any other application that people could come up with? When someone writes an application using the library, they would reasonably expect that they can use this library without first adding new information about their application to files in the library's include/ directory in order to parse their application's configuration file. If we don't unify the parser, one obvious downside is we have multiple parse.y files. Is that bad? I don't know how much of a burden they are to maintain. Have you already thought about this?