Misplaced Pages

Comparison of type systems

Article snapshot taken from[REDACTED] with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

This is an old revision of this page, as edited by Cedar101 (talk | contribs) at 09:43, 5 September 2017 (-{{nom}}). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Revision as of 09:43, 5 September 2017 by Cedar101 (talk | contribs) (-{{nom}})(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Comparison of type systems" – news · newspapers · books · scholar · JSTOR (September 2014) (Learn how and when to remove this message)
It has been suggested that this article be merged into Comparison of programming languages by type system. (Discuss) Proposed since May 2016.
This article has no lead section. Please improve this article by adding one in your own words. (October 2016) (Learn how and when to remove this message)
Programming language static / dynamic strong / weak safety nominative / structural
Ada static strong Safe nominative
Assembly language none strong Unsafe structural
APL dynamic weak Safe nominative
BASIC static weak Safe nominative
C static weak Unsafe nominative
C++ static strong Unsafe nominative
C# static strong both nominative
Cayenne dependent strong Safe structural
Clipper dynamic weak Safe duck
D static strong both nominative
Delphi static strong Safe nominative
E dynamic strong Safe nominative + duck
Eiffel static strong Safe nominative
Erlang dynamic strong Safe nominative
F# static strong Safe nominative
Fortran static strong Safe nominative
Go static strong Safe structural
Groovy dynamic strong Safe duck
Haskell static strong Safe nominative + structural
Io dynamic strong Safe duck
Java static strong Safe nominative
JavaScript dynamic weak Safe duck
Julia dynamic + static strong both? A usable subset is safe. See manual
Lisp dynamic strong Safe structural
Lua dynamic weak Safe structural
ML static strong Safe structural
Objective-C static+dynamic strong Unsafe nominative
Pascal static strong Safe nominative
Perl 1–5 dynamic weak Safe nominative
Perl 6 hybrid hybrid Safe duck
PHP dynamic weak Safe ?
Pike static+dynamic strong Safe structural
Python dynamic strong Safe duck
Ruby dynamic strong Safe duck
Scala static strong Safe nominative + structural
Scheme dynamic strong Safe nominative
Smalltalk dynamic strong Safe duck
Swift static strong Safe nominative
Visual Basic hybrid hybrid Safe nominative
Windows PowerShell hybrid hybrid Safe duck
xHarbour dynamic weak Safe duck

References

  1. The C basis is unchanged. 3.0 has hybrid typing with Anonymous Types. Can be both Unsafe and safe with use of 'Unsafe' functions and code blocks.
  2. D's philosophy is: safe by default with Unsafe "backdoors". D also supports @safe functions that provably can't corrupt memory at the cost of disabling some of the Unsafe language constructs.
  3. "RFC / Discussion: Security and Julia". Julia code can do anything C code can (e.g. you can work with raw unchecked pointers if you want to), so it is equivalent to C code in terms of security. i.e. you should not run untrusted Julia code, unless you use OS-level sandboxing.
  4. docs.julialang.org/en/release-0.5/manual/conversion-and-promotion/
  5. Variables can change type with the use of metatables.
  6. Applies to the Objective-C extension only.
  7. Not yet released.
  8. Scala supports structural types through runtime reflection on the JVM
Categories:
Comparison of type systems Add topic