Hacker News new | past | comments | ask | show | jobs | submit login
Clack: Common Lisp Web Application Env (ala WSGI, Rack, Plack, Ring, WSAPI, etc) (clacklisp.org)
74 points by draegtun on June 3, 2011 | hide | past | favorite | 24 comments



For completeness here are some additional links for the "similar" web application environments provided by other languages listed in the post title:

* WSGI (Python) - http://wsgi.org/wsgi/

* Rack (Ruby) - http://rack.rubyforge.org/

* Plack/PSGI (Perl) - http://plackperl.org/

* Ring (Clojure) - https://github.com/mmcgrana/ring

* WSAPI (Lua) - http://keplerproject.github.com/wsapi/


Hack (Haskell) - http://hackage.haskell.org/cgi-bin/hackage-scripts/package/h...

Paste (Python) - http://pythonpaste.org/ *

* WSGI is a spec, Paste was the original (AFAIK) implementation. Interestingly, WSGI was itself inspired by the Servlet API.


Hack is certainly usable, although I would consider it deprecated in favor of WAI (mostly for performance reasons): http://www.yesodweb.com/book/wai


I included code samples from several of these in a presentation I did a little while ago: http://www.slideshare.net/bscofield/great-developers-steal/2...


Don't forget Jack (Javascript) - http://jackjs.org/


Thank you for adding. Anymore anyone?




I love seeing installation instructions made simple by Quicklisp.


Yeah -- there was a great example of this yesterday, too:

http://nklein.com/2011/06/quicklisp-win-weblocks/


It looks like this offers no way to stream chunks of a response -- you send the whole thing as a list of strings, or tell it to send a file.


I believe that's normally implemented as middleware on top of Rack et al.

I assume it's expected that the same strategy would be used here.


IIRC Rack and WSGI and Ring all let you return lazy sequences for the body, allowing you to stream responses.


PSGI/Plack also provides streaming responses by sending back a callback instead of the usual [$code, $headers, $body] array(ref).

ref: http://bulknews.typepad.com/blog/2009/10/psgiplack-streaming...


archimag (of RESTAS fame) wrote WSAL, which does something similar: https://github.com/archimag/cl-wsal


Is there really need for every language to have its own web stack? Most do work with FastCGI, but treat it as second class citizen (or so it seems as an outside spectator). This is somewhat similar effect to that every language seems to have its own package manager.



I can understand why some newer, better protocol than CGI or even FastCGI might be useful. But why there isn't a "FastCGI 2.0" which would have the advantages that these language-specific middleware boast, but which would be language-agnostic on the server side. At least from my point of view most languages are not that much different that they'd couldn't fit in a common interface.


Hmm, there seems to be quite a bit less here than in, say, Weblocks. No widget system, no form support, no AJAX support.

Anyone else here using Weblocks?


Well, by analogy with Rack, WSGI, Ring, Plack, etc, widget systems and forms and AJAX are way outside the scope of the problem that Clack is trying to solve.

All of these systems boil down to providing a simple convention for web applications to interface with web servers by implementing exactly one function that takes the environment and returns a triple of response code, content-type, and content.

Everything else you describe would be built on top of this, not built into this.


You've missed the point here, think framework-agnostic web server interface (like WSGI or Rack) rather than web framework (like Django or Rails).

The Weblocks developers could use Clack to interface to web servers like Nginx or Apache rather than maintain their own web server interfaces.


Caveman is an example of a minimal Common Lisp web framework built on top of Clack.

https://github.com/fukamachi/caveman/

Same developer is building a much richer framework called Utopian on top of Caveman. https://github.com/fukamachi/utopian


I use weblocks for small demos and private stuff, but at work it's all Clojure now.





Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: