
Running Lisp in Production (2015) - lisper
https://www.grammarly.com/blog/engineering/running-lisp-in-production/
======
rusabd
Back in Amazon I found some ancient code written in Common Lisp. Doubt any
production services left, but I updated the build system to support Clozure
CL. My contribution in $BIGCORP :)

~~~
ken
Was it the "You may also be interested in:" box on product pages? I remember
going to a tech talk, many years ago, by the person who wrote that.

~~~
rusabd
Nah, I implemented a simple wrapper around an internal tool for auto-
translating Oracle PLSQL to SparkQL. Data Engineers liked that a lot

------
dang
See also:

2019
[https://news.ycombinator.com/item?id=20814511](https://news.ycombinator.com/item?id=20814511)

2018
[https://news.ycombinator.com/item?id=16860646](https://news.ycombinator.com/item?id=16860646)
and
[https://news.ycombinator.com/item?id=16679963](https://news.ycombinator.com/item?id=16679963)

Discussed at the time:
[https://news.ycombinator.com/item?id=9785944](https://news.ycombinator.com/item?id=9785944)

Edit: also
[https://news.ycombinator.com/item?id=23231701](https://news.ycombinator.com/item?id=23231701)
from a few days ago.

~~~
faq125
Thank you for the links, what a nice discussion back in 2015.

Everything has gotten more corporate. I hardly dare to make a Lisp comment
now, because people from $BIGCORP would jump on it.

~~~
dang
Really? Please dare. I don't think $BIGCORP is so dominant here, or that
things have changed so much since 2015.

Most changes that people notice on HN are random fluctuation. Note that I
don't say all changes—just most. The trouble is that it's hard to figure out
which ones are vs. aren't, and none of us really tries. We just notice the
data points we notice (which, btw, are the ones we're primed to notice—usually
whatever we dislike the most) and connect the dots with material from our
imagination. It's an amazing thing! Randomness plus cognitive bias equals
narrative.

There's a thread about this on the front page right now:
[https://news.ycombinator.com/item?id=23293462](https://news.ycombinator.com/item?id=23293462).
I've been saying the same thing about people's interpretations of HN for
years:

[https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...](https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=by%3Adang%20notice%20dislike&sort=byDate&type=comment)

[https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...](https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=by%3Adang%20narrative%20random&sort=byDate&type=comment)

------
ngcc_hk
For normal small team it might be hard to get advise. More diverse users in
other eco-system. Even clojure is hard. At least the code is easier to read.

------
lerax
On reddit I found that following questions. I would be glad for some possible
answers.

\---------

That was a good post.

I wonder if the tech stack still uses Common Lisp after these 5 years,
considering all other languages described in the post?

Are there any new lessons learned after running Common Lisp for another 5
years, if it is still actively used?

Would you pick up Common Lisp again or something else, if you can go back in
time and get a chance to start fresh?

Thanks!

------
emit_time
My previous job was all common lisp. I really enjoyed writing it. The REPL was
definitely a job, and having a dynamic runtime environment.

------
naveen99
Finally read the reference on lisp reader macros :
[http://www.lispworks.com/documentation/HyperSpec/Front/X_Mas...](http://www.lispworks.com/documentation/HyperSpec/Front/X_Mast_9.htm)

Now I sort of get what #+unix means...

~~~
jlarocco
For the benefit of everybody else, #+ does feature checking.

The Common Lisp standard defines a standard "special variable" (kind of like a
global) named * features * (shouldn't be spaces, but HN italicizes it
otherwise), and #+ (and #-) take a "feature expression" and conditionally
execute the expression that immediately follows it when the feature expression
is true. If the feature check is false, the next expression is ignored.

For example:

    
    
        #+freebsd(print "This is FreeBSD")
        #+(not (and 64-bit linux))(print "This is not 64-bit Linux.")
        #+quicklisp (ql:quickload :some-library)
    

The CL standard lists a few standard features (:common-lisp, :ieee-floating-
point, etc.) but for the most part implementations and libraries define their
own.

It's not perfect, but works well enough in practice.

~~~
TeMPOraL
The common thing done with it is:

    
    
      #+nil(this expression (won't be read))
    

(Also done with #+and, and #+or.)

This is an unofficial Common Lisp s-expression level comment. One of these
incredibly nice things that's missing in most programming languages. It
comments out a single s-expression, no matter how complex. It's like a #|block
comment|# in that it can span multiple lines, and like ; line comment in that
you only put something at the beginning. Have a complex expression within a
function, that you need to temporarily shut down? Just shove #+nil in front of
it.

(The #+nil version is discouragd because there's a remote chance somebody will
define a * feature * called :nil for some reason.)

A less-common thing done with it is library interop. Many libraries tend to
add a tag to * features * to indicate they've been loaded, so in your library,
you can use #+library_tag to detect that another library is a part of the same
project, and conditionally compile-in some extensions or interoperability
code.

(@dang, I think HN could use a way to escape the * * formatting marks. For a
site and community that has a soft spot for Lisp, not being able to type in
the "earmuffs" is something that always bewildered me.)

~~~
rjsw
I would guess that there was a feature :nil defined in the NIL [1] system.

[1]
[https://en.wikipedia.org/wiki/NIL_(programming_language)](https://en.wikipedia.org/wiki/NIL_\(programming_language\))

~~~
TeMPOraL
That must be it, thanks!

------
phoe-krk
Previous discussions:
[https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...](https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=Running%20Lisp%20in%20Production%20grammarly&sort=byDate&type=story)

~~~
dang
You can add "comments>0" to get the ones with comments:

[https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...](https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=Running%20Lisp%20in%20Production%20grammarly%20comments%3E0&sort=byDate&type=story)

~~~
capableweb
Interesting, seems the "comments>0" op is undocumented, couldn't find it
anywhere on the algolia page. Is there a page with all the different operators
you can use?

~~~
dang
It's documented here:
[https://hn.algolia.com/help](https://hn.algolia.com/help). You have to click
'help' at the bottom of the search page, I guess.

Another option I use, which doesn't appear on that page, is storyText=none, if
you want to exclude matches from text posts. That one has to go in the URL,
though. Note the difference between the link in my GP comment vs. this one:

[https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...](https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=Running%20Lisp%20in%20Production%20grammarly%20comments%3E0&sort=byDate&type=story&storyText=none)

The latter creates much cleaner search results if you want to match just on
title and URL.

------
fardeem
This is so cool

------
codersfocus
This is officially the hardest I've laughed at a grammar mistake. At the end
of the third line, there's a missing space between "years." and "We". Petty, I
know, but I expect a grammar company who took over my Youtube ads earlier
about writing perfect emails and blog posts to have perfect blog posts.

~~~
dirtydroog
Earlier? I still get them

------
jgwil2
From 2016

~~~
cpach
2015, no?

~~~
jgwil2
Yep, I guess I saw June 26, 2015, and flipped the 5 and the 6. Thanks.

------
dirtnugget
I seriously don’t get why lisp is so popular on HN, it’s basically unreadable
to very most of developers. It’s an ivory tower.

~~~
pritovido
I will explain it for you.

Lisp is hard to master, like playing the violin, but if you master it you can
get enormous rewards.

Other languages are more like "playing guitar hero", most of the work is done
for you and it it way easier to learn.

HN is like a musician network but for programmers. It attracts lots of people
around the world that master lisp like musicians master an instrument.

I will tell you about myself, I had a lisp master that did teach me that what
had taken me weeks in c, c++ and python code he could do it in lisp in
minutes.

As I saw this man "play his instrument" it was obvious that if I wanted to be
a good programmer I should master it myself.

Because I had this master teaching me, I could learn it fast.

The "secret" of Lisp is that you can automate your code writing, making you
tens or hundred of times more capable with your code.

"Ivory tower" means it is not related to reality. Lisp is very real, like
violins are real.

~~~
avalys
Could you give me an example of a real-world software engineering task which
takes “weeks” in Python and minutes in Lisp?

~~~
srean
Not weeks to minutes, but still, try writing an Airlines booking, scheduling
application which gets the traveler the best route given his/her requirements.

~~~
goto11
That is just an algorithm, isn't it? I cant see how it would be simpler to
implement in Lisp that Python.

I suspect the issue is that a flight booking system is basically the only
significant commercial system written in Lisp, which is why it is always
dragged out in these discussions.

~~~
lispm
The flight search was designed 20 years ago with the goal to disrupt
mainframe-based flight search systems domain:

Here is some background on that particular application:

[https://www.msri.org/people/members/sara/articles/airfares.p...](https://www.msri.org/people/members/sara/articles/airfares.pdf)

[http://www.paulgraham.com/carl.html](http://www.paulgraham.com/carl.html)

> I suspect the issue is that a flight booking system is basically the only
> significant commercial system written in Lisp

How would you know that?

~~~
goto11
The claim was that something which would take weeks in say Python would take
minutes in Lisp. Then this flight search system is presented as evidence.

I just don't see how it is any form of evidence for that rather extraordinary
claim? It just shows it is possible to write complex software in Lisp, but I
wasn't disputing that. I'm disputing the claim of 100 x productivity.

~~~
lispm
I was addressing your 'That is just an algorithm, isn't it?', in case you
would be interested what that application is actually about.

There was no general claim of 100x productivity. The commenter wrote: "I had a
lisp master that did teach me that what had taken me weeks in c, c++ and
python code he could do it in lisp in minutes"

That was his personal impression, not a general claim. I can't also imagine
how this could be a general claim.

