On Mon, Jul 6, 2026 at 3:10 AM Rob Pike <[email protected]> wrote:

> Surely these AI tools are powerful enough that you can tell them how to
> run the command rather than changing the language's tools to cover their
> inadequacies.
>

I've observed people never bothering to do go build; they want to treat go
like an interpreter.
And most popular interpreters offer a way to run code from the commandline.
Here's a little rosetta stone:

# Program coming from stdin

echo 'echo "Hello, World!"' | sh

echo 'echo "Hello, World!"' | pwsh

echo 'print("Hello, World!")' | python3

echo 'print "Hello, World!\n"' | perl

echo 'puts "Hello, World!"' | ruby

echo '<?php echo "Hello, World!\n"; ?>' | php

echo 'console.log("Hello, World!")' | node

echo 'print("Hello, World!")' | lua

#not supported in go


# Program coming from commandline option

sh -c 'echo "Hello, World!"'

pwsh -Command 'echo "Hello, World!"'

python3 -c 'print("Hello, World!")'

perl -e 'print "Hello, World!\n"'

ruby -e 'puts "Hello, World!"'

php -r 'echo "Hello, World!\n";'

node -e 'console.log("Hello, World!")'

lua -e 'print("Hello, World!")'

awk 'BEGIN{print "Hello, World!"}'

echo 'package main; func main() {println("Hello, world!")}' > hello.go; go
run hello.go; rm hello.go


It does seem worth supporting, at least to me, as an idiom for quickly
printing out constants or running really tiny programs.

- Dan

-- 
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/CAGrodq9OnOvUfutG6mFpNw0b1p%3D0GqXfaZJPUimpVVjKmT2J_Q%40mail.gmail.com.

Reply via email to