Hello, I'm Nick Fitzgerald. This is my weblog. You can also check out my shared items from Reader and code on GitHub. Feel free to contact me about whatever.
July 23rd, 2010
I got a quick and dirty, first-iteration of TryParenScript.com up and running!
TryParenScript follows in the footsteps of TryRuby.org, TryHaskell.org, and TryClojure. It provides a basic ParenScript REPL inside your browser. Type ParenScript code in, see the compiled JavaScript, and then view the result from evaluating that JS.
Common Lisp was such a pain to set up behind Apache that I ended up coding both front- and back-ends in ParenScript by taking advantage of Node JS on the server. (Don't you like how the technology that has only started to gain traction in the last year was easier to deploy than the language that was used to write one of the early interpreters for JavaScript?)
This is still a work in progress! That means you shouldn't expect a flawless experience yet.
For example, the biggest reason to use ParenScript is to harness the power of macros in your client side code. Unfortunately, because the macro-expansion is run on my server, and I haven't figured out a good way to sandbox Common Lisp, I can't let anyone define custom macros yet. If I did, anyone could run arbitrary code on my server.
Also, and this should be fixed reasonably soon, because of the way I am
(ab)using jQuery.globalEval, function declarations are screwed up. It is
expected that the following form creates a new, global function.
(defun foo (x) (return (+ x 1)))
However, what ends up getting evaluated in jQuery.globalEval is equivalent to
this:
window.__tryps_return = function foo(x) {
return x + 1;
}
As you can see, Function Declarations are accidentally transformed in to Named Function Expressions, which don't leave a footprint on the scope they are created within (except in IE, because of a nasty JScript bug). As I said, I plan to fix this one very soon.
Despite those two shortcomings, I am very pleased with the progress I have made so far! The code is hosted for the world to see on GitHub, please take a look at the source! This is my first "real" ParenScript project, and I would love to get some feedback.
On August 10th, 2010
On August 2nd, 2010
On July 23rd, 2010
On July 19th, 2010
On July 5th, 2010
On June 29th, 2010
On June 25th, 2010
On June 21st, 2010
On June 2nd, 2010
On May 20th, 2010
blog comments powered by Disqus