HNHacker News
TopNewBestAskShowJobs

mrkeen

5,995 karma · joined February 13, 2017

submissionscomments
mrkeen··on Revolut down as users report app not working

  Revolut, for example, has confirmed all its operations, that include, sign-ups, sign-ins, payments and transfers, top-ups, ATM withdrawals, stock trades, cryptocurrency, are all down.
https://www.neowin.net/news/google-cloud-outage-takes-down-h...
mrkeen··on Revolut down as users report app not working
He suggester that they had both. My question was what to do when they disagree, and he wasn't able to either conceive of the 'two sources of truth problem' or wasn't able to suggest a solution. He pushed back saying: if they disagree then you've got buggy code, and that your job is to not write buggy code. "That's why we test". "For race conditions?" etc. etc.

Who owns the database in your locked example?

mrkeen··on Revolut down as users report app not working
I don't think you can avoid negative balance, without giving up on availability (i.e. moving from AP to CP). And then an outage like TFA takes down your whole system.

You might be assuming that there is only one database, and that all consumers are reliably connected it. So who owns the database: Visa or MasterCard? Because ACID doesn't span across database instances (let alone database vendors or companies).

If you write down that "Bob withdrew $20", that cannot be wrong, (at best it can lack info that you later wish you had).

If you write down "Bob's balance is now $10", you already know the problems with that from your question.

mrkeen··on Revolut down as users report app not working
The interviewer's job (I was briefed beforehand) was to make sure I know my concurrency, because they use a lot of it there.

I have all the patience and time in the world to discuss my ideas.

I had the problems, the solutions, slide decks and a Miro board ready to go.

He wanted to shut down discussion at every turn with nonsense like "so you think no banks work at all?". Sure, I can grin and eat shit, or I can say "banks predate your CRUD operations by just a little bit".

If he had working knowledge on how to represent mutable money amounts in a distributed environment, he didn't let on. I was all ears.

So I pushed back on him, and I'll push back on you:

> even if you were technically correct why would a company hire someone...

Because I'm technically correct.

You're certainly not alone in your appraisal of the situation. The market over here works exactly this way. Correct, reliable systems come a distant second to agreeing with the team.

Technical discussions are incredibly likely to devolve into people discussions.

No people discussion has ever worked it's way back into being about fixing the broken software.

mrkeen··on Revolut down as users report app not working
Interviewed for them this year.

Got into a heated argument where the interviewer insisted it was perfectly acceptable to store money as a mutable row in a database.

I pushed back with the standard "You append transactions (including corrections) to a ledger" but he wasn't convinced.

I whipped out the standard two-ATMs -separated-by-a-distance overdraft example, and how you can create or destroy money that way.

He said it made no sense as an example because it was buggy and you would never release buggy code.

I asked if he'd done bug fixes before (yes) but obviously he was going to keep digging in further.

The irony of it was that he was part of the blockchain team.

mrkeen··on Revolut down as users report app not working
I've been hearing about bitcoin for 15+ years and I don't think I've ever walked into a shop where they accepted it.

So, approximately six 0s of uptime for my use case?

mrkeen··on Parser Combinators
What kind of mapping/unwrapping are you being subjected to with PCs?
mrkeen··on Parser Combinators
Tokenising is actually a strength of PC, it fits the parser structure exactly!

  pToken :: Parser<Bytestring, Token>

  pExpr :: Parser<List<Token>, Expr>
mrkeen··on Parser Combinators
If you use an Either instead of a List, then you can write an or combinator, which accepts two parsers and tries the second if the first fails. It branches on the Left/Right of the Either.

If it's a List, wouldn't you be forced to write the Cartesian product of two parsers instead?

mrkeen··on Parser Combinators
Each parser blindly follows its own rules.

If pDigit saw "123 ", according to TFA's design, it would return (1, "23 ").

If PInt saw the "123 ", it would return (123, " ").

You could approximate pInt in terms of pDigit via:

  PInt = many1 pDigit
(Ignoring negatives, int maxvalue, and many1 implies 1-or-more, not 0-or-more.)

I say "according to TFA's design" because I've been arguing elsewhere that parsers must return Either<Error,(T, Remainder)> not (T, Remainder)

mrkeen··on Parser Combinators
No. The parser code (in a library that everyone depends on) will branch on success/fail internally. It has nothing to branch on if it only sees T, because T may not have a success/fail nature.

You could take a step back and make sure T has a fail case, e.g. T-extends-Either<A, B>, but what is to be gained?

* Firstly, what the hell is A?

* The user would need to type Parsers of T=Cat and T=Dog instead as Parsers of T=Either<Error,Dog> and T=Either<Error,Cat>. If everyone has to do it, pull the common abstraction back into the library itself! Also the caller would receive a successful parse of T=Either and would then need to check to see if it was success(success) or success(fail).

* You also mix abstractions in the same way as newlines in string literals. You could no longer represent a successful parse of a failed Either, since the failed Either would look like a parse error.

mrkeen··on Parser Combinators
No, that was my ironically landed upon definition of partial.

The article used it as in a sub-parser, which is the other thing I objected to. If you add two Integers, you get back an Integer, not a Sum. Same principle here, two parsers make a parser. You don't need to write new code to combine a partial parser with a parser, or vice versa.

mrkeen··on Parser Combinators
Not a good starting type:

  type Parser<T> = (input: string) => [T, string]
This implies that it accepts a string and will return a T. Parsers might return a T.

The article also starts with the concept of a 'partial parser', from which other (non-partial?) parsers can be constructed?

  Or, and this is where the real power of partial parsers comes in: we wrap the chain up as a new parser of its own.
Nope, there's no distinction. If you combine partial parsers, you end up with a partial parser. If you combine full parsers (whatever that means) you end up with full parsers.

(Ironically there is a fitting definition of 'partial' here: the function isn't well defined on all inputs. For some inputs, T is returned, on other inputs, maybe an error is thrown, who knows..)

mrkeen··on Microsoft Teams is a red flag
The last time I was part of a Teams environment (late 2025 or early 2026), search literally did not work.

I could see the keywords right there in the chat, enter them into the search bar, and get back 'no results found'.

(This was across at least a period of months too, not just an intermittent bug)

mrkeen··on Types of types: Haskell's Kind system
"Generic" and "for a particular type" cancel out.

You don't need List<A> to write an IntList, nor do you need + to work on different integers in order to have a particular integer.

mrkeen··on Types of types: Haskell's Kind system
Just to polish that,

ArrayList's kind is type->type

ArrayList<A>'s kind is type.

The A is what plugs into type on the LHS of the arrow, leaving only the RHS remaining.

mrkeen··on Types of types: Haskell's Kind system
> As any problem can be expressed in C, how would what the author did look like in C? KISS

This is C.

  void * bsearch (const void *key, const void *array, size_t count, size_t size, comparison_fn_t compare)
How do you express "the thing you get back has the same type as the thing you're looking for"?
mrkeen··on 11 year old unsoundness bugs found in Rust borrow checker
AFAIK there isn't a language spec. Rustc is the language for now.
mrkeen··on 11 year old unsoundness bugs found in Rust borrow checker
Type systems are hard! Check out https://counterexamples.org/

I gave it a quick scan for Rust examples; there are 11 samples among the following pages:

  https://counterexamples.org/eventually-nothing.html
  https://counterexamples.org/mutable-matching.html
  https://counterexamples.org/selfishness.html
  https://counterexamples.org/scope-escape.html
  https://counterexamples.org/nearly-universal.html
The first thing I always look for is mutability (combined with some other tricky feature), e.g. "Now it's a Just(3):Maybe<Int>, now it's a Nothing:Maybe<Int>, now it's a Nothing:Maybe<String>."

I wonder if TFA's example could be reproduced without mutability.

mrkeen··on Elisha Wiesel: The Death of the Nobel Peace Prize
The IDF doesn't need your optics. They really don't give a shit.

  I have ordered a complete siege on the Gaza Strip. There will be no electricity, no food, no fuel, everything is closed. We are fighting human animals and we are acting accordingly.

  Cited in Defense minister announces ‘complete siege’ of Gaza: No power, food or fuel, The Times of Israel (9 October 2023).
mrkeen··on Clojure in the age of language models
> A bigger problem is the tedious necessity of having to reconstruct the desired state every single run. When you have something small with limited functionality, that is fine, but as your application grows, rebuilding the state can take a significant effort.

This is what tests are for. There should be no buildup of internal state that can't be arrived at with a simple invocation in a unit test.

mrkeen··on The complement of true is true, except when it's false
You have some expectations of the size of the bool (it's simply 1 bit but also 8 bits.)

What expectations do you have of the value?

mrkeen··on Cloudflare K2: serverless event streams
To support the ordered use-case, put events on the same topic-partition. To support the unordered use-case, don't.
mrkeen··on How to speed up the Rust compiler in September 2026
If you built two impls, your compiler wouldn't know which to pick. Or to phrase it differently, if you wanted to be able to choose the right one, it wouldn't be 'orphan impls', it would be 'orphan impls plus some selection mechanism'. E.g. Scala implicits. And once you have Scala implicits, non-orphan impls probably start looking like a pretty sweet alternative!
mrkeen··on Needed 1+1, built a functional programming language
I'm absolutely stuck on your comment that trees are the wrong approach, or that trees are somehow incompatible with precedence. They encode the precedence more explicitly and unambiguously than the original string itself.

Trees being incompatible with precedence is like parentheses being incompatible with precedence.

mrkeen··on Needed 1+1, built a functional programming language
Agree with 'solve it during parsing'.

I had a look at the link. The BNF looked good:

  Expr =
    Expr '+' Expr
    ...
Then the author fixed the left-recursion and precedence (which also looks good,) but then complains about the fixed version - "the “shape” of expressions feels completely lost in this new formulation." :

  Expr =
    Factor
  | Expr '+' Factor
  ...
Then the author takes us through Pratt parsing and ends up at:

  fn expr_bp(lexer: &mut Lexer, min_bp: u8) -> S { 
    let mut lhs = match lexer.next() {
        Token::Atom(it) => S::Atom(it),
        t => panic!("bad token: {:?}", t),
    };

    loop {
        let op = match lexer.peek() {
            Token::Eof => break,
            Token::Op(op) => op,
            t => panic!("bad token: {:?}", t),
        };
    ...
Yikes! I think he criticised the wrong code. I'll take the '{expression} is a {factor} or an {expression plus a factor}' formulation over the 'mut-loop-peek-panic-lexer-next' approach any day!
mrkeen··on The internet discovers TLA+. Now what?
* You define initial states and all possible state transitions.

* It will brute force all states.

* You can add a variety of assertions.

mrkeen··on Go Concurrency Distilled
Closer to mvar. Tvars support full transactional semantics.
mrkeen··on Netherlands bracing for potentially devastating US sanctions against the ICC
You may not have intended it this way, but your top paragraph could easily be repurposed as a talking point for the current administration. What does the I in ICC stand for?
mrkeen··on Brood War Bench
Game programmers have long been the producers of the most impressive applied computer science.

The film Shrek 3 (2007) took 20 million CPU hours of render time. Games push 60 frames a second. For a visual comparison, check Call of Duty world at war (2008).

Also compare to browsers, which can sometimes scroll smoothly through some styled rectangles and text, and consume gigabytes of ram if you have a few tabs open.

Games have directional sound effects and soundtracks. Don't need 800 Spotify engineers to pull that off.

Multiplayer games solve crazy distributed system problems, making it feel like 'now' when players shoot each other, even with historical latencies of 100-200ms.

AI (in terms of LLMs) seems to be a continuation of that. You used to be able to play 7 AIs on 1998 hardware, at a distinctly "non-beginner level".

← PreviousPage 2 of 34Next →