
Lisp in Web-Based Applications (2001) - tosh
http://lib.store.yahoo.net/lib/paulgraham/bbnexcerpts.txt
======
deepaksurti
Many years back, at a movie studio, I was working on an application that would
enable users to mine historical release data for planning. I started off with
a proof of concept in RoR (v0.2ish) days and on a flight home read 'Hackers
and Painters'.

After the trip came back and dropped RoR and prototyped the app in CL (CMUCL
IIRC). The users loved it, so to deploy it with a UI, ended up with Lisplets
[1] (checkout who wrote it!)

Fast forward a year or so, the users were happily mining the data with a clear
impact on bottom line. Then I came across NLP in CL and extended the app with
NLP functionality so users could do kind of google search for their queries
("show me all movies which were directed by X and starred Y, Z and made N
dollars in A, B, C territories). Writing NLP app in non ML hype phase was fun,
note that there was some simple query syntax for users to learn.

Last I heard, after I left, a year or so later, they did a rewrite of the app
in Java land; most Lispers here can predict how that story ended :-(. One of
the most enjoyable phases in my career and don't even ask me how I pulled off
writing CL in corporate for 4+ years, because frankly I don't remember (side
effect of coding in CL being fun!) but I think my manager had failingly
invested a lot in getting this app developed prior to giving me a chance to
prototype 'quickly' and I think the prior pressure of not-shipping helped me.

[1] [http://lisplets.sourceforge.net](http://lisplets.sourceforge.net)

[2]
[https://www.aclweb.org/anthology/J90-2005](https://www.aclweb.org/anthology/J90-2005)

~~~
neilv
I've worked on a couple large Web-involved projects that would not have been
viable, had they not used a Lisp (one Scheme, one CL). (The Scheme one, some
advanced ancient astronaut before me had single-handedly made an architecture
that did every complicated thing needed, and I'd say wouldn't have been viable
to do in a non-Lisp.)

It's easier in the last few years to see why startups aren't using a Lisp,
despite PG's early advocacy of that -- they want a very polished-looking
Web/app frontend, and everyone is pushing you to buy into their frameworks and
SDKs for that.

But I'd still like to see some students who played with Racket/Scheme/CL in
college spin out to do a startup with a Lisp for prototyping/beta, and once
they have real funding (when they should probably be rewriting prototype code
in any case, or even pivoting) decide whether to keep going with a Lisp. (If
they keep going with a Lisp, a bonus is that they have special access to a
disproportionately high-skilled labor pool, like in other niches that attract
nerdy enthusiasts.)

------
lisper
The order-processing system behind my site [1] is written in Common Lisp. It
interfaces with Stripe for credit card processing and Easypost for generating
mailing labels. The whole thing took me about two days to write and it has
been working without a hitch for several years. It has more than paid for
itself just in the time it has saved me in preparing international shipping
labels manually.

I also have a prototype of a server-mediated version of the SC4 secure
communications system [2] [3] written in CL. The code for this is a bit of a
mess so it's not publicly released but if you're interested drop me a line.
Contact info is in my HN profile.

[1] [http://sc4.us/hsm](http://sc4.us/hsm)

[2] [https://github.com/Spark-Innovations/SC4](https://github.com/Spark-
Innovations/SC4)

[3] [https://stage.sc4.us/sc4/sc4tk.html](https://stage.sc4.us/sc4/sc4tk.html)

------
pavlov
_”In fact it turned out that Web consultants didn 't like Viaweb. Consultants,
as a general rule, like to use products that are too hard for their clients to
use, because it guarantees them ongoing employment.”_

A useful reminder of why much of web development is the way it is.

~~~
lgessler
Is this really true? Genuine question, I'm not being snarky. When I think
about common complaints about web dev, they all seem to be caused by something
else. JS's non-existent standard library and mournfully inconsistent semantics
were caused by Brendan Eich writing it in a weekend and never getting a chance
to fix it because it got standardized too quickly. Framework churn is caused
by the fact that the web browser and all its primitives were unlike any
platform that came before it and we didn't (and still don't) know what the
right abstractions are even for any given kind of web app. UI design to a good
extent is just inherently hard and requires accounting for many details that
HTML and CSS must therefore expose to you, etc.

~~~
pavlov
Most sites just don’t need JavaScript. But “SPA everything!” certainly has
kept the consultants happy.

------
reaperducer
I'd like to try Lisp for a personal web project I'm working on. What's the
Lisp equivalent of a LAMP stack? What is the recommended process for an Ubuntu
server?

~~~
aeorgnoieang
Racket can probably do everything you want (i.e. serve as its own 'LAMP
stack').

Clojure with whatever the standard libraries are nowadays is easy to get setup
and running.

I'm sure there's a common Common Lisp set of libraries for web apps too.

And there's a variety of smaller Lisp projects for various other runtime
environments, e.g. various Lisp-to-JavaScript transpilers that you could run
on top of Node.js.

~~~
privong
> Racket can probably do everything you want (i.e. serve as its own 'LAMP
> stack').

Here's a quick tutorial on web applications in Racket: [https://docs.racket-
lang.org/web-server/index.html](https://docs.racket-lang.org/web-
server/index.html)

------
tosh
I fondly remember the a-ha moment I had when I realized Ruby on Rails &
Symfony are relying heavily on passing hashmaps around, instead of positional
parameters.

~~~
dmux
Is this related to a particular paragraph in the article? I've found this
style interesting as well and would enjoy reading about others experiences
with it.

~~~
tosh
Not directly re passing hashmaps but related:

He writes how keyword parameters helped evolve the code. Today we might say
“anti-fragile”.

> Rtml even depended heavily on keyword parameters, which up to that time I
> had always considered one of the more dubious features of Common Lisp.
> Because of the way Web-based software gets released, you have to design the
> software so that it's easy to change. And Rtml itself had to be easy to
> change, just like any other part of the software. Most of the operators in
> Rtml were designed to take keyword parameters, and what a help that turned
> out to be. If I wanted to add another dimension to the behavior of one of
> the operators, I could just add a new keyword parameter, and everyone's
> existing templates would continue to work. A few of the Rtml operators
> didn't take keyword parameters, because I didn't think I'd ever need to
> change them, and almost every one I ended up kicking myself about later. If
> I could go back and start over from scratch, one of the things I'd change
> would be that I'd make every Rtml operator take keyword parameters.

------
cracauer
Well, most of the big airlines pay ITA software for their Lisp written QPX
engine so that it searches their insane pricing data structure to display on
that airline's own website.

~~~
IronBacon
Paid, in the past tense, as they were acquired by Google/Alphabet a few years
ago, IIRC.

Does someone know if they rewrote QPX with one of their internal approved
languages (Java?) or if they continued to use CL? The Wikipedia page mentions
that they offered a simplified API but was discontinued April last year.

I would dare to say they canned the product for good... ^__^;

~~~
cracauer
The carriers and OTAs are still using QPX the same way after the Google
takeover. That was actually part of the agreement to let Google buy ITA.

It is still Common Lisp. Among other things you can tell by their
contributions to open source Lisp projects.

------
bitwize
This is one of those things like "In the Beginning Was the Command Line" that
sounded profound in its day, but didn't take into account the inexorable march
of time. In 2019, there is a strong bias to write Web service applications in
the same language as the client. If you're doing greenfield development and do
not choose JavaScript as your implementation language, someone will tell you
you're being impractical.

~~~
outworlder
> In 2019, there is a strong bias to write Web service applications in the
> same language as the client.

Really? One would have thought that this was true a couple of years ago. Now?
Does it really matter which languages your backend is written in, since you
are going to interact using APIs anyway? And the backend is going to be
composed of containerized microservices, so not even runtime installation is
an issue now.

Not sure who in the right mind is still advocating for writing backend code
exclusively in NodeJS in 2019.

~~~
Scarbutt
_Not sure who in the right mind is still advocating for writing backend code
exclusively in NodeJS in 2019._

Millions of node.js developers? ;)

Also, paypal, netflix, ebay, linkedin, uber,...

~~~
bitwize
Not to mention coding bootcamps. For those with short memories, Java didn't
achieve its dominance based on Sun's marketing alone. Sure, that played a
role, but Java was also convenient for universities to roll out as a language
for instruction, usually displacing the likes of C++ and Pascal. It became the
first language for millions of developers, many of whom wouldn't have much
exposure to anything else.

For a while, it looked like Python had a shot at becoming the next dominant
teaching language. Then the coding bootcamps realized they could save money
and retain more students if they pitched JavaScript as _the_ language for
client and server. And so millions more developers are emerging with little
exposure to anything outside JavaScript.

------
idlewords
Worth remembering that Yahoo's first major decision after buying Viaweb was to
rewrite it so it was not in Lisp.

[https://discuss.fogcreek.com/joelonsoftware1/31402.html](https://discuss.fogcreek.com/joelonsoftware1/31402.html)

~~~
simonsaidit
Reddit also started out as lisp [https://redditblog.com/2005/12/05/on-
lisp/](https://redditblog.com/2005/12/05/on-lisp/)

~~~
idlewords
Lisp really is the Wankel engine of programming languages. Everybody loves it
until it's time to put it into production.

------
jiyinyiyong
ClojureScript and Node.js now even a junior JavaScript can do that without
learning obscure syntaxes from Lisp.

