Examples of gradually typed languages derived from existing dynamically typed languages include
Closure Compiler,
Hack (for PHP), PHP (since 7.0), Typed Racket (for
Racket), Typed Clojure (for
Clojure), or
cperl (a typed
Perl 5).
ActionScript was a gradually typed language that interoperated with
ECMAScript, though it originally arose separately as a sibling, both influenced by Apple's
HyperTalk. A system for the
J programming language has been developed, adding coercion, error propagation and filtering to the normal validation properties of the type system as well as applying type functions outside of function definitions, thereby the increasing flexibility of type definitions. Conversely,
C# started as a statically typed language, but as of version 4.0 is gradually typed, allowing variables to be explicitly marked as dynamic by using the dynamic type.
Raku (formerly Perl6) has had gradual typing implemented from the start. Type checks occur at all locations where values are assigned or bound. An "untyped" variable or parameter is typed as Any, which will match (almost) all values. The compiler flags type-checking conflicts at compile time if it can determine at compile time that they will never succeed.
Objective-C has gradual typing for object pointers with respect to method calls. Static typing is used when a variable is typed as pointer to a certain class of object: when a method call is made to the variable, the compiler statically checks that the class is declared to support such a method, or it generates a warning or error. However, if a variable of the type id is used, the compiler will allow any method to be called on it. The
JS++ programming language, released in 2011, is a superset of
JavaScript (dynamically typed) with a gradual type system that is
sound for
ECMAScript and
DOM API corner cases.
GDScript, the Godot game engine's primary scripting language, started out dynamically typed and introduced gradual typing with version 3.1 of the engine, allowing users to type variables, function parameters, arrays and dictionaries through type hints. Additionally, when assigning a value to a variable using the := notation, Godot will attempt to infer the type of the variable at build time. == References ==