Hacker News new | past | comments | ask | show | jobs | submit login

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.




>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


There's also Saturnine, https://github.com/texodus/saturnine though I haven't tried it yet.


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.


Sibilant is Lisp lipstick for JavaScript.

https://github.com/jbr/sibilant



Have you heard of CoffeeScript? It makes writing JS a much, much more pleasant experience.


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.)


> 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: