Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Interesting to see this get linked to - this was a little hack that I did back in 2006 and haven't touched it since.

In short it was an experiment to develop an alternative syntax to jQuery (I've always felt that jQuery's syntax and idioms are very much like a domain-specific language for traversing and manipulating the DOM). One of my primary reasons for creating jQuery was to develop a library that had very little syntactical overhead. This jQuery^2 experiment was trying to take it to the next extreme (almost no syntax, just some whitespace). To do this I built a very-hacky parser and search through the page for scripts that have a type of "text/jquery".

You'll note that the script that runs the page is actually in this meta-language. Also note that the code in the textarea compiles to some nonsense that doesn't actually run on that page. I was mostly just throwing in code to test the parser.

Projects like Cappuccino have taken this idea to the extreme and developed complete languages on top of JavaScript that are much more functional than what I present here.

Glad people are finding it to be interesting, though!



This is actually pretty neat. I'd much prefer it to what jQuery source looks like today.

And I'd argue there's no reason not to want to optimize the syntax like this.


In one of his talks [1], Alex Warth (the author of OMeta [2]) points out that JS might be the "assembly of the web" - in the sense that future languages will compile to it. OMeta makes this surprisingly easy:

1. http://www.cincomsmalltalk.com/video/2008/sts/ometa_keynote_... 2. http://tinlizzie.org/ometa/




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

Search: