I love it. I'm using Go to handle building full stack javascript apps, which actually works great since esbuild can be used directly inside a Go program. The issue is that it's a dependency, so I settled for having a go mod file and running it directly with Go. If somehow these dependencies could be resolved without an explicit module configured (say, it was inline in the go file itself) it would be perfect. Alas, it will probably never happen.
That being said...use Go for scripting. It's fantastic. If you don't need any third party libraries this approach seems really clean.
Are you sick of python? Did you (rightfully) want to tear your eyes out when some LLM suggested that you script with .mjs? Well, there is a solution for you:
Get a grip.
Back in the days, I've seen that with C files, which are compiled on the fly to a temporary file an run.
Something like //usr/bin/gcc -o main "$0"; ./main "$@"; exit
I love it. I'm using Go to handle building full stack javascript apps, which actually works great since esbuild can be used directly inside a Go program. The issue is that it's a dependency, so I settled for having a go mod file and running it directly with Go. If somehow these dependencies could be resolved without an explicit module configured (say, it was inline in the go file itself) it would be perfect. Alas, it will probably never happen.
That being said...use Go for scripting. It's fantastic. If you don't need any third party libraries this approach seems really clean.
>full stack
Device drivers, task switching, filesystem, memory management and all?
No, I mean what do you expect, I said it was Javascript :P
Don't be that guy.
Official stance about supporting interpreter mode for the reference https://github.com/golang/go/issues/24118
I've been meaning to port some dotfiles utils over to go, I think I'll give this a shot.
Are you sick of python? Did you (rightfully) want to tear your eyes out when some LLM suggested that you script with .mjs? Well, there is a solution for you: Get a grip.