Re:Navigating the Postmodern Python World
by foldr on Friday July 12, 2013 @03:03PM
(#6034455)
Lisp's optional type declarations don't provide any compile-time guarantees though, they're just hints. (Although some implementations do use them to make compile-time checks.)
[ Parent
| on HN ]
Technically, your are correct.
HOWEVER, In most of the compiled versions you set speed/space/safety/debug levels 1-3 and get different uses of the type hints.
In SBCL, if i set safety/debug at high priority, I will get warnings or errors if I make a type mistake.
Furthermore, there is an option you can turn on to make the type infrencer tell you what it is doing.
Here's some example doc:
http://common-lisp.net/project/cmucl/doc/cmu-user/compiler-h...
You'll notice that CMUCL's compiler is called 'Python' so technically, Python supports type inference. :)
Depends what you are going for. If the point of type declarations is speed, I think most high-quality CL implementations will take advantage of a type declaration. If the point is compile-time type safety, yeah, that's a more obscure feature. Of course you can always use check-type for run-time type safety though.