[parenscript-devel] TryParenScript.com!

Nick Fitzgerald fitzgen at gmail.com
Fri Jul 23 06:59:24 UTC 2010


Hey guys!

I just got a quick and dirty first iteration of http://tryparenscript.com/ up
and running. Emphasis on dirty. This is my first "real" piece of
ParenScript, so I would love to have some feedback. All of the code is
hosted at http://github.com/fitzgen/tryparenscript.com

It follows in the footsteps of http://www.tryruby.org/,
http://tryhaskell.org/, and http://tryclj.licenser.net/. Basically provides
a REPL for ParenScript inside of your browser. I would like to add an
interactive tutorial like how some of those have in the future.

I couldn't get sbcl and hunchentoot running behind apache, it was a
nightmare for me (though I expect I just was overlooking something), so I
ended up writing the backend in ParenScript too, with Node JS.

Currently there are some issues with the way that function definitions are
evaled in the global scope, so

(defun foo (x) (return (+ x 1)))

won't create a new global foo function because it ends up being evaluated as
this:

window.__tryps_return = function foo(x) { return x + 1; }

so what should have been a Function Declaration gets turned in to a Named
Function Expression. This is on the top of my list of things to do next.
Fortunately, there is a simple (while not quite "easy-to-use") fix:

(setf (@ window foo) (lambda (x) (return (+ x 1))))

which will work as expected.

I also expect I will need to set up some type of monitoring for the server
because it is just a single process in detachtty, and if it crashes (which I
suspect it might if it hit the front page of Hacker News all of a sudden, or
something like that) I would have to go back in and restart the process
(after I somehow found out it died). This is obviously less than optimal. If
anyone has any suggestions on this front, I would love to hear them too.

Most of all, I would just like to get some feedback and suggestions on the
code :)

Thanks in advance for all your responses!

_Nick_
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/parenscript-devel/attachments/20100722/fa1eb0fc/attachment.html>


More information about the parenscript-devel mailing list