Programming languages can be distinguished by their type systems.
No vs. weak vs. strong typingThis question concerns whether types are checked at run-time or at compile-time. Static typing has the advantage that errors can be caught before the program runs. This is especially useful if in a large library or program the type of a basic function is changed and this change affects many parts of the project. The type checker can spot many places where the program must be adapted. Static types also allow more efficient code, because if the type of a variable is 'ASCII character' the compiler knows that it must reserve a byte for it. The program does not need to allocate memory for it at run-time. If the variable is processed, its type needs not to be checked, actually the program even cannot check if the type is correct. The program just assumes that the place where the variable is stored always contains an ASCII character.
Dynamic typing is needed whenever the types are not known at compile time. Haskell provides the type Dynamic
, which can safely be used but is hardly needed. Scripting languages usually rely entirely on dynamic typing.
Object oriented type systems try a balancing act between dynamic and static typing. Each reference has a static type, but at runtime you can assign more an object of a more specialised type to it. You need type information and type checks at run-time, but you have also static checks.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3