|
|
|
|
|
by ukj
1813 days ago
|
|
>If it's the latter I'm not really sure how the analogy works—if programming languages are to routers as types are to routing entries, what in a router is analogous to a value of a given type? It's not an analogy. Programming languages and routers are particular instances of computable functions. "dispatching" and "routing" are just another example of us using different English words to describe the exact same computation: M:N mapping function. Whether the input is mapped to an IP address or a memory address - boring implementation details. Nothing in a router is analogous to a value of a type because there is no such thing as "types" at runtime unless you infer them! Types exist only at compile time. Types are semantic annotations of data. You are helping the compiler help you by telling it what you know about the data you are handling. This blob encodes a Number.
That blob encodes a String. If you don't want any help from your compiler, you don't have to tell it the types of anything - just manipulate the data directly! That's precisely what an Assembly language do. Everything is untyped. |
|