├── .gitignore ├── java.mmd.png ├── scala.mmd.png ├── javascript.mmd.png ├── typescript.mmd.png ├── package.json ├── scala.mmd ├── javascript.mmd ├── typescript.mmd ├── README.md └── java.mmd /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules -------------------------------------------------------------------------------- /java.mmd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcherny/language-types-comparison/HEAD/java.mmd.png -------------------------------------------------------------------------------- /scala.mmd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcherny/language-types-comparison/HEAD/scala.mmd.png -------------------------------------------------------------------------------- /javascript.mmd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcherny/language-types-comparison/HEAD/javascript.mmd.png -------------------------------------------------------------------------------- /typescript.mmd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcherny/language-types-comparison/HEAD/typescript.mmd.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "language-types-comparison", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "README.md", 6 | "scripts": { 7 | "build": "mermaid *.mmd -e ./node_modules/.bin/phantomjs" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "mermaid": "^0.5.8", 13 | "phantomjs": "^1.9.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /scala.mmd: -------------------------------------------------------------------------------- 1 | %% Scala Type Hierarchy 2 | 3 | graph TB 4 | Any --> AnyVal 5 | Any --> AnyRef 6 | 7 | AnyVal --> Double 8 | AnyVal --> Float 9 | AnyVal --> Long 10 | AnyVal --> Int 11 | AnyVal --> Short 12 | AnyVal --> Byte 13 | AnyVal --> Char 14 | AnyVal --> Boolean 15 | AnyVal --> Unit 16 | 17 | AnyRef --> Object 18 | Object --> Seq 19 | Object --> List 20 | Object --> Option 21 | AnyRef --> String 22 | 23 | Nothing --> Null -------------------------------------------------------------------------------- /javascript.mmd: -------------------------------------------------------------------------------- 1 | %% JavaScript Type Hierarchy 2 | 3 | graph TB 4 | Object --> Number 5 | Object --> String 6 | Object --> Boolean 7 | Object --> Function 8 | Object --> Date 9 | Object --> RegExp 10 | Object --> Array 11 | Object --> Math 12 | Object --> Error 13 | Object --> JSON 14 | Object --> ArrayBuffer 15 | Object --> DataView 16 | Object --> TypedArray 17 | Object --> Map 18 | Object --> WeakMap 19 | Object --> Set 20 | Object --> WeakSet 21 | Object --> Promise 22 | 23 | Proxy 24 | Symbol 25 | Null_primitive 26 | Undefined_primitive 27 | Boolean_primitive 28 | Number_primitive 29 | String_primitive -------------------------------------------------------------------------------- /typescript.mmd: -------------------------------------------------------------------------------- 1 | %% Typescript Type Hierarchy 2 | 3 | graph TB 4 | Any --> Primitive 5 | Any --> Object 6 | Any --> Union 7 | Any --> Intersection 8 | 9 | Primitive --> Number 10 | Number --> Enum 11 | Enum --> Void 12 | 13 | Primitive --> Boolean 14 | Boolean --> Void 15 | 16 | Primitive --> String 17 | String --> Void 18 | 19 | Primitive --> Symbol 20 | Symbol --> Void 21 | 22 | Object --> Class 23 | Class --> Void 24 | 25 | Object --> Interface 26 | Interface --> Void 27 | 28 | Object --> Array 29 | Array --> Tuple 30 | Tuple --> Void 31 | 32 | Object --> Function 33 | Function --> Void 34 | 35 | Object --> Constructor 36 | Constructor --> Void 37 | 38 | Void --> Null 39 | Null --> Undefined -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hierarchical diagram of various type systems 2 | 3 | ### javascript 4 | ![](https://raw.githubusercontent.com/bcherny/language-types-comparison/master/javascript.mmd.png) 5 | see http://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%201st%20edition,%20June%201997.pdf 6 | 7 | ### typescript 8 | ![](https://raw.githubusercontent.com/bcherny/language-types-comparison/master/typescript.mmd.png) 9 | see https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3 10 | 11 | ### java 12 | ![](https://raw.githubusercontent.com/bcherny/language-types-comparison/master/java.mmd.png) 13 | see https://docs.oracle.com/javase/7/docs/api/java/lang/package-tree.html 14 | 15 | ### scala 16 | ![](https://raw.githubusercontent.com/bcherny/language-types-comparison/master/scala.mmd.png) 17 | see http://docs.scala-lang.org/tutorials/tour/unified-types.html -------------------------------------------------------------------------------- /java.mmd: -------------------------------------------------------------------------------- 1 | %% Java Type Hierarchy 2 | 3 | graph TB 4 | Object --> Boolean 5 | Object --> Character 6 | Object --> Character.Subset 7 | Character.Subset --> Character.UnicodeBlock 8 | Object --> Class 9 | Object --> ClassLoader 10 | Object --> ClassValue 11 | Object --> Compiler 12 | Object --> Enum 13 | Object --> Math 14 | Object --> Number 15 | Number --> Byte 16 | Number --> Double 17 | Number --> Float 18 | Number --> Integer 19 | Number --> Long 20 | Number --> Short 21 | Object --> Package 22 | Object --> Permission 23 | Object --> Process 24 | Object --> ProcessBuilder 25 | Object --> ProcessBuilder.Redirect 26 | Object --> Runtime 27 | Object --> SecurityManager 28 | Object --> StackTraceElement 29 | Object --> StrictMath 30 | Object --> String 31 | Object --> StringBuffer 32 | Object --> StringBuilder 33 | Object --> System 34 | Object --> Thread 35 | Object --> ThreadGroup 36 | Object --> ThreadLocal 37 | Object --> Throwable 38 | Throwable --> Error 39 | Throwable --> Exception 40 | Object --> Void --------------------------------------------------------------------------------