3 ms·
I think it's probably a matter of taste, and also the type of project (which surely are correlated). I prefer this sort of micro-framework because it gives me c
by pmjordan 16y ago
I think it's probably a matter of taste, and also the type of project (which surely are correlated). I prefer this sort of micro-framework because it gives me control. I like my software to consist of many independent pieces that I can mix & match and then string together. The Rails approach is more the opposite, you've got the structure and fill in the gaps.
Admittedly, none of my web projects in recent years have been typical database-backed web apps. Clojure (and thus Compojure) is actually a fantastic candidate if you're keeping state in memory - STM is made for this.
On my infinite TODO list I've got an xLightweb back-end for Compojure. This would allow asynchronous I/O in the style of Node.js, something that's a bit tedious in pure Java (no closures), and Clojure has certain advantages over JavaScript/V8. I find asynchronous I/O hard to imagine in a Rails-style environment.
- itistoday 16y agoI'm also hoping for node.js-like development in Clojure, it seems like as a Lisp, that style of development is well suited for it. What would be great is for someone to use JNI with libevent to create a nice, fast event driven server for Clojure/Java. Edit: I forget, does java.nio already use kqueue/epoll and friends? If so then Netty should do the trick as it uses java.nio.
- pmjordan 16y agoThere's an epoll-based implementation of the java.nio.channels.Selector so JNI should hopefully not be necessary. I haven't tried netty yet, it seems a lot more heavyweight than xSocket/xLightweb? Or is my perception warped because it's hosted on jboss.org and the description uses "enterprise-friendly" language?
- itistoday 16y agoFrom everything I've read Netty looks like a champ compared to all other NIO servers. :-) So, I'm quite excited to have found the answer to my question, AND someone has already started a clojure/netty project: http://github.com/texodus/saturnine http://github.com/texodus/saturnine Check out these comparisons of Netty vs others: http://gleamynode.net/articles/2232/ http://gleamynode.net/articles/2232/ http://amix.dk/blog/post/19456 http://amix.dk/blog/post/19456 http://www.znetdevelopment.com/blogs/2009/04/07/scalable-nio-servers-part-1-performance/ http://www.znetdevelopment.com/blogs/2009/04/07/scalable-nio... http://www.znetdevelopment.com/blogs/2009/04/09/scalable-nio-servers-part-2-memory/ http://www.znetdevelopment.com/blogs/2009/04/09/scalable-nio... http://www.znetdevelopment.com/blogs/2009/04/13/scalable-nio-servers-part-3-features/ http://www.znetdevelopment.com/blogs/2009/04/13/scalable-nio...