Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> "making a folder" and "putting a ... main() func" in it

You can't do that with python for instance. First, you need a python interpreter on the target machine, and on top of that you need the correct version of the interpreter. If yours is too old or not old enough, things might break. And then, you need to install all the dependencies. The correct version of each, as well. And they might not exist on your system, or conflict with some other lib you have on your target machine.

Same problem with any other interpreted language, including Java and C# obviously.

C/C++ dependency management is a nightmare too.

Rust is slightly better, but there was no production-ready rust 16 years ago (or even 10 years ago).



You also need a version of the go compiler, possibly one new enough to handle some //go:magic:comments.

I agree that static linking is great and that python sucks but I was trying to say I can, very easily, mkdir new-py-program/app.py and stick __main__ in it or mkdir new-perl-program/app.pl or mkdir my-new-c-file/main.c etc.

For 2/3 of the above I can even make easy/single executable files go-style.


Nowadays, with uv (and probably some other tools too) it's pretty easy to ship a python program on a machine that doesn't even have python on it, so it's pretty much a solved problem today (in most cases). But 5 or 10 years ago it was a real hassle that go solved elegantly. Yes you can make python executables but they are like 100 Mb even for a simple hello world. It's a last resort solution.

I don't understand your comment on magic comments. You don't need them to cross-compile a program. I was already doing that routinely 10 years ago. All I needed is a `GOOS=LINUX GOARCH=386 go build myprog && scp myprog myserver:`




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: