HNHacker News
TopNewBestAskShowJobs

amw-zero

1,249 karma · joined June 27, 2016

submissionscomments
amw-zero··on Ruby “Thread Contention” Is Simply GVL Queuing
Your whole system is a queue. Requests come in, are processed, and some output is given.

Algorithmic complexity affects the processing time of each request / task. Knowing the latency distribution is crucial in understanding the queueing characteristics of the system, and the algorithmic complexity will greatly affect that distribution.

amw-zero··on Ruby “Thread Contention” Is Simply GVL Queuing
A queue is:

* An arrival rate of requests * A processing time for each request * A corresponding queue length when a new request comes in before the current one is done being processed.

So anything that affects processing time affects queueing. Cache hit rates, data packing, etc., all affect processing time, but processing time is in the context of a queue.

amw-zero··on Ruby “Thread Contention” Is Simply GVL Queuing
Loved this writeup, because queues are the most important and general concept in reasoning about performance. When you realize this, you start seeing them everywhere. Locks, async IO... everything is just interacting queues.
amw-zero··on Ruby “Thread Contention” Is Simply GVL Queuing
Yes, but I think it's a revelation to many people that things like this map to queueing. Literally _everything_ related to performance is queueing, but we use different words for different scenarios, like "contention."
amw-zero··on Ruby “Thread Contention” Is Simply GVL Queuing
It's the most "enjoyable" language to write in my opinion. I totally agree. I wish I got to use it more at work, now it's all Go and Python.
amw-zero··on I Wrote a WebAssembly VM in C
This is an opportunity to learn. The way WebAssembly is defined is the standard way PL semantics are defined.
amw-zero··on I Wrote a WebAssembly VM in C
I think it's much better to just learn how to read inference rules. They're actually quite simple, and are used ubiquitously to define PL semantics definitions.

Constraining this on "that's not an option" is a big waste of time - learning this will open up all of the literature written on the subject.

amw-zero··on Property-Based Testing for the People
> Users care quite a lot when these things break.

Users care when their expected behavior breaks. They certainly do not care why it broke, or _where_ it broke. Most users don't know what a database is.

> If I go down my recent list of bugs and categorize them, ~8 out of 10 of them are in areas which the author would have abstracted away.

Even though the model is abstract, all of the behavior of the implementation is covered in a model-based test. For example, let's say a SQL query is what's broken for some use case. This query would be exercised in the test, and it wouldn't pass until the query is fixed. That's the main reason I prefer model-based integration tests - there are no such bugs that escape.

Also, I still write targeted tests. There's nothing that prevents you from doing that, and it absolutely is useful in many cases. I just believe that most tests should be generated, and hand-written tests should be the minority.

amw-zero··on Property-Based Testing for the People
For "business applications," I much prefer the variant of property testing called model-based testing. This is where your property is "does the implementation behave like some simplified model." This is the correct way to test such applications in my opinion, because users don't care about "custom widgets," "queues," or "databases." They care about business functionality, which is quite easily expressible in model form.

I don't do much mocking either, because I also prefer integration tests for these types of applications. Here is an example that tests against a database, all the way up to the state management layer of the UI: https://concerningquality.com/model-based-testing/.

In fairness, people don't write about doing this a lot. PBT literature seems to revolve around sorting functions or binary tree operations. But PBT much more powerful than just that.

amw-zero··on OpenAI, Google and Anthropic are struggling to build more advanced AI
We might not have exhausted their applications, but everything I’ve witnessed them being used for has been extremely disappointing.

That is, other than me using them to bounce ideas off of and create small snippets of code.

amw-zero··on Modelling the archetype of a message-passing bug with TLA+ (2022)
There’s a few different perspectives on this. One is, there isn’t much of a need to verify the implementation once you’ve verified an abstract specification. The costliest errors are _design_ mistakes, i.e. high-level errors that could never lead to a satisfactory implementation. Once you figure those issues out, it’s simple to write an implementation that conforms to the spec.

I think there’s actually merit to that perspective if you think about it for a while. However, I have also seen relatively simple behavior be implemented in complex ways, usually due to performance optimizations. In those cases, it’s nontrivial to know if it’s implementing the spec. But the spec can be used to generate test cases in many ways, e.g. http://www.vldb.org/pvldb/vol13/p1346-davis.pdf.

Frankly, I’ve had the most success by not using TLA+ and by instead writing executable models. And then using the model to show the expected values for interesting test cases, and then manually write test cases using those expected values.

amw-zero··on TLA⁺ is more than a DSL for breadth-first search
Quint looks like _exactly_ what I’ve been looking for. It’s all the good parts of TLA+, but with sensible types, and a focus on executability.

I understand that executability makes the language much less _powerful_ in a mathematical sense. But it’s such a benefit in all other ways that I think we should focus on the specification that we can write that are also executable.

amw-zero··on Amazon tells employees to return to office five days a week
I thought they meant that it just wasn’t enough money. Of course there are more important factors to a job than just compensation.
amw-zero··on Amazon tells employees to return to office five days a week
And why is that?
amw-zero··on Rearchitecting Core Services at X
That’s not a hot take. Literally thousands of people have written and said this exact same thing, for years.
amw-zero··on Amazon tells employees to return to office five days a week
Levels.fyi puts L6 at Amazon at over $400k. That’s not worth it?
amw-zero··on Sqlc: Compile SQL to type-safe code
There’s nothing unique about go-jet. Jooq does the same thing for example.
amw-zero··on Why Ed-Tech Startups Don't Scale (2022)
How does this make money? It says it’s free, and I don’t see any ads.
amw-zero··on Electric Clojure v3: Differential Dataflow for UI [video]
Try making comments that are relevant to the article.
amw-zero··on Electric Clojure v3: Differential Dataflow for UI [video]
What I’ve never understood about this approach is that it claims to be “network transparent,” but you need to add client and server annotations. So it’s very much network-aware.
amw-zero··on On the cruelty of really teaching computing science (1988)
LLMs are really, really bad at proofs so far in my experience. Especially proofs in proof assistant since those are machine checked and unable to be faked.
amw-zero··on If we want a shift to walking, we need to prioritize dignity
I also don't understand the obsession
amw-zero··on Hydrothermal explosion at Yellowstone National Park
What a weird thing to care about
amw-zero··on Ask HN: What skillsets/stacks will keep me employable over the next 5-10 years?
Laughably bad advice.

What's the failure rate of startups - 90%? This is less risky than a slightly crowded job market where there's still millions of jobs?

amw-zero··on WebAssembly: A promising technology that is quietly being enshitified
That’s what I’m asking - did the comment mean that the async/await pattern is bad, or that asynchronous programming in general is bad?
amw-zero··on WebAssembly: A promising technology that is quietly being enshitified
What does this even mean, how can you do any form of modern computation without async?
amw-zero··on F* – A Proof-Oriented Programming Language
Code written in F* is running in Firefox, Linux, Windows, and Azure: https://project-everest.github.io/.
amw-zero··on Functional semantics in imperative clothing
This doesn't feel in contrast to what I was saying. You can reason about imperative code, but you have to add things to it to reason about it, most importantly the notion of a memory store. This is because imperative code assumes an underlying CPU + RAM which holds state.

It's not that it's easier, it's that imperative code has implicit state.

amw-zero··on Functional semantics in imperative clothing
I've come to the conclusion that executability and reasoning are separate axes. If we view everything in terms of languages with interpreters, of course functional semantics must be executed by imperative machines. But to reason about either kind of program, we need functional semantics, because functional programming is the language of pure reasoning.

More on the subject: https://concerningquality.com/quality-and-paradigm/

amw-zero··on New Foundations is consistent – a difficult mathematical proof proved using Lean
This is precisely why humans will always be involved with creating software.
← PreviousPage 3 of 22Next →