Settings

Theme

Type Inference in JavaScript

kylesletten.com

21 points by kbsletten 7 years ago · 3 comments

Reader

choeger 7 years ago

So dependent types. Unfortunately, not decidable.

https://cs.stackexchange.com/questions/12691/what-makes-type...

In general I am torn between the enthusiasm people like the author bring to the table and their apparent lack of due diligence regarding a discipline that has been subject to thorough research for decades.

  • kbslettenOP 7 years ago

    So, I'm the author and I'm aware there are smarter people than me working on things like this, but my question is mostly whether there's a threshold where things can be useful. As an honest question, in C++ I think there's a "stack limit" of like 15 deep for generic types to avoid the fact that the types are Turing complete. Is there something that can be done that addles the type system but makes useful things possible? I think that just because something isn't possible in the general case doesn't mean that the specific cases people are likely to encounter are impossible.

    • choeger 7 years ago

      Of course there is a room for pragmatism when it comes to type system. Just lookup the computational complexity of HM inference. But to be useful, the restrictions need to be understood very well. Otherwise your implementation very probably ends up unsound.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection