

Prolog in Javascript - franze
http://ioctl.org/logic/prolog1

======
daviddaviddavid
I 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
You can embed Prolog in Lisp and it can be efficient. As Lisp resurges, I
suspect that Prolog will too.

~~~
daviddaviddavid
So in order to do Prolog-DOM programming how bout Prolog as a DSL in
ClojureScript?

~~~
swannodette
There's a bit of work to do, I'm interested in getting core.logic to be
compatible with ClojureScript.

------
daviddaviddavid
Sorry, my newlines got lost in the ether!

<https://gist.github.com/1256385>

~~~
aaronblohowiak
<http://news.ycombinator.com/formatdoc>

