How come most Lisps and Schemes are dynamically typed? Does static typing not mix with some of their common features?
all scripting languages are dynamically typed, because their is no compiler to do static type checking anyway.
Lisp is dynamically typed because type checks are done at runtime and variables by default can be set to all kinds of objects. For this Lisp also needs types attached to the data objects themselves.
Actually, CL has both static and dynamic typing aspects.
By this definition, most higher-level languages, including dynamically typed languages, are type safe, because any attempt to use a type incorrectly is guaranteed to cause an error (compile-time or run-time) in them.
Typing and s-expressions can be made to work together, see typed scheme.
Partly it is a historical coincidence that s-expression languages are dynamically typed. These languages tend to rely more heavily on macros, and the ease of parsing and pattern-matching on s-expressions makes macro processing much easier. Most research on sophisticated macros happens in s-expression languages.
Typed Hygienic Macros are hard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With