Alright, that does it. Mr or Ms. 3b, come forth and show yourself!
:)
On Mon, Jul 12, 2010 at 11:56 PM, Red Daly reddaly@gmail.com wrote:
On Sat, Jul 3, 2010 at 4:36 PM, Daniel Gackle danielgackle@gmail.com wrote:
Red, It sounds awesome. I've often wondered how hard it would be to get a PS REPL running inside Emacs. Would this project be relevant to the effort? Or is it supplanted by your stuff? http://js-comint-el.sourceforge.net/ Daniel
It looks like 3b's slime-proxy project is the most relevant. js-comint-el seems better for a js runtime operating outside of a host lisp.
I would love to see a Parenscript mode that interacts gracefully with SLIME.
For me it would be ideal to have a SLIME-derived mode for editing .paren files, and a SLIME-derived Parenscript REPL that interacted with the host lisp. The REPL may evaluate Parenscript forms in a CL-SPIDERMONKEY environment, or it may push compiled code into a web client via the WebSocket API[1] or some other means--it's really up the host lisp.
I'm not particularly familiar with emacs lisp or SLIME, but I think extending SLIME would be the best means of enhancing Parenscript editing. Slime Proxy seems like the perfect approach ( http://github.com/3b/slime-proxy )
Red
[1] http://dev.w3.org/html5/websockets/
On Thu, Jul 1, 2010 at 11:58 AM, Red Daly reddaly@gmail.com wrote:
Dearest Meta Javascripters,
I have written a library for interfacing Common Lisp with the Spidermonkey Javascript engine. You may find some use in this for testing Parenscript code, or ever running Parenscript code to do some important, lisp-end task. In any case, what follows is excerpted from the README. The home page for the project is http://github.com/gonzojive/cl-spidermonkey . Contributes are of course welcome.
All the very best, Red
# CL-SpiderMonkey: Common Lisp interface to Javascript
### A Common Lisp library for interacting with Javascript through the SpiderMonkey library
## Introduction
cl-spidermonkey provides a Javascript runtime environment inside of Common Lisp by embedding a widely-used and tested Javascript engine: Mozilla's SpiderMonkey.
With full access to Javascript from Common Lisp, it becomes easier to test Javascript libraries in the same breath as normal testing. It also allows a Lisp REPL to be used as a Javascript REPL, and for many other combinations of lisp and JS.
## Installation
Before you do anything you need the git repostiory.
git clone git://github.com/gonzojive/cl-spidermonkey.git
First you need to compile Spidermonkey. It's not that bad! Just cd into the vendor directory and then run the install script:
cd vendor sh install-spidermonkey.sh
That will download and install SpiderMonkey, and set up all the paths properly.
Now you should be able to load the library in lisp:
REPL> (asdf:operate 'asdf:load-op :cl-spidermonkey)
## Usage
Right now there are only two exported symbols, so things are pretty easy:
REPL> (sm::with-js-context (context) (sm:evaluate-js "10 * 24;")) 240
Note that you can only get doubles, ints, strings, voids (undefined), nulls, and boolean values back from EVALUATE-JS. Any other object will come back as a pointer to a JS_Object whichs needs further attention from the bindings. If you are so inclined, lookat the src/spidermonkey-bindings.lisp file for more info on how to deal with native Spidermonkey objects.
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
parenscript-devel mailing list parenscript-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel