Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
An expanded comment on Clojure web development (hackworth.be)
39 points by lkrubner on Feb 6, 2014 | hide | past | favorite | 15 comments


On 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.


I'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


I 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.


Luminus 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).


ah, 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 (>__> ?)


It'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.


heh, 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?


For 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.


And 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.


I'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?


There 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.


The 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).


I 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 :).


I've moved to http://pedestal.io for Closure Web.


hoplon is cool, too




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

Search: