tag:blogger.com,1999:blog-2681864008001569004.post261153601603334903..comments2023-12-12T01:10:23.246-08:00Comments on azakai's blog: Lua in JavaScript: Running a VM in a VMazakaihttp://www.blogger.com/profile/00792138494525424175noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-2681864008001569004.post-7504241953738813042013-06-01T10:44:05.943-07:002013-06-01T10:44:05.943-07:00Ok, understood. Thank you very much. :)Ok, understood. Thank you very much. :)yep!https://www.blogger.com/profile/07896874002215268190noreply@blogger.comtag:blogger.com,1999:blog-2681864008001569004.post-54863558955330382572013-06-01T10:10:08.323-07:002013-06-01T10:10:08.323-07:00If you disabled js.global, it won't be accessi...If you disabled js.global, it won't be accessible in any way. That's the only way to reach out of the Lua VM.azakaihttps://www.blogger.com/profile/00792138494525424175noreply@blogger.comtag:blogger.com,1999:blog-2681864008001569004.post-30602924647794140372013-06-01T07:46:23.887-07:002013-06-01T07:46:23.887-07:00Thank you very much for the reply. Actually speaki...Thank you very much for the reply. Actually speaking, I'm not a Lua expert as well, however the author of lua.js described known issues in his implementations. Please see here: https://github.com/mherkender/lua.js#known-issues<br /><br />If I disable js.global somehow -- is it possible to restore it again from a Lua script? I'm just wondering if it can be considered as a security issue giving full access to the JavaScript globals, for example, sending unauthorized HTTP requests, etc.yep!https://www.blogger.com/profile/07896874002215268190noreply@blogger.comtag:blogger.com,1999:blog-2681864008001569004.post-88771494626318141732013-05-31T11:10:44.051-07:002013-05-31T11:10:44.051-07:00Can you perhaps give an example for the things you...Can you perhaps give an example for the things you found to not work? I'm not a lua expert so I'm not sure how to test those things just by their names.<br /><br />The only pitfall I am aware of is the cross-VM GC issue I mention in the post. But very possibly there are other issues we will run into.<br /><br />You can disable js.global of course, perhaps I should add a nice API call to make it even easier.<br /><br />This should already include all the standard libraries, I think - I followed the embedding examples as best I could. But I didn't test. Of course, what they can do is limited by the browser - you can't read files on the user's machine due to web security.<br /><br />azakaihttps://www.blogger.com/profile/00792138494525424175noreply@blogger.comtag:blogger.com,1999:blog-2681864008001569004.post-31570821246373276672013-05-31T11:08:00.376-07:002013-05-31T11:08:00.376-07:00Thanks! I'll take a look at how they do that.
...Thanks! I'll take a look at how they do that.<br /><br />Overall the project is very new, thoughts on what the API should look like are welcome. I like the idea of using script tags.<br />azakaihttps://www.blogger.com/profile/00792138494525424175noreply@blogger.comtag:blogger.com,1999:blog-2681864008001569004.post-85774172876392185362013-05-31T02:12:10.831-07:002013-05-31T02:12:10.831-07:00This is possible with empydom: https://github.com/...This is possible with empydom: https://github.com/bkase/empydom/blob/master/srv/script-tag-example.htmlJanus Troelsenhttps://www.blogger.com/profile/16955941075243047389noreply@blogger.comtag:blogger.com,1999:blog-2681864008001569004.post-66518671637407659462013-05-30T23:46:29.523-07:002013-05-30T23:46:29.523-07:00These are good news!
I've played around with ...These are good news!<br /><br />I've played around with lua.js, and, unfortunately, it seems to have a few disadvantages:<br /><br />* it does not support several Lua features (coroutines, for example, and maybe something else);<br />* and it seems to require objects marshalling and unmarshalling (not a trivial problem in this case, imo, or I missed in lua.js too much re-implemented cyclic graphs objects traversing to marshall JS objects to lua.js and vice versa).<br /><br />My questions are:<br /><br />- How easy it takes to interop with JavaScript objects in this Lua implementation? (Yes, I've read the sample in the post, however, it would be great to know potential pitfalls)<br />- Is it possible to disable js.global object access?<br />- Does this implementation come with all features from the Lua standard library?<br /><br />Thank you very much in advance!yep!https://www.blogger.com/profile/07896874002215268190noreply@blogger.comtag:blogger.com,1999:blog-2681864008001569004.post-4447799309245920452013-05-30T23:10:33.763-07:002013-05-30T23:10:33.763-07:00Is it possible to include it in a website as a sin...Is it possible to include it in a website as a single .js file? As in can you just do script src="lua.vm.js" and then its good to go, or is there more to it? <br /><br />Also, whats the calling convention? Do you just write a lua code inside script type="text/lua" or do you call a js function etcAnonymoushttps://www.blogger.com/profile/14009211188389464074noreply@blogger.comtag:blogger.com,1999:blog-2681864008001569004.post-82799886226596275072013-05-30T18:33:45.169-07:002013-05-30T18:33:45.169-07:00Performance is definitely being looked at very car...Performance is definitely being looked at very carefully, I fully agree it's important.<br /><br />Firefox's asm.js optimizations can do even better than 1.5x, it will take work though, but in principle there is nothing PNaCl can do that it cannot. And note that already on some benchmarks it does better than 1.5x, for example Box2D is just 33% slower than native.<br /><br />The 1.15x number for PNaCl is also probably an average of various benchmarks, I am sure they do better on some and worse on others. Note though that AFAIK they generally ignore compilation time in their results, and the asm.js benchmarkj don't, so the results are not necessarily directly comparable.azakaihttps://www.blogger.com/profile/00792138494525424175noreply@blogger.comtag:blogger.com,1999:blog-2681864008001569004.post-82572791555422559462013-05-30T18:12:56.436-07:002013-05-30T18:12:56.436-07:00I already write SVG pages in Postscript (Ps)
run t...I already write SVG pages in Postscript (Ps)<br />run through Ghostscript.<br /><br />Firefox has PDF.js. PDF includes Ps.<br />So, how does one run Ps through Firefox?<br /><br />Thank you,<br />Eddie Maddox<br /><br />nullhttps://www.blogger.com/profile/13247063775256574417noreply@blogger.comtag:blogger.com,1999:blog-2681864008001569004.post-17517523282497380842013-05-30T10:53:06.671-07:002013-05-30T10:53:06.671-07:00Very nice.
I'd like to point something at what...Very nice.<br />I'd like to point something at what B. Eich said recently at the conference. He said, that "maybe" the max asm.js speed could get to 1.5x native? Well, if this is the case, then you might want to have more time looking at improving the performance of emscripten, because PNaCl is comming at 1.15x. And yes, I'd prefer asm.js to take the lead, that's why I think you should focus more on performance at this stage.<br /><br />One other thing to look at would be the comming Nashorn project, with 100% compatible JS engine, aiming to run node.js applications at even better speeds than the current ones. (check the recent videos on the project)<br /><br />Main target of course should be C compatibility, but performance is also something worth looking more at it.Anonymousnoreply@blogger.com