Name: Anonymous 2014-09-13 5:48
Is it okay to use lower bits for a type tag?
data Either a b = Left a | Right b
Left "testicle"
Either String b
value but we can't tell the b
from the tag. It's a classification tag and can of course be encoded various ways, but it's in no way a type tag.Numeric = I Int | D Double
I
or D
) in the lowest bits of its representation, but it still wouldn't make them type tags. There's no way to find out at runtime if the value D 2.71
has the type Numeric
or maybe some other typeAsswipe = I Int | D Double | C Char Char Char Char Char Char
You can typecheck a program with just pencil and paper, without ever running it.You can also "run" the program with pencil and paper. (What do you mean you need a computer...? What the fuck are they teaching kids these days...!?)
2. Stop dividing computation into compile-time and run-time. It is a false dichotomy.For me, anything that needs input is run-time, and anything else is compile-time. (You academic intellectual masturbators are probably going to disagree but that's how it works in practice.)
You can also "run" the program with pencil and paperBut then you would be running it. Whereas if you typecheck it on paper, you won't be running it. Feel the difference? In one case you run it (doesn't matter the hardware: laptop, workstation, cluster, brain), in the other you don't run it. That's why typechecking is a logically phase logically separated from runtime. Even if it might happen at the same time.
You can also "run" the program with pencil and paper. (What do you mean you need a computer...? What the fuck are they teaching kids these days...!?)Yeah. Back then people literally debugged code by manually evaluating it, because computer time priced more than human.