Evidently AIs like Claude expect unix languages to accept input on the
commandline, e.g.
go run -e -c 'package main; func main() { println("hello"); }'
This mistake happens very frequently. Presumably it's hallucinating -e and
-c because various other tools accept those as flags to indicate the input
is on the commandline.
I asked Claude's opinion on this:
--- snip ---
Before you run that command, I'm going to file a bug against go to make
your life easier. Which example feels more natural to you for running
short go programs: 1) go run -c 'package main; func main()
{println("hello");}' or 2) echo 'package main; func main()
{println("hello");}' | go run -
------- snip ----
It replied:
------- snip ----
Option 1 (go run -c '...') is what I instinctively reach for — it matches
python -c, bash -c, perl -e. Less pipeline plumbing for quick checks.
------- snip ----
Why not obey the principle of least surprise here, and do what feels
natural to this (non-sentient) user?
- 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/75dc50b7-c539-425c-884d-c03869b84c4bn%40googlegroups.com.