6 ms·
An expanded comment on Clojure web development
- adambard 13y agoI think it's definitely worth starting with just compojure, or even just ring. I don't know of any other language/library where writing request/response handlers is so approachable ( notwithstanding any commentary on the lisp syntax or functional style); even Flask and Sinatra require a routing layer.
- moomin 13y agoLuminus is basically just a set of sane defaults for Ring. Anything substantial (e.g. cljs-ajax) is split out into its own library. Basically, I'd recommend luminus until you get opinions of your own (e.g. I rather like bidi).
- auvrw 13y agoah, i dunno, compare (defroutes app (GET "/" [] "<h1>Hello World</h1>")) and @app.route('/hello') def hello(): return "hey" seems about equivalent. EDIT: except for the inherent awesomeness of s-expressions (>__> ?)
- moomin 13y agoIt's worth pointing out that in the first case what you get is a pure function that you can test without any mocking whatsoever. Sinatra's lovely, though.
- auvrw 13y agoheh, i wouldn't know anything about ruby. that was flask, of course. the promise of clojure to me (aside from liking lisp) is similar to that of node: only having to maintain one codebase for both client and server sides. also, really should say thanks to the author of the original article. returned here today when i realized that korma doesn't create tables and i'll need .... lobos, apparently, which was not mentioned in any of my searches for such a library. why didn't this submission get more upvotes?
- deleted 13y ago[deleted]
- erichmond 13y agoFor what it's worth, I've been working on a RESTful API service in clojure, and I've been using Liberator, and been loving it. The one thing I've really loved about the clojure community is the willingness to take a step back from the problem at hand and the attempt to understand what kind of architecture could address that problem, as opposed to just porting an existing idea/architecture to clojure.
- moomin 13y agoAnd for the most part, there's a serious commitment to composability. e.g. You can add liberator to your luminus project seamlessly without re-engineering.
- joeevans 13y agohoplon is cool, too
- beat 13y agoOn a related question, what are the good blogs or communities to follow for Clojure web development? I just recently (like within the past two weeks) started using Clojure to rewrite some back end code that was getting pretty gross in Ruby. I'm building a rest api using compujure, and it's been very pleasant, but I know I'm going to need more tools and more help soon.
- danenania 13y agoI'd say following the clojure mailing list is the best way to stay current. Most clojure-related blog posts/resources/new libraries get posted there, and the discussion quality is high. https://groups.google.com/forum/#!forum/clojure https://groups.google.com/forum/#!forum/clojure
- jbeja 13y agoI am just using what the "Web Development with Clojure" book by Dmitri Sotnikov is telling me to use since i am a beginner in Clojure web development. also learning Reagent for the client stuff :).
- VMG 13y agoI'm interested in a toolchain for cutting down on the editor-edit/server-restart/browser-refresh cycles. Is there any development in the direction of meteor that can help me make development a live experience?
- weavejester 13y agoThere are two approaches you can take. The ring/ring-devel library includes middleware that reloads modified files (ring.middleware.reload), and this is included by default with the Lein-Ring plugin. The second approach is to run the server from within the REPL, and to have functions to reload modified files and restart the server. There are libraries like Component and Jig that provide a framework for this style of development. The trend seems to be toward the second, though it requires a little more work than the first option.
- billrobertson42 13y agoThe first option is really easy to get started with. It can get a little clunky though when you suddenly need a repl, because now you need a new window (be it terminal or emacs).
- espeed 13y agoI've moved to http://pedestal.io http://pedestal.io for Closure Web.