On Tue, Jul 7, 2026 at 1:01 AM 'Brian Candler' via golang-nuts
<[email protected]> wrote:
>
> To be fair, I'm not sure many other *compiled* languages do this either - 
> perhaps the list should also include Rust, C, C++, Swift, Java ?

One version for C (or C++) is a thing of beauty. It's a bit
inconvenient since you need to put the string in the middle of the
command. And you need to name an executable file. This assumes bash.

gcc -o /tmp/run -x c - <<< '#include <stdio.h>
int main() { printf("hello, world\n"); }' && /tmp/run

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVpa8boEgy3KpbKT9WJd19PYgNMFcytmW%2BdQuMWMi7X4A%40mail.gmail.com.

Reply via email to