Ask HN: How do you configure your software?

9 points by Aegean ↗ HN
I am looking for a software configuration solution (not version control). Based on a menu, I should be able to select configuration options, and each option could potentially make new options visible, or derive new values from the given values. Finally all options would create a list of symbols which can be used to generate a header file and for other purposes.

I am currently using this: http://catb.org/~esr/cml2/cml2-reference.html#AEN189

But something better and supported would be appreciated.

4 comments

[ 3.2 ms ] story [ 22.0 ms ] thread
If you are using Windows then Visual Studio is the answer - a correctly set up solution removes /every/ problem commonly associated with getting and building source code.

Since you have this problem at all though, I'm guessing you want a *nix solution of some kind... the best solution imo is to provide decent scripts in the source package which hide the configuration details, and try to arrange the source and dependencies so that you don't need to do any configuration just to get it to build at all.

Your requirements bring many different paradigms to mind:

"menu-selectable options" -> GUI

"options could make new options visible" -> code folding

"derive new values from given" -> spreadsheet

"create list of symbols" -> compiler

However, I suspect - and I could be wrong - that you don't literally want just these four things. You probably still want to be able to dive in and do cut, paste, and search in a text editor. You probably will want some kind of general scripting functionality as your needs for derived values become more complex. And you haven't mentioned what structures are contained in the resulting data, which would drive the dominant UI mechanism and the compiler structure.

If you want the most flexibility, you should look towards a full-on scripting language, using its built-in data structures and libraries to build out a custom app with the minimum viable UI. Then you will have the freedom to choose the most appropriate data structure at each juncture, you can build custom visualizations and processing tools to get fast feedback and auto-entry, etc. The boilerplate parts of the UI can still get abstracted away into a library or framework for configuration tools, but you won't have to be hamstrung by a DSL.

The purpose of the question is configuring software before building. You typically want to do it in automated fashion as opposed to any cut and paste. A menu-based system is easy to use, and with a configuration mini-language you can produce complex configuration data with a few keystrokes.

CML2 already has most of this. It is a mini-language written in Python so that you can create rules for your configuration. Based on your selection of symbols, the configuration rules decide on the visibility and/or value of other symbols. All symbols are gathered in hierarchical menus which are then displayed in the graphical GUI.

We accompany this with python scripts to generate header files, but also extract information from the symbols to drive the build.

CML2 is unfortunately unmaintained and has some limitations.

One other alternative is the linux kernel configuration system, but I don't want to use that as it is based on older scripting methods.

Out of these two I haven't seen anything else to this extent, which is why would like to know how people configure their software for building.

Well, with that info, I can safely say you're over my head. Within the domains I've worked it's unheard of for builds to need such elaborate configuration.

One area that suggests further study is logic programming, though. The hierarchical dependencies and view rules lend itself to that approach. As well, I recall thinking the Boomerang language would be interesting for code generation, albeit it's getting into esoteric academia land:

http://www.seas.upenn.edu/~harmony/