Andrei wrote: > Adam wrote an in-browser evaluator for D programs. These, when > presented on the homepage with "hello, world" in them are of > limited usefulness. > However, a personalized "try it now" button present for _each_ > artifact in an std module would be of great usefulness.
Indeed. I actually wrote a little javascript thing for that new home page that's reusable across other ddoc or similar sites. Check it out: http://arsdnet.net/d-web-site/std_algorithm2.html Every time it sees a d_code block, the script adds a button. Hit the button, and you can edit the code and send it off to my completelyexpendable vm to compile and run it. (It's also on my not-quite-done newsreader so example code in newsgroup posts are detected and made editable. That's less perfect since it's trying to pick code out of unstructured text, but it works reasonably well.) Of course, most examples fail to actually compile... but maybe a few replacement rules for the text - automatically insert main() if it's not there, import std.all or similar at the top, replace "..." with some generic data. I think we could make the examples work with just a few lines of code. Unittests are a different story though, since their code isn't in the HTML today. If dmd did make it available though, this same script should work on it.