Live data from Hacker News

Clojure Programming

clojurebook.com

11–20 of 37 posts

Re: Clojure Programming

#11
post #5

Does anyone know of a good web framework for Clojure? Perhaps a rails of django equivalent? I love using Java for the exact reason the author claims Clojure is so powerful--the magnitude of libraries. If a decent web framework is available, then I would be inclined to give it a go.

There's some (none so mature as django or Rails)... take a look at Noir (http://webnoir.org/)

However, the Clojure philosophy seems to be trending towards building your own composition of highly composable micro-libraries, rather than being handed one monolithic framework. It works very well, but does have the side effect that there isn't real "one stop shop" for beginners.

And when you're designing a webapp (or any app) in Clojure, you'll notice that you have a much higher degree of freedom regarding how to do things. There's no "one true way" the way there is with Rails. Again, this is extremely powerful, but it makes the next step somewhat less obvious for beginners.

Re: Clojure Programming

#12
post #3
post #2

IIRC, O'Reilly was flat-out refusing to publish any Lisp books as recently as 2005. How things have changed. :)

Last I looked, their author proposal FAQ still has that exclusion. FYI, a Common Lisp book nearly made it out of the gate a couple of years ago, Nick Levine's 'Lisp Out of the Box'. The contents of it are available under a Creative Commons license: http://lisp-book.org/

Looks like that exclusion is still there: http://oreilly.com/oreilly/author/writeforus_1101.html

It seems to be a strong recommendation rather than a hard rule, though. Clojure is worthy of an exception in my opinion.

Re: Clojure Programming

#13
post #5

Does anyone know of a good web framework for Clojure? Perhaps a rails of django equivalent? I love using Java for the exact reason the author claims Clojure is so powerful--the magnitude of libraries. If a decent web framework is available, then I would be inclined to give it a go.

Nearly everything web in Clojure is built on Ring. I personally like using Compojure (which bundles together clout for routing and a bunch of good defaults for sites or web services) and Enlive (for templating). This is the stack we describe in depth in the web portion of the book.

Frameworks are largely not used, at least in the monolithic, un-composable way that 'frameworks' generally are in other languages. This is what makes it so easy for alternative conceptualizations of the problem to come about (i.e. Noir, which also uses Ring and Compojure, but with different defaults, some macro sugar, and hiccup for templating), and themselves to be mixed/integrated with other web codebases. For example, you can trivially compose a noir application with a couple of "low level" Ring handlers with another app written using Moustache and stringtemplate.

That is all to say, yes, you'll find all the pieces you need for web development.

Re: Clojure Programming

#14
post #2

IIRC, O'Reilly was flat-out refusing to publish any Lisp books as recently as 2005. How things have changed. :)

Just curious, does anyone know why O'Reilly would refuse to publish any Lisp books?

FWIW, we didn't go to O'Reilly; they were shopping around for someone to write a Clojure book. So, whatever guidelines they have out there probably shouldn't be taken as actual "policy".

Re: Clojure Programming

#15
post #5

Does anyone know of a good web framework for Clojure? Perhaps a rails of django equivalent? I love using Java for the exact reason the author claims Clojure is so powerful--the magnitude of libraries. If a decent web framework is available, then I would be inclined to give it a go.

many said noir, there's also http://clojurescriptone.com which is noir plus a seemingly working integration of clojurescript

Re: Clojure Programming

#16
post #3
post #2

IIRC, O'Reilly was flat-out refusing to publish any Lisp books as recently as 2005. How things have changed. :)

Last I looked, their author proposal FAQ still has that exclusion. FYI, a Common Lisp book nearly made it out of the gate a couple of years ago, Nick Levine's 'Lisp Out of the Box'. The contents of it are available under a Creative Commons license: http://lisp-book.org/

Thanks for this! I took a look at the home page and have bookmarked the page.

I've been dabbling in Lisp (read Land of Lisp and am going through PCL) and eventually I'd like to create my own text-based game using common lisp. However, I am indeed wondering if/how it would make sense to use it at work.

I mostly do full stack web stuff (ruby/sinatra/rails, javascript) and I'm not at all sure where Lisp would fit in. In fact, I don't really know what it brings to the table except its expressiveness. As opposed to e.g. python, java, c, or objective-c where I have a decent idea of the domains where they shine.

Re: Clojure Programming

#18
post #3

Earlier quoted context omitted.

Last I looked, their author proposal FAQ still has that exclusion. FYI, a Common Lisp book nearly made it out of the gate a couple of years ago, Nick Levine's 'Lisp Out of the Box'. The contents of it are available under a Creative Commons license: http://lisp-book.org/

Thanks for this! I took a look at the home page and have bookmarked the page. I've been dabbling in Lisp (read Land of Lisp and am going through PCL) and eventually I'd like to create my own text-based game using common lisp. However, I am indeed wondering if/how it would make sense to use it at work. I mostly do full stack web stuff (ruby/sinatra/rails, javascript) and I'm not at all sure where Lisp would fit in. In…

I think you'll find Clojure to be superb in the web space. I've never been a ruby guy, but I did spend a lot of time with python in web dev, and Clojure compares very, very well IMO. In short, all the creature comforts of ruby/python + an efficient runtime + an unbeatable selection of libraries.

Re: Clojure Programming

#19
post #5

Does anyone know of a good web framework for Clojure? Perhaps a rails of django equivalent? I love using Java for the exact reason the author claims Clojure is so powerful--the magnitude of libraries. If a decent web framework is available, then I would be inclined to give it a go.

I wrote Noir primarily to help people new to Clojure to get up and running really quickly. It provides a simple set of core abstractions that allow you build whatever you want. As others have said though, I don't think something like Rails or Django should exist in Clojure. Large frameworks like those are very limiting and I would argue don't really end up letting you build real apps any faster than you can using simple composable libraries.

There's immense value in the approach the Clojure ecosystem has taken. For example, how many other places can you seamlessly swap out your webapp's server from something like jetty (thread-based) to tomcat (battle-hardened) to netty (NIO) to ...

FWIW, https://www.readyforzero.com/ is a non-trivial app in production that is built entirely on Noir.

Re: Clojure Programming

#20

Earlier quoted context omitted.

Thanks for this! I took a look at the home page and have bookmarked the page. I've been dabbling in Lisp (read Land of Lisp and am going through PCL) and eventually I'd like to create my own text-based game using common lisp. However, I am indeed wondering if/how it would make sense to use it at work. I mostly do full stack web stuff (ruby/sinatra/rails, javascript) and I'm not at all sure where Lisp would fit in. In…

I think you'll find Clojure to be superb in the web space. I've never been a ruby guy, but I did spend a lot of time with python in web dev, and Clojure compares very, very well IMO. In short, all the creature comforts of ruby/python + an efficient runtime + an unbeatable selection of libraries.

Thanks! This and the other comments in the thread are definitely motivating me to check out clojure. My dream of the moment is to make my command-line text-based game playable through a web front end and deployed to heroku using the clojure buildpack. I think that will give me at least, like, 5 geek points.
Post reply on HN