
Show HN: Full Stack Lisp – A book in progress about writing Common Lisp apps - pavelludiq
http://fullstacklisp.com/
======
AlexeyBrin
The book can be read online, link is easy to miss but it is there
[https://leanpub.com/fullstacklisp/read](https://leanpub.com/fullstacklisp/read)

~~~
valbaca
or click on the book cover. hard to miss

~~~
Wonnk13
I missed it ...

~~~
marvindanig
It is interesting to see people call an image a "cover" and a website a book
even when the said cover actually never covers anything nor there is a book in
there because a website.

Digital books are so broken!

~~~
kazinator
It's assumed that these deliverables will closely correspond to the printed
ones.

If you scan a dead tree book to PDF, and you include an image of the outside,
that's still called a cover; PDF isn't broken.

~~~
marvindanig
PDFs and Word were originally designed (still meant to) for enterprise
documents, not books. It works somewhat for books too but then PDF is not
really "on web". People still have to download an artifact, save it somewhere
or may be bother about other similar digital book formats the same way.

If that isn't broken then what is?

~~~
kazinator
> _If that isn 't broken then what is?_

Why, viewing content on some god forsaken web site, page by page, through some
proprietary plugin, with no ability to save other than taking a screenshot of
the window.

Downloading and saving is king.

------
auvi
I really appreciate the author taking the time to write this book. I have read
his previous book Lisp Web Tales and learned many things from it.

------
zeveb
Best of luck!

I like how you mention first thinking Common Lisp was archaic, and then
realising how advanced it really is.

BTW, you might want to wrap your text lines:-)

~~~
shoover
+1. Kenny Tilton's blog is also great for that kind of thing.

"You know Lisp is the perfect language precisely because it lost its momentum
(died) and lives on. Other languages need their Next Big Thing momentum."

[http://smuglispweeny.blogspot.com/2013/08/wow-even-
lispers-h...](http://smuglispweeny.blogspot.com/2013/08/wow-even-lispers-hate-
lisp.html)

~~~
PeCaN
I think the journey of a Lisper inevitably ends up with realizing that Common
Lisp is not an acceptable Lisp. Then you start searching for an acceptable
Lisp. You look at Tcl, at Prolog, Io, Rebol, and Icon; you learn Shen, try
Scheme and Racket, appreciate Smalltalk and Self and Slate, wrap your head
around Forth and Joy and Factor… and the whole time you write Common Lisp.
Because there is no acceptable Lisp.

~~~
kirubakaran
Why is that though?

~~~
adwf
Because lisp is an immensely flexible language/concept. Everyone has their own
idea of what it should be/can be.

Common Lisp was exactly what it says "Common". Just some sort of common ground
between all the various lisp dialects that existed, because everyone went
their own way in extending the language. People end up coming back to it time
and time again, because all the others don't quite provide that common ground
for people to work on. Whilst there may be things missing, there's always
something _more_ missing in other lisps.

------
mark_l_watson
Very nice, I love seeing new Common Lisp books being written. (BTW, I also
have a Common Lisp book on leanpub.com - a great company to work with if you
are a writer).

It is especially good to see a complete caveman2 application developed in the
book.

~~~
eggy
I am in the middle of reading Adam Tornhill's 'Lisp for the Web', and I just
stumbled on this book.

Yes, Lisp seems to me to be getting more exposure, but that may be my 'Lisp-
colored sunglasses' ;)

Is caveman2 a lot easier, or what other advantages does it have over piecing
stuff together?

I have always liked and programmed in Lisp, but not for the Web, so I need to
get up to speed with Web frontend/backend programming again for personal use,
not a job.

OT: Mark, I am on your 3 edition of 'Loving Common Lisp', and I really
appreciate the Networking chapter update, and your smooth writing style!

------
haspok
I'd love to read a chapter about why would someone choose Common Lisp instead
of, say, Clojure (with all the JVM ecosystem behind it) or LFE (with the
Erlang ecosystem behind it). What are the use cases in which CLISP stands out
and offers a benefit?

~~~
Elrac
Disclaimer: Amateur's blundering travelog.

I've been dabbling in Clojure for about 4 years now, off and on, and it works
very well for small-ish projects. The integration, as others have mentioned,
with the JVM is superbly seamless (it leaves Scala in the dust in this
respect) and this opens up most of the Java ecosystem. Also, the STM model of
concurrency management is super cool. So far so great!

But every time I try to build something more substantial than a Project Euler
submission, I end up with something blowing up in my face. Recently, I was a
bit annoyed to discover that the set of keys of a map doesn't have the same
semantics (including sequential access) as other sets, and on another occasion
I was debugging something and the contents of some variables that displayed
valid data in "print" statements showed as "null" in my debugger. None of this
is show stopping but when I'm just playing around I have a low frustration
threshold. My impression is that Clojure is a good Lisp with many fantastic
new features but not all of the batteries are included (yet).

Meanwhile, I have zero experience with CL but I keep hearing that it's highly
mature, rock solid, the choice of most professional Lispers, and the platform
of choice for Peter Norvig's book on AI programming. In my imagination, that
means everything works exactly as expected and there is a wealth of useful
libraries - which would be sweet, from where I stand.

~~~
mark_l_watson
Some advice for Clojure that applies to all lisps: write code bottom up in
small pieces making heavy use of the repl for development. Really understand
what your small piece of code does, clean it up, put it in a separate small
file, and once you have confidence in it think of it as a library that just
works.

~~~
collyw
Isn't that the same as many other languages is you take a tdd approach?

~~~
ohyes
no. You test by plugging it into the repl and running some stuff through it.

(Tdd is writing some tests then making some code that passes them. Which, imo
is cart before the horsism)

------
zelcon
I recently gave up Lisp for Clojure instead because of the dearth of
"batteries," so this book is very important and timely.

------
avmich
Can you include a good description of reading macros? I'm still looking for
good explanation with examples of their power.

~~~
jonathankoren
It's just a macro. It's pretty much exactly like a #define in C

~~~
_ph_
This is pretty much wrong. C macros have a simple substitution language. But
all Common Lisp macros can run arbitrary common lisp functions to compute the
macro expansion. That means, you are not limited to pattern matching, but can
write a program - in the same programming language you are using for your
application - to compute the expansion. Of course there are simple cases which
are just syntax rewrites, but there are also complex cases, like the loop
macro. The loop macro allows you to specify looping constructs in an almost
natural language.

------
cadr
Just a nitpick, but I find the code part hard to read. Not sure if it is the
colors or what. You might get some other feedback on it. Good luck!

~~~
tropo
It's just the language. Everything looks the same.

~~~
cadr
No, I'm use to reading Lisp. Something else, but I'm not a designer and can't
quite put my finger on it.

~~~
joelg
Given your username alone, I'm inclined to believe that you are, in fact, used
to reading Lisp.

~~~
DonaldFisk
Assuming Lisp is correctly indented, it's quite easy to read. You can just
ignore the parentheses for the most part, and concentrate on the layout and
the built in macros - defun, let, do/loop, cond/if/when/unless/case, lambda,
...

If it's written in a functional style it becomes even easier: you don't have
to hold any state in your head.

------
TheMagicHorsey
Is it full stack Lisp in the sense that Lisp is running on both the server and
in the client (browser/mobile)?

If it is the latter, that would be quite compelling. Clojure/Clojurescript is
quite compelling from a developer point of view, since you don't have to
switch mental context to develop your server and client code (as you would
have to do if you develop Go on the server and JS in the browser).

~~~
pavelludiq
I plan on covering par, but mostly the name came from an attempt to explain
the current state of lisp libraries, the "stack".

~~~
e12e
Interesting book. Your introduction covering toolsets, choice of lisp etc was
enough that I bought a copy!

I've been seeing (common) lisp everywhere lately, from talks on clasp to the
recent(ish) work on (really) fast http parser for lisp etc. It really feels
like cl, with the help of a few, but very much needed tools and libraries
(like quicklisp) and mature implementations that compile down to machine code
could have a bit of a renaissance.

I think a lot of people simultaneously realized that one didn't _have_ to code
old style lisp, just because the cl spec has been written. Like the project to
reimplement cl in cl. There's no _need_ to rely on old broken crutches, just
take the good parts of cl, combine with 40 years of experience from system and
language engineering, and reduce back down to cl. And suddenly you have
something very elegant and efficient and powerful.

Ok, I admit, I still want "sweet expressions"[1] -- but I think just a simple
thing like acknowledging that global variables with * earmuffs * , are still
global variables - and generally a bad idea -- and that cl is much more than
some small "functional" language goes a long way. I remember I came to lisp
rather late, and was confused by how _un-functional_ a lot of the code was.
There was just a lot of messy examples with detached functions for
manipulating ad-hoc data structures that didn't seem properly _motivated_ at
all. And it all seemed terribly brittle.

But if one ignores all of that (and a lot of the classic lisp books), what
emerges is that the "good" parts of cl are really great, and there's really no
reason not to use _those parts_. And the warts in moderation (as with any
other language).

[1]
[http://srfi.schemers.org/srfi-110/srfi-110.html](http://srfi.schemers.org/srfi-110/srfi-110.html)

~~~
wtbob
> Ok, I admit, I still want "sweet expressions"

There's a Common Lisp library on Sourceforge:
[http://readable.sourceforge.net/](http://readable.sourceforge.net/)

I've been thinking of using it to make a Lisp interface palatable to non-
Lispers. We'll see though.

------
TimJRobinson
I'd love to see more books like this for less common languages (Haskell
particularly), as I've found there's generally plenty of resources for
learning the basic commands and code structure but there's little information
for going from those first steps to creating an actual useful application.

~~~
sharmajai
I believe this is one of the major goals of
[http://book.realworldhaskell.org/read/](http://book.realworldhaskell.org/read/)

 _With this book, we want to show you how to use functional programming and
Haskell to solve realistic problems. This is a hands-on book: every chapter
contains dozens of code samples, and many contain complete applications._

~~~
vog
There's also a similar book for OCaml:

[https://realworldocaml.org/](https://realworldocaml.org/)

------
deckard1
or you realize Perl, Ruby, Python give you everything good from Lisp anyway
with an environment and packages that can talk to the real world, and that
macros and metaprogramming are massively overrated and a danger in almost any
hands that touch those features.

Ask me how long I spent banging my head against the wall trying to get OpenGL
working in CMUCL with Alien. Jesus jumping-jack Christ. I can only hope things
have improved in the past 12 years or so. But I highly doubt it.

~~~
pjmlp
> Perl, Ruby, Python give you everything good from Lisp

So where are the:

\- AOT compilers to native code

\- REPL environments with GUI debuggers, with fix-and-continue?

\- Ability to do systems programming without having to use an external
language?

\- Macros

------
crispytx
Why is this on the front page of Hacker News? Isn't this an advertisement?

~~~
dang
Work in progress is a fine thing to have on Hacker News as long as there's a
way for users to check the work out. In this case there's a sample chapter,
which more than clears that bar. In fact we've added "Show HN" to the title,
because this is the kind of thing that Show HN is for:
[https://news.ycombinator.com/showhn.html](https://news.ycombinator.com/showhn.html)

~~~
AlexeyBrin
There is actually a link to read online on the same page
[https://leanpub.com/fullstacklisp/read](https://leanpub.com/fullstacklisp/read)

------
kazinator
Poor cover art.

How about fitting, into a single image, a joke about some ex-web developer,
stacking pancakes at IHOP.

Or maybe a visual reference to this type of full stack:
[https://www.google.com/search?q=guitar+full+stack&tbm=isch](https://www.google.com/search?q=guitar+full+stack&tbm=isch)

~~~
imglorp
The critter is a reference to [http://landoflisp.com/](http://landoflisp.com/)

