3 ms·
Prolog in Javascript
- daviddaviddavid 15y agoI would love to be able to do something like the following in the browser: add_mouseovers(Selector, Callback) :- ready(DOM), elements_by_class(Selector, Elements), add_mouseovers_to_elements(Elements, Callback). add_mouseovers_to_elements([], _). add_mouseovers_to_elements([Element|Rest], Callback) :- bind(Element, mouseover, Callback), add_mouseovers_to_elements(Rest, Callback). :- add_mouseovers('.myclass', background_blue). I'm a huuuuuge Prolog fan but I have serious doubts that it will see the resurgence that Lisp is seeing these days. The problem is that unless you've never programmed in the language it takes a very long time before things start to 'click' and you can be genuinely productive. Seems like with FP people can get shit done even if they're not totally thinking functionally. With Prolog you just sit there feeling stupid.
- swannodette 15y agoYou can embed Prolog in Lisp and it can be efficient. As Lisp resurges, I suspect that Prolog will too.
- daviddaviddavid 15y agoSo in order to do Prolog-DOM programming how bout Prolog as a DSL in ClojureScript?
- swannodette 15y agoThere's a bit of work to do, I'm interested in getting core.logic to be compatible with ClojureScript.
- daviddaviddavid 15y agoSorry, my newlines got lost in the ether! https://gist.github.com/1256385 https://gist.github.com/1256385
- aaronblohowiak 15y agohttp://news.ycombinator.com/formatdoc http://news.ycombinator.com/formatdoc