HNHacker News
TopNewBestAskShowJobs

icholy

1,312 karma · joined September 9, 2012

submissionscomments
icholy··on Deadcode: Finding unreachable functions in Go
Apologies, I misread your comment. But can you elaborate on your statement that tree-shaking (more commonly referred to as dead-code-elimination) is no longer required?
icholy··on Deadcode: Finding unreachable functions in Go
Calling vtables "reflection" is a stretch.
icholy··on Deadcode: Finding unreachable functions in Go
I believe the checks you're referring are local to a package. It doesn't do whole program analysis like deadcode does.
icholy··on From slow to SIMD: A Go optimization story
Last time I checked, it didn't even unroll loops.
icholy··on Deadcode: Finding unreachable functions in Go
It's not that simple. The Go compiler uses a main package as its entry point when compiling a binary. A module can have a many main packages each using different subsets of the library packages.

So there are two choices here:

    1. The Go compiler complains about code which is unused by the current main package.
    2. The Go compiler tries to find/compile all main packages every-time.
Both of these options suck.
icholy··on Deadcode: Finding unreachable functions in Go
Seems like you're conflating two separate things here. The Go compiler has a DCE pass which prevents unused code from ending up in the binary. The linked blog-post describes a tool for identifying unused code in your codebase. Two completely separate use-cases.
icholy··on Deadcode: Finding unreachable functions in Go

    deadcode ./cmd/...
icholy··on Get your work recognized: write a brag document (2019)
At my company we have a shared "wins" document where team members add entries for things they're proud of. It's annoying to maintain, but it's definitely been helpful when asking for a raise.
icholy··on To revive Portland, officials seek to ban public drug use
It goes both ways.
icholy··on AST-grep(sg) is a CLI tool for code structural search, lint, and rewriting
Looks like a competitor to me.
icholy··on AST-grep(sg) is a CLI tool for code structural search, lint, and rewriting
Semgrep is capable of one-off searching and refactoring. I agreed that the docs are a little hard to navigate.
icholy··on Optimizing Go string operations with practical examples
I only switched mine once a second dev joined the project.
icholy··on Gron: Make JSON greppable
Thanks for the follow up. Is your fork public?
icholy··on Gobs of data (2011)
Eh, I like Go and respect Rob Pike, but I seriously doubt gob had any impact on the proto3 design
icholy··on Gron: Make JSON greppable
I think it's because Go's encoding/json package doesn't support incremental parsing.
icholy··on Optimizing Go string operations with practical examples
You can clean up this code by writing a package for generating JSON token by token.

    w := jsonx.New(os.Stdout)
    w.OpenObject()
    w.ObjectKey("commit")
    w.Int(0)
    w.CloseObject()
icholy··on Show HN: Python decorator to log local variables with each line of code run
ipdb.set_trace is the best of both worlds
icholy··on Why are Golang heaps so complicated
It's because the package predates generics and a v2 hasn't been added yet.
icholy··on Making games in Go for absolute beginners
https://raytracing.github.io/
icholy··on datetime.utcnow() is now deprecated
Why can't opening hours be stored in UTC?
icholy··on Inko Programming Language
Go channels are synchronous by default.
icholy··on Rob Pike’s Rules of Programming (1989)
It's not 75% of the code-base. During the error handling proposals, the Go team analyzed a large corpus of Go, and it turns out people drastically overstate how much error handling contributes to the line count.
icholy··on Better HTTP server routing in Go 1.22
If this turns out to be real issue (which I seriously doubt), then they'll add a vet check.
icholy··on What I learned about MP3 encoding
Then don't act like total knob. Demanding justification for someone's personal blog post is weird man.
icholy··on Deconstructing Go Type Parameters
Yeah, that one if statement really melts my brain. /s
icholy··on Should I Rust or Should I Go?
You're just making problems up now ...
icholy··on Fixing for loops in Go 1.22
There's no reason it can't be optimized away when they're not necessary.
icholy··on Fixing for loops in Go 1.22
Keep posting about D, I'm sure it will catch on soon.
icholy··on Fixing for loops in Go 1.22
They did something sneaky. In go 1.21, they changed the version number format in the `go.mod` files. So trying to build with go 1.18 will result in:

  go: errors parsing go.mod:
  go.mod:3: invalid go version '1.21.0': must match format 1.23
However, this will only happen if you use the `go mod init` to create your module. If you manually specify `go 1.21` in your `go.mod`, it will build without complaining.
icholy··on Should I Rust or Should I Go?
Prefixing doc comments with the ident name is a convention that isn't enforced in any way. You must have been using a 3rd party linter.
← PreviousPage 3 of 15Next →