|
|
|
|
|
by a2code
873 days ago
|
|
What makes Lisp (Scheme) great (for me) is that functions are first class citizens, the prefix syntax is consistent, tail call recursion optimization makes it runnable, and metaprogramming allows for powerful abstractions. What I would also emphasize is that using lambda expressions makes you wonder when to define something and when to omit the definition. Lisp is simple to learn but difficult to master. What I would like to do is to use Lisp to solve complex problems. The problem is that abstractions are not often efficient. For example, consider computing the calculus product rule. An S-expression abstracts the function: (lambda (u v) (* u v). With metaprogramming, this becomes a new S-expression (lambda (u v) (+ (* (d u) v) (* u (d v)))), where (d u) and (d v) further compute the derivative. To optimize this further, you need implementation dependent code and replace abstractions of S-expressions with native machine code. This is where I feel that the troubles with Lisp start. |
|
This can be done by a program called a compiler. There are many compilers for Lisp.
(In other words, the same argument applies to every language ever which doesn't exactly correspond to machine code.)