5 ms·
> Does anyone here use any lisp for Web Development? I do. > What's the modern lisp (CL or otherwise) stack? There is no fixed stack, though people want to m
by jlg23 10y ago
> Does anyone here use any lisp for Web Development?
I do.
> What's the modern lisp (CL or otherwise) stack?
There is no fixed stack, though people want to make you believe there is.
I use cl-who for html generation, my own lib for css generation (basically sass with lisp syntax), a bastard of cl-json for json generation and a heavily patched hunchentoot as a web server and in very rare cases parenscript - but only to generate js class definitions from cl classes since transpilation of business logic usually places too many constraints on what you can implement how on the lisp side. For database access I mostly use cl-postgres but fall back to cl-sql if the client insists on another DB than pg.
- LyndsySimon 10y agoDo you have any project examples that are public by chance? I'd love to get a better feel for how all that fits together.
- aidenn0 10y agoI also use lisp for web development, and want to second this: > There is no fixed stack, though people want to make you believe there is. My stack: I use parenscript[5] fairly heavily (to the point where I'm now a contributor). Note that parenscript is mostly javascript semantics with lisp syntax, but macros for it are written in common-lisp, which makes a lot of the javascript annoyances go away. Like jlg23, I use cl-who for html generation. I spent a while experimenting with css generation, but now just use something prepackaged (currently Pure[1]). If I had need for a custom look, I would pay someone who knows graphic design to generate a layout, and I'd code to that. I've rotated between several JSON libraries to the point that I couldn't say which one I used for my last project; for JSON I'm very opinionated on the proper mapping from JS types to lisp, and none of the libraries do the Right Thing out of the box, so I wrap them with something that will. As users expect something less like "fill out a form and hit submit" and more like "Instantly responsive web application that saves my work as I go" I started experimenting with using parenscript with various JS application libraries. I found React to be okay[2], but much prefer the simplicity of Mithril[3]. For webserver, I use clack[4] which is in roughly the same space as WSGI is for python or Ring is for clojure. It is sadly severely lacking in documentation (at least in English). A clack tutorial is on my "todo" list. I happen to run clack behind mongrel2, but that's because it's the server I'm most familiar with; it has backends for FastCGI and several native lisp web servers, and adding new backends is very easy (the mongrel2 backend is under 200 lines of code). For a database I use postmodern[6] (a library for pgsql) and I use cl-redis[7] for quick & dirty projects, as a key/value store tends to make for more rapid prototyping. 1: http://purecss.io/ http://purecss.io/ 2: https://github.com/jasom/parenscriptx https://github.com/jasom/parenscriptx 3: https://github.com/jasom/parenscriptm https://github.com/jasom/parenscriptm 4: https://github.com/fukamachi/clack https://github.com/fukamachi/clack 5: https://common-lisp.net/project/parenscript/ https://common-lisp.net/project/parenscript/ 6: http://marijnhaverbeke.nl/postmodern/ http://marijnhaverbeke.nl/postmodern/ 7: https://github.com/vseloved/cl-redis https://github.com/vseloved/cl-redis
- fovc 10y agoThanks! Lots of great reading here. The React piece looks interesting, but would definitely like to hear more about Clack. My biggest hangup is around infrastructure. I wouldn't mind terribly re-inventing the wheel a bit in terms of client-side and business logic (if I can use lisp), but dealing with a FastCGI deploy makes me cringe a bit. Maybe it's just bad memories from a site I took over that was on shared hosting.
- aidenn0 10y agoYou can always use one of the lisp http servers, though I believe most people put those behind a reverse proxy when doing so.
- patrickmay 10y agoI second the request for more information about Clack. I'm using Hunchentoot at the moment and am about to start some stress tests. I hear that Clack has higher performance.