Experiments with emscripten and D

Adam D. Ruppe destructionator at gmail.com
Sat Aug 17 18:58:40 PDT 2013


On Saturday, 17 August 2013 at 20:42:33 UTC, H. S. Teoh wrote:
> And you'd have to sandbox the code since arbitrary D code 
> running wild on the user's computer is a Bad Thing(tm).

You have to do that with javascript anyway, just in case your 
impl has a security flaw. Run it in a separate process with a 
restricted security token and you'll be in decent shape.

...though, you know, just thinking wildly here, I wonder how well 
it'd work if you used a virtual machine. They are pretty quick 
nowadays thanks to fancy hardware and such. What if your browser 
extension fired up a tiny little virtual machine, ran the one 
process and just mapped its video framebuffer to the browser 
window?

Then the one program can just be a standard program using a 
special library (I've make small executables with an unmodified 
dmd that can run on bare metal), no need to modify the compiler 
like with google's salt thing.

I wonder how hard it would be to write that. Searching the web 
for kvm though always assumes qemu. No, I want to write a 
super-small qemu, and I don't care if it can't boot linux. How 
hard can it be?

but i'd better not get too much into it, I already have other 
plans for the next few weeks. Gotta finish my minigui.d!


More information about the Digitalmars-d mailing list