4 ms·
I think in modern parlance Common Lisp uses a gradually typed system, at least some implementations. Common Lisp allows for type inference and some compilers u
by guenthert 6y ago
I think in modern parlance Common Lisp uses a gradually typed system, at least some implementations.
Common Lisp allows for type inference and some compilers use that to various degree, as well as to declare a type of a given symbol (or the signature of a function). Depending on compiler and optimization settings, that information is then used to generate optimized code, much like a compiler for a (weakly) statically typed language would or detect mismatches. SBCL is probably one of the most advanced Common Lisp compilers in this regard.
- phoe-krk 6y agoSure, that's the case in SBCL - the type inference engine in it is rather advanced; with type declarations here and there (which are capable of turning Common Lisp into a weakly statically typed language), they are capable of type-optimizing a lot of code. It also generates warnings in case type mismatches are detected at compile-time.