|
> You could use lisp for scientific computing, for example, but it'd be crazy to do so because you'd be reinventing so much that's getting built elsewhere. However, it has the potential to be just great for scientific computing. And it has been used for scientific computing extensively in the past. First because of the fully interactive experience. Even a running program can be modified while running, in an easy and safe way. Second, because of Lisp supporting easily, with no use of special libraries or special operators, the following: Arbitrary length numbers, complex numbers, fractions, integers, and arbitrary long integers. You work with them with all the built-in operators (+,-,/, etc) and all the built in functions like sine, cosine, etc. They all work correctly with the provided datatype. Let me quote a part of the "History of Lisp" PDF by Gabriel: ---------------- QUOTE ------------------------ The S-1 was initially intended to be a fast signal processor. (...)
Infuenced by S-1 Lisp, Common Lisp provides an expanded system of floating-point data types to accommodate such architectural variation. The inclusion of complex numbers in Common Lisp was also an inheritance from the S-1. This was something of a sticking point with Scott Fahlman. A running joke was an acceptance test for nascent Common Lisp implementations developed by Steele. It was in three parts. First you type T; if it responds T, it passes part 1. Second, you define the factorial function and then calculate (/ (factorial 1000) (factorial 999))
If it responds 1000, it passes part 2.Third, you try (atanh -2)
If it returns a complex number, it passes; extra credit if it returns the correct complex number.
(...) Gerald Sussman and his students (including Gerald Roylance and Matthew Halfant) became
interested in numerical applications and in the use of Lisp to generate and transform numerical
programs [Sussman, 1988; Roylance, 1988]. Sussman also spent a fair amount of time at MIT
teaching Lisp to undergraduates. Sussman thought it was absolutely crazy to have to tell students
that the quotient of 10.0 and 4.0 was 2.5 but the quotient of 10 and 4 was 2. Of course, nearly
all other programming languages have the same problem (Pascal [Jensen, 1974] and its derivatives
being notable exceptions), but that is no excuse; Lisp aspires to better things, and centuries of
mathematical precedent should outweigh the few decades of temporary aberration in the field of
computers. At Sussman's urging, the / function was defined to return rationals when necessary,
so (/ 10 4)
in Common Lisp produces 5/2. (This was not considered a radical change to the
language. Rational numbers were already in use in symbolic algebra systems. The developers of
Common Lisp were simply integrating into the language functionality frequently required by their
clients, anyway.)----------------------------------------------- I think any programmer that has had to work with huge numbers, complex numbers, floats and integers in C or C++ will appreciate the above information. > Similarly with games, C++ just has a lot more libraries available (you could FFI I guess, but that's never as bulletproof). True, however it can be done in Lisp as well. Some commercial games were written in the past in Lisp. Some famous and frankly groundbreaking games of the past, like King's Quest, Space Quest, Police Quest and Leisure Suit Larry, were written in an special interpreter (AGI) which was basically... a minimal Lisp. Currently, on the Lisp reddit there is a long series of tutorials on this topic, called "Pushing Pixels with Lisp". |