HNHacker News
TopNewBestAskShowJobs

ludiludi

171 karma · joined September 7, 2022

submissionscomments
ludiludi··on NilAway: Practical nil panic detection for Go
I got a nil pointer deref panic trying to use this tool:

$ nilaway ./...

panic: runtime error: invalid memory address or nil pointer dereference [recovered]

panic: runtime error: invalid memory address or nil pointer dereference

[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x100c16a58]

ludiludi··on Print(“lol”) doubled the speed of my Go function
It appears so. https://developer.arm.com/documentation/102374/0101/Program-...

"So far, we have seen examples that use branches to handle decisions. The A64 instruction set also provides conditional select instructions. In many cases, these instructions can be used as an alternative to branches."

Seems CSEL is not a branch.

ludiludi··on Print(“lol”) doubled the speed of my Go function
Your disasm is for x86-64. The benchmarks in the blog were run on an M1 MacBook Pro, which is an ARM64.
ludiludi··on Print(“lol”) doubled the speed of my Go function
Good question. As you can see in the comment in the github repo, it has no effect. https://github.com/ludi317/max/blob/master/blog/max_test.go#...

It is there only to match the continue in the second code sample, where it is needed.

ludiludi··on Mastermind Solver
Here's my visual implementation of Knuth's algorithm to solve Mastermind!

Click "Solve within 5 moves"

https://ludi317.github.io/

Gory details here: https://github.com/ludi317/ludi317.github.io

ludiludi··on Making a Go program faster with a one-character change
> If you read the title and thought “well, you were probably just doing something silly beforehand”, you’re right!

Don't feel too silly. Russ Cox, one of the technical leads on the Go language, made the same mistake in the regexp package of the standard library.

https://go-review.googlesource.com/c/go/+/355789