Is Lisp inherently slower than more conventional languages such as C?
This is a tough question to answer, as you probably expected. In many cases, it appears to be. Lisp does not require the programmer to specify the data type of variables, so generic arithmetic operators may have to perform type checking at runtime in order to determine how to proceed. However, Lisp code can also be denser (i.e. there is more expressed in a single line) than many other languages: the Lisp expression (+ A B) is more powerful than the C expression A+B (the Lisp version supports bignums, rationals, and complex numbers, while the C version only supports limited-size integers and floating point); therefore, one may claim that it is reasonable that the Lisp version take longer than the C version (but don’t expect everyone to accept this rationalization). Solutions to this include hardware support (e.g. processors that support type tags in data, such as SPARC and Symbolics Lisp Machines), declarations, and specialized variants of functions (e.g. in MacLisp, + accepts and retur
Related Questions
- Early on, some drivers were saying the Spektrum system was noticeably slower than their conventional system and switched back. Why was this?
- Why is ICR inherently able to provide better resolution and mass accuracy than conventional mass spectrometers?
- Is Lisp inherently slower than more conventional languages such as C?