News for hackers. Stuff that matters.
Re:Show HN: Go Plan9 Memo, Speeding Up Calculations 450% by dsv3099i on Friday October 18, 2024 @04:24PM (#41883141)
mips64!? That's a blast from the past. It must be some kind of legacy hw that's getting current software updates in some kind of really niche use case. Or academia. :)

Like previous you, I have to admit I'm skeptical but would be happy to be wrong.

Re:Show HN: Go Plan9 Memo, Speeding Up Calculations 450% by cloudfudge on Friday October 18, 2024 @04:35PM (#41883246)
> mips64 .. must be some kind of legacy hw that's getting current software updates

Hundreds of thousands of linux-based smartnic cards, actually. Fun stuff. Those particular ones were EOLd and have been replaced with ARM but the MIPS based ones will live on in the datacenters until they die, I'm sure.

> Like previous you, I have to admit I'm skeptical but would be happy to be wrong

Seriously, you are going to be delighted to be wrong. On your linux machine, go write a go program and write "GOOS=darwin GOARCH=arm64 go build ..." and you will have yourself an ARM mac binary. Or for going the other way, use GOOS=linux GOARCH=amd64. It really is that simple.

Re:Show HN: Go Plan9 Memo, Speeding Up Calculations 450% by ncruces on Saturday October 19, 2024 @01:28AM (#41885834)
It gets even more amazing than that. Look at this bit from my GitHub Actions: https://github.com/ncruces/go-sqlite3/blob/fefee692dbfad39f6...

I install QEMU (I have the same setup locally), then it's one line each to run unit tests for: Linux 386, arm64, riscv64, ppc64le and s390x.

With QEMU installed, all you have to do is:

    GOARCH=bla go test ./...
Re:Show HN: Go Plan9 Memo, Speeding Up Calculations 450% by cryptofistMonk on Saturday October 19, 2024 @11:43AM (#41888442)
Wait is go test automatically running it under QEMU or what's going on here?
Re:Show HN: Go Plan9 Memo, Speeding Up Calculations 450% by cryptofistMonk on Saturday October 19, 2024 @11:51AM (#41888505)
Ah I found this https://ctrl-c.us/posts/test-goarch I guess it's qemu-user-binfmt registering the alternate bin formats to automatically run under QEMU, that's pretty neat
Re:Show HN: Go Plan9 Memo, Speeding Up Calculations 450% by ncruces on Saturday October 19, 2024 @12:25PM (#41888755)
Yep.

The Go build system runs under your current architecture, cross-compiling tests to your target architecture.

Then, the Go test runner also runs under your current architecture, orchestrating running your cross compiled test binaries.

Since you registered to run cross-compiled binaries under QEMU, those test binaries magically run through QEMU.

The Go test runner collects test results, and reports back to you.

The first run might be slowish, as the Go compiler needs to cross compile the standard library and all your dependencies to your target platform. But once that's done and cached, and if your tests are fast, the edit-test cycle becomes pretty quick.

Re:Show HN: Go Plan9 Memo, Speeding Up Calculations 450% by wahern on Friday October 18, 2024 @04:34PM (#41883230)
MIPS64 is still very much alive: https://store.ui.com/us/en/products/er-4

"EdgeOS" is based on Linux, and people run vanilla Linux distributions on those boxes, as well as OpenBSD and NetBSD.

I wonder how long Marvell will continue selling those Octeon MIPS64 chips, though. Marvell (then Cavium) switched to ARM nearly a decade ago (2016) for newer chips in the Octeon series. I think Loongson sells more modern MIPS64 (or at least MIPS64-like) chips, but they don't seem to be commercially available outside China.

Re:Show HN: Go Plan9 Memo, Speeding Up Calculations 450% by t-3 on Sunday October 20, 2024 @08:02PM (#41899542)
They're not widely available in the west, but you can get a whole Loongarch workstation on aliexpress:

https://www.aliexpress.us/w/wholesale-loongson-3a6000.html