Hey guys!<div><br></div><div>I just got a quick and dirty first iteration of <a href="http://tryparenscript.com/">http://tryparenscript.com/</a> 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 <a href="http://github.com/fitzgen/tryparenscript.com">http://github.com/fitzgen/tryparenscript.com</a></div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>It follows in the footsteps of <a href="http://www.tryruby.org/">http://www.tryruby.org/</a>, <a href="http://tryhaskell.org/">http://tryhaskell.org/</a>, and <a href="http://tryclj.licenser.net/">http://tryclj.licenser.net/</a>. 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.</div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>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.</div>
<div><br></div><div>Currently there are some issues with the way that function definitions are evaled in the global scope, so</div><div><br></div><div>(defun foo (x) (return (+ x 1)))</div><div><br></div><div>won't create a new global foo function because it ends up being evaluated as this:</div>
<div><br></div><div>window.__tryps_return = function foo(x) { return x + 1; }</div><div><br></div><div>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:</div>
<div><br></div><div>(setf (@ window foo) (lambda (x) (return (+ x 1))))</div><div><br></div><div>which will work as expected.</div><div><br></div><div>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.</div>
<div><br></div><div>Most of all, I would just like to get some feedback and suggestions on the code :)</div><div><br></div><div>Thanks in advance for all your responses!<br clear="all"><br>_Nick_<br><br>
</div>