Hacker News new | past | comments | ask | show | jobs | submit login

Go doesn't pride itself on not having a runtime though. People aren't surprised that there's space taken up by the garbage collector and green thread management and such.



I don't understand your remark. To the contrary, a runtime should decrease binary size. The same PHP script (interpreted not JIT or VM'd though, obviously) will be only a few hundred bytes..


The runtime in this case is compiled into the binary. With php, the runtime is all contained in the php binary that runs your scripts, in Go's case, the runtime is copied into every binary it produces.


For a more true comparison with external scripting runtimes one can do: go run main.go

Although this would be ill-advised, kind of like PHP in general..


I'm not sure what you mean. Isn't this equivalent to `go build main.go && ./main`?


It is. Not sure if the other guy has ever used Go.


Hmm it would seem so, I could of sworn it was different, my bad.


Aren't you just assuming the runtime is dynamically available? This is not a necessary feature of a runtime. You could compile PHP and add the size of the interpreter to the executable.


each go binary is self contained and has the entire runtime linked into it. I'm sure you will find the php runtime is many megabytes.


By default yes, but they are adding dynamic linking support.

So far it only works on GNU/Linux I think.




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

Search: