Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are most S-Expression languages dynamically typed?

Tags:

How come most Lisps and Schemes are dynamically typed? Does static typing not mix with some of their common features?

like image 625
keiter Avatar asked Jun 01 '10 20:06

keiter


People also ask

Why are some languages dynamically typed?

all scripting languages are dynamically typed, because their is no compiler to do static type checking anyway.

Why is Lisp dynamically typed?

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.

Is Common Lisp dynamically typed?

Actually, CL has both static and dynamic typing aspects.

Why do dynamically typed programming languages tend to be type safe?

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.


1 Answers

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.

like image 174
Doug Currie Avatar answered Sep 29 '22 10:09

Doug Currie