Chas Emerick's recent "State of Clojure" survey [http://bit.ly/dtdAwb]
indicated that a significant proportion of Clojure users are beginning
to use Clojure for web development. A recent Hacker News posting
[http://bit.ly/91Bu5J] seems to corroborate these results, with
several Clojure-based web applications already out in the wild.
As one of the main developers of Ring and Compojure, I'd be very
interested to hear more about how people are using Clojure to build
web apps. To this end, I have a few questions I'd like to quiz Clojure
web developers about:
1. Have you written, or are you writing, a web application that uses
Clojure? What does it do?
2. Which libraries or frameworks are you using? Which versions?
3. What made you choose Clojure to develop web applications in? What
are the strengths of Clojure web development?
4. What do you think are the current weaknesses of web development in
Clojure? What could be improved?
5. Anything else you want to comment on?
Please reply to this thread with your answers, and thank you very much
in advance for your time. I really appreciate any feedback you can
provide.
<weavejes...@googlemail.com> wrote: > 1. Have you written, or are you writing, a web application that uses > Clojure? What does it do?
I don't know that I'll be writing entire web applications in Clojure any time soon but I expect to be using Clojure in some form from (essentially) Java-based web applications some time soon, much as I currently use Groovy and/or Scala for parts of a web application. I'll be interested in both the easiest and most performant ways to use Clojure code from something Java based. FWIW, I use CFML (running on Railo, a free open source JBoss community project, that compiles CFML down to Java bytecode and runs in a Servlet container) as my primary web templating / scripting language right now and drop down to other languages where useful / appropriate.
Looking forward to hearing how others are doing web development with Clojure! Thanx for kicking off this thread James. -- Sean A Corfield -- (904) 302-SEAN Railo Technologies, Inc. -- http://getrailo.com/ An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive." -- Margaret Atwood
On Jun 23, 11:23 pm, James Reeves <weavejes...@googlemail.com> wrote:
> Hello there!
Hi James!
:)
> 1. Have you written, or are you writing, a web application that uses
> Clojure? What does it do?
I've written one very simple "internal organsiation" site in clojure
that's finished except for a few little bugs. Should be cleared next
monday.
> 2. Which libraries or frameworks are you using? Which versions?
compojure in whatever was the last release version - with a few lines
of patches.
joda-time 1.6 - which should be mandatory for any java/clojure project
dealing with time in any way
and lucene 3.0.1
> 3. What made you choose Clojure to develop web applications in?
I hate typing any more than is needed. This means a Lisp variant.
Clojure is just the best Lisp I know to program in, and the JVM is a
bonus if you need it.
> What are the strengths of Clojure web development?
See the previous question. Plus "pure" functional programming meshes
well with typical Front end - Controller - Database web programming.
> 4. What do you think are the current weaknesses of web development in
> Clojure? What could be improved?
Not sure. Will get back on this. I will say that anyone claiming to
have a full integrated solution in clojure right now is probably
wrong. And I'm not sure we need an integrated system at all. Which is
why I like compojure splitting up into real composable parts.
> 5. Anything else you want to comment on?
Stick with relational databases unless you really need to get rid of
them.
Don't think of the previous sentence as an excuse to squeeze/enforce
an OO/relational mapping in whatever web framework you're thinking of
writing. I'm doing fine without one, thank you very much.
First, thank you for all of your work in this area. It is greatly appreciated. My answers follow:
1. DocuHarvest ( https://docuharvest.com ), which I've already talked about here. Broadly speaking, it extracts data from documents, and it's just getting started.
2. Relevant to web development, DocuHarvest uses compojure 0.3.x (modified to suit clojure 1.2 HEAD), HEAD of enlive and clutch, spring- security v3, jetty for local development, Tomcat for staging and production environments, and enclojure's REPL server library in all environments.
3. Compojure gets me very close to the metal, or as much as one can be w.r.t. HTTP. Middleware is the pleasant superset of all other flavors of web request handling; helluva lot of power there with very little cost. Mix that with a solid REPL (via enclojure for me) for zero- turnaround development, and I'm very, very happy.
The most common issues I see are related to packaging and deployment. I think this could probably be made easier for those that aren't familiar with the java way of doing webapp deployment. Getting people familiar with the (honestly simple) mostly-canned tooling solutions that are out there would help, but short of that, perhaps a pre- compiled servlet (configured via a web.xml file that defines the top- level route that all requests are dropped into, etc) would help. Building the war file would still be necessary, but that's when-in- Rome territory. IMO, every time someone deploys a compojure app via a hacked-up shell script and embedded jetty, a kitten is killed. ;-)
5. I better quit while I'm ahead for today!
And no, thank you, and everyone else that's made web development with Clojure as pleasant as it is! :-D
> Chas Emerick's recent "State of Clojure" survey [http://bit.ly/dtdAwb] > indicated that a significant proportion of Clojure users are beginning > to use Clojure for web development. A recent Hacker News posting > [http://bit.ly/91Bu5J] seems to corroborate these results, with > several Clojure-based web applications already out in the wild.
> As one of the main developers of Ring and Compojure, I'd be very > interested to hear more about how people are using Clojure to build > web apps. To this end, I have a few questions I'd like to quiz Clojure > web developers about:
> 1. Have you written, or are you writing, a web application that uses > Clojure? What does it do?
> 2. Which libraries or frameworks are you using? Which versions?
> 3. What made you choose Clojure to develop web applications in? What > are the strengths of Clojure web development?
> 4. What do you think are the current weaknesses of web development in > Clojure? What could be improved?
> 5. Anything else you want to comment on?
> Please reply to this thread with your answers, and thank you very much > in advance for your time. I really appreciate any feedback you can > provide.
On Jun 23, 2:23 pm, James Reeves <weavejes...@googlemail.com> wrote:
> 1. Have you written, or are you writing, a web application that uses
> Clojure? What does it do?
My blog and a couple of other blog-like hobby sites. I also wrote a
small standalone data-collection app at work. It collects survey data
for psych research.
> 2. Which libraries or frameworks are you using? Which versions?
I try to stick with bleeding-edge versions of almost everything. You
almost have to, things change too quickly.
> 3. What made you choose Clojure to develop web applications in? What
> are the strengths of Clojure web development?
DSL-based HTML generation (as per Hiccup) is a huge selling point for
me. Nothing else compares. Lispy interactive development via REPL is
great for webapps. Web development is a good place to take advantage
of macros and other boilerplate-elimination techniques that a Lisp
gives you.
I mostly chose Clojure for web development mostly because I like
Clojure and wanted an excuse to use it more.
> 4. What do you think are the current weaknesses of web development in
> Clojure? What could be improved?
Deployment is my main headache. Better documentation / more examples
for Compojure and other libs would be very useful. DB interaction /
data persistence is a bit of a weakness, but the Clojure world is
improving very quickly in this area.
> 5. Anything else you want to comment on?
Web development in Clojure is loads of fun. Thanks for your work on
Ring/Compojure/etc., they're great tools.
<weavejes...@googlemail.com> wrote: > 1. Have you written, or are you writing, a web application that uses > Clojure? What does it do?
I'm writing cloudhoist.com, a cross cloud management console and api, that lets you start and stop nodes on Amazon, Rackspace, etc, configure them with your favourite stacks (eg, tomcat, mysql, couchdb), deploy you apps and carry out admin actions.
> 2. Which libraries or frameworks are you using? Which versions?
> 3. What made you choose Clojure to develop web applications in? What > are the strengths of Clojure web development?
It's a lisp, with all that entails, and it deploys nicely on the JVM.
> 4. What do you think are the current weaknesses of web development in > Clojure? What could be improved?
I am interested in using clojure for client side coding. Ring friendly authentication and authorisation libs would be nice (I rolled my own). I miss rails' named routes, but am sure something better will materialise for clojure.
On Jun 23, 11:23 pm, James Reeves <weavejes...@googlemail.com> wrote:
> 1. Have you written, or are you writing, a web application that uses
> Clojure? What does it do?
I'm guerilla coding a small web app to do some very non-standard
statistical analysis of customer returns (ABS/ESC systems for cars).
The whole thing is in stealth mode. So it won't ever be released to
the public. (When I look at the code, I have to say: "Luckily!") It is
a webapp to allow some closely related departments to access the
information w/o having to deploy an app.
> 2. Which libraries or frameworks are you using? Which versions?
> 3. What made you choose Clojure to develop web applications in? What
> are the strengths of Clojure web development?
It's a lisp and my exclusive language for hobby projects since March
2008. The only other language I have a comparable knowledge is C. And
I didn't want to start with C. Also deploy: Java is here ubiquitous. I
can just take a plain jar to some machine and am done. (I'm didn't
kill a kitten. I sacrificed a puppy instead.) I have an embedded
nailgun server my vimclojure talks to. So I can hot swap functions and
immediately test in the browser. (I'm sure there are better ways to do
this, but at the moment this is efficient enough for me)
> 4. What do you think are the current weaknesses of web development in
> Clojure? What could be improved?
I can't say anything for that one. I would have to learn how to write
a webapp first.
> 1. Have you written, or are you writing, a web application that uses > Clojure? What does it do?
I am and have been extending an existing production java web application environment with all new server work now being done in clojure. It is a complex jvm server running tomcat and other threaded proprietary services and integration paths into back-end feed systems. Front-end stuff, previously jsp is now all being replaced by javascript/jquery and ajax.
I am also working on a netty/clojure setup to create some distributed event-driven processes for scaling up the services and in the future replacing most of the the above in-jvm/threaded routines. Down the line I hope to release some of this as open-source.
> 2. Which libraries or frameworks are you using? Which versions?
In the early stages, I tried compojure, but my setup needed much tighter java/clojure interop and hence most of my effort has gone in that direction. I do use enlive, joda-time, jfreechart and a bit of clj-html/hiccup. Java libs - tomcat, log4j, apache-commons, postgresql-jdbc. Plus many person-years of various proprietary java and unix utility libraries for (hosted) infrastructure and operations management. Generally I have found most of the other java frameworks too "heavy" for my rather close-to-the-wire preferences.
> 3. What made you choose Clojure to develop web applications in? What > are the strengths of Clojure web development?
I learnt a bit of lisp way back but career-wise all my work has generally been c/c++/java based. I spent about 9 months with scala hoping for an improved jvm capability, but found it too tedious when trying to work on the complex setup mentioned above. Happened upon clojure 18 months ago and this was the holy-grail incarnate. You really can get pretty close to expressing directly what's in your mind. Haven't looked back since.
> 4. What do you think are the current weaknesses of web development in > Clojure? What could be improved?
Plenty of room for event-driven techniques, javascript/jquery generation stuff, distributed processing, disk-based persistence, etc. The new protocols/types/records and the coming primitives improvements are very exciting.
> 5. Anything else you want to comment on?
Performance, performance, performance and by the way, performance. When you run server applications, especially non-blocking, event driven, every little milli-second per function counts hugely when scaling up to thousands, tens of thousands or more asynchronously accessed services. Clojure has done wonders in eliminating boilerplate tedium and maintenance grovel, so generally I would now like to focus on improving my reality of 30% coding, 70% tuning/benchmarking/refactoring.
Hi James,
For me the big missing item is Comet/Websockets support. More and more
of the web
development I do requires near real time communication and to have
that feature integrated
in the framework (like lift) would be great.
thanks
Jimmy
<weavejes...@googlemail.com> wrote: > 1. Have you written, or are you writing, a web application that uses > Clojure? What does it do?
we are currently developing a game server backend using clojure.
> 2. Which libraries or frameworks are you using? Which versions?
we are using grails for the web app aspect, and uses the grails plugin to call clojure code.
> 3. What made you choose Clojure to develop web applications in? What > are the strengths of Clojure web development?
in this case, we are really using grails for the web aspect, but uses clojure for AI and game logic. clojure is very good at that.
> 4. What do you think are the current weaknesses of web development in > Clojure? What could be improved?
too many scattered libraries and approaches. For me, it's about problem solving. I would like to be able to just grab something, and get it started. Right now, if a new clojure user ask, I want to develop a web app, what should I use? Compojure? Ring? What template system should I use? enlive? str html? hiccup? How do you deal with database? clj-record? clojuresql? How do you make outbound REST request?
> 5. Anything else you want to comment on?
clojure is still young. I hope in time, a web dev approach that's more clojure-ish. lift has done a good way to show what a web framework using scala and functional style would look like.
I look forward to see something like this for clojure one day.
I don't use Clojure for web development and I thought sharing why could be useful too.
For web development, my favourite tool is Django<http://www.djangoproject.com/>. It comes as a fullstack framework which means I have everything I need out of the box. Templates, caching, ORM, a kick-ass autogenerated admin section, cross-domain request forgery protection etc. and the documentation is really top notch.
I'd rather have Clojure than Python but all the goodness that Django provides is such a time saver that I feel I'd lose too much time with Clojure.
If I had a full-stack, well-documented clojure framework, I'd jump to that.
> 1. Have you written, or are you writing, a web application that uses
> Clojure? What does it do?
I've created a commercial app that has the server side written start
to finish in Clojure. It leverages the existing calendaring and
scheduling functionality of ScheduleWorld - which was written in Java.
(It was trivial to do this using
Clojure)
> 2. Which libraries or frameworks are you using? Which versions?
Compojure - patched from git now and then to work with Clojure 1.2.
> 3. What made you choose Clojure to develop web applications in? What
> are the strengths of Clojure web development?
It's difficult to answer this in a couple of sentences - all of
strengths of Clojure come into play here. Rich's videos that explain
the strengths of Clojure all turn out to be true.
I've been coding enterprise server-side services for ~20 years using C/
C++/Java.
Compared to C/C++/Java I've found the strengths of Clojure beget:
1. better designs
2. less bugs: immutable data, better designs, STM, atoms, ...
3. faster code given the same effort: lazy sequences, memoization,
clojure.[core,contrib],
4. better productivity: the REPL, the Clojure language, etc. it all
snowballs here.
> 4. What do you think are the current weaknesses of web development in
> Clojure? What could be improved?
weaknesses: none really. I sometimes miss the perfect command
completion (with auto import generation) provided by Eclipse/Java when
I do Java interop. But this is an editor issue. (And I'm really happy
with vimclojure.)
Improved: I think I'd be happy with Clojure and Compojure as they
stand for a long time. But since you asked:
LOGGING: The current logging capabilities are not useful to people
creating services with lots of users. The only way logging is useful
is to have one file peruser logging. We wrote our own logging system
that does this and it works great. At midnight the logging system
creates a new directory (based on the date) andstarts using that. So
if someone emails and says at this date/time operation X failed we can
easily analyze the logs around that time.
(A while back ScheduleWorld was signing up 800 people / day with 8000
simultaneous established http connections doing work. Imagine the
intertwined logging data...Per user logging is the best way.)
> 5. Anything else you want to comment on?
Thank you for creating Compojure.
1. defroutes = excellent way of defining our services.
2. decorate = fantastic fine-grained way for us to decorate our
services.
3. requests just have to return a map. Excellent.
Compojure is simple to use and never gets in the way. We have nginx
fronting a cluster of boxes. Our Compojure services respond to
requests, and sometimes theyalso dynamically create and manage static
responses (nginx returns a static file if the request has been seen
before and no other request invalidates the cached response).
(The other Clojure web frameworks might be as good. I don't meant to
take anything away from them. I have only used Compojure.)
1. Have you written, or are you writing, a web application that uses
Clojure? What does it do?
I am an independent contractor and do a lot of corporate intranet web
applications. All of my clients support Java. Each year I write a few
new applications and spend a lot of time maintaining old Java
applications. The first new application that I wrote this year was
pure Clojure. It was a very simple application for collecting ideas
from employees. It was great to be able to use Lisp and yet integrate
and deploy into a Java environment. The application was deployed to
WebSphere as a war file, connects to an SQL Server database and uses
the company's LDAP Java libraries. I plan to use Clojure for all new
projects.
I also work for a research group with a bunch of statisticians
building web based tools based on the work that they do. Usually
taking some nasty spreadsheet that someone has created and turning it
into a web application. Clojure (functional programming) with Incanter
will be a perfect fit for this type of project.
2. Which libraries or frameworks are you using? Which versions?
I am also working on Sandbar and Carte. Sandbar provides middleware to
allow one to work with the session as if it were a global map with put
and get functions. It also provides middleware for authentication and
authorization. Carte is non-object oriented relational mapping. Both
are very new.
3. What made you choose Clojure to develop web applications in? What
are the strengths of Clojure web development?
1. Functional programming is a better fit than OO for web
applications.
2. Lisp is as DRY as you can get. Every other environment that I have
worked in, you get to some point where you can no longer create
abstractions and have to resort to design patterns, code generation or
non-primary language configuration. I don't see this ever happening
with Clojure.
3. It is just Java. Easy deployment into any Java container. Clients
get a Java app and there is much rejoicing.
4. Mutable objects as a default are bad, even for web applications.
5. Interactive REPL development.
6. Ring and Compojure are exactly what I want as the foundation for my
web applications: simple, small and extensible. Middleware is
wonderful.
4. What do you think are the current weaknesses of web development in
Clojure? What could be improved?
Packaging and deployment seem to be the big problem at this point. I
have a lot experience with Java web applications so it is not that
difficult for me to create a war for deployment but I can see that
someone without a Java background would be completely confused by
this. I would love to see a tool that can package my app into a war
including a REPL server.
It would also be nice to have easily accessible, thorough,
documentation for Ring and Compojure with example code that goes
beyond the most simple cases. The community is young and so there is a
lack of shared knowledge about best practices when developing larger
applications.
One of the things that I like about Clojure web development (the
flexibility) also causes some concern. In my opinion, the best thing
about Rails is that any developer who knows Rails can go to any Rails
project and know where everything is. The conventions of Rails have
also contributed greatly to Rails' ability to grow and innovate. I
don't know what the solution is, just wanted to bring this up.
5. Anything else you want to comment on?
Many thanks to Mark and James for all of your work on Ring and
Compojure. Without these two libraries there wouldn't be much Clojure
web development going on. Also, thanks for keeping it simple and not
trying to do too much.
On Jun 23, 2:23 pm, James Reeves <weavejes...@googlemail.com> wrote:
> Chas Emerick's recent "State of Clojure" survey [http://bit.ly/dtdAwb]
> indicated that a significant proportion of Clojure users are beginning
> to use Clojure for web development. A recent Hacker News posting
> [http://bit.ly/91Bu5J] seems to corroborate these results, with
> several Clojure-based web applications already out in the wild.
> As one of the main developers of Ring and Compojure, I'd be very
> interested to hear more about how people are using Clojure to build
> web apps. To this end, I have a few questions I'd like to quiz Clojure
> web developers about:
> 1. Have you written, or are you writing, a web application that uses
> Clojure? What does it do?
> 2. Which libraries or frameworks are you using? Which versions?
> 3. What made you choose Clojure to develop web applications in? What
> are the strengths of Clojure web development?
> 4. What do you think are the current weaknesses of web development in
> Clojure? What could be improved?
> 5. Anything else you want to comment on?
> Please reply to this thread with your answers, and thank you very much
> in advance for your time. I really appreciate any feedback you can
> provide.
Good point. I have a todo waiting for me to figure out how to deliver some services that HTTP might not be cut out for. It looks like v3.0 servlets have a variety of enhancements in this area, so hopefully compojure/ring can stand on those shoulders. I've no idea about the container support in that area though.
> Hi James, > For me the big missing item is Comet/Websockets support. More and more > of the web > development I do requires near real time communication and to have > that feature integrated > in the framework (like lift) would be great. > thanks > Jimmy
> -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient > with your first post. > To unsubscribe from this group, send email to > clojure+unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en
We have written a currency trading app in Clojure in my company.
It has an embedded web server with a compojure app that provides an
administration interface.
2. Which libraries or frameworks are you using? Which versions?
3. What made you choose Clojure to develop web applications in? What
are the strengths of Clojure web development?
The entire app is Clojure and Compjure/Hiccup is very powerful so we
could build the web UI surprisingly quickly and in very little code.
The order of magnitude simplification reminds me of switching to Rails
and how it made everything prior to that look bloated and complex by
comparison. Compojure is to Rails what Rails is to ASP.NET.
4. What do you think are the current weaknesses of web development in
Clojure? What could be improved?
At the time we needed an easy way to bind configuration information to
the routes (we ended up wrapping each request with the configuration
data which is a bit cumbersome). A more explicit way would be to use
some kind of partial evaluation to bind the relevant settings to each
route.
5. Anything else you want to comment on?
Clojure and Compojure rock! Thanks for your work on the library :-)
1. Have you written, or are you writing, a web application that uses
Clojure? What does it do?
I am new to Clojure, I've ported over most of my code for an ad-hoc
application creator / with reporting and GIS integration.
I'm pretty much finished. I benchmarking speed.
2. Which libraries or frameworks are you using? Which versions?
My own custom frameworks. I use some contrib stuff.
3. What made you choose Clojure to develop web applications in? What
are the strengths of Clojure web development?
Strengths:
* Allows for creating succinct code to manage complex data.
* Access to many libraries (that are current and active).
* Not forced to include BS code for OO abstractions.
Weakness:
REPL errors. Seems fragile. If I hit an error, some errors corrupt
something under the hood,
ie. reloading the corrections doesn't help I have to close the REPL
then restart.
I'm familiar with REPLs - This is odd, but it's probably a JVM issue.
4. What do you think are the current weaknesses of web development in
Clojure? What could be improved?
Nothing big yet.
5. Anything else you want to comment on?
Only one week into Clojure I could be too green, but:
I would like some chaining to less the brackets.
i.e.
> Chas Emerick's recent "State of Clojure" survey [http://bit.ly/dtdAwb]
> indicated that a significant proportion of Clojure users are beginning
> to use Clojure for web development. A recent Hacker News posting
> [http://bit.ly/91Bu5J] seems to corroborate these results, with
> several Clojure-based web applications already out in the wild.
> As one of the main developers of Ring and Compojure, I'd be very
> interested to hear more about how people are using Clojure to build
> web apps. To this end, I have a few questions I'd like to quiz Clojure
> web developers about:
> 1. Have you written, or are you writing, a web application that uses
> Clojure? What does it do?
> 2. Which libraries or frameworks are you using? Which versions?
> 3. What made you choose Clojure to develop web applications in? What
> are the strengths of Clojure web development?
> 4. What do you think are the current weaknesses of web development in
> Clojure? What could be improved?
> 5. Anything else you want to comment on?
> Please reply to this thread with your answers, and thank you very much
> in advance for your time. I really appreciate any feedback you can
> provide.
At the moment I use nginx proxying to embedded Jetty. Works fine for me, though I'm interested in hearing or reading documentation about what other people are doing.
> Instead do this: >> stuff:key1:item1:sub1 > val1
(-> stuff :key1 :item1 sub1)
> Also, some of the function names don't make sense: > (def stuff (list 1 2 3 4 5)) >> (rest stuff) > (2 3 4 5) >> (next stuff) > (2 3 4 5) <---- this can be done with rest.
On Thu, Jun 24, 2010 at 12:27 PM, Daniel Gagnon <redalas...@gmail.com>wrote:
> I don't use Clojure for web development and I thought sharing why could be > useful too.
> For web development, my favourite tool is Django<http://www.djangoproject.com/>. > It comes as a fullstack framework which means I have everything I need out > of the box. Templates, caching, ORM, a kick-ass autogenerated admin section, > cross-domain request forgery protection etc. and the documentation is really > top notch.
> I'd rather have Clojure than Python but all the goodness that Django > provides is such a time saver that I feel I'd lose too much time with > Clojure.
> If I had a full-stack, well-documented clojure framework, I'd jump to that
full-stack frameworks take time to evolve, and even then for many projects they aren't a good fit since they impose a both narrow perspective and a heavy cognitive load (massive APIs). In my experience development in Clojure is just as fast as it is in Django. The main thing lacking is documentation of the Clojure goodies that are currently available.
I still like mine better, fortunately I can create my own functions,
but I was just highlighted that some of the function names are not
intuitive (to me).
Most of them are good.
Along this vein, I find the documentation is great, but a little hard
to navigate around.
Example to find a list of predicates requires hunting. Is there a
trick? I know ' source' and 'find-doc', but I'm constantly
searching :)
This is a really niggly point since relatively speaking it's well
done.
As I said, I'm green. I'll get there soon I promise :)
Tim
On Jun 24, 1:48 pm, Meikel Brandmeyer <m...@kotka.de> wrote:
> 1. Have you written, or are you writing, a web application that uses
> Clojure? What does it do?
Recently started writing a webapp to display financial data, along the
lines of Google finance. Although somewhat less ambitious :).
> 2. Which libraries or frameworks are you using? Which versions?
Enlive, latest version. (Downloaded last week, don't know the version
number.) Aiming for mostly static HTML, JavaScript/JSON, a few
servlets and CouchDB.
> 3. What made you choose Clojure to develop web applications in? What
> are the strengths of Clojure web development?
* I've been doing Java/JSP web development for years, it is stable,
has tons of libraries and performs well, but is somewhat cumbersome do
develop in.
* I've been doing a little web development in Ruby/Ruby on Rails.
Development is much quicker and nicer, especially with HAML (a
templating library). The disadvantage is performance issues - Ruby is
lousy on numerical computation.
* I had just started looking into server-side JavaScript (like
Node.js). The primary disadvantage is that it is very new and
unproven, and there are few libraries available yet.
* I also considered Google's Go, and was aiming for a combination of
Go for the heavy lifting and Ruby for templates and display.
I think Clojure hits a sweet spot with better performance than purely
dynamic languages like Ruby and less verbosity than Java. For me that
means I can stick with one language, which is always less hassle than
using several.
I used Common Lisp several years back, and liked it a lot, so I
welcome a modern Lisp on a mature platform.
The REPL is very helpful in allowing quick iterations.
Libraries are not an issue with Java underneath, and the Clojure-
specific libraries seem to be in decent shape as well.
The Enlive template system is simply brilliant, I know of nothing even
close in conveniently separating HTML/design and application logic.
All in all, I can't think of a better option at the moment.
> 4. What do you think are the current weaknesses of web development in
> Clojure? What could be improved?
In general Clojure web development is in early stages yet, it can't
compete with the maturity of Java or Ruby frameworks. But that goes
with the territory, it's one of the costs of trying something new. And
I can always drop down to Java if needed.
Documentation is highly variable, I'm not entirely happy with having
to read source code to figure out an API.
For anything more specific, it's too early for me to tell, I can
probably say more about it in a month or two. Perhaps database
connections, although since there is plenty of DB support in Java,
writing a small Clojure wrapper seems manageable.
> 1. Have you written, or are you writing, a web application that uses > Clojure? What does it do?
roman candle is a web app designed to let me control X10 plc components from any web-capable device, using the X10 firecracker controller. It's still in very early development, and hasn't been given much attention lately. The intent is more to learn about clojure rather than provide a distributable utility.
> 2. Which libraries or frameworks are you using? Which versions?
I've always been impressed by the Seaside framework, if only it weren't tied to smalltalk. While there are now some C/C++ frameworks along this line, there don't appear to be any available for Java, much less clojure. So I'm developing a small framework - bitchen' - in parallel with roman candle. This is also more pedagogical than production, in that it's not at all clear how to "port" the seaside model from an OO language to a functional/immutable one like Clojure. Should I decide that I'm going to get serious about clojure, this might eventually become a full-fledged framework.
> 3. What made you choose Clojure to develop web applications in? What > are the strengths of Clojure web development?
Wanting to provide a better answer to that question. Clojure itself is interesting for it's LISPyness, concurrency facilities, and tight integration with the JVM.
> 4. What do you think are the current weaknesses of web development in > Clojure? What could be improved?
The tight integration with the JVM. I believe it's brought more pain than happiness.
> Chas Emerick's recent "State of Clojure" survey [http://bit.ly/dtdAwb] > indicated that a significant proportion of Clojure users are beginning > to use Clojure for web development. A recent Hacker News posting > [http://bit.ly/91Bu5J] seems to corroborate these results, with > several Clojure-based web applications already out in the wild.
> As one of the main developers of Ring and Compojure, I'd be very > interested to hear more about how people are using Clojure to build > web apps. To this end, I have a few questions I'd like to quiz Clojure > web developers about:
> 1. Have you written, or are you writing, a web application that uses > Clojure? What does it do?
> 2. Which libraries or frameworks are you using? Which versions?
So far, no dependencies ... but I may switch out some ad hoc logic for stuff from Ring. Even I try not to reinvent the wheel every time!
> 3. What made you choose Clojure to develop web applications in? What > are the strengths of Clojure web development?
I eventually hope to have Cascade handle parallel rendering of the overall content across multiple threads, which makes sense when rendering a single view requires multiple database queries that can execute in parallel.
Partly Cascade exists as a way to learn Clojure fully, even if I don't use Cascade professionally in the meantime. For most projects, I'll keep using Tapestry :-)
However, I do really like having the template be Clojure forms.
Unlike Compojure/Hiccup, the Cascade templates are rendered to an intermediate DOM format that can be manipulated before final streaming as text. There are advantages to this, learned from Tapestry, in terms of coordinating individual rendering functions (what might be components in Tapestry) ... especially w.r.t. the inclusion of stylesheets and JavaScript libraries. These are done declaratively in Cascade.
For the most part, it was easier to get live reloading working in Cascade than in Tapestry (in Tapestry, change a class, it is reloaded. In Cascade, change a namespace, it is reloaded). There are still some issues, especially when there are errors in the reloaded namespace.
> 4. What do you think are the current weaknesses of web development in > Clojure? What could be improved?
Clojure's native exception reporting is weak! Cascade improves on this in a couple of ways (some of which may have been picked up by Compojure).
> 5. Anything else you want to comment on?
For what I've heard, I'm not the first person to implement an application in Cascade, which floors me. It's really at the research project level right now, but I do like what I've managed so far.
> Please reply to this thread with your answers, and thank you very much > in advance for your time. I really appreciate any feedback you can > provide.
> - James
> -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your first post. > To unsubscribe from this group, send email to > clojure+unsubscribe@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en
-- Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast!