frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Type systems are leaky abstractions: the case of Map.take!/2

https://dashbit.co/blog/type-systems-are-leaky-abstractions-map-take
17•tosh•4d ago

Comments

mcphage•1h ago
> Unfortunately, this decision completely defeats the purpose of adding a function similar to Map.take!, as the goal of the function is to return a map where we are certain the given keys exist!

I mean, if you define a function calling Map.take! that returns one of two possible set of keys based on a random number, I’m not sure it’s actually possible to get a map where you’re certain what keys exist.

travisgriggs•1h ago
I think his point was any logic branch which branches on any state injected by the world outside of the compilation scope.
travisgriggs•1h ago
“Every institution perishes by an excess of its own first principle.” - Lord Acton

For the reasons explored in the post, I prefer my type systems optional. It has been my experience and observation that typing in languages follow an 90:10 rule. You get 90% of the gains for 10% of the effort. And the remaining 10% for 9x the effort.

I’m rather happy with the way Python allows me to do the easy ones and/or pick the hotspots.

I’ve worked in exhaustively typed languages, and while it gives a sense of safety, it’s literally exhausting. And, anecdotally, I feel I dealt with more zero divides, subscript woops, and other runtime validation errors than I had in less typed languages.

Not that it matters. Soon, we’ll use semantically vague human language, to prompt, cajole, nudge LLM agents to produce programs that are (lossy) statistical approximations of what might be correct programs.

HauntingPin•29m ago
I've worked with both Java and Python extensively. Python's type system is far more exhausting, tbh. You have to think about types in both languages, but at least in Java, the compiler and static analysis can tell you if there are type-related issues. In Python, runtime errors. Anything larger in Python becomes a nightmare to work with because you basically never know for sure what's being passed into a function without excessive type checking and testing.
kace91•18m ago
Every time I've interacted with optional type systems, it feels like I'm driving in a road where only 50% of the drivers follow the rules.

Meaning, it's just as hard as no one following rules, but on top of that I get blindsided by expectations of security.

foxes•56m ago
So if we pretend a list is a function from an index to an entry for the moment ``` Enum.take(list , 2) ``` Is more like ``` Enum.take(list, [1,2]) ``` So if you apply that to a list of length 1 or zero, you just get either list[1], or []

The difference is that Enum is maybe a total function - the domain of the function is always well defined, while Map take is trying to be dressed up as a total function but its really something thats only partial.

So the type system needs a way to describe a map that has "at least these keys" a bit like the enum case. So that requires some polymorphism.

logicprog•54m ago
This seems like a really easy problem to avoid by simply having a better type system and knowing how to use it. namely just have the take! function return an optional map where it returns Some(map) if the map has the expected keys and None if the map it would have returned in the non-asserting version wouldn't have been valid (I.e, wouldn't have had the expected keys). Then if you really want to assert on this, you just use .unwrap or .expect.

Canada's bill C-22 mandates mass metadata surveillance of Canadians

https://www.michaelgeist.ca/2026/03/a-tale-of-two-bills-lawful-access-returns-with-changes-to-war...
261•opengrass•3h ago•71 comments

Chrome DevTools MCP

https://developer.chrome.com/blog/chrome-devtools-mcp-debug-your-browser-session
307•xnx•5h ago•136 comments

The 49MB web page

https://thatshubham.com/blog/news-audit
271•kermatt•5h ago•151 comments

Cannabinoids remove plaque-forming Alzheimer's proteins from brain cells

https://www.salk.edu/news-release/cannabinoids-remove-plaque-forming-alzheimers-proteins-from-bra...
24•anjel•43m ago•6 comments

LLM Architecture Gallery

https://sebastianraschka.com/llm-architecture-gallery/
217•tzury•9h ago•18 comments

//go:fix inline and the source-level inliner

https://go.dev/blog/inliner
108•commotionfever•4d ago•41 comments

A new Bigfoot documentary helps explain our conspiracy-minded era

https://www.msn.com/en-us/news/us/a-new-bigfoot-documentary-helps-explain-our-conspiracy-minded-e...
31•zdw•2h ago•5 comments

Separating the Wayland compositor and window manager

https://isaacfreund.com/blog/river-window-management/
213•dpassens•9h ago•92 comments

Bandit: A 32bit baremetal computer that runs Color Forth [video]

https://www.youtube.com/watch?v=HK0uAKkt0AE
12•surprisetalk•3d ago•1 comments

The Linux Programming Interface as a university course text

https://man7.org/tlpi/academic/index.html
7•teleforce•1h ago•0 comments

What makes Intel Optane stand out (2023)

https://blog.zuthof.nl/2023/06/02/what-makes-intel-optane-stand-out/
172•walterbell•9h ago•113 comments

Nasdaq's Shame

https://keubiko.substack.com/p/nasdaqs-shame
119•imichael•2h ago•25 comments

Glassworm Is Back: A New Wave of Invisible Unicode Attacks Hits Repositories

https://www.aikido.dev/blog/glassworm-returns-unicode-attack-github-npm-vscode
215•robinhouston•11h ago•133 comments

C++26: The Oxford Variadic Comma

https://www.sandordargo.com/blog/2026/03/11/cpp26-oxford-variadic-comma
113•ingve•4d ago•61 comments

Stop Sloppypasta

https://stopsloppypasta.ai/
95•namnnumbr•7h ago•48 comments

Learning athletic humanoid tennis skills from imperfect human motion data

https://zzk273.github.io/LATENT/
119•danielmorozoff•9h ago•24 comments

Bus travel from Lima to Rio de Janeiro

https://kenschutte.com/lima-to-rio-by-bus/
116•ks2048•4d ago•43 comments

In Memoriam: John W. Addison, my PhD advisor

https://billwadge.com/2026/03/15/in-memoriam-john-w-addison-jr-my-phd-advisor/
93•herodotus•9h ago•4 comments

Excel incorrectly assumes that the year 1900 is a leap year

https://learn.microsoft.com/en-us/troubleshoot/microsoft-365-apps/excel/wrongly-assumes-1900-is-l...
36•susam•1h ago•9 comments

LLMs can be exhausting

https://tomjohnell.com/llms-can-be-absolutely-exhausting/
64•tjohnell•4h ago•47 comments

A Visual Introduction to Machine Learning (2015)

https://r2d3.us/visual-intro-to-machine-learning-part-1/
313•vismit2000•14h ago•29 comments

Show HN: Free OpenAI API Access with ChatGPT Account

https://github.com/EvanZhouDev/openai-oauth
22•EvanZhouDev•3h ago•11 comments

Type systems are leaky abstractions: the case of Map.take!/2

https://dashbit.co/blog/type-systems-are-leaky-abstractions-map-take
17•tosh•4d ago•7 comments

Kangina

https://en.wikipedia.org/wiki/Kangina
64•thunderbong•2h ago•4 comments

Show HN: GDSL – 800 line kernel: Lisp subset in 500, C subset in 1300

https://firthemouse.github.io/
58•FirTheMouse•9h ago•13 comments

Show HN: Open-source playground to red-team AI agents with exploits published

https://github.com/fabraix/playground
15•zachdotai•2h ago•2 comments

Ask HN: How is AI-assisted coding going for you professionally?

231•svara•9h ago•388 comments

Hollywood Enters Oscars Weekend in Existential Crisis

https://www.theculturenewspaper.com/hollywood-enters-oscars-weekend-in-existential-crisis/
120•RickJWagner•12h ago•389 comments

Animated 'Firefly' Reboot in Development from Nathan Fillion, 20th TV

https://www.hollywoodreporter.com/tv/tv-news/animated-firefly-reboot-in-development-nathan-fillio...
174•Amorymeltzer•7h ago•47 comments

Show HN: Signet – Autonomous wildfire tracking from satellite and weather data

https://signet.watch
105•mapldx•13h ago•30 comments