Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I want static types in a higher level assembly language for systems programming. That's because I want to work with machine-level representations, in which there are no spare bits for indicating type at run-time (moreover, using such a language, we can design a type system with such bits, in any way we please).

I don't want static types in a high level language.

It's just counterproductive.

We only have to look at numbers to feel how it sucks. If we divide two integers in Common Lisp, if the division is exact, the object that comes out is an integer. Otherwise we get a ratio object. Or if we take a square root of a real, we get a complex number if the input is negative, otherwise real.

This cannot be modeled effectively in a static system. You can use a sum type, but that's just a greenspunned ad hoc dynamic type.



> This cannot be modeled effectively in a static system. You can use a sum type, but that's just a greenspunned ad hoc dynamic type.

This can easily be modeled in a static type system. All you really need is subtyping.


Oh come on, sum types are so much more useful than a value which can have literally any type (including undefined aka nil).




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

Search: