logoalt Hacker News

zozbot234last Sunday at 9:04 PM1 replyview on HN

The "runtime" values of a dependent type system are not quite runtime values either, because the computation is happening at compile time. When you "extract" a program from a dependently-typed to an ordinary programming language that can compile down to a binary, the dependent types are simply erased and replaced with ordinary, non-dependent types; though there may be "magic" casts in the resulting program that can only be proven correct via dependent types.


Replies

wk_endyesterday at 1:30 AM

It's not that simple, right? Because the computation can actually rely on the types, so the types can't always just be erased. The complexity around knowing when the types are going to be erased or not is part of what motivated Idris 2's adoption of quantities.

https://idris2.readthedocs.io/en/latest/updates/updates.html...

show 2 replies