On Tue Jul 7, 2026 at 04:32 CET, 'Dan Kegel' via golang-nuts wrote: > 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
another option is to contribute to mvm (even though, I personally won't anymore as it does accept AI contributions): https://github.com/mvm-sh/mvm $> mvm run -e "fmt.Println(1+2)" 3 ie: if one wants interpreter-like features, better work with an interpreter. -s PS: that said, I suppose one could perhaps consider 'go run' accepting code from stdin. -- 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/DJS5GG1RR9SH.3BB21S98OPJT0%40sbinet.org.
