Questions tagged [static-typing]
For questions relating to languages whose variables' data types are known at compile time, and type systems supporting this.
21
questions
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 ...
5
votes
3
answers
209
views
How can I reconcile “all functions are variables” with a typeclass type system?
In my WIP language, all functions are really just variables with a callable type. That is, a function call foo(bar) is parsed into the following AST:
...
11
votes
2
answers
341
views
What are the run-time implications of gradual typing?
Statically-typed languages specify the types of variables and functions and reject programs they know won't work before they run. Dynamically-typed languages don't include these annotations or checks, ...
9
votes
4
answers
634
views
What are the pros and cons of static typing?
Static typing means the type of a variable is known at compile time. This means that either you have to specify the type, or the compiler has to infer it (usually both). You also can't change the type ...
7
votes
2
answers
304
views
How to Add Static Typing to a Stack Language?
What level of static typing can be added to a stack-based language? I know it's impossible to fully statically type some stack languages:
...
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 ...