3 ms·
If your application is written in a language that could be used as a configuration language, then this is quite simple. I've come across it in Ruby and Python -
by twic 12y ago
If your application is written in a language that could be used as a configuration language, then this is quite simple. I've come across it in Ruby and Python - for example, Ruby's rackup config file is Ruby code:
https://github.com/rack/rack/wiki/%28tutorial%29-rackup-howto https://github.com/rack/rack/wiki/%28tutorial%29-rackup-howt...
However, if your application's language is not suitable for use as a config language, then this becomes significantly more painful. You have to link in an interpreter for the configuration language, and then expose your application's internals to the interpreter. The easiest this could be is probably using JavaScript as a configuration language in Java, because the Java runtime already includes a JavaScript interpreter which can reach into the Java object model. The hardest it could be is using pretty much anything with C, where you'd have to add a separate interpreter, and then expose all the relevant internals by hand.