Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

People still use common lisp? ducks

In all seriousness, the plugin architecture will certainly allow for exactly that to happen. If you're interested in trying your hand at adding CL, I know a guy who could probably sneak you into the beta when it turns private ;)



I stopped serious use of common lisp about 5 years ago - but jokes about lisp not seeing serious use still hurt. :)


I was actually suggesting that I can't believe people still use CL when Clojure exists...

I await my lynching. :D


Well, since you threw that out there...

...I can't believe that people use Clojure-the-language over CL-the-language. It seems to have no reason to exist except as a "I hate parens" Lisp-1. The interesting parts of Clojure (i.e., the sequence abstraction design) are replicatable in CL as a library. Extant issues (e.g., cl's map not mapping over vectors)* can be abstracted over with other tools.

While the JVM interop is compelling, I don't understand why the libraries and macros to create similarly compelling interop over ABCL weren't developed instead.

Bluntly, I don't know why Clojure was created as a new language instead of an advanced library over Common Lisp. I appreciate the interest it's been able to drum up in the Lisp family, and I deeply appreciate the libraries people have written for it.

*: I was wrong: map goes over a variety of types: mapcar, mapcan, etc, are common and only operate on lists. Ignorance uncovered and filled in by knowledge.


>The interesting parts of Clojure (i.e., the sequence abstraction design) are replicatable in CL as a library.

The interesting part of Clojure for me is that the sequence abstraction design is part of the standard language distribution and NOT implemented as an optional library.

The major flaw with Lisps is exactly the proliferation of competing, (and frequently half-arsed), custom solutions for stuff that should be built-in and used by all.

I'll take a slightly inferior implementation of something that's standard in a language's libs, over 20 competing solutions or rolling my own, any day of the week.


The only reason I can understand for the existence and use of Clojure is interoperation with Java and because Clojure is more actively developed than ABCL.

The big question to me is why people who do not need Java interop are using Clojure. Here are some reasons I can think of:

- The tooling around Clojure feels more familiar to Ruby/Python/Node programmers.

- Ruby/Python programmers need their programs to run slowly so that they can be certain something is happening.

- Cult of personality. Rich Hickey has a lot of great videos and conference presentations. Lisp has no apparent technical or thought leader. Followers need leaders.

- Hubris. The same stupidity that causes organizations to throw out Robert's Rules of Order and then subsequently reinvent non-standard solutions to the problems RR was created to solve in the first place.

P.S. CL's map works with all sequences, including vectors.


To be fair, unlike Ruby/Python/JS, Clojure actually tries to solve a relevant problem in a new way (concurrency). It is something that probably could have been built on top of Common Lisp, but at the same time, there is something to be said for having a relevant paradigm baked into the standard library from the beginning.


Nice way to ignore the big one.

It's less than one fifth of the age of CL, yet it has vastly superior libraries. Part of this is the Java interop, but at this point, even Clojure native libraries tend to be just better than CL libraries.

The reason for this is probably the common focus on good, sensible defaults and less on "everyone can easily roll their own". Having a set of basic, sensible data structures and abstractions that everyone share is not the same thing as "well, it's easy for anyone to do this". The idea that CL is flawless because it's so powerful that all flaws can be fixed by users is a disease, not a strength. It leads to a community where work is massively duplicated because all libraries are designed for a specific use, and every user needs to bend them to his uses.


You're making the same argument for why MIT started teaching Python instead of Scheme. I feel sorry for anyone whose life as a programmer is library spelunking instead of solving new problems.

If you think libraries are more important than having a truly interactive development environment that is Lisp 100% of the way down, you are missing out hugely on power and expressiveness. It has to be experienced to be understood. You're only fooling yourself and other people by thinking that Clojure is a "good enough" Lisp.


> I feel sorry for anyone whose life as a programmer is library spelunking instead of solving new problems.

You do realize that the vast majority of all the things that need to be done are essentially "library spelunking"? Not every programmer can spend his time doing AI research. A lot of the things that need to be done are "easy" but very work-intensive, and can be made much, much faster by good libraries. The majority of programming jobs are still essentially crud apps with a db backend, and CL is simply just a bad language to implement those in.

> If you think libraries are more important than having a truly interactive development environment that is Lisp 100% of the way down, you are missing out hugely on power and expressiveness. It has to be experienced to be understood.

I have experienced it, and understood it. And after 6 years of it, I switched to Java, because that's actually a more productive language to get things done in. Because even if the language itself is shit, things like internationalization and input validation have good libraries so I don't have to spend weeks working on getting all the little details right. Clojure buys me that, and a better language.

Clojure may not be a good enough lisp, but it's certainly better than CL.


Apologies to CL. I usually use MAP(CAR|CAN). I hadn't investigated MAP itself due to the extra parameter.


You're dangerously close to trolling, but I'll comment anyway.

> a "I hate parens" Lisp-1

Clojure's minimal syntax is, in my opinion, a gigantic improvement over Common Lisp. And I say this as a person who quite likes parens. I feel similarly about Lisp-1s, but that is well trotted territory: Lisp-1s have won.

Parens are overloaded in traditional Lisps for both invocation and grouping. The introduction of vectors with square brackets makes a lot of code a great deal more readable at virtually zero cost: It's still homoiconic. Similarly, the inclusion of curly braces for maps is wonderful, as it makes maps a lot more common in Clojure than they would otherwise be in CL, which is a good thing for most business logic.

> replicatable in CL as a library

Defaults matter. A lot. Presence in a library is insufficient. The fact that seqs et al are in core means that 100% of Clojure libraries use those abstractions. That's a big deal.

> I don't understand why the libraries and macros to create similarly compelling interop over ABCL weren't developed instead

Rich discussed this on the CL mailing lists long before Clojure or even his first attempt, dotLisp, ever existed. See [1] and [2]. In short, interop needs to be planned for at the lowest levels to make it pleasant to use and efficient to execute. And it's not just JVM interop: Clojure was designed for $SOME_HOST interop, so ClojureScript interops as nicely with JavaScript as Clojure does with the JVM. CL would have two different libraries with two different ideas of interop for two different host platforms.

> I don't know why Clojure was created as a new language

I think you have a different definition of the word "language" than I do. Look at PG's Arc. It's built on a scheme implementation. It's not so much a new language by your definition as it is a set of scheme libraries. But that's what a language is: A common base vocabulary encoded with a well known set of syntax and semantics rules. Clojure could be implemented (quite trivially, thanks to the aforementioned careful hosting design) as a set of libraries to CL, but it would still be a new language.

[1] https://groups.google.com/d/msg/comp.lang.lisp/3-X76dTw8dI/I... [2] https://groups.google.com/d/msg/comp.lang.lisp/3-X76dTw8dI/s...

Snippet from [2]:

    If one were starting from scratch,
    and supplied a platform like .NET, would one define Lisp the way CL is
    defined?

    I would hope the answer is 'most definitely not'. For instance, .NET
    provides for numbers, characters, strings, arrays, hashtables, exceptions,
    namespaces, files, streams, user-defined types, a type hierarchy and
    inheritance, I/O, object creation and initialization, reflection etc. Should
    a language define its own incompatible versions of these things in such an
    environment?


"Parens are overloaded in traditional Lisps for both invocation and grouping."

And boy do I wish they were overloaded the same way in Clojure. I hate the fact that I have to say

     (cond
       (some-long-predicate involving multipler-parameters)
       (what-to-do has to go-on-the-next-line because-of wrapping)
       (here-is-the-next predicate)
       [(func1 arg1) ...])
It's very easy to end up in this situation (and it's not always just a sign that you need to refactor). It messes things up visually, and it also means that #_ doesn't work to comment out an entire test-and-expression (likewise #_ doesn't comment an entire binding-plus-binding-expression in a let), because it's not just one s-expression.

I don't really understand the rationale, tbh (in fact I don't even know what it's supposed to be to try to understand it); somewhere I saw the observation that there's no need for you as a macro writer to make the client of the macro use parens for grouping when you can just call (partition 2 ...) on the arguments, which is true enough (at least, as long as the unpaired args in a larger group (e.g. binding vector) or are the tail of the arguments to the macro, captured as a rest param), but ... I kind of doubt that CL and Scheme went with the form of let, cond, etc. that they did out of convenience for implementation of the relevant macros. And even if that were the original motivation, those forms have other benefits.


I'm not sure how your cond example is related to vector syntax. The decision to use (partition 2 ...) style pairs, rather than extra brackets is orthogonal.

The more important point of literal syntax for composites other than lists is the fact that they are resolved at read time. This means you don't need a macro to have grouping. With (some-macro ((f x) (g y))), you need to force expansion inside the parens. Quoting (some-function '((f x) (g x))) requires forcing evaluation in your function. You could use (vector (f x) (g x)), but now that means some-function gets a vector argument and some-macro would get a list argument with first element 'vector. In Clojure, (some-function-or-macro [(f x) (g y)]) both have a vector as an argument because of the read-time behavior of data structure literals. Huge win in my book.


The cond example isn't related to vector-style syntax. There are two options: either the unpaired elements are the last (so you can get them from rest parameters) or the unpaired elements are already grouped somehow (for instance, by being in a vector). Cond does the former, let does the latter. I'm not sure why you're mentioning vector syntax at all since the comment you're replying to was specifically talking only about grouping.

Literal syntax for composites other than lists is totally unrelated to this.

I actually really don't understand why if you had (some-macro ((f x) (g y))) you'd have to "force expansion inside the parens", since well-behaved macros won't expand their arguments. You'd iterate through the elements in the parens, but ... that's what you'd do with clojure-style partition macros, too, you'd just call partition first.

For a function call the obvious choice, and one you see in Scheme/Racket quite frequently, is either `(,(f x) ,(g y)) for your second example, or even (list (f x) (g y)). Yeah, then your macro gets a list whose first element is 'list, but ... so what? Your macro probably shouldn't be looking inside what it receives anyway, and if it does then it should be documented that it expects a literal ((foo bar) (baz quux)) or whatever (just as in Clojure you can't write (let (vector 'a 'b) (+ a b)) and have that work).


Actually, I'd appreciate expansion on the respect in which Clojure is designed for interop with an arbitrary host. One (relatively uninteresting) respect in which that might be the case is that Clojure-the-language might not say anything about, say, what numeric types there are. Actually it does, though: Clojure supports ... all Java numeric types. And then there are two more Clojure-specific types. Or perhaps that is the sense in which it's designed for interoperation: it just says "we'll use the number types the host has".

Isn't it the case that Clojure and ClojureScript have different libraries with "different ideas" (whatever that means) about interop with their hosts? And ClojurePy yet other ideas about interoperation with Python? The hosts are very different in each case; how could the interoperation not be? (I suppose you could supply the host with a runtime that emulates aspects of the interoperation on the original host---but that's not very interesting!)

(Also, he mentions dotLisp in the post you reference as footnote [1].)


I disagree that Numbers are relatively uninteresting. In fact, I think any language designer would tell you that numerics are one of the hardest areas to get right. It's also the area where Clojure is weakest in terms of interop, I'd say. ClojureScript, for example, only has host Numbers (ie double-precision floating-point)

The main thing that Clojure does in terms of being designed for interop is to require the use of host values/objects. There are no wrapper/proxy/delegate/whatever objects. This has big implications. It (unfortunately) means that there is behavior you simply can't have in core, such as reflection or continuations. That's a big part of being interop friendly: Intentionally specifying fewer things. If you have very strict rules for how something like strings behave, then you might wind up in a situation where you need to create a ClojureString class or something like that.

Additionally, the '. (dot) special form is like a giant "INTEROP HERE" sign, which is extremely useful when porting code from CLJ to CLJS. You can literally grep your source for /\./ and find platform specific code.


What I meant is that "if designed for interop" in the case of numbers is something like "there is no design for numbers, just use the host's numbers", that's not a very interesting design. And it leads to, for instance, huge differences between Clojure and ClojureScript (as you note).


Minimal syntax can be implemented in reader macros in Common Lisp. If you really think some punctuation marks are more readable than a LAMBDA form you can write a reader macro to do it (and people have).

Parens are not overloaded in Common Lisp. It's always (function value value ...). And lists are always (). It's an artifact of homoiconicity that the program code can be represented in the same first-class data structures that it manipulates. I think we can all agree that is an advantage.

   '()
Is just a reader macro for QUOTE which returns its arguments unevaluated. LIST simply returns a new list from its arguments. BACKQUOTE lets you optionally evaluate parts of a list (which is useful unsurprisingly in macro definitions).

Re: seq; I don't really see the advantage. Some defaults might be right for certain applications but I prefer to be in control of making that decision.

ABCL interop is working rather well. They even have CLOS support now.

Parenscript generates great Javascript from Common Lisp code. The great thing about Lisp-like languages is that the evaluator can take a description of a process and create a machine capable of emulating that process. This happens to be really useful when experimenting with new languages. There's even a cl-python project to evaluate Python code in Common Lisp.

The great idea of Common Lisp was to bring together under one standard the forest of incompatible lisp implementations. I'm happy to see experimentation in the lisp space but it seems that fragmentation is only going to happen if everyone runs off into the woods to write their own incompatible lisp over things like syntax.

As for $SOME_HOST interop... a fair bit of the language is an artifact of the JVM. LOOP/RECUR is simply because the JVM is probably never going to support TCO (and while not required by a CL implementation it's nearly universal because it makes for efficient recursive programs... a style of program that is rather natural to lisps). The language doesn't have conditions and restarts because of the JVM (though I've heard it posited that it could be possible to implement them on top of exceptions).


Wish I could upvote more than once.


Honestly, I'm far more of a Schemer than a... Clojurite?Clojurist? Clojourneyman? I did try to make the switch to Common Lisp back in 2006, but I wasn't happy and went back to Scheme. Still, I'm far more interested in learning Clojure than giving Common Lisp another try. Here's what makes the difference for me:

1)Library support. With Clojure, it's a five minute import to get Bessel functions. When I asked about how to do Bessel functions in 2006, I was told to write it myself. I've heard things have become better since then, but I haven't been able to find any evidence that

2)Immutable data structures. Yes, this can be implemented as a library in CL. However, having it as the default means that I know every non-Java function I call isn't going to break that assumption. If I did find a Bessel function library, I can't assume that it's safe.

3)GUI support. In 2006, I needed to write a GUI application that ran on Windows, Mac, and Linux. PLT Scheme (now racket) had options available, but they weren't pretty. When I went to Common Lisp, I was first directed toward CLX, which wasn't native on Mac or Windows. Someone then suggested McClim, which still needed an X-server on Windows and now seems to be largely dead. It was then suggested that I write my own binding to WXwidgets. I considered that, but I'd then need to write a high level wrapper over those low level bindings.

Comparatively, from the little I've toyed with the Seesaw library from Clojure, it seems to be a beautiful way of handling GUIs.

Okay, I guess this comes down to another library issues.

4)Dotted pairs. The only use I've ever encountered for these is extremely fine tuning performance optimizations, but third party libraries loved surprising me with these at odd moments. I can see how Lisp-1 versus Lisp-2 might be a matter of taste, but I've never heard someone complain that how they missed dotted pairs when working in Scheme or Clojure. They may be a good argument, but I've never heard it.

5) Libraries. I'm sorry that I keep coming back to this point, but I guess it's a big one. Every time I tried to do something interesting in Common Lisp, the recommendation that I was given was to write low level wrappers to three different C libraries. For several of those projects, I found it easier to just cut out the middle man and write the whole damn thing in C. The rest of the time, I wound up writing Lisp that looked almost exactly like C.

Honestly, half of this is because I'm a mediocre programmer. I have no pretensions of greatness. If I was a great programmer, I could see how to make my own DSL that made the interaction of the libraries beautiful, instead of C with more parentheses. However, in scheme or clojure, I can usually find the work of another, better programmer, who has already made that DSL. In Common Lisp, I'm usually told to write it myself. I don't know if that's because all the other Common Lisp programmers are so brilliant that they all write DSLs all day or if it's just because they're all mediocre programmers like myself and no one knows how to do it.

6) Global variables. Every examples of idiomatic Common Lisp code I was delivered was littered with globals. This might be a stylistic decision, but it's one I've never liked. A third of my problems seemed to be solved by setting OPEN-NETWORK-SOCKET-AND-SET-FIRE-TO-PRINTER to 1 and STOP-PRINTER-FIRE to nil. I can see this reliance on globals if you're writing servers, where you have a long running application with lots of state, but I wasn't, so it just made the code harder to reason about.

7)Image based programming. I understand from the SmallTalkers that this is the best way to write code, but I don't get it. What always happened for me was that some global SWITCH-CHARACTER-ENCODING-TO-EBCDIC would get set at some point and all my code would now fail. With a file based language, I'd exit and restart to kill this accidental state and everything would be okay. With the image based code, I'd have to go through the assorted globals and find which one had changed.


Regarding image based programming. There is nothing preventing you from exporting your package(s) as a "change set". This change set can be imported into your start image. Any real globals would of course not reside in the change set, because it originated from a package. Maybe I'm missing your point.



>Bluntly, I don't know why Clojure was created as a new language instead of an advanced library over Common Lisp

I think you basically answered your own question :)

>JVM interop is compelling


But the thing is, Armed Bear Common Lisp (ABCL) already offers JVM interop.

If someone sat down and really massaged it, the currently clunky interop there could be just as shiny as Clojure.


Rich Hickey's previous projects to clojure were all about Lisp<->JVM interop (see http://foil.sourceforge.net/, but there is at least one other) -- so I think he found limitations to what you can do.


>But the thing is, Armed Bear Common Lisp (ABCL) already offers JVM interop.

Yes, a half-arsed, barely supported interop. And slow to top.

>If someone sat down and really massaged it, the currently clunky interop there could be just as shiny as Clojure.

I rest my case.


Yeah, they do. And there's quite many of them actually. :-) Clojure might be big in the startup bubble, but that's about it I'm afraid.


I'll use Clojure when it gets LOOP.


Well here's where you might start: https://github.com/tayssir/cl-loop

Although the community seems to prefer the port of Iterate: https://github.com/nathell/clj-iter


Isn't Loop just a big macro? Write it if you want it.


If you need someone to try a hand in supporting ruby, give me a hit, would gladly try to accomplish it.


I can't wait for that to happen, I learned Emacs for the sake of CL development... I was actually thinking of learning Clojure just to check out LT.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: