If you do have a go, mail me at mst -> shadowcat.co.uk, I know a bit about the perl side of things and my first CPAN release was fixups to Guile.pm so I'd be interested to help you.
The source itself is pretty close to ActionScript compatible. Problem is, I mess with the __proto__ property a lot for basic data types and for scope chaining. It's what lets me use JavaScript's native lookup mechanism for variable lookup; instead of searching down an a-list, I make each activation frame a JavaScript object and knit their prototypes together, so I can lookup variables with 'env[symbol]' and the whole search process is in C. __proto__ is a non-standard property; it's supported in all major browsers, but I wouldn't bet on it appearing in Flash. And I'm not sure it'd be fast enough if you had to implement variable lookup in the interpreter itself.
I thought about writing a compiler instead of an interpreter, but macros & quasiquote present a bit of a problem. You can compile the code down to JavaScript...but if you run into a quasiquote, you've got to jump back into the compiler to evaluate it, then splice that code back into your function, then eval the newly-generated JavaScript code to get back a real function. Remember, even ordinary functions like setforms (in the standard library) call macex at runtime, so you can't just separate things into a compile-time-only macroexpansion pass. And ActionScript doesn't have an eval function, so that gets a little complicated.
I understand your point about macros but not quasiquote... I thought `(a b ,x ,y c d) was an abbreviation for (list 'a 'b x y 'c 'd)? What am I missing?
I wonder if it might work if you have an identical Arc implementation in your compiler and in your runtime so that all the macro expansions can be done at compile time.
ActionScript3 flash.display.Loader.load() says it loads SWF files... does this include compiled ActionScript? If so, maybe a REPL inside the Flash application could be written by calling back to your server which ran the compiler. Not ideal, but certainly more fun than an edit -> compile -> run -> debug cycle.
`(a b ,x ,y c d) is an abbreviation for (quasiquote (a b (unquote x) (unquote y) c d). The quasiquote returns a literal list, except that whenever it encounters an unquote or unquote-splicing it hops back into the evaluator and evaluates the form in the local environment.
Flash load() is probably your best bet. My startup has a similar problem - dynamically generating code that will run in a browser - and we eventually decided it was easier to go with JavaScript/eval than Flash, even though we have to support Flash anyway for the finished product. Our other option was to send the code back to the server through Flash's XMLConnection, compile it there, returns a URL of the compiled SWF through the connection, then loadSWF() it and hope we can figure out how to dynamically reference the new classes. Check out MTASC for the server; Macromedia's Flash Compiler won't run on the command line.
Or you could just punt on the dynamic features. I don't support continuations in ArcLite, and I know someone doing a native-code port that's planning to leave out a few of the more dynamic features. Beware that I found (= ...) doesn't work if you leave out (macex ...), though.
Yeah, it was a deliberate design decision by Macromedia. They wanted to keep the VM small, so they deliberately left out anything that smacked of a runtime compiler. Eval, regexps. Though I heard regexps may have come back in AS3...
I haven't yet heard of any Scheme -> JavaScript compilers that support eval (and thus a REPL)... so ArcLite (or some other interpreter written in JavaScript) would be a good way to support interactive programming in the meantime.
The other thing I'm noticing is that I've been nesting lets when the second assignment depends on the first. I think I should be using withs which I did not know about.
Not quite: you need tostring to capture the output of system (which is sent to stdout, not returned as a string). tostring is macro, so you can't compose it using :.
If I thought of a shorter name than "rmeol/ssystem" that I would still understand to mean "concatenate strings together, pass to system, capture the output, and remove the trailing newline", I would use it instead of "rmeol:ssystem". If "rmeol/ssystem" is the best I can come up with, then hey, I can save myself a function def and use "rmeol:ssystem". :-)
I think "better string processing" is below the level of writing a grammar, even a mini-grammar.
If you treat strings as lists of characters and have good pattern-matching, this problem mostly solves itself, without something as ugly as regular expressions. You have the rich set of list operations, function-based predicates and, with clause selection by pattern, that's mostly what you need.
Yes, I know strings-as-lists seems like a terribly unoptimal thing to do; but it's an optimization challenge (how to optimize a particular backing representation of lists so that certain kinds of operations--subset matching, tokenizing, etc.--happen efficiently?), not something to bake into the language.
Yes, exactly. The Git repository is terrific resource as a place to conveniently store everyone's patches, but of course some patches may be "bad" (by one criteria or another), and that is OK (good even) for its purpose.
I'm running Linux, and so date was broken and thus so was the web server, I looked in the repository and was happy to see someone had a fix, and I didn't even have to read the date man page (lazy me!)
So, just like you say, Paul's canonical releases of arcn.tar and a community repository (for good patches, bad patches, experimental patches, weird patches...) are both useful.
"... I'm running Linux, and so date was broken and thus so was the web server, I looked in the repository and was happy to see someone had a fix, and I didn't even have to read the date man page ..."
Yes. When projectileboy said "the Git repo that's been created", I assumed he meant the one you just linked to (I don't know of any other), which is where I found the date fix.
Thank you! I was just starting to see if I could fix date on my Linux system when I thought, "hmm... I should go see if someone has fixed this already..." and there it was in your git repository! A fix by Nathan Weizenbaum! Yay!