HNHacker News
TopNewBestAskShowJobs

mrkeen

5,995 karma · joined February 13, 2017

submissionscomments
mrkeen··on Why isn't mutable a subtype of immutable, or vice versa?
An immutable object is a special kind of mutated object, which when mutated does what exactly?
mrkeen··on Bend 2 and the Vibe-Coding Trap
To clarify, It looks like Haskell got better string types around 20 years ago.
mrkeen··on Vinix – A modern operating system written in V
For a longer read:

https://justinas.org/the-bizarre-world-of-v

mrkeen··on Anecdotally, programmers dislike "reduce"
No, the sum of the first ten natural numbers is always 55. It is not "initialised" to some other number beforehand.
mrkeen··on Anecdotally, programmers dislike "reduce"
Nah. It involves multiple passes and setting the answer to the wrong value before (hopefully) setting it to the right value.

Plus it forces you out of whatever lazy/streaming paradigm you had going on. If your foldr produces a list, downstream can start consuming it in constant memory as long as you let it do its thing.

mrkeen··on Anecdotally, programmers dislike "reduce"
It's pairwise, not global reasoning.
mrkeen··on Java 27
I don't think I can recall a time where I routed-around-the-damage on the basis of a particular typed exception.

As soon as you consider retrying a network failure, you immediately need to start thinking about distributed systems failures, idempotency, and all that good stuff.

As soon as you start thinking about the above, it becomes immediately obvious that low-level calls should not be able to decide to re-run themselves.

mrkeen··on Java 27
The standard library writers can go first.
mrkeen··on A few good ideas in programming languages
Same rationale as flow valuing. Some people like values being reassigned, and some people like types being reassigned.

You might be reading too much into the union example. The checker just doesn't know if the middle block ran, so maybe it remained an int, or maybe it became a string.

mrkeen··on A few good ideas in programming languages
Yep, this sounds like conflating two different ideas about SSA.

You could parse a source language with shadowed variables into an AST, and then one of your earliest AST transforms could be a 'de-shadowing' pass. The resulting AST would only see variables assigned only once.

Then a type-inference pass, where your AST expressions would gain type info.

(Then a bunch more passes, e.g. closure conversion if you have them)

Then towards the end you could lower your typed AST into a typed instruction list (having the SSA property - but nothing to do with allowing variables and their types to shadow earlier in the pipeline)

mrkeen··on A few good ideas in programming languages
Ok. More thoughts.

I was trying to see what was special about Crystal in this regard.

It seems like if you took any ML or Haskell-like, you'd have type inference.

Then you could allow shadowing (Rust-style) meaning the same symbol in the source code would be one variable now, and a different variable later.

Then your compiler would need to distinguish x into x1 and x2 so it could track them separately.

So yeah, kind of an SSA I guess!

mrkeen··on A few good ideas in programming languages
No. Type systems are unrelated to abstract machines which are unrelated to usability.

Type inference/checking happens early in the pipeline.

SSA is a way of laying out assembly instructions for an abstract machine. I say abstract because real machines re-assign values to the same addresses over time (which is precisely what 'single' static assignment prescribes against). Once you know which registers your real machine has (and instructions), you could take your SSA and turn it into real assembly.

Also, "single-pass SSA"? Not to be too pedantic, but SSA is the destination, not the journey. You could take a single pass to transform from some expressions or statements into SSA, or perhaps from SSA into something else. What's the paper?

mrkeen··on A Design Space Exploration of Async/Await
The solution to this is assume an async spine to your program, and branch off to as much sync code as possible. It's the same lesson you learn wrangling the IO monad in Haskell, or dependencies (like databases) in OO-land.
mrkeen··on Houthis 'take control' of key island in global shipping route
I started reading from the first sentence
mrkeen··on Houthis 'take control' of key island in global shipping route
He won. The only thing sinking him is a term limit.
mrkeen··on Houthis 'take control' of key island in global shipping route
Like I said, I got curious to see what they've been up to. Links would have been better.
mrkeen··on Houthis 'take control' of key island in global shipping route
It got me curious, so I took a look at what Iran has been up to.

https://www.aljazeera.com/news/2026/1/13/a-timeline-of-crise...

It doesn't look like foreign conquest is part of their MO.

mrkeen··on Version control second coming
> If only 2 years ago somebody said GitHub would be no longer relevant soon, nobody would believe them. GitHub was the undisputed leader in repository hosting [..]

> GitHub has done too many great things over the years, so I hope it remains, but there is obviously an earthquake going on.

Is the 'earthquake' referring to the frequent outages over the last couple of years, and if so are those outages because Microsoft can't keep up with the demand?

It's closer to 'too relevant' than it is to 'no longer relevant'.

mrkeen··on Copyright does more harm than good and should be abolished
And by my work, you are of course talking about Harry Potter.
mrkeen··on Copyright does more harm than good and should be abolished
Good for them. They can sell not-your-work, and you can sell your work.
mrkeen··on Copyright does more harm than good and should be abolished
What's the most generous, charitable definition of an alternative?
mrkeen··on C*: Unifying Programming and Verification in C (2025)
Found another one:

https://www.cs.columbia.edu/~sedwards/classes/2021/4115-fall...

https://github.com/kkysen/cstar

And to sibling comments: I care. Non-mainstream languages are talking points. I don't want to get 15 minutes into a "you should have effects like Koka" argument and then find out the other person is talking about a different Koka.

mrkeen··on Visualizing Rust's Vtables: How dyn Trait Works In Memory
I'm not a C++er, but I sorely miss this is nearly every non-Haskell language.

I have a type capable of some behavior, e.g ToString. I also want to write general code operating on such objects (highlighting, obfuscating passwords, escaping, etc.).

But I have zero desire to throw away its static type information. If it gets stored in an Escaped<T>, the compiler ought to know T is still my type.

mrkeen··on Cloud in a Bottle: making self-hosting accessible to everyone
It's evidence of bad abstraction if you need everyone else to make changes and couple themselves directly to you.

If for some reason your services can't speak an already common language, I think it's on you to add those shims into your own project.

mrkeen··on Write Software in Latin (2025) [video]
C already has vel and aut operators, but now we can name them as such!
mrkeen··on Static Allocation, Constant Work
The article shows how to have a fixed array of maybe-null orders.

It doesn't show how to place, cancel, or execute an order.

It's even worse than just leaving this core functionality as an exercise for the reader. Because the first thing the reader would do is try to track the null/non-null orders, which the article says not to do.

mrkeen··on Static Allocation, Constant Work
> TigerStyle: All memory must be statically allocated at startup. No memory may be dynamically allocated (or freed and reallocated) after initialization. This avoids unpredictable behavior that can significantly affect performance, and avoids use-after-free.

Maybe maintaining an array of NULL-orders satisfies the letter of the "no dynamic allocation" law, but I'm not convinced it satisfies the spirit.

Haven't you just written a buffer of NULL-orders, which you proceed to loan out to callers (i.e. "allocate" and "reallocate"?).

Someone else's battle-hardened allocator might be slow or buggy, so you write your own as part of the business logic implementation?

mrkeen··on Why OOP Exists
Well did you learn proper computer science or did you learn plain wrong computer science?
mrkeen··on Why OOP Exists
Don't forget to define OOP before requiring it!
mrkeen··on Why OOP Exists
Admittedly I read this pretty quickly, but this is just structs.

The "behaviours" being modelled here were data access. Writing .name() instead of .name.

You can save yourself the time of manually packing these structs by writing out a constructor in full. Which the article called "automatic".

(You don't even need to write out the constructor for a struct in C99. Probably any other modern language too)

← PreviousPage 3 of 34Next →