Live data from Hacker News

Answers from 2017 Common Lisp experts

blog.teknik.io

21–30 of 48 posts

Re: Answers from 2017 Common Lisp experts

#22

Wow, that is great, thanks for putting it together! I have been using CL since the mid 1980s, but cumulatively have just used the language for perhaps five years. While I find myself using Python a lot because it wraps so many machine learning libraries and Java because of the ecosystem, there are other languages like CL, Ruby, and Haskell that all just make me feel good when I use them.

I really wish I could use CL more. It's just that in almost every domain, the new libraries are elsewhere. 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. Similarly with games, C++ just has a lot more libraries available (you could FFI I guess, but that's never as bulletproof). Not sure lisp is better at any one…

> 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".

Re: Answers from 2017 Common Lisp experts

#23
post #11

I really don't get the lispm's answer about cl21. What are the hidden treasures of the genuine Common Lisp we are ignorant of? In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in a hurry. The results is not that bad (like, say, C++) but we know, arguably, a much more refined versions of Lisp, such as the dialect from…

> What are the hidden treasures of the genuine Common Lisp we are ignorant of?

Actually Common Lisp is in many places a very well documented and designed language. Other languages have copied its numeric tower, its macros, its object-system, its error handling, ...

>In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in a hurry

The 'hurry' took place from 1981 (when the work on Common Lisp started) until 1994 when the ANSI CL standard finally was published. 13 years where hundred+ persons helped to design the language and provided comments, improvements, designs, prototypical implementations, alternative designs, ...

Also the 'various dialects' were mainly only Maclisp successors and Common Lisp was designed to be successor to them, not a summary of various dialects.

CL21 has more problems than lines of code, including security problems. As an experiment, fine. As a library that should be used? Please don't.

Edit: this thread gives a bit more detail discussing a COERCE method of CL21:

https://www.reddit.com/r/lisp/comments/6snw5d/questions_for_...

Re: Answers from 2017 Common Lisp experts

#24
post #11

I really don't get the lispm's answer about cl21. What are the hidden treasures of the genuine Common Lisp we are ignorant of? In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in a hurry. The results is not that bad (like, say, C++) but we know, arguably, a much more refined versions of Lisp, such as the dialect from…

> In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in a hurry.

Can you give a particular example?

I have read many times about people speaking about the amount of "cruft" that was left into Common Lisp, but frankly i've yet to find any cruft. Some people use as an example the fact that there is "CAR " and "CDR", but in this particular topic:

1) you could use "first" and "rest" if you wnat, instead of "car" and "cdr" 2) Using "car" and "cdr" is good because it shows that you are explicitely wanting to modify cons cells; 3) "car" and "cdr" is to Lisp what "*" is to C; that is, part of the charm!!

Re: Answers from 2017 Common Lisp experts

#25
post #23
post #11

I really don't get the lispm's answer about cl21. What are the hidden treasures of the genuine Common Lisp we are ignorant of? In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in a hurry. The results is not that bad (like, say, C++) but we know, arguably, a much more refined versions of Lisp, such as the dialect from…

> What are the hidden treasures of the genuine Common Lisp we are ignorant of? Actually Common Lisp is in many places a very well documented and designed language. Other languages have copied its numeric tower, its macros, its object-system, its error handling, ... >In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in…

I remember reading the Symbolics manuals from bitsavers and how I have been impressed by clarity and unity of the language, and how they incorporated CL into Zetalisp just by moving their own stuff into packages.

At least in the documentation everything looks wonderful. Compared to Symbolics CL looks like a mess at least from reading the books.

Re: Answers from 2017 Common Lisp experts

#26
post #11

I really don't get the lispm's answer about cl21. What are the hidden treasures of the genuine Common Lisp we are ignorant of? In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in a hurry. The results is not that bad (like, say, C++) but we know, arguably, a much more refined versions of Lisp, such as the dialect from…

> In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in a hurry. Can you give a particular example? I have read many times about people speaking about the amount of "cruft" that was left into Common Lisp, but frankly i've yet to find any cruft. Some people use as an example the fact that there is "CAR " and "CDR", but i…

Its mostly about inconsistent naming, order of arguments and standard idioms. Obviously most of these are historical artifacts, like nconc and friends or the primitives for working with hash-tables.

Car and cdr are small miracles because they give us of caddr or caadr and friends. It is beautiful accident which should be appreciated and preserved.

Re: Answers from 2017 Common Lisp experts

#27
post #25
post #23

Earlier quoted context omitted.

> What are the hidden treasures of the genuine Common Lisp we are ignorant of? Actually Common Lisp is in many places a very well documented and designed language. Other languages have copied its numeric tower, its macros, its object-system, its error handling, ... >In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in…

I remember reading the Symbolics manuals from bitsavers and how I have been impressed by clarity and unity of the language, and how they incorporated CL into Zetalisp just by moving their own stuff into packages. At least in the documentation everything looks wonderful. Compared to Symbolics CL looks like a mess at least from reading the books.

That does not make sense to me. Common Lisp provided lots of improvements over Zetalisp.

Re: Answers from 2017 Common Lisp experts

#28
post #26

Earlier quoted context omitted.

> In my humble opinion Common Lisp is the classic example of the kitchen sink syndrome, where many pieces taken from various dialects were put together in a hurry. Can you give a particular example? I have read many times about people speaking about the amount of "cruft" that was left into Common Lisp, but frankly i've yet to find any cruft. Some people use as an example the fact that there is "CAR " and "CDR", but i…

Its mostly about inconsistent naming, order of arguments and standard idioms. Obviously most of these are historical artifacts, like nconc and friends or the primitives for working with hash-tables. Car and cdr are small miracles because they give us of caddr or caadr and friends. It is beautiful accident which should be appreciated and preserved.

One of the goals of Common Lisp was backwarts compatibility. The stuff from McCarthy's Lisp is mostly present in Maclisp, Zetalisp and Common Lisp. That's why they are Lisp languages. Every language existing for a longer period of time accumulates different design approaches. A language purist may complain, but a programmer will get his stuff ported and will get work done.

Re: Answers from 2017 Common Lisp experts

#29
post #16

Earlier quoted context omitted.

>There are at least two portable libraries to do this. What are they?

One is CFFI, widely known and well documented, with tutorial and tooling: https://common-lisp.net/project/cffi/ The other was UFFI, older; but then there are others. In fact, there are a ton of other projects for doing FFI in Common Lisp! http://www.cliki.net/FFI And then you can also use the FFI functionalities provided by the particular Lisp implementation (i.e. SBCL, LispWorks, ABCL, etc.) However, the use of a po…

Sure is a lot. Thanks!

Re: Answers from 2017 Common Lisp experts

#30
post #17
post #16

Earlier quoted context omitted.

>There are at least two portable libraries to do this. What are they?

I'd guess one is cffi: https://www.quicklisp.org/beta/UNOFFICIAL/docs/cffi/doc/Intr... Maybe with the help of cl-autowrap: https://github.com/rpav/cl-autowrap/blob/master/README.md There are others... : http://www.cliki.net/FFI

Interestingly there is a CFFI module in Python too. Maybe they got the idea from Lisp.
Post reply on HN