Live data from Hacker News

A Road to Lisp: Which Lisp

scotto.me

121–130 of 180 posts

Re: A Road to Lisp: Which Lisp

#121
post #82

CommonLisp really should evolve to update the language up to the modern standards and become more functional and better typed.

It is already typed. Types are optional. I think types have been available for the last 30 years? Check the specs.

I wrote "better typed", not just "typed".

Re: A Road to Lisp: Which Lisp

#122
post #38

Since this is the largest gathering of LISP users I have seen, I have a question. Why prefer lisp-1 over lisp-2 or vice-versa?

The usual argument I've seen in favour of Lisp-2 (I personally don't care as much about the function namespace as I do about the type namespace, which I find much more important) is that you can name an argument a conflicting name with a function without the conflict interfering with the code you would write:

  (defun merge-sort (list before?)
    (declare (type List list)
             (type Function before?))
    (flet ((merge-2 (a b)
             (declare (type List a b)
             (merge 'List a b before?)))
      (unless (null list)
        (reduce #'merge-2 list :key #'list))))

  (merge-sort '(1 9 8 2 3 4 7 6 5)
              #'
Instead of having to name lists 'lst' or something. Which is pretty much personal preference anyway.

Re: A Road to Lisp: Which Lisp

#123

I'm going to take the opposite position that there is much less special about Lisp than people think. Like I have met so many programmers that travel around like itinerant martial artists looking for true functional programming and they never find it. To be specific, you can work all of the examples in Graham's On Lisp in Python except for one of the last chapters where he implements continuations that really need ma…

I thought Scheme was just an educational tool - a minimal language that allows the student to explore language construction & design relatively quickly. I'm not sure I understand your comment about homoiconicity leading people astray. Isn't that the characteristic feature of lisp? Doesn't that dramatically simplify generating code (in principle)?

I find it interesting that a number of PLs were initially developed as educational or research tools but later expanded for general use. Some examples are Pascal, Scheme, Prolog. AFAIK many development languages are used in education so the distinction is rather fuzzy.

Several Scheme implementations, e.g., Chicken, Chez, Gambit, are capable of producing almost any type of program. I'm most familiar with Chicken Scheme. Comes with a large "standard" library plus a broad range of available extensions. Its easy to use FFI adds to productivity.

My experience anyway. Of course, mileage varies widely among users of any language.

Re: A Road to Lisp: Which Lisp

#124

Earlier quoted context omitted.

You can directly call C++ as C++ , not via a C ABI.

> You can directly call C++ as C++, not via a C ABI. That's a unique definition of "native". It suggests that C is not a native language, which is going to be a hard thing to convince others of.

Ya, I think that was a bit misspoken. They mostly meant direct C and C++ interop. It feels much less like a traditional FFI and more like using C and C++ libraries from C++ itself.

Re: A Road to Lisp: Which Lisp

#125
post #59

Earlier quoted context omitted.

The argument is: if you don’t have hygienic macros, a Lisp-2 is going to be less brittle than a Lisp-1. The classic example is, imagine you have a function with a local variable called “list”, common enough. Now imagine you invoke a macro inside that function which generates a call to the built-in “list” function - also common enough. In a Lisp-1 without hygiene that breaks - your local definition shadowed the built-…

@nathan_compton, your sibling comment to what I'm writing now is [dead] (not [flagged]) but you're not shadowbanned, newer and older comments are still alive. I vouched for it but it's still [dead], you may want to reach out to the mods.

[deleted]

Re: A Road to Lisp: Which Lisp

#126
> Common Lisp lacks some conveniences that have become common in newer languages, such as concise literals for a wider variety of data structures, persistent immutable collections, lazy sequences and built-in general-purpose pattern matching.

we can explore libraries on https://github.com/CodyReichert/awesome-cl/

concise literals: serapeum's dict or other libraries bring you { } for hash tables and the like.

persistent collections: FSet (and more)

lazy sequences: series, gtwiwtg (generators) (and more)

pattern-matching: Trivia

many libraries are shipped in CIEL: https://ciel-lang.org/ (shameless plug)

---

> It’s currently used in …

more example companies: https://github.com/azzamsa/awesome-lisp-companies/

also: https://lisp-screenshots.org/

---

> at the cost of slightly slower startup times

that means ±30ms, not the Java-esque slow startup time ;)

---

editors: don't miss https://lispcookbook.github.io/cl-cookbook/editor-support.ht... and the new Mine, OLIVE for VSCode, ICL repl (terminal and browser).

Re: A Road to Lisp: Which Lisp

#127
post #82

CommonLisp really should evolve to update the language up to the modern standards and become more functional and better typed.

It is already typed. Types are optional. I think types have been available for the last 30 years? Check the specs.

It is typed, but it's not very well typed. List is 'null or cons' for instance, not 'null or (cons * list)'. Also lack of generics so you can't have a class which holds an element of a generic type which can be determined later on in the compilation process (e.g. a weight-balanced tree which holds elements of a given type).

Re: A Road to Lisp: Which Lisp

#128

Earlier quoted context omitted.

I thought Scheme was just an educational tool - a minimal language that allows the student to explore language construction & design relatively quickly. I'm not sure I understand your comment about homoiconicity leading people astray. Isn't that the characteristic feature of lisp? Doesn't that dramatically simplify generating code (in principle)?

I find it interesting that a number of PLs were initially developed as educational or research tools but later expanded for general use. Some examples are Pascal, Scheme, Prolog. AFAIK many development languages are used in education so the distinction is rather fuzzy. Several Scheme implementations, e.g., Chicken, Chez, Gambit, are capable of producing almost any type of program. I'm most familiar with Chicken Schem…

[deleted]

Re: A Road to Lisp: Which Lisp

#129

Earlier quoted context omitted.

I thought Scheme was just an educational tool - a minimal language that allows the student to explore language construction & design relatively quickly. I'm not sure I understand your comment about homoiconicity leading people astray. Isn't that the characteristic feature of lisp? Doesn't that dramatically simplify generating code (in principle)?

I find it interesting that a number of PLs were initially developed as educational or research tools but later expanded for general use. Some examples are Pascal, Scheme, Prolog. AFAIK many development languages are used in education so the distinction is rather fuzzy. Several Scheme implementations, e.g., Chicken, Chez, Gambit, are capable of producing almost any type of program. I'm most familiar with Chicken Schem…

Yea sorry. I didn't mean to criticize or diminish its value by saying it's just an educational tool. It's a powerful tool that lets you do some advanced things quickly. That's totally valuable outside of an educational setting. And I didn't mean to imply that there's any limitation to its use.

I just don't understand the criticism in the post I was replying to.

Post reply on HN