Hacker News new | past | comments | ask | show | jobs | submit login

What about the things you pass into the function? You can't know their properties in advance, in general, or can you?



> What about the things you pass into the function? You can't know their properties in advance, in general, or can you?

You can know that, e.g. a function passed in as an argument can be dereferenced as a pointer stored in a specific offset on the stack.

If your typechecks are compiler-generated statements inserted before a function call, then if you know at compile-time (via declarations or type inference, or type propagation) that a certain variable (to be passed as an argument) will always be of the correct type T, then you can omit the typecheck, as well as boxing/tagging.

You can get really close to the metal this way, and still have your language be as dynamic as can be.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: