in browser repl (with access to the dom?)

105 views
Skip to first unread message

Darren Cruse

unread,
Mar 2, 2015, 1:57:21 PM3/2/15
to lispy...@googlegroups.com
In playing with lispyscript it struck me that I'd really like an easy in browser lispyscript repl.

i.e. the "lispy" command line repl seems great for server side things but for web pages I want access to the dom, and even though browser developer tools have the javascript "repl" built in I'd love to be able to copy/paste my lispyscript and run it rather than switching to javascript.

Is that available?  Is it possible?

(on a related note I notice there's no "run" button on the "Try it' page:  http://lispyscript.com/tryit/ was that intentional?)

Thanks,

Darren 

Darren Cruse

unread,
Mar 2, 2015, 4:01:45 PM3/2/15
to lispy...@googlegroups.com
I'd also meant to mention that IIRC there's some options with clojurescript to somehow (I don't know it works behind the scenes) connect the simple command line repl to the browser and kind of "remote debug" it.

i.e. I could imagine that as a nice option if something like the current lispy command line repl were able to do that.

(I don't know if that's easier or harder than truly running a repl right in the browser - either would be appealing to me for web stuff)

Darren Cruse

unread,
Mar 8, 2015, 1:55:29 PM3/8/15
to lispy...@googlegroups.com
Whoops accidentally replied to this thread in my other one about source maps.

I said I looked a little at the lispy repl code and was impressed that I didn't think it should be that hard if somebody wanted to take on getting it running the browser.

I pointed to this as something I thought might help:  http://sdether.github.io/josh.js/

Darren Cruse

unread,
Mar 10, 2015, 2:06:12 PM3/10/15
to lispy...@googlegroups.com
FYI I do have an in-browser REPL I wound up using this "jquery terminal" plugin:

    http://terminal.jcubic.pl/

Hopefully I can do like a screencast where people can see what it looks like.

Right now I've got it as optional (so it doesn't weigh things down much further i.e. the size of browser-bundle.js), but I tried to make it easy to add when you want to.

To add it on your page you have separately link in jquery and the jquery.terminal plugin js files (in addition to browser-bundle.js of course).

Then in document ready you just do:

        ((.ready ($ document)) (function ()
                ((.enableBrowserRepl (require "lispyscript")))))

Having done that, the page will look normal but I've a couple alt-key commands that "slide" it open (from the bottom or from the right).

So far it's working fairly well.  I truthfully need to use it more myself before I know how genuinely useful it is.

(as I mentioned before I was tempted to do this partly by disappointments over source maps seeming kind of funky - plus I'm interested a lot in in-browser single-page-application stuff)


Santosh Rajan

unread,
Mar 10, 2015, 9:59:52 PM3/10/15
to lispy...@googlegroups.com
Awesome. I am looking forward to releasing 0.4 once we get all these working and tested.

--
You received this message because you are subscribed to the Google Groups "lispyscript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lispyscript...@googlegroups.com.
To post to this group, send email to lispy...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/lispyscript/72af7577-b964-428f-a372-6b1aefac80d3%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages