5 ms·
Either will allow you to do this. I imagine the only difference (in terms of existing features for your platform) would be 'generating JavaScript.' CL has Pare
by tumult 17y ago
Either will allow you to do this. I imagine the only difference (in terms of existing features for your platform) would be 'generating JavaScript.'
CL has Parenscript http://common-lisp.net/project/parenscript/ http://common-lisp.net/project/parenscript/ which is probably more powerful than whatever JavaScript compiler/macro/generator tools you would have to hack together yourself in Clojure.
As for my own personal opinion, I would choose the Lisp that has tail call optimization.
If you are willing to look into a third option, I highly recommend HOP from Inria http://hop.inria.fr/ http://hop.inria.fr/ which is a Scheme web platform with a true JavaScript compiler.
- KirinDave 17y agoParenscript, a javascript generator, eh? I don't understand, why would anyone want to generate javascript from S-exprs? I understand this is fashionable in the CL world, but I've never seen any good justification for this practice outside of saying, "Now everything is in lisp." But this isn't a terribly compelling argument. Most web applications are multi-language and it doesn't seem terribly detrimental to them. Further, the state of the art in web technology moves so incredibly fast that it seems strange and almost obstructionist to insist on a secondary library that needs to be kept in synch. Finally, it tends to lead to crap designs. Anyone who does cross-browser implementations designs will tell you that simple CSS over a generic HTML framework is almost never enough. Frequently you need to introduce new enclosing scopes or add seemingly senseless markup to help make IE play nice (a torturous exercise many web designers still need to go through). So while CL has some awesome web libraries, I'd say their extensive work into making HTML+JS+CSS generation from pure lisp seems like a foundation built on sand. Sometimes I wonder if the whole exercise was just to avoid working with HTML, which many (more prejudiced) developers find distasteful to work with. I don't think Clojure is at a significant disadvantage to CL in this field. If anything, it's at an advantage in web applications, as it has access to a massive number of very good web-related and utility libraries. A paucity of modern, battle tested libraries that "work everywhere" has always been Common Lisp's achilles heel.
- chollida1 17y agoWell people would do it for the same reason they use the GWT. In that case they are more familiar with Java and GWT lets them write Java and have it compiled to javascript for client side use.
- asher 17y agoGood points, KD. Clearly, you've been there. Is there a good writeup somewhere of the deviations from "nice" web design that are needed?
- hackoder 17y agoI (OP) agree with a lot of what you've said. I have done a lot of work in javascript, and my reason for html/js generation wasn't because I believe that everything should be lisp. I enjoy writing html, js and css from scratch. The reason I chose it as one of my criterion is because it allows you to get off the ground _fast_ if you're coding in a single language (so basically it helps with prototyping stuff). I really enjoy the html generation libraries- I can test stuff without doing a mental switch between languages, even build a half decent UI very quickly, and that is a huge advantage. My initial scripts will not need to be run in multiple browsers, they'll be simple scripts to get the app going. Since I intend to keep the scripts small and smiple, I can replace them later with javascript as the app grows.
- KirinDave 17y agoThank you for a serious response! So you view it as a net win in rapid prototyping?
- gruseom 17y agoYou say you "don't understand", apparently disingenuously, because you then go on to announce what the argument supposedly is, object to it, change the subject (what, exactly, does Parenscript have to do with HTML?) and end with a red herring. As someone who works in Parenscript every day and hasn't had his coffee yet, I find that irritating.
- 17y ago
- anonjon 17y agoClojure has scriptjure: http://github.com/arohner/scriptjure http://github.com/arohner/scriptjure which compiles s-expressions to javascript.
- tumult 17y agoVery cool, thanks for showing me this.