HNHacker News
TopNewBestAskShowJobs

akshayshah

636 karma · joined March 16, 2012

https://akshayshah.org
submissionscomments
akshayshah··on Show HN: Rill – Composable concurrency toolkit for Go
The "map" under discussion here is very different from sync.Map. The discussion here is focused on the "map" primitive from functional programming - transforming a collection by applying a function to each element.

sync.Map is a concurrency-safe hash map. Same name, totally different thing.

akshayshah··on Dear sir, you have built a compiler (2022)
I enjoyed the article, but the unintentional Easter egg at the end left me in stitches: the link to “If Architects had to work like Programmers” just 404s, which feels spot on.
akshayshah··on Google Cloud region in Germany suffers 12 hour outage
> Customers lost access to virtual machines and disks in the availability zone. The other two zones in the region were less affected, with Google reporting less than one percent of operations experiencing internal errors.

Contrary to the article's title, it looks like this was a zonal rather than regional outage.

GCP incident report (also linked in the article): https://status.cloud.google.com/incidents/e3yQSE1ysCGjCVEn2q...

akshayshah··on After 6 years, I'm over GraphQL
In places I've seen this used, front-end developers can run any query in development environments. In production (and sometimes staging) environments, queries must be allowlisted.

This gives the front-end developers lots of flexibility when initially developing new screens and components. Once the UI is ready to ship, the backend team checks to make sure that performance is acceptable (optimizing if necessary), allowlists the new query/queries, and ships to production.

akshayshah··on After 6 years, I'm over GraphQL
https://connectrpc.com

We just joined the CNCF, too!

akshayshah··on HAProxy 3.0 Released
I’m intrigued by the support for CBOR log output: I haven’t seen CBOR support built into any other widely-used infrastructure software before. Is HAProxy unusual in this regard, or am I just unaware of CBOR support elsewhere?
akshayshah··on Protobuf Editions are here: don't panic
Per multiple sources, including the team currently maintaining the Protobuf toolchain within Google, proto3 was largely designed by Rob Pike. Of course the Protobuf wire format is quite a bit older, but some aspects of proto3 and Go's shared semantics (like implicit zero values) do seem to have come from the same mind.
akshayshah··on Dehydrated: Letsencrypt/acme client implemented as a shell-script
Apparently the author recently sold the project to a company called apilayer: https://lukas.im/2020/01/30/selling-dehydrated/index.html

They plan to keep the project open source and employ Lukas to continue maintaining it.

akshayshah··on A company that sells lost airplane luggage
Luggage is fairly expensive and easy to reuse - sizing isn’t personal, and most designs are fairly bland. I’m surprised that the bags themselves aren’t a substantial source of income.
akshayshah··on C and C++ prioritize performance over correctness
Expanding this for those not familiar with Go's history: Ken Thompson, formerly of Bell Labs and co-creator of B and Unix, was deeply involved in Go's early days. Rob Pike, also ex-Bell Labs, was also one of Go's principal designers.

I can't find a source now, but I believe Rob described Russ Cox as "the only programmer I've met as gifted as Ken." High praise indeed.

akshayshah··on Go 1.21 Released
Zap author here :) Logrus remains quite a bit more popular than zap. (Does anyone remember the epic tire fire when Sirupsen briefly changed the casing of his GitHub username?)

From my perspective, the problem with the KeyValuePairs API is that it’s inescapably slow and allocation-heavy. I’m glad that a logging API built into the standard library is usable in more performance-sensitive contexts. It’s easy enough to wrap it up in a KeyValuePairs-style API if you’d prefer that, and you’ll now have the ability to unwrap your logger and interop with other libraries that expect the standard slog interface.

akshayshah··on Istio moved to CNCF Graduation stage
I've never encountered a proxy that can't do the portions of TLS 1.3 that gRPC requires - NGINX, Envoy, linkerd, all the managed cloud offerings I know of, and any random Go binary can handle it. What esoteric portions of the spec are you referring to?

gRPC _does_ require support for HTTP trailers, which aren't used much elsewhere. If you want to use streaming RPCs, you also need a proxy that doesn't buffer (or allows you to disable buffering).

akshayshah··on Istio moved to CNCF Graduation stage
It's maintained by James Newton-King, so it's in the hands of .NET royalty :)

Unlike the other gRPC implementations, it's also taken seriously by MSFT's entire developer division. MSFT contributed a bunch of performance improvements to the protobuf runtime and generated code for .NET, the Kestrel webserver team runs gRPC benchmarks, and support for gRPC-Web is baked right into the core frameworks. From a user perspective, it's clear that someone cares about how all the pieces fit together.

akshayshah··on Istio moved to CNCF Graduation stage
gRPC had a graduation application open for 3 years. It was rejected very recently: https://github.com/cncf/toc/pull/300.

Reading between the lines, it sounds like the main problem is Google's tight control over the project. Apple contributes to the Swift implementation and MSFT drives the native .NET implementation, but there's little non-Google input in decision-making for Go, Java, C++ core, or any of the implementations that wrap core.

More subjectively, I'm impressed by the CNCF's willingness to stick to their stated graduation criteria. gRPC is widely used (even among other CNCF projects), and comes from the company that organized the CNCF - there must have been a lot of pressure to rubber-stamp the application.

akshayshah··on Ask HN: What books helped you in your entrepreneurship journey?
Disciplined Entrepreneurship, by Bill Aulet. A very condensed video version is available at https://www.youtube.com/watch?v=GtWexnfPhKk.
akshayshah··on Shfmt – format shell programs
At a previous job, my team slowly built an absolutely unmanageable bash script (hundreds of lines, including _many_ complex, multi-line jq incantations). The first step in migrating that script to go was to embed it in a Go binary and run it with gosh.

Kudos to Daniel for building such a wonderful package.

akshayshah··on Helios, HashiCorp’s New Design System
I’m surprised by the choice of Ember.js. Are many organizations choosing Ember for new projects these days?

React now seems like the conservative choice, with early adopters maybe using Svelte; I haven’t heard much about Ember in years. I’m not a web developer, though :)

akshayshah··on The End of High-School English
In some sense, yes - evaluation in high school math, physics, and similar quantitative fields has been reduced to proctored problem sets. Even in so-called advanced classes, this has come at a cost. Evaluations rarely assess creativity, independent reasoning, or even a non-trivial proof - because every problem must be part of a strictly time-limited problem set, with no space for real challenge or even a few hours of thought.

To date, writing has evaded this trap. Sure, students write short essays during timed exams, but they also wrestle with more complex ideas and topics in longer assignments. Those assignments often take days, or even weeks, to do well.

I’m not sure what the future of those longer assignments is. I’m a bit disturbed by the idea that reading widely, thinking deeply, and distilling a few pages of coherent thoughts may not be an important part of early education. (Schools don’t always teach this well today, but at least we expect them to try.)

akshayshah··on Technical Blogs You Recommend?
Love Dan Luu’s writing: https://danluu.com/
akshayshah··on Go Style
https://github.com/uber-go/guide/blob/master/style.md
akshayshah··on Apache AGE, a PostgreSQL extension with graph database functionality
As long as comments are a tree, there’s only one path from the root (the post) to an individual comment. How would a recursive CTE perform better than a prefix scan on an indexed string column?

Storing a pointer to each node’s parent or using sorted sets seems like it would make the parent poster’s query slower. Those approaches would make it easier to reparent comments, though, and they’d support arbitrarily deep trees (whereas the materialized path implementations I’ve seen limit path length).

akshayshah··on The Protobuf Language Specification
> But there's no reason you'd ever do the inverse, pushing protobuf schemas around with no intent to handle the wire format.

You could be writing a linter, a formatter, an implementation of the Language Server Protocol, a compiler that's not protoc, a way to apply semantic patches to large numbers of Protobuf schemas, or any number of other useful tools. There's clearly at least some demand for tools like this - partial implementations of most of these exist, often with some corporate backing.

Unless you're implementing a Protobuf runtime (google.golang.org/protobuf in Go, upb for Python, etc.), your experience seems unusual to me - most developers I've encountered read and write the wire format using one of the existing runtimes.

That said, it does sound like a lot of fun - especially if it's in lisp!

akshayshah··on Benefits of ‘looping’ kids with teachers for multiple years
Typically, schools that loop do so in fixed-size windows (often 2 years, so K/1, 2/3, etc). Often, teachers for the looped grades plan curriculum together. This tends to minimize the effects of unfamiliar subject matter and the kids' changing social/emotional maturity.

(Source: I helped to start and taught at a charter school in the early 00's. For better and for worse, that school grew into a fairly large charter management organization. Classroom management - which boiled down to convincing a lot of very jaded kids that we actually cared about them - took months at the beginning of each year, and no substantive academic work was possible during that time. Looping in two-year windows struck a good balance between amortizing that cost and preserving teacher expertise.)

akshayshah··on The Protobuf Language Specification
Apache 2.0: https://github.com/bufbuild/protobuf.com/blob/main/LICENSE
akshayshah··on The Protobuf Language Specification
The wire format is fairly straightforward if you've seen a few binary encodings. The language used to write the schemas isn't quite as simple and regular as you might hope, though.

> Maybe you mean something besides the wire format. In that case, good luck, because that shit ain't protobuf.

Naming's hard :) Being really pedantic, I think even Google calls the schema description language "Protocol Buffers" and uses phrases like "the Protobuf binary format" or "the Protocol Buffer wire format" to refer to the wire format. Colloquially, it's never confused me to just use "Protobuf" for both.

akshayshah··on An odd discovery on Spotify
Only loosely related, but Robin Sloan also wrote a truly excellent article about using neural nets to produce music: https://www.mcdbooks.com/features/sourdough

In his book Sourdough, he spends quite a while describing the music of the Mazg - a fictional group of European migrants. For the audiobook version of Sourdough, he trains a SampleRNN model on a particular genre of Croatian music, then has the model produce Mazg music. The description of machine learning is vivid and approachable, and the audio clips are fantastic.

akshayshah··on Why does gRPC insist on trailers?
I understand the points you're raising; I'm saying that gRPC enveloping solves them. Once messages are enveloped, you _do_ have a length field for the entire message.

The article is, IMO, somewhat misleading - it discusses the issue without mentioning gRPC envelopes at all, and it seems pretty clear that envelopes were designed (in part) to address this exact issue.

akshayshah··on Why does gRPC insist on trailers?
That's true of CORBA, for sure. I'm not familiar with ONC-RPC or Java RMI.

It's not true of gRPC. It's not "RPC" in any traditional sense - it's just a particular HTTP convention, and the clients reflect that. They're asynchronous, make deadlines and transport errors first-class concepts, and make it easy to work with HTTP headers (and trailers, as the article explains). Calling a gRPC API with a generated client often doesn't feel too different from using a client library for a REST API.

It's definitely a verb-oriented style, as opposed to REST's noun orientation. That's sometimes a plus, and sometimes a minus; it's the same "Kingdom of Nouns" debate [0] that's been going on about Java-style OOP for years.

0: http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom...

akshayshah··on Why does gRPC insist on trailers?
Is decoding performance typically a problem for web UIs? The lackluster performance of binary protobuf decoding in browsers (and unmarshaling BigInts from JSON) seems much less problematic than (1) using a 200 for unary error responses, (2) choosing a wire format that's _always_ opaque to the network inspector tab, and (3) having really poor generated code.

> It didn't seem like the gRPC folks understood the needs of web developers very well.

Agreed. Being fair to the team that designed the protocol, though, it seems like browsers weren't in scope at the time.

akshayshah··on Why does gRPC insist on trailers?
I've spent a fair bit of time working with gRPC, and you're correct - gRPC's length-prefixing makes it easy to detect when individual messages are terminated early. You do still need some way to detect streams that terminate unexpectedly on message boundaries - perhaps you could rely on HTTP/2 EOS bits as evidence of an application-level success, but you need some equivalent of trailers to communicate the details of any errors that occur midway through the response stream anyways.
← PreviousPage 3 of 6Next →