One system I work with exposes a CLI. The whole system is written in C, and the CLI is basically just a frontend for a bunch of commands that take in [int argc, char argv]. It is, to misquote Greenspun's tenth, an ad-hoc, informally-specified, bug-ridden, slow implementation of a proper REPL.
My secret wish is to replace it with an embedded TCL REPL. TCL isn't perfect, but it's pretty easy to interface with C, and it fits on small targets. My main problem (aside from lack of time) is that I'd actually need a tiny version that would fit within dozens of kilobytes of code. Closest I've found is Jim [1], which is 100-200kB (depending on features). Compare that with Lua, which fits under 100kB (though excluding its standard library).
> One system I work with exposes a CLI. The whole system is written in C, and the CLI is basically just a frontend for a bunch of commands that take in [int argc, char argv]. It is, to misquote Greenspun's tenth, an ad-hoc, informally-specified, bug-ridden, slow implementation of a proper REPL.
My secret wish is to replace it with an embedded TCL REPL. TCL isn't perfect, but it's pretty easy to interface with C, and it fits on small targets. My main problem (aside from lack of time) is that I'd actually need a tiny version that would fit within dozens of kilobytes of code. Closest I've found is Jim [1], which is 100-200kB (depending on features). Compare that with Lua, which fits under 100kB (though excluding its standard library).
[1] http://jim.tcl.tk/index.html/doc/www/www/index.html