3 ms·
C and C++ are about the worst possible languages to use for scripting—let alone interactive interfaces, which even the current crop of conventionally “scripting
by mananaysiempre 3y ago
C and C++ are about the worst possible languages to use for scripting—let alone interactive interfaces, which even the current crop of conventionally “scripting” languages is kind of bad at[1].
Having an interpreter to poke at in-development code, though, would IMO still be useful. (I wouldn’t use Haskell or SML/OCaml for scripting either, and yet I swear by their interpreters.) Even GDB has something like one—the expression fragment the “print” command understands includes casts, which means it can parse type names, and for unoptimized C that’s honestly half the battle.
Or take it from (younger) Russ Cox[2]:
> All current C environments suffer from a much larger problem, namely a lack of interactivity. You can’t sit at a prompt, enter C fragments, and see what happens.
[1] http://yosefk.com/blog/i-cant-believe-im-praising-tcl.html http://yosefk.com/blog/i-cant-believe-im-praising-tcl.html
[2] https://swtch.com/~rsc/systems-2002.pdf https://swtch.com/~rsc/systems-2002.pdf
- saboot 3y agoDepends on the workflow, "C++ for scripting" helped to discover the higgs boson
- Mikhail_Edoshin 3y agoPython has an excellent interactive shell but I’m not sure this is such a blessing. It seems that nearly every package out there required you to use that shell to understand something mundane, like the type of a function result or properties of some object. I’d rather have good documentation instead.
- igouy 3y agoAs-in "The advantage of using a normally compiled language is that code can be compiled once the prototype is debugged and refined. CINT is a C++ interpreter, making it a tool for rapid prototyping and scripting in C++." https://root.cern.ch/root/html534/guides/users-guide/CINT.html https://root.cern.ch/root/html534/guides/users-guide/CINT.ht...