Talk:Gradual typing
Add topic| This is the talk page for discussing improvements to the Gradual typing article. This is not a forum for general discussion of the subject of the article. |
Article policies
|
| Find sources: Google (books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
| This article is rated C-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||
Optional type systems/optional typing vs. gradual typing
[edit]This article ought to discuss the differences between optional type systems/optional typing (https://en.wikipedia.org/wiki/Type_system#Optional_type_systems) and gradual typing, also because this article claims some programming languages like Dart have gradual typing, but the websites for those programming languages claim that they have optional typing, never mentioning gradual typing. The article should also mention that several terms for optional typing and optional type systems existed in several different papers before http://scheme2006.cs.uchicago.edu/13-siek.pdf .
Further issues are that optional typing does not have a clear, commonly agreed upon definition according to one of the commonly used sources https://bracha.org/pluggableTypesPosition.pdf :
Common Lisp had a concept of optional typing, which meant something significantly different - type annotations could optionally be used to guide optimizations.
While https://en.wikipedia.org/wiki/Type_system#Optional_type_systems appear to try to claim both a specific definition of gradual typing and optional type system/optional typing, and try to contrast them clearly, in practice the meaning of gradual typing and optional typing appear to be used as if it is more or less the same in multiple places, as in the case of Dart being described in this page as having gradual typing, and in its own website previously having optional typing and never mentioning gradual typing. Another Wikipedia page http://stackoverflow.com/questions/13399960/is-there-a-language-that-allows-both-static-and-dynamic-typing/13414347 tries to differentiate between optional and gradual typing, but that page seems as if Typescript would have optional typing, not gradual typing. 212.97.236.13 (talk) 13:28, 2 October 2025 (UTC)
- @212.97.236.13
- Came here to discuss this: what differentiates gradual typing from optional typing is that gradual types are enforced at runtime AFAIK. TypeScript and mypy have their types erased. Haxe will type check and throw at the boundaries.
- Not a type theorist, but as this seems to be the consensus here I will make changes. ツ indolering (talk) 18:54, 21 February 2026 (UTC)
- I removed the incorrect TypeScript references, made the comparison more explicit, and added example code. It would probably make more sense to a user if I did a class with an integer ID or something, but I've procrastinated on this task long enough. ツ indolering (talk) 20:11, 21 February 2026 (UTC)
- NVM I was dumb and spent another hour making a better example :P ツ indolering (talk) 22:09, 21 February 2026 (UTC)
- I removed the incorrect TypeScript references, made the comparison more explicit, and added example code. It would probably make more sense to a user if I did a class with an integer ID or something, but I've procrastinated on this task long enough. ツ indolering (talk) 20:11, 21 February 2026 (UTC)
Check content
[edit]The content of this article should be double-checked for whether the mentioned programming languages are correctly categorized as gradual and not optional.
For instance, Typescript, both here and in its official documentation, is described as gradually typed https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes-func.html#gradual-typing . But Typescript generally does not perform runtime checks, since Typescript generally strips type annotations before runtime. An example of the consequences of this is https://dev.to/narasimha1997/the-most-common-misconception-about-typescript-3f2a .
Another example of that is Dart. Dart is described in the article as having gradual typing, but both its Wikipedia page and its website refer to optional typing for Dart 1.0, not gradual typing. And Dart even replaced its optional typing with a full static type system in Dart 2.0 https://dart.dev/null-safety/understanding-null-safety . 212.97.236.13 (talk) 13:28, 2 October 2025 (UTC)
- C-Class Computer science articles
- Low-importance Computer science articles
- WikiProject Computer science articles
- C-Class Computing articles
- Low-importance Computing articles
- C-Class software articles
- Low-importance software articles
- C-Class software articles of Low-importance
- All Software articles
- All Computing articles

