webjure vs compojure?

2020-06-09 06:57发布

I've heard of two Clojure based web application frameworks: Webjure and Compojure. Can someone let me know which is better?

8条回答
该账号已被封号
2楼-- · 2020-06-09 07:28

Compojure seems to be getting the most buzz right now. Not necessarily indicative of quality, but the one with the most eyes will probably evolve the fastest.

查看更多
Juvenile、少年°
3楼-- · 2020-06-09 07:29

I've been building a project for my own use using Compojure and it has worked out great. It doesn't really get in the way very much and lets you focus on what's important, your problem domain. The project is about 1100 lines of clojure just to give you an idea of the size.

查看更多
▲ chillily
4楼-- · 2020-06-09 07:30

Now you can add Ring to the list. All of these frameworks are very new and likely to evolve (or die) quickly, but Compojure does seem to be the most actively developed based on the past 6 months or so.

"Better" is too subjective a question to get a definitive answer to. Try them all and see what works.

查看更多
一纸荒年 Trace。
5楼-- · 2020-06-09 07:41

Compojure is based on Ring, which is a low-level framework that doesn't attempt to hide much of HTTP. It's similar to WSGI (Python) or Rack (Ruby). Ring has a concept of middleware, small pieces of code that can do something meaningful with an HTTP request and/or response, such as dump header infos, manage cookies etc. Compojure is a higher-level framework, somewhat similar to Ruby's Sinatra. Its aim is to provide a convenient API (or DSL, if you prefer) for most tasks a Web app developer faces. It's usually used together with an HTML generation library, such as Hiccup.

I haven't heard much about Webjure in the last few months, I'm not sure it's in active development (but I'd be interested to find out more). It precedes Ring, AFAICT, which seems to have become somewhat of a standard for Clojure Web frameworks.

查看更多
SAY GOODBYE
6楼-- · 2020-06-09 07:47

I second Rayne's recommendation on Moustache.

Right now, we are using Ring (base layer, middleware), Moustache (routing), Hiccup (html generation). We just began using Compass for CSS (http://compass-style.org/). So far, I'm happy with this collection of small libraries rather than a big "complete stack" framework (Django, Rails, ect...).

查看更多
Emotional °昔
7楼-- · 2020-06-09 07:47

Now, there is also a new one named Noir build on top of compojure. Really recommended, especially with Heroku.

查看更多
登录 后发表回答