Using clojurescript for a website on the server side and client side
Asked Answered
J

3

5

I am considering building a website using ClojureScript. Does it make sense to write ClojureScript on both the client side and the serverside, much like node.js?

Janeejaneen answered 29/7, 2011 at 11:31 Comment(1)
I would assume by going for ClojureScript in the back-end OP is losing all the concurrency benefits of Clojure which was originally optimized for JVM.Agonized
U
12

It's possible, but there's absolutely no reason not to use Clojure itself on the server side, and you'll get better performance and much better library availability. Interfacing Clojurescript/Clojurescript is no easier than Clojure/Clojurescript.

The only situation where I'd recommend this is where you're already fully committed to a server-side javascript infrastructure (e.g, node) and wanted to write Clojurescript instead of Javascript.

Unbidden answered 31/7, 2011 at 22:20 Comment(1)
One possible reason is if the particular libraries you want to use are available in ClojureScript but not in Java. Or perhaps you want to use the same library client side and server side.Salvation
F
1

The JVM and concurency argument seems important.And clojure/clojurescript are very similar so the argument to use same language in client and server doesnt seem important here.

For clojurescript on the server(nodejs) we have this MACCHIATO its similar to ring.

Furlough answered 20/7, 2022 at 22:37 Comment(0)
C
-2

@A reply to Levand: (Not a real answer and I am just a plain human being who is mainly a php programmer). So. I really really (if you can) urge levand to futher develop his answer. Just don't get it, thats all. I am a big fan of some lisp features (especially a rather unusual macro syntax in scheme). Therefore I would like him (if he knows it), or anybody else for that matter to tell me. Whats so bad about it. I don't see anything bad at all. On the contrary I rather like it (havn't used clojurescript in the browser myself unfortunately). The only bad thing I can think of on the top of my head is.

  1. Hard to measure performance (since it was buildt for the java engine).
  2. YAGNI.
  3. Rather esoteric i.e. the possibuility that someone who takes over the homepage or server might not want to learn it. (So many questions so little answers).

If Gambit-Scheme can be a good tool for a unix scripter then I can't see what the problem is with having some nice Clojurescript Lisp in the brower or server. (As you can see I can hardly call myself a good programmer. F.e. I used Debian full time for 2 months then promised myself that Debian and Ubuntu was not for me, although it hardly was bad or so. Just the feeling that it complicated things that I wanted to be easy). If not so for the fun of learning and experimenting. (Tries to see the problem in a new direction, or so to say, "thinking outside the box"). If Zubair could share his thoughts on the matter of integrating clojurescript in html I would be more than happy. /Bad programmer who was tought scheme in school by another bad programmer and is very happy he learned it. Although it was a rather frustrating experiance. Throws the ball away in the air, hoping that someone can take it up.

Cadman answered 3/8, 2011 at 23:2 Comment(3)
I don't understand the question. levand is saying that instead of using ClojureScript on the server, you might as well just use Clojure, since it's more powerful.Roadstead
There is a lot of noise in your post, which might explain why it gets downvotes. Consider making an edit to clean it up and just focus on answering the question. This will make it easier for future visitors to read and understand how it applies to the question. Good luck! :)Longbow
@Cadman I actually upvoted your answer as I see there is a very valid point in there, but you need to express it more clearly. I still don't understand the point you are trying to makeJaneejaneen

© 2022 - 2024 — McMap. All rights reserved.