3 ms·
If the PL you are using already has named parameters with defaults then you can roll a CLI on top of it with a more well specified "spec" language (the PL itsel
by cb321 5y ago
If the PL you are using already has named parameters with defaults then you can roll a CLI on top of it with a more well specified "spec" language (the PL itself) and with less work. There are a few Python packages for this and https://github.com/c-blake/cligen https://github.com/c-blake/cligen (which lets you add a CLI to an existing API with just one line of code).
This is theoretically even possible for C++ with some kind of compile-time reflection API, but the way the C preprocessor works probably makes it hard to preserve structured comments for automatic documentation extraction. It was quite easy to do in Nim.