Typechecking is undecidable when 'type' is a type (1989) [pdf]

dspace.mit.edu

79 points by zem 4 days ago


pvillano - 2 days ago

This stack exchange answer talks about the importance of decidability in type checking

https://langdev.stackexchange.com/a/2072

My interpretation

Decidability is of academic interest, and might be a hint if something is feasible.

But there are (1) ways of sidestepping undecidability, e.g. A valid C++/Rust program is one for which the typechecker terminates in x steps without overflowing the stack

And (2) things which are decidable, but physically impossible to calculate, e.g the last digit of the 10^10^10 th prime

What matters is being able to reject all incorrect programs, and accept most human written valid programs

jeberle - a day ago

Does Rice's theorem cover this?

> [ all non-trivial semantic properties of programs are undecidable ]

https://en.wikipedia.org/wiki/Rice's_theorem

Found here:

From Sumatra to Panama, from Babylon to Valhalla

https://www.youtube.com/watch?v=bE1bRbZzQ_k&t=48m27s

Animats - 2 days ago

This sounds close to Russell's "class of all classes" paradox. Is it?

randomNumber7 - 2 days ago

And still this type system could be the base for a very interesting and powerfull programming language imo.

da_chicken - a day ago

This seems strange to me, but it's hours past my bed time and I haven't tried reading lambda calculus or lambda-star calculus theory in about 20 years.

Many programming languages have a variant or object type. In C#, any instance of a class will also say that it is of type System.Object. That does nearly make that a type of all types.

There is some nuance and special cases. Like any null is considered a null instance of any nullable object, but you're also not permitted to ask a null value what type it is. It just is a null. Similarly, C# does differentiate between a class and an instance of a class. Both a class and an instance are of a given type, but a class is not an instance of a class.

Presumably the difference is either in one of those nuances, or else in some other axiomatic assertion in the language design that this paper is not making.

Or else I'm very much missing what the author is driving at, which at this time of the morning seems equally possible.

noosphr - 2 days ago

Type systems aren't magic. They do stop all incorrect programs from running, but also the majority of correct programs too.

moomin - 2 days ago

It feels like this is unsurprising, given we already have Goedel's theorems and halting theorems. Any system of self-describing complexity ends up in this territory.

rerdavies - 2 days ago

Not getting it. Why would you want to do this? And why is no distinction made between `typeof(type)` and `type`? And doesn't the entire problem go away if you distinguish between `typeof(type)`, which is a value whose type is `type`?

marcosdumay - 2 days ago

Hum... I'm getting 403, forbiden. Is it down?

- a day ago
[deleted]
cwmoore - 2 days ago

Similar to the difficulty in finding Title Search companies on Indeed.

operogg - a day ago

[dead]