Hacker News new | past | comments | ask | show | jobs | submit login
Common Lisp Koans (github.com/google)
100 points by galois198 on Dec 19, 2015 | hide | past | favorite | 22 comments



I'm surprised to see that this is on Google's Github page. Do they have any projects (besides this) that use Common Lisp?


They bought ITA Software a few years ago, which largely used Common Lisp.


And additionally employ Peter Norvig[0].

[0] https://en.wikipedia.org/wiki/Peter_Norvig



I think they also use Common Lisp with their work on D-wave quantum computers. I'd still wager the ITA group has the lion share of Lisp though.


Is there any reason today to study Common Lisp instead of a more popular and evolving Lisp, like Clojure or Racket?


btw, your question assumes that Common Lisp is not evolving. This is not correct at all. Which improvements Clojure evolving consists of? Transducers? Cl got them too: https://github.com/aamedina/transducers Transactional memory? http://stmx.org/ ClojureScript? http://davazp.net/jscl/jscl.html

These are only infrastructure things, Common Lisp has language features which are just impossible in Clojure while it based on JVM.


>btw, your question assumes that Common Lisp is not evolving. This is not correct at all. Which improvements Clojure evolving consists of?

Traction for one.

>Transducers? Cl got them too

Pointing to some random libs that implement the same concept doesn't mean it's part of a languages culture/ecosystem/common practice as transducers are to closure.

E.g. I could say "Rails? Well, language X has a rails like framework too", but that wouldn't mean you get the same benefits of using that framework over rails, when you include language adoption, community vibrancy, availability of programmers to hire, tooling, books, etc.


The whole point of common lisp, the reason it has survived since the beginning of time, is that the language was designed so that language innovation happened by people developing libraries for it. Complaining that common lisp hasn't evolved is like complaining that free-software posix systems haven't evolved. True, the posix standard hasn't evolved much, but its not meant to, it's meant to be evolved by the userspace programs and libraries that people write.

Yes, this approach is not the best approach to getting mass adoption, and there are benefits to mass adoption — people can help you, there's a bigger pool of people to hire, etc (I think its much more important to companies than individuals). But mass adoption isn't always the goal. I suppose you can consider Ruby analogous to Ubuntu while common lisp is like a *bsd distribution (or arch, gentoo, slack...). Ubuntu is great, all Ubuntu installations start from the same starting point, and the potential for customization is limited (try changing Ubuntu's init system), so you can just ask a question on stack overflow and get an answer with instructions specific to how your system works. And companies are more likely to pick Ubuntu than gentoo, because its better supported and supposedly more stable. That doesn't mean that people consider the distributions where the user can pick and choose exactly what their system does (like a common lisp programmer does by picking out libraries of macros) to be any worse of a distribution. Quite the contrary, the mythos seems to consider these distributions better in some way, like they're a better tool for a more skilled practitioner, a sentiment which has also found its place around common lisp.


>The whole point of common lisp, the reason it has survived since the beginning of time, is that the language was designed so that language innovation happened by people developing libraries for it.

And that "whole point" hasn't worked very well as to the availability of a rich library ecosystem and/or adoption. So, while it's a nice trait to have, it's perhaps too much of a burden.

>But mass adoption isn't always the goal.

True, but it's not like CL was designed like some researchy or experimental project that doesn't care about mass adoption.


They should not be a part of language, what for?

Everything else you mentioned is about community only, and doesn't apply directly to the language.

E.g. if you have a good language without a community, community can eventually grow, but you can use the language anyway.

If you have a bad language with great community - it doesn't reduce your suffering from the language itself.


>E.g. if you have a good language without a community, community can eventually grow, but you can use the language anyway. If you have a bad language with great community - it doesn't reduce your suffering from the language itself.

My experience has been the inverse.

I'd rather use a bad, or usually mediocre language WITH community, tooling, libs, books, programmers etc, than a better one where I'll be burdened by the lack of all of these.

So, in a sense, community tramps inherent language qualities.

After all that's the very basic message from Lisp and Smalltalk.


Agreed. Clojure isn't overall a bad language, but it has annoying quirks in a lot of places, presumably because it needs to be compatible with Java. The ones that annoy me the most are (0) `nil` and `false` being different, and (1) wonky arithmetic that uses Java's numeric types under the hood, unless you explicitly ask it not to.


Racket is not Lisp, and I mean this as praise, not as an in "boo hoo, not Lisp, ergo bad". Racket's macro system, in particular `syntax-parse` and `define-syntax-class`, makes it a joy to extend the language. When you use a Racket macro wrong, you get an error message in terms of the abstraction the macro provides, not in terms of what the macro expander compiles it to, which is an implementation detail you have no business knowing or caring about. `defmacro` doesn't even begin to get close to the level of abstraction that Racket macros provide.


One reason is that there are projects/situations where language stability can outweight the benefits of language evolution. While this isn't the coolest view out there, the fact the the ANSI standard didn't need to be revised since 2004 can actually be a feature, not a bug. For an extreme example of my point, look at the state of the front-end JavaScript frameworks in the last couple of years.


> state of the front-end JavaScript frameworks

There's evolution and there's running in circles. :-p

Few languages really evolve fast in a meaningful sense. The only examples that come to my mind are Haskell, Racket and pre-1.0 Rust. And the first two are research languages. Breaking changes (e.g. Python 3) to get rid of accumulated cruft can be a good thing, but nevertheless stability is a feature.


1. It's suitable for object-oriented programming. Common Lisp Object System is insanely powerful.

2. Depending on the implementation it can be really fast.

3. Depending on the implementation, support for typing and type inference.

+more. It's a much bigger language with a kitchen sink of features.


Note that Clojure also supports OO style with rotocols http://clojure.org/protocols and multimethods http://clojure.org/multimethodsp in fact stuff like Om https://github.com/omcljs/om/wiki/Quick-Start-(om.next) is fairly object oriented in nature.

Clojure is also very fast thanks to running on the JVM and it supports type hinting. There's also core.typed for static typing support.


Yes, they are _completely_ different languages, despite being lisps.


Thanks. Any suggestion about with which one to start? I don't believe that I'd use them for work or for many personal projects, but I've read about the advantages of learning FP. So I'd like to learn something that teaches me to think about programming in a different way and be able to apply those insights into the code I write in Java or other procedural or OO languages used at work.


OCaml, Haskell and friends will give you best FP insights. Common Lisp is far beyond these categories =)


Clojure is definitely a perfect fit for you then, you can even interop with your Java code.




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

Search: