Here we go, let's see how the new M1 chips do on Go benchmarks!

(Might be a good time to mute #M1, I have a new toy and I took time off work until the end of the month.)

First step is

$ GOOS=darwin GOARCH=arm64 ./bootstrap.sh

on my corp MacBook.
Well, it couldn't be too easy I suppose.

Ran bootstrap[.]sh (which is just a convenience wrapper for make + mv bin/darwin_arm64/go bin/go + tar), sent it over with webwormhole.io, cleared the quarantine xattr, and...

zsh: killed ./go-darwin-arm64-bootstrap/bin/go

#M1
Frank has it right, after codesigning bin/* and pkg/tool/darwin_arm64/* I got the compiler running.

Still, this needs fixing, it stops "go run" and "go test" from working. I wonder if the dev kits had it disabled.

Alright, the friction is high because the Go linker does not automatically codesign binaries like the system linker (which will be a major pain for cross-compiling) but I should be able to get some benchmarks to compile.

No make.bash timing though :( #M1

github.com/golang/go/issu…
Trying to find apples to apples comparisons since the amd64 assembly in the Go crypto tree is quite a bit better.

In the meantime, the brokenness is noticeable. magic-wormhole doesn't install as PyNaCl doesn't compile. Chrome runs under Rosetta 2 (cool!) but is not fast. #M1
First Go #M1 benchmarks out the oven!

x/crypto/chacha20poly1305
Open-8192
-18%

x/crypto/curve25519
ScalarBaseMult
-46% (!!)

Pure Go running on a MacBook Pro (13-inch, M1, 2020) vs a MacBook Pro (15-inch, 2017) 3.1 GHz Quad-Core Intel Core i7.
(Oh hey, there actually is a native version of Chrome. 9to5google.com/2020/11/17/chr…)
Dependency loop detected: can't work on replacing gpg with age in pass, because I can't access my password-store since gpg does not run on #M1.

Ok I give up, I have no idea why Apple is requiring codesigning, if you can run binaries signed ad-hoc on a different machine. #M1

Putting in place the infrastructure to do better logic later?

github.com/golang/go/issu…
Ok, back on track after a good night's sleep.

Turns out Homebrew runs well under Rosetta 2 on #M1, and gpg can talk to the YubiKey from it.

It's neat, you start an emulated shell with "arch -x86_64 zsh" and then everything you do is emulated.
I am keeping a Google Doc with my notes on developing on Apple Silicon if you want to follow along.

I'll be dropping benchmarks there, too. #M1

docs.google.com/document/d/1iW…
#M1 first impressions 24h in:
· this thing is honestly fast
· Rosetta 2 is kind of amazing
· many CLI tools only run under R2 for now, and that's fine
· native makes a difference for heavy apps
· code signing is a bit annoying but makes sense, and hopefully tooling will catch up
For developing in Go on Apple Silicon, there's two main issues to be aware of:

- arm64 binaries are not codesigned automatically (github.com/golang/go/issu…)
- amd64 binaries need GODEBUG=asyncpreemptoff=1 (github.com/golang/go/issu…)

Read more: docs.google.com/document/d/1iW… #M1 #golang

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Filippo Valsorda 💚🤍❤️ ✊

Filippo Valsorda 💚🤍❤️ ✊ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @FiloSottile

10 Aug
YIKES.

It's important to destigmatize therapy, but giving permanent therapy transcripts to a VC-backed engagement-optimized tech startup is TERRIFYING.

Teletherapy should be ephemeral by law, and it should not be allowed to optimize for more therapy.

YIKES. YIKES. YIKES. ImageImageImage
CLIENT RETENTION BONUSES. For therapists!

What the actual fuck. This can't be ethical.
Ephemerality is fundamental to therapy. The patient decides whether they trust the therapist to uphold confidentiality today.

What if in ten years some law is passed weakening client confidentiality, and Talkspace is subpoena'd? People can't model that!
Read 6 tweets
31 May
The police is arresting, shooting, and macing journalists.
They are driving tanks into cities and escalating.
They're getting recorded and they don't care.

Defund the police. Disarm them. Drop qualified immunity.
A black CNN reporter was arrested after identifying himself while filming on a highway that was blocked by police and protesters.

An MSNBC live crew is shot at and cornered by police as they yell "press press press press" and "don't shoot".

Read 14 tweets
27 Dec 19
🚨 The age-encryption.org reference implementation reached beta! 🥳

age(1) — a simple, modern, secure file encryption tool.
Easy UNIX piping! No config options! Modern crypto! No keyrings! Public keys that fit in a tweet! No more looking up how to encrypt a file on StackOverflow. 💥

age1t7r9prsqc3w3x4auqq7y8zplrfsddmf8z97hct68gmhea2l34f9q63h2kp

Try it out and send feedback 👉 age-encryption.org Image
I'm particularly happy that thanks to @str4d we have two interoperable implementations of age-encryption.org from the get-go.

Both in memory safe languages, they provide maturity and future proofing for the format, spec and ecosystem.

github.com/str4d/rage Image
Read 10 tweets
6 Sep 19
Go 1.13 is definitely the best Go version ever! You'll have to trust me this time, as @bradfitz was on leave 😉

Here's a thread of highlights from the release ✨💥

There were more than 1750 commits since Go 1.12, so I'm going to miss some awesomeness here. Of course, I can't claim credit for almost any of this.

All user-visible changes are in the release notes 👇

golang.org/doc/go1.13
First the headliners: Go 2 language changes!

New number literals and signed shift counts.
No more ugly "x << uint(n)".

golang.org/design/19308-n…
golang.org/design/19113-s…
Read 20 tweets
12 May 19
Alright Twitter, it’s time to #killgpg. If you use gpg to encrypt files, tell me how and what features you need.

Do you care about signatures? Streaming? Do you pipe tar into it? Do you need seeking? CLI or libraries? Big or small files?
Today we’re going after encryption, not signing. Signing is not a tooling problem but a trust problem, and to the extent it is, it’s mostly covered by signify.

Emails are also out of scope. Again, a trust and medium problem. (Which OpenPGP does not solve.)
I’m hearing a lot of passwordstore.org, and that’s my own last use case for it! So the new tool will definitely work as a pass backend, and support YubiKeys through the PIV applet.
Read 5 tweets
7 May 19
Oh my. Apparently, AMD CPUs will sometimes return bad results from RDRAND after a suspend. That's bad, but if everyone has been following the cryptographer's advice and _just used getrandom()_ that's not a problem.

... nope! systemd of course didn't!

github.com/systemd/system…
Now I'm kind of scared to go look what genuine_random_bytes does...

OK, WTF, what is pseudo randomness exactly, and why on earth would you want some "genuine" randomness with a splash of "pseudo" on top.

github.com/systemd/system…
Oh... oh.

Pseudo-randomness is literally rand(). You know, the predictable one. Not some AES-CTR thing. Literally rand().

WHY WOULD YOU EVER WANT HALF CRYPTO AND HALF PREDICTABLE RANDOMNESS.

github.com/systemd/system…
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!