Here is a little update:<div><br></div><div>I set up monitoring of the process, so the site should be a little more stable now.</div><div><br></div><div>`defun` will now work correctly.</div><div><br></div><div>I added a small "cheat sheet" section to help people get off the ground quicker.<br clear="all">
<br>_Nick_<br><br>
<br><br><div class="gmail_quote">On Fri, Jul 23, 2010 at 11:58 AM, Vladimir Sedach <span dir="ltr"><<a href="mailto:vsedach@gmail.com">vsedach@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
This is pretty cool.<br>
<br>
Apache is a huge pain to set up, good call on Node.js. I like how<br>
short the glue code is.<br>
<br>
You should probably go with a Lisp process per session.<br>
<br>
Consider using CLISP because it starts up really fast and has very<br>
little memory overhead (although both CLISP and SBCL share their Lisp<br>
image VM pages, loading FASLs causes some of the pages to be modified<br>
and unshared - if you make a new image file with Parenscript<br>
preloaded, all the processes will share their entire image).<br>
<br>
The tricky thing is going to be detecting a stuck process. One easy<br>
way to bypass this is to do a new Lisp process per eval - just run the<br>
entire REPL history over every time the user presses enter, and have<br>
something like a 5 second timer that kills that process if it doesn't<br>
complete. I guess that's exactly like CGI. Users might run into<br>
trouble if something depends on randomly generated names (gensyms<br>
should be identical across invocations).<br>
<br>
You can use FreeBSD jails or one of the Linux jail tools to sandbox<br>
the Lisp and allow defmacros (although the latter are kind of a pain<br>
to set up).<br>
<br>
As far as the code goes, the repository Parenscript has implicit<br>
returns for defuns and lambdas. I should put together a new release<br>
soon.<br>
<br>
Vladimir<br>
<br>
2010/7/23 Nick Fitzgerald <<a href="mailto:fitzgen@gmail.com">fitzgen@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Hey guys!<br>
> I just got a quick and dirty first iteration<br>
> of <a href="http://tryparenscript.com/" target="_blank">http://tryparenscript.com/</a> up and running. Emphasis on dirty. This is my<br>
> first "real" piece of ParenScript, so I would love to have some feedback.<br>
> All of the code is hosted at <a href="http://github.com/fitzgen/tryparenscript.com" target="_blank">http://github.com/fitzgen/tryparenscript.com</a><br>
> It follows in the footsteps<br>
> of <a href="http://www.tryruby.org/" target="_blank">http://www.tryruby.org/</a>, <a href="http://tryhaskell.org/" target="_blank">http://tryhaskell.org/</a>,<br>
> and <a href="http://tryclj.licenser.net/" target="_blank">http://tryclj.licenser.net/</a>. Basically provides a REPL for ParenScript<br>
> inside of your browser. I would like to add an interactive tutorial like how<br>
> some of those have in the future.<br>
> I couldn't get sbcl and hunchentoot running behind apache, it was a<br>
> nightmare for me (though I expect I just was overlooking something), so I<br>
> ended up writing the backend in ParenScript too, with Node JS.<br>
> Currently there are some issues with the way that function definitions are<br>
> evaled in the global scope, so<br>
> (defun foo (x) (return (+ x 1)))<br>
> won't create a new global foo function because it ends up being evaluated as<br>
> this:<br>
> window.__tryps_return = function foo(x) { return x + 1; }<br>
> so what should have been a Function Declaration gets turned in to a Named<br>
> Function Expression. This is on the top of my list of things to do next.<br>
> Fortunately, there is a simple (while not quite "easy-to-use") fix:<br>
> (setf (@ window foo) (lambda (x) (return (+ x 1))))<br>
> which will work as expected.<br>
> I also expect I will need to set up some type of monitoring for the server<br>
> because it is just a single process in detachtty, and if it crashes (which I<br>
> suspect it might if it hit the front page of Hacker News all of a sudden, or<br>
> something like that) I would have to go back in and restart the process<br>
> (after I somehow found out it died). This is obviously less than optimal. If<br>
> anyone has any suggestions on this front, I would love to hear them too.<br>
> Most of all, I would just like to get some feedback and suggestions on the<br>
> code :)<br>
> Thanks in advance for all your responses!<br>
><br>
> _Nick_<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> parenscript-devel mailing list<br>
<div class="im">> <a href="mailto:parenscript-devel@common-lisp.net">parenscript-devel@common-lisp.net</a><br>
</div>> <a href="http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel" target="_blank">http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel</a><br>
><br>
><br>
<br>
_______________________________________________<br>
parenscript-devel mailing list<br>
<div class="im"><a href="mailto:parenscript-devel@common-lisp.net">parenscript-devel@common-lisp.net</a><br>
</div><a href="http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel" target="_blank">http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel</a><br>
</blockquote></div><br></div>