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

Go-like cross-compilation only works with pure Go libraries that don't make use of either syscalls or cgo.


True and pretty obviously so, but Go is still fantastic in this regard. :) Compare to other native cross-compile stories like with how you'd have to go about to cross compile a Qt app on Linux to Windows... Or even worse to Mac.


Have you ever tried to cross-compile a Go application using native UI toolkit?


I keep hearing praise over how easy it is to statically compile Go applications. Does the same apply to static compilation? Is it only easy when using pure Go libraries?


Usually those praises come from young developers that never developed software back in the days when static linking was the only option.

So they look at Go's static linking, their experiences using -static in gcc and glibc, and think they just found something magical.

It is interesting the amount of knowledge that gets lost within a few generations.


> It is interesting the amount of knowledge that gets lost within a few generations.

I've only been programming for 4 years. What's the second best way to learn the old practices and the way things were done (the first best being "living back then").


If you enjoy reading documents, BITSAVERS.ORG is a treasure mine full of lost knowledge.

https://archive.org/details/bitsavers

Here you will find Xerox PARC, DEC, Burroughs, Apple, Sun, Borland,... old research documents, papers, manuals.

In the context of static compilation, for example in MS-DOS, take Turbo Pascal 6.0 programmer's guide.

https://archive.org/details/bitsavers_borlandturVersion6.0Pr...

For some 8 bit love you can check ZX Spectrum and Atari archives.

http://www.worldofspectrum.org/

http://www.atariarchives.org/

Next step is to get an emulator for any of those old OS/computers and try to follow along one of those books.

Also there are some videos on YouTube showing those systems.

"The Smalltalk-80 Programming System"

https://www.youtube.com/watch?v=JLPiMl8XUKU

"NeXT vs Sun"

https://www.youtube.com/watch?v=UGhfB-NICzg

"Steve Jobs internal demo of NeXTSTEP 3"

https://www.youtube.com/watch?v=gveTy4EmNyk

"Amiga Programming"

https://www.youtube.com/watch?v=WOAyVIWFaXQ&list=PL1E7187BCF...

"Amiga Hardware Programming"

https://www.youtube.com/watch?v=p83QUZ1-P10&list=PLc3ltHgmii...

The Mother of All Demos"

https://www.youtube.com/watch?v=yJDv-zdhzMY

Just a very tiny sample of videos


I emailed the bitsavers link to our programming team at work with the subject: "jurassic park"


according to https://dave.cheney.net/2016/01/18/cgo-is-not-go

> It is possible to compile a Go program entirely statically, but it is by no means simple and shows that the ramifications of including cgo in your project will ripple through your entire build and deploy life cycle.

(that article also contains the beautiful line "You’re not writing a Go program that uses some logic from a C library, instead you’re writing a Go program that has to coexist with a belligerent piece of C code that is hard to replace, has the upper hand negotiations, and doesn’t care about your problems.")




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

Search: