Now, if the file ~/.configs/Foo/settings.conf exists, and it has a field color: <color_name> I want my src code to change the default value of a color so next time I don't have to do I/O on the settings file again?
What options do I have? (lower latency option is preferred) An optimal way to read settings from the file, set them up once without a need to do IO, and set default values every time the program is executed. Do I write some meta program that updates the source code?
Or do you mean, compilers of the program have a config file that determines the default (which will be the same for every execution of the compiled program)? At a low level there's include_str; at a higher level, you could combine a config file approach with a build script.