aspose file tools*
The moose likes Clojure and the fly likes Is it Clojure useful in desktop applications? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Clojure
Bookmark "Is it Clojure useful in desktop applications?" Watch "Is it Clojure useful in desktop applications?" New topic
Author

Is it Clojure useful in desktop applications?

Rogerio Kioshi
Ranch Hand

Joined: Apr 12, 2005
Posts: 689


SCEA 5 (part 1), SCBCD, SCWCD, SCJP, CLP, CLS
Rick Goff
Ranch Hand

Joined: Nov 14, 2006
Posts: 54

Clojure runs on the JVM, so it's useful anywhere Java is useful.


OCPJP 6
Jacek Laskowski
Ranch Hand

Joined: Nov 06, 2005
Posts: 41

Rogerio Kioshi wrote:

Hi,

Although you can develop any application in Clojure, I think developing UI applications is often centered around changing state of the windowing system and as such doesn't fit very well in the functional approach (and Clojure in particular). You can, but it doesn't necessarily mean you should.

Jacek


Jacek Laskowski - http://blog.japila.pl
Sean Corfield
Ranch Hand

Joined: Feb 09, 2011
Posts: 267
    
    5

There's a very nice library called Seesaw that makes building desktop Swing applications almost pleasant: https://github.com/daveray/seesaw
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 367
At a recent Austin Clojure Meetup someone demonstrated JavaFX integration, showing building and updating a UI from the repl. I don't do enough desktop app work to compare it to Seesaw, but it was quite interesting.
Jacek Laskowski
Ranch Hand

Joined: Nov 06, 2005
Posts: 41

norman richards wrote:it was quite interesting.

Hi Norman,

That exactly reflects my sentiments - it's quite interesting and amusing to see how one could develop a decent UI application in Clojure (or any other functional language) as the process is more dynamic (REPL) as well as challenging where mutable state is wrapped by a thin layer atop a immutable/pure one. It'd be a highly recommended exercise for anyone who'd like to enter the functional programming scene - it's especially helpful to see someone who's good at FP doing it (I think I've seen a video on youtube or vimeo).

Jacek
John Stevenson
author
Greenhorn

Joined: Mar 25, 2013
Posts: 7
    
    5
Sean Corfield wrote:There's a very nice library called Seesaw that makes building desktop Swing applications almost pleasant: https://github.com/daveray/seesaw


I haven’t done much desktop Java with Clojure, although the little I have done I found it much easier than using Java itself. There is a function in Clojure called doto that helps you chain functions together, making your code much easier to follow and cleaner than the GUI code you need to write in Java. Is it following the functional programming idiom, possibly not in a pure way, but I'd consider it a more attractive option that writing all that GUI code in Java. However, there were quite a few GUI applications developed in Scheme over the years, so it would be interesting to see if there are any good concepts functional GUI development to discover.

I would certainly recommend using Seesaw if you wanted to develop Java desktop applications, along with the Netbeans platform.

Thanks
John.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it Clojure useful in desktop applications?