Is it possible to embed Clojure in HTML using the approach used in Brython
for Python?

https://news.ycombinator.com/item?id=4923530

Here is the correct link to the site: http://www.brython.info/

The idea is to embed Python code in the HTML and then have an interpreter
that translates it to JavaScript on the fly. Here is what it looks like.

<script type="text/javascript" src="brython.js"></script>
<script type="text/python">
from browser import document as doc
from browser import alert
def echo(*args):
  alert("Hello %s !" %doc["zone"].value)
doc["test"].bind("click", echo)
</script>
<p>Your name is : <input id="zone"><button id="test">clic !</button>

>From an efficiency point of view this is not as optimal as the
compiler-based approach that ClojureScript uses—however, from the
perspective of lower-the-barrier-to-entry this approach wins hands down. It
is great for writing quick one-off scripts that over time can evolve into
more sophisticated applications.

Asim

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to