frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Dependent types and how to get rid of them

https://chadnauseam.com/coding/pltd/are-dependent-types-actually-erased
40•pie_flavor•1w ago
Recent and related: Why don't you use dependent types? - https://news.ycombinator.com/item?id=45790827 (116 comments)

Comments

nixpulvis•1h ago
I read the first post and thought someone should at the very least post the lambda cube. This isn't my area of expertise, since I've done very little with dependent types (staying firmly on the left side of the cube), but it outlines some useful categories of type systems here.

https://en.wikipedia.org/wiki/Lambda_cube

azdavis•34m ago
I wrote a small post on that: https://azdavis.net/posts/lambda-cube/

Hope it’s helpful!

nixpulvis•25m ago
Cool that you worked on an implementation of the CoC.

I've been somewhat wanting to go back and revisit ATAPL and read chapter 2 on this subject: https://www.cis.upenn.edu/~bcpierce/attapl/frontmatter.pdf

ChadNauseam•19m ago
That is a good post. I've linked to it from mine!
aatd86•58m ago
I am trying slowly to understand dependent types but the explanation is a bit confusing to me as, I understand the mathematical terminology of a function that may return a type, but... Since function types take a value and return a value, they are by definition in another universe from say morphisms that would take a type and return a type.

The same way, I see a value as a ur-element and types as sets of values. So even if there is syntactic sugar around the value <-> type equivalence, I'd naively think that we could instead define some type morphism and that might be more accurate. The value parameter would merely be declared through a type parameter constrained to be a singleton. The same way a ur-element is not a set but a member of set.

Then the question is representation but that could be left as an optimization. Perhaps that it is already what is done.

Example:

type Nine int = {9} And then the rest is generic functions, parameterizable by 9, or actually, Nine.

So nothing too different from a refinement of int.

Basically, 'value' would be a special constraint on a type parameter in normal parametric polymorphism implementations. There would probably be derived constraint information such as size etc...

But I guess, the same issue of "which refinement types can be defined, while keeping everything decidable" remains as an issue.

Also how to handle runtime values? That will require type assertions, just like union types? Or is it only a compile time concept and there is no runtime instantiations. Only some kind of const generics?

A typeof function could be an example of dependent type though? Even at runtime?

Just wondering...

pinkmuffinere•30m ago
Hi aatd86! We had a different thread about existence a couple days ago, and I'm just curious -- is English your second language? What's your first language? I'm guessing French, or something from Central Europe.

Thanks for humoring me!

anon291•7m ago
Functions that return types are indeed at a higher level than those that don't.

Values can be seen as Singleton types. The key difference is the universe they live in. In the universe of types, the level one level below is perceived as a value. Similarly, in the universe of kinds, types appear to be values.

> Basically, 'value' would be a special constraint on a type parameter in normal parametric polymorphism implementations

Yes this is a level constraint.

> But I guess, the same issue of "which refinement types can be defined, while keeping everything decidable" remains as an issue.

If you're dealing with fully computable types. Nothing is decidable.

> Also how to handle runtime values? That will require type assertions, just like union types? Or is it only a compile time concept and there is no runtime instantiations. Only some kind of const generics?

A compiler with dependent types is essentially producing programs that are itself embedded with its input. There cannot be a distinction between runtime and compel time. Because in general type checking requires you to be able to run a program. The compilation essentially becomes deciding which parts you want to evaluate and which parts you want to defer until later.

> A typeof function could be an example of dependent type though? Even at runtime?

Typeof is just const.

Typeof: (T : type) -> (x:T) -> Type

jesse__•22m ago
Off the topic of dependent types, but this is way too hilarious to pass up..

> Imagine if pickType did a network request to a server and then returned whatever type the server said. Sounds like a bad idea!

Fucking .. isn't this what LSPs are?! Finally something functional programming people and I can agree on. That does sound like a bad idea.

ChadNauseam•14m ago
I think it's a bit apples and oranges. I was suggesting that compilation itself should probably not involve nondeterministic network requests. If I understand LSP correctly, it only uses network requests to allow your editor to communicate with a binary that provides type information. But the compiler behavior is unchanged. Honestly LSPs seem pretty reasonable to me.
jesse__•9m ago
What's the fundamental difference between a syntax highlighter and the frontend of a compiler? I would argue not much, apart from the fact that people are willing to have their syntax highlighter randomly explode, but are much more concerned about their compiler randomly exploding.

High-performance 2D graphics rendering on the CPU using sparse strips [pdf]

https://github.com/LaurenzV/master-thesis/blob/main/main.pdf
96•PaulHoule•2h ago•11 comments

Unexpected things that are people

https://bengoldhaber.substack.com/p/unexpected-things-that-are-people
416•lindowe•8h ago•210 comments

Writing your own BEAM

https://martin.janiczek.cz/2025/11/09/writing-your-own-beam.html
129•cbzbc•1d ago•21 comments

Spatial intelligence is AI’s next frontier

https://drfeifei.substack.com/p/from-words-to-worlds-spatial-intelligence
97•mkirchner•3h ago•56 comments

The lazy Git UI you didn't know you need

https://www.bwplotka.dev/2025/lazygit/
198•linhns•6h ago•79 comments

Dependent types and how to get rid of them

https://chadnauseam.com/coding/pltd/are-dependent-types-actually-erased
40•pie_flavor•1w ago•10 comments

Zeroing in on Zero-Point Motion Inside a Crystal

https://physics.aps.org/articles/v18/178
30•lc0_stein•3h ago•1 comments

Using Generative AI in Content Production

https://partnerhelp.netflixstudios.com/hc/en-us/articles/43393929218323-Using-Generative-AI-in-Co...
74•CaRDiaK•5h ago•41 comments

Unix v4 Tape Found

https://discuss.systems/@ricci/115504720054699983
133•greatquux•4d ago•16 comments

Error ABI

https://matklad.github.io/2025/11/09/error-ABI.html
64•todsacerdoti•22h ago•22 comments

The Physics of News, Rumors, and Opinions

https://arxiv.org/abs/2510.15053
10•Anon84•6d ago•0 comments

Rademacher Complexity and Models of Group Competition

https://www.symmetrybroken.com/group-selection/
3•riemannzeta•29m ago•0 comments

Launch HN: Hypercubic (YC F25) – AI for COBOL and Mainframes

73•sai18•8h ago•46 comments

Building a high-performance ticketing system with TigerBeetle

https://renerocks.ai/blog/2025-11-02--tigerfans/
74•jorangreef•3d ago•10 comments

Linux in a Pixel Shader – A RISC-V Emulator for VRChat

https://blog.pimaker.at/texts/rvc1/
30•rbanffy•2h ago•7 comments

Omnilingual ASR: Advancing automatic speech recognition for 1600 languages

https://ai.meta.com/blog/omnilingual-asr-advancing-automatic-speech-recognition/?_fb_noscript=1
63•jean-•6h ago•16 comments

Benchmarking leading AI agents against Google reCAPTCHA v2

https://research.roundtable.ai/captcha-benchmarking/
90•mdahardy•7h ago•66 comments

Head in the Zed Cloud

https://maxdeviant.com/posts/2025/head-in-the-zed-cloud/
53•todsacerdoti•10h ago•13 comments

Registered OAuth Parameters

https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#parameters
34•mooreds•6d ago•6 comments

Sysgpu – Experimental descendant of WebGPU written in Zig

https://github.com/hexops-graveyard/mach-sysgpu
12•coffeeaddict1•3h ago•1 comments

What Caused Performance Issues in My Tiny RPG

https://jslegenddev.substack.com/p/what-caused-performance-issues-in
6•ibobev•1h ago•1 comments

Redmond, WA, turns off Flock Safety cameras after ICE arrests

https://www.seattletimes.com/seattle-news/law-justice/redmond-turns-off-flock-safety-cameras-afte...
241•dredmorbius•6h ago•241 comments

Canadian military will rely on public servants to boost its ranks by 300k

https://ottawacitizen.com/public-service/defence-watch/canadian-military-public-servants
75•Teever•7h ago•197 comments

3D Heterogeneous Integration Powers New DARPA Fab

https://spectrum.ieee.org/3d-heterogeneous-integration
14•rbanffy•2h ago•0 comments

Pose Animator – An open source tool to bring SVG characters to life (2020)

https://blog.tensorflow.org/2020/05/pose-animator-open-source-tool-to-bring-svg-characters-to-lif...
132•jerlendds•6d ago•14 comments

Cybersecurity breach at Congressional Budget Office remains a live threat

https://www.politico.com/live-updates/2025/11/10/congress/cbo-still-under-threat-00644930
33•mooreds•2h ago•4 comments

Show HN: Davia – Open source visual, editable wiki from your codebase

https://github.com/davialabs/davia
21•ruben-davia•3h ago•1 comments

LLMs are steroids for your Dunning-Kruger

https://bytesauna.com/post/dunning-kruger
307•gridentio•9h ago•245 comments

Time to start de-Appling

https://heatherburns.tech/2025/11/10/time-to-start-de-appling/
285•msangi•9h ago•207 comments

Interesting SPI Routing with iCE40 FPGAs

https://danielmangum.com/posts/spi-routing-ice40-fpga/
93•hasheddan•10h ago•7 comments