Show HN: Cpi – Immediately compile and execute c++ program like a scripting lang
treefrogframework.github.io
treefrogframework.github.io
- cling: https://root.cern.ch/cling
- cint: http://www.hanno.jp/gotom/Cint.html
- Ch: https://www.softintegration.com/
If people know of other ones, I'd love to hear about them in the comments!
It's not an interpreter but can be used as one, because it compiles so quickly.
A scripting language that accepts a subset of javascript and C/C++
A shebang-friendly script for "interpreting" single C99, C11, and C++ files, including rcfile support.
No interpreted mode.
HolyC is "kind of" C from a compiler perspective so I think it counts.
https://rosettacode.org/wiki/Native_shebang
Also:
https://rosettacode.org/wiki/Multiline_shebang
I contributed the C one here.
#if 0
/bin/env cpi "$0"
exit
#endif
And you don't need this cpi program depending on your tolerance for hacks: #if 0
out=/tmp/$RANDOM
gcc "$0" -o $out
$out
rm $out
exit
#endifIt's cool, but you can set something up like this just a few lines of bash code.