HNHacker News
TopNewBestAskShowJobs

alecthomas

464 karma · joined March 2, 2008

http://twitter.com/alecthomas http://swapoff.org http://github.com/alecthomas alec@swapoff.org

[ my public key: https://keybase.io/alec; my proof: https://keybase.io/alec/sigs/EwhDB5ZFYHetGQT4QBxryMKudydFlHx6vfI2ZbYaXTY ]

hnchat:M7diobfazxWsK0TZ9aVm

submissionscomments
alecthomas··on Gojq: Pure Go Implementation of Jq
> Right, the startling thing about Python's previous dict was that it was so terrible that the ordered dict was actually significantly faster.

I've never heard that before and it would be really surprising, given that Python's builtin dict is used for everything from local symbol to object field lookup. Do you have more information?

alecthomas··on Why I Don't Like Golang (2016)
A lot of these little irritations were due to a lack of user-accessible generics. Now that generics are available, they're available in the exp/slices package: https://pkg.go.dev/golang.org/x/exp@v0.0.0-20220609121020-a5...
alecthomas··on Kagi search and Orion browser enter public beta
I like the UX, but the results are full of content farms and weird ranking for the query "golang parser" (https://you.com/search?q=golang+parser). OTOH it is much faster than kagi.

First result is good: pkg.go.dev/go/parser

Second result looks like a content farm: golangdocs.com/golang-parser-package

Third result looks like a valid Chinese search result, but it's a duplicate of the first result and also _very_ weird that it would rank that highly: golang.cm/pkg/go_parser.htm

Then the next two results are content farms: golangexample.com/tag/parser/ golangexample.com/a-dead-simple-parser-package-for-go/

Then a valid result from a low-starred GH project: github.com/prataprc/goparsec

Then a good result: blog.gopheracademy.com/advent-2014/parsers-lexers/

Then a random seemingly unrelated academic paper: www.arxiv.org/abs/1505.08075

Then a valid result from a high-starred GH project: github.com/alecthomas/participle

Then another content farm: awesomeopensource.com/projects/golang/parser

kagi also has a bunch of the content farms, but the ranking is better IMO. Good luck!

alecthomas··on Meld for Macs
I agree. The old version was super slow but still great, but the new major release a year or so ago is fantastic. Super fast, super intuitive. Well worth the $$
alecthomas··on Compile-Time Sort in D
Zig does this too I believe: https://kristoff.it/blog/what-is-zig-comptime/
alecthomas··on Go performance from version 1.2 to 1.18
I'd be interested in reading more about that. Do you have a reference?
alecthomas··on Go performance from version 1.2 to 1.18
FWIW for SQL, sqlc[1] is probably the nicest SQL layer I've used in any language.

[1] https://github.com/kyleconroy/sqlc

alecthomas··on Professional maintainers: a wake-up call
> Making it easier and making it a common habit. Companies need to realize, that paying maintainers/contributors pays off for them.

Definitely agreed.

> Looking at https://flossbank.com/, this seems like just what you describe. I don't know how it works exactly, though.

That looks ... related, but I _detest_ that it relies on injecting ads into package managers. It's also not extensible.

I think an open source tool would be preferable so that incentives don't get skewed by for-profit motives.

I would also prefer if the payments didn't go through a single company. Paying developers through GitHub Sponsors, Patreon, Flattr, or whatever their preferred mechanism is.

alecthomas··on Professional maintainers: a wake-up call
You should set up GitHub Sponsors if you haven't already.
alecthomas··on Professional maintainers: a wake-up call
I maintain a lot of open source projects, but IMO this is not the right approach. I think the [anecdote from @jbk](https://news.ycombinator.com/item?id=29524103) about ffmpeg illustrates that.

I also don't think the problem it solves gives the greatest benefit for the amount of work required. I think making it easier for companies to pay open source contributors is the right approach. For any company that builds software, finding and paying the open source projects they use is a massive amount of work and there's nothing that helps with that. If there was much less friction to paying maintainers, more companies would do it.

I would love to see a tool that, given a pool of money, will collect dependencies from projects in any language (extensible), find the authors (git commit history, etc.), find where they accept contributions (extensible), and pay them, based on both computed and hand crafted weights.

alecthomas··on Statement from Mark Zuckerberg
It's more nuanced than this. You can watch her full testimony here if you're actually interested: https://www.youtube.com/watch?v=GOnpVQnv5Cw
alecthomas··on FCC plans to rein in “gateway” carriers that bring foreign robocalls to US
I'm surprised some enterprising lawyer hasn't initiated a class action lawsuit against the telco's on behalf of those who have been scammed as a result of their inaction.
alecthomas··on Effective Go
Assuming the parent is being genuine in asking for help, I don't think is a very constructive response.
alecthomas··on Effective Go
Others have recommended Advanced Testing With Go [1]. I haven't personally watched it, but Mitchell Hashimoto writes clean code.

But if you'd like I'd be happy to take a look at some of the problems you're encountering. I'm @alecthomas on the Gophers Slack or Twitter, feel free to DM me. No guarantees, but it sounds very unusual for an additional test to consume 15 minutes of setup.

[1] https://www.youtube.com/watch?v=8hQG7QlcLBk

alecthomas··on Effective Go
It does. It sounds like the parent has had an unfortunate interaction with a bad codebase, because that is not accurate at all.
alecthomas··on How to make $80k per month on the Apple App Store (2017)
I just did a quick search for "Virus Scanner" and this was in the first 10 results:

https://apps.apple.com/au/app/phone-protection/id1282949977

Pretty clearly fake reviews, what it provides seems like a complete scam, in app subscriptions - ticks all the boxes from that article!

Four years on and it's still happening. Pretty incredible. Apple largely justifies its 30% cut as providing a curated experience, which is hard to reconcile with this reality.

alecthomas··on Error stack traces in Go with x/xerror
One extra tip when wrapping error return values is to use the wrapcheck (https://golangci-lint.run/usage/linters/#wrapcheck) linter. This will tell you when you're returning an error without wrapping it.
alecthomas··on Tesla launches its Full Self-Driving subscription package for $199 per month
I guess the key word that lets them get away with it here is "Capability".
alecthomas··on A new ProtoBuf generator for Go
Oh huh, interesting, I've never seen that done before.

I'm struggling to understand what the rationale _for_ doing it is though. Maybe it's to avoid an import cycle?

alecthomas··on A new ProtoBuf generator for Go
I haven't looked in more detail, but one blocker is that `ProtoMethods() *methods` returns a private type, making it effectively unimplementable outside this package.
alecthomas··on How M1 Macs feel faster than Intel models: it’s about QoS
As the sibling comment mentions, if you're running Intel JDK on M1 it will be slow. You can find M1 native JDK builds here: https://www.azul.com/downloads/?version=java-11-lts&os=macos...
alecthomas··on My Experience at Apple
Seems to have been removed. Archive link: https://web.archive.org/web/20210102041634/https://ex-apple-...
alecthomas··on HomePod Mini
My previous Apple TV (pre 4K) bricked itself twice. I got a refund after the second time.
alecthomas··on iPhone 12 and iPhone 12 Pro
Same here, and my wife. That was one of my most infuriating phone experiences. The 6S was working perfectly fine then after some update it was basically useless. This was around the time of the underclocking debacle.
alecthomas··on What is the best dumb TV?
This one? https://jvctv.com.au/product/58-4k-uhd-led-tv/

No mention of "Android" or "Smart", but it does do DVR of some sort, so it's not 100% clear.

alecthomas··on Kitty – A fast, featureful, GPU based terminal emulator
I just add the following to my kitty.conf and have never had any issues with TERM:

    term xterm-256color
alecthomas··on The database I wish I had
Alas https://github.com/attic-labs/noms#status :(

> Status > Nobody is working on this right now. You shouldn't rely on it unless you're willing to take over development yourself.

alecthomas··on Google: Open Letter to Australians
Your response is unrelated to what I was disagreeing with.

My underlying argument is that a strong free press must be maintained and that the reductionist argument that legitimate news sources and JoeRandomYouTuber should be treated identically is naive at best.

> Instead it goes directly to the big publishers who cut journalists while increasing the salary of people like Andrew Bolt (who is so far removed from a journalist it is objectionable).

The relationship between the rise of populist/sensationalist media and that of the Internet/social media/Google is inextricably linked. Traditional news sources found their revenue declining and so chased whatever attracted consumers, including sensationalist cretins like Bolt. Google should accept responsibility for this.

To be clear, I'm not arguing that the ACCC's proposal is the perfect solution to the underlying problem, but the status quo does need to change. At least they're doing something.

alecthomas··on Google: Open Letter to Australians
> On the Open Web, ABC News should get the exact same treatment at JoeBloggsYT2020.

I legitimately don't understand this point of view. Original reporting of the kind that keeps politicians and corporations in line costs money; investigative journalists aren't cheap. What YouTuber gives you this kind of depth? Will the world be a better place without the Fourth Estate?

alecthomas··on Go vs. Rust: Writing a CLI Tool
Yes, though unlike Rust they use reflection: https://github.com/alecthomas/kong (my own)
← PreviousPage 3 of 7Next →