3 ms·
Using C++ as a scripting language: statically type-checked functions
- ncmncm 6y agoThis is a recently sensible idea: computers, and thus compilers, are now so fast that it is reasonable to compile and run a small program, even for a single use, in preference to interpreting it. Arguably this is the same reasoning that favors JIT interpreters for (e.g.) Javascript and Guile, and the bytecoded forms of Python and Emacs-lisp. Among ahead-of-time compilers it is more true for faster compilers, such as for C and Golang, less so for Rust. But the abstraction facilities and libraries available in C++, in between, make it the more powerful choice, on par with with Guile. Usefulness for this purpose depends on having libraries that are especially convenient to use. The file system addition to the C++ Standard Library is welcome.