News for hackers. Stuff that matters.
Re:Porting Alpine Linux to RISC-V by Thaxll on Friday December 21, 2018 @11:39AM (#18734434)
Go compiler is built in Go, big difference ( all of Go is built in Go). Cross-compiling in Go is the easiest of any languages as far as I know.

Ex: GOOS=windows go build .

GOOS=linux GOARCH=arm go build .

And you can run that from any os / arch, I can build a single Windows binary from my Raspberry Pi with the above example.

https://golang.org/doc/install/source#environment

Re:Porting Alpine Linux to RISC-V by krylon on Friday December 21, 2018 @11:41AM (#18734463)
As opposed to C/C++ compilers being built in C/C++?

EDIT: Try to build NetBSD for some esoteric platform from the comfort of your desktop machine. Remember to pick up your jaw from the floow when you're done. ;-) My point is, it does not have to be hard.

Re:Porting Alpine Linux to RISC-V by steveklabnik on Friday December 21, 2018 @11:46AM (#18734508)
In my understanding, Go re-implements the system's interface, rather than using libc (or the equivalent), even on platforms where the syscall interface isn't considered stable. This means cross-compiling is really easy, but it can also mean breakage when the unstable interface changes. A tradeoff like anything else.
Re:Porting Alpine Linux to RISC-V by Thaxll on Friday December 21, 2018 @11:47AM (#18734514)
Rust compiler is LLVM afaik so C++, same for the JVM / C#. Having your entire runtime / tools in the same language make it easier.
Re:Porting Alpine Linux to RISC-V by steveklabnik on Friday December 21, 2018 @11:56AM (#18734573)
This is true for Rust, however, given that LLVM is the project doing the codegen, it's a little bit special; cross-compiling it to the platforms it supports is a bit easier than a random C++ library, since it's the one with the support in the first place.

Rust projects make much more use of C libraries than Go projects do, though, so for things other than the Rust compiler, this is still a good point.

Re:Porting Alpine Linux to RISC-V by jhawk28 on Friday December 21, 2018 @02:10PM (#18735698)
Go uses a common assembly with ways to covert into the specific architecture which makes porting the toolchain to new targets somewhat trivial. (https://www.youtube.com/watch?v=KINIAgRpkDA)