8

I am writing a webapp in Clojure.

I almost want to use Google Web Toolkit for the frontend -- since I can just write Clojure/Java code, and have the library automatically generate the Javascript/AJAX.

However, for some reason, GWT does not sem to be used much in the real world.

Is there something that is similarly tied into Java (like GWT is) but more popular?

Thanks!

anon
  • 41,035
  • 53
  • 197
  • 293
  • 3
    See also http://stackoverflow.com/questions/523728/why-isnt-google-web-toolkit-more-popular and http://stackoverflow.com/questions/768749/why-might-gwt-be-getting-more-popular – Robert Harvey Jan 25 '10 at 20:41
  • 2
    Don't forget: http://stackoverflow.com/questions/2097964/why-gwt-advantages-and-trade-offs-of-using-this-ria-framework – Michael Balint Jan 25 '10 at 23:44
  • 7
    http://wave.google.com/ _is_ the real world. Unless you mean the _real real world_ , in flesh and bones. – Robert Munteanu Jan 26 '10 at 00:06

6 Answers6

9

There is JWT.

kotarak
  • 17,099
  • 2
  • 49
  • 39
9

GWT is used in the real world!!! A lot! And google is doing some pretty huge things with it so I don't think popularity is a valid concern.

I don't want to start a flame war so I won't elaborate any more on this.

Also, remember that GWT is a java - javascript compiler. No bytecode will run on the client. Hence, you can only use java, not clojure code when writing client-side code.

triggerNZ
  • 4,221
  • 3
  • 28
  • 34
  • 1
    Basically Google builts all of its new apps with GWT: http://www.youtube.com/user/GoogleDevelopers#p/c/0C2E1DEFBC90E546/0/yemCxLMwals And you've mentioned: Client-side code must be written in Java but for the server-side code within the same GWT module you can use any JVM language (Scala, Clojure, Groovy, ...). – Alex Mar 10 '10 at 03:33
  • Google also uses Google Closure toolkit (javascript to javascript) a lot, so its not just GWT. – Sergey Oct 31 '10 at 22:32
6

GWT is not particularly useful with Clojure, because it (GWT) uses a custom compiler that reads Java source code (not bytecode). Unless you want to write all your user-interface code in Java, GWT will not help you.

Stuart Sierra
  • 10,837
  • 2
  • 29
  • 35
  • True. It is perfectly possible to write the UI part in GWT and have it make calls to clojure services. GWT has a mode for this scenario. See http://code.google.com/webtoolkit/doc/latest/DevGuideServerCommunication.html – Allen Oct 12 '10 at 22:47
  • Hi @Allen. I do not find what you mean within your linked page. Please could you update your link or explain what section to read... Maybe GWT is no longer very suitable to be used with clojure services... I wonder... What's about you? Cheers ;) – oHo Nov 18 '13 at 08:47
0

You might also want to check out my micro-framework supporting development of AJAX apps with Clojure/Ring/Compojure/lib-noir stack:

http://ganelon.tomeklipski.com

It does not copy execution model of GWT, but rather works like Vaadin or Weblocks (but without session-statefulness or complicated UI components): it simply lets your XHR handlers return side effects to be applied to a page client-side through thin (and extendable) JavaScript layer.

For example: response from XHR handler can update part of a page by #id or display Bootstrap's Modal or redirect browser to a new url - but you can really easy add own operations.

Tomek Lipski
  • 166
  • 4
0

I realise this question was asked long ago, but there is now a direct answer - ClojureScript. It allows you to directly compile clojure code into javascript, and supports most of the common clojure idioms.

triggerNZ
  • 4,221
  • 3
  • 28
  • 34
0

Now ClojurescriptOne is a good way on an alternative to GWT. The things I found missing so far are full source optimization, and of course some customized libraries.

Also for instance clojurescriptone does only compile javascript to one file, does not yet create cached html-files to further speed up load times like GWT does.

The support for Google Closure is not fully wrapped yet so you have to use interops. That said, I still think this is an equivalently good alternative compared to java-programming in GWT.

claj
  • 5,172
  • 2
  • 27
  • 30