Skip to main content

Questions tagged [static-typing]

For questions relating to languages whose variables' data types are known at compile time, and type systems supporting this.

6 votes
0 answers
135 views

What are some options for integrating subtyping with Damas-Hindley-Milner inference? gets into this tangentially at the end of Jon Purdy's post ("Placing various restrictions on recursion (...
David Durschlag's user avatar
11 votes
1 answer
479 views

I'm putting together a small language, and I'd like its type system to include bounded integer types, where for any expression e and integer literals $l,h$, the ...
Antal Spector-Zabusky's user avatar
6 votes
5 answers
3k views

In a language, some types are actually type variables. I am aware of three kinds of type variables: Generic Parameter Types: In the declaration of Foo<T>, ...
Jeff Walker Code Ranger's user avatar
7 votes
2 answers
401 views

Answer #2693 introduces the notation of typing rules. That answer shows typing rules for a simple language in which all types are primitive, i.e., built into the language. Other similarly beginner-...
user570286's user avatar
7 votes
1 answer
217 views

I'm reading Practical Foundations for Programming Languages by Robert Harper and am confused by the exercises in Chapter 4, "Statics", where he discusses a (monomorphic) type system. The ...
Jay Lee's user avatar
  • 232
1 vote
1 answer
951 views

mypy is very slow, pyright is fast but not quick enough in a large codebase, and tsc gives an immediate intellisense and type errors. I do not know whether it is because Python has more complex type ...
mq7's user avatar
  • 113
15 votes
6 answers
5k views

Use case Some languages offer techniques to ensure certain requirements at compile time. For example, rust has the NonZeroU32 type that will ensure at compile time ...
mousetail's user avatar
  • 9,627
9 votes
1 answer
2k views

I've just watched an interview on YouTube with Simon Peyton Jones where they talk about Epic's Verse language. Here (at roughly 51:30) they start talking about the type system. Simon mentions that ...
Timo's user avatar
  • 193
11 votes
5 answers
1k views

In C++, 3 || 4 returns true. But in Python, 3 or 4 returns 3 instead. That's a logical operator that returns its operand. I don'...
user23013's user avatar
  • 3,314
21 votes
4 answers
3k views

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 ...
Caleb Thomas's user avatar
4 votes
2 answers
615 views

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 ...
user23013's user avatar
  • 3,314
8 votes
1 answer
587 views

As I understand it, as a (value-level) function f that takes a value x of type T and returns ...
user570286's user avatar
29 votes
6 answers
2k views

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 ...
kaya3's user avatar
  • 22.4k
19 votes
2 answers
1k views

Type inference in a Damas-Hindley-Milner type system with subtyping is known to be undecidable in general. What makes it so difficult? What options are there to get around undecidability which could ...
Pseudonym's user avatar
  • 5,716
4 votes
1 answer
193 views

I'm almost finishing my open-source language's verifier. It performs parsing and verification, which ensures a set of programs are valid both syntatically and semantically at compile-time. To start ...
Hydroper's user avatar
  • 1,047

15 30 50 per page