All Questions
Tagged with static-typing types
8
questions
19
votes
4
answers
3k
views
To what extent is type theory relevant to dynamically typed languages?
There seem to be two conflicting views regarding the status of "type systems" used in dynamically typed languages:
That dynamically typed languages are actually just unityped static ...
3
votes
2
answers
422
views
What are the possible variations of the type of "this" or "self"?
In the class definitions of an object oriented language, this refers to the object instance the code is about to work upon. Naturally, it should have the same type ...
8
votes
1
answer
366
views
How, if at all, do kinds fit into the type universe hierarchy?
As I understand it, as a (value-level) function f that takes a value x of type T and returns ...
26
votes
6
answers
1k
views
Why don't many languages have integer range types?
An integer range type like 0..100 means that a value can be any integer in that range. Arithmetic operations on range types produce other range types, for example ...
11
votes
3
answers
316
views
How can a language statically ensure a required index exists in a list?
Suppose a language has a conventional list data structure that contains some dynamic number of values indexed sequentially. Some operations to access a value from the list require that a certain index ...
11
votes
1
answer
444
views
How can I have mutually-exclusive properties in a structural type system?
I have a structurally-typed object-oriented language, and I'd like to allow for types with some mutually-exclusive properties/attributes/slots/methods. That is, an object having more than one of these ...
10
votes
1
answer
207
views
How can optional properties be made sound in a static structural type system?
Typescript's structural type system is known to be (intentionally) unsound, in the sense that the value of an expression at runtime is not always necessarily assignable to its type determined at ...
6
votes
3
answers
438
views
What are common approaches to representing types within a compiler?
I'm implementing my own statically-typed programming language and I'm not too happy with my own approach to types. At the moment, I'm relying on mapping a textual representation of a type to an index ...