News for hackers. Stuff that matters.
Re:Advanced programming languages by edw on Monday April 11, 2011 @09:32PM (#2435406)
Just the mention of Scheme, my favorite programming language, makes me get irritated when I think about the thousand or fifteen hundred lines of JavaScript I've written in the last couple weeks. I'm basically writing Scheme using C syntax, and the anonymous functions as arguments to functions which are called by anonymous functions that are themselves arguments to functions really start to get confusing, in large part because the mixing of parentheses and curly brackets and the semicolons and all the things that are supposed to be the sane alternative to all those sets of parantheses. Oh, and let's not even mention the way JavaScript doesn't do block scoping the way C++ does, and let's not even think about how closures interact with mutation—which almost guarantees that code with for loops and closures will have bugs in it.

And the sad thing is, I don't mind writing JavaScript. Relatively speaking, I love JavaScript. Now, if a framework-platform like Node.js existed for Clojure, now, that would be a different story. Except that I'd then constantly have to do mental context switches whenever I jumped from client to server code.

There is no rest for the wicked, I suppose.

Re:Advanced programming languages by ataggart on Tuesday April 12, 2011 @12:38AM (#2435922)
>Now, if a framework-platform like Node.js existed for Clojure, now, that would be a different story.

What about aleph?

http://github.com/ztellman/aleph

Re:Advanced programming languages by pmjordan on Tuesday April 12, 2011 @05:07AM (#2436462)
There's also Saturnine, https://github.com/texodus/saturnine though I haven't tried it yet.
Re:Advanced programming languages by muyuu on Tuesday April 12, 2011 @09:55AM (#2437176)
The guys at INRIA (you may know them from Bigloo or OCaml) have a scheme to javascript compiler that works quite well. HOP is made with that.

This short paper: http://www-sop.inria.fr/indes/scheme2js/files/icfp2006.pdf elaborates on Scheme to JS compilation and goes beyond. You can actually generate all the HTML in Scheme as well (as done in HOP).

If you download HOP's sources, it's there.

Re:Advanced programming languages by sjs on Tuesday April 12, 2011 @01:02AM (#2435971)
Sibilant is Lisp lipstick for JavaScript.

https://github.com/jbr/sibilant

Re:Advanced programming languages by ahrjay on Tuesday April 12, 2011 @05:59PM (#2439543)
Re:Advanced programming languages by tkahn6 on Tuesday April 12, 2011 @12:10AM (#2435840)
Have you heard of CoffeeScript? It makes writing JS a much, much more pleasant experience.
Re:Advanced programming languages by edw on Tuesday April 12, 2011 @03:10PM (#2438669)
Thanks; I just checked it out and while it has some nice features, it doesn't do all that much to compact my already-dense JS. Additionally, the added complexity it introduces to the development process negates some of its charm, as does the extra cognitive load of playing human backtracking parser whenever I have to think about what function applications require parens and which don't. (This is all IMO, so while I think I've accurately portrayed CoffeeScript, YMMV, so people should check it for themselves.)
Re:Advanced programming languages by tkahn6 on Tuesday April 12, 2011 @03:48PM (#2438877)
> function applications require parens and which don't.

Yes. An understanding of JS is definitely necessary when developing with CoffeeScript. The ambiguity that the parser allows sometimes leads to code generation that isn't at all what you intended. I sometimes find myself going into the JS output to make sure the compiler did what I intended.

Annoying, but at least for me, the benefits of cleanliness and things like list comprehensions and Python-esque list semantics makes it worthwhile.