3 ms·
> They said “powerful”. Yes, it was called a "powerful type system". But a type system with only one type isn't powerful, more the contrary. https://existent
by still_grokking 4y ago
> They said “powerful”.
Yes, it was called a "powerful type system".
But a type system with only one type isn't powerful, more the contrary.
https://existentialtype.wordpress.com/2011/03/19/dynamic-languages-are-static-languages/ https://existentialtype.wordpress.com/2011/03/19/dynamic-lan...
But the now linked page was an interesting read. At least SBCL has indeed real types. I didn't know that until now.
Compile-time type checking
You may provide type information for variables, function arguments etc via `proclaim`, `declaim` and `declare`. However, similar to the `:type` slot introduced in CLOS section, the effects of type declarations are undefined in Lisp standard and are implementation specific. So there is no guarantee that the Lisp compiler will perform compile-time type checking.
However, it is possible, and SBCL is an implementation that does thorough type checking.
- kazinator 4y agoCalling dynamically typed languages "one typed" is basically trolling; there is no substance behind it. Obviously, the expressions 1234, "foo" and '(hello world) do not have the same type.
- still_grokking 4y agoHave you read the linked post? Did you look up who the guy is who written it? Calling Mr. Harper a "troll" is quite a strong statement…
- lispm 4y agoCommon Lisp has more than one type. See the standard: http://www.lispworks.com/documentation/HyperSpec/Body/04_bc.htm http://www.lispworks.com/documentation/HyperSpec/Body/04_bc.... This exists since early 80s. The first language definition book appeared 1984: Common Lisp the Language. One could think that it is a gradual type system. Type declarations are optional and are used for several purposes. Many implementations use type declaration and optionally type inference as input for optimizing compilers. In the 80s the first implementation to add limited forms of static type inferencing and checking was CMUCL. SBCL is a later fork of CMUCL. The challenge is to integrate dynamic types, static types into a language which is often used interactively - including a lot of dynamic features, where programs can change at runtime or parts of the language might change during runtime. Thus the type system has its problems and hasn't been improved since the 90s... Not many implementations have adopted the type system implementation of CMUCL & SBCL. Generally the SBCL compiler, even though it is based on 80s technology, is quite helpful when developing Lisp code.