3 ms·
(loaded question alert) What differentiates Ring from Compojure? What is the appropriate use case for Ring vs Compojure?
by icey 17y ago
(loaded question alert)
What differentiates Ring from Compojure? What is the appropriate use case for Ring vs Compojure?
- mmcgrana 17y agoRing is a lower-level library than Compojure. It provides a variety of common web-related utilities that will be needed by many Clojure web developers, regardless of what higher-level libraries they choose to use. The purpose of Ring is to prevent those utilities from being rewritten all over the place while also allowing custom utilities to be shared among Clojure web developers. Note that Compojure 0.4 depends on Ring, to which it delegates things like parameter parsing and cookie manipulation. If you're familiar with the Ruby web ecosystem: Ring : Compojure :: Rack : Sinatra.
- runevault 17y agoRing is an underlying piece of compojure, though as compojure moves towards 0.4 where weavejester is breaking a lot more of it up into libraries the difference goes down, since you'll be able to take the parts you want and not the ones you don't, so you could use ring for middleware/routes/etc and take his html library that used to be built into compojure and take that instead.