<br><br><div class="gmail_quote">On 25 August 2011 23:45, Raymond Hettinger <span dir="ltr"><<a href="mailto:raymond.hettinger@gmail.com">raymond.hettinger@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">The <span style="color:rgb(68, 68, 68);font-family:Arial, 'Helvetica Neue', sans-serif;font-size:15px;line-height:19px;background-color:rgb(255, 255, 255)"><a href="http://t.co/mPKzyp1" title="http://gumbyapp.com/" rel="nofollow" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;color:rgb(0, 132, 180);text-decoration:none" target="_blank">http://gumbyapp.com/</a></span><span style="color:rgb(68, 68, 68);font-family:Arial, 'Helvetica Neue', sans-serif;font-size:15px;line-height:19px;background-color:rgb(255, 255, 255)"> project succeeded in getting Python to run in the browser but it can't import pure python modules (because there is no filesystem in the browser).</span><div>
<font color="#444444" face="Arial, 'Helvetica Neue', sans-serif"><span style="font-size:15px;line-height:19px"><br></span></font></div><div><font color="#444444" face="Arial, 'Helvetica Neue', sans-serif"><span style="font-size:15px;line-height:19px">I think it would be wonderful to beef-up this project by bundling-in the rest of the standard library.  Gumby was built by compiling CPython to LLVM and then generating Javascript.  ISTM it would be possible to write a script to transform pure python standard library modules into C strings that could also be part of the final build.  The import-statement would have to be hooked to search for the C string instead of a physical file.</span></font></div>
<div><font color="#444444" face="Arial, 'Helvetica Neue', sans-serif"><span style="font-size:15px;line-height:19px"><br></span></font></div><div><font color="#444444" face="Arial, 'Helvetica Neue', sans-serif"><span style="font-size:15px;line-height:19px">If that technique works, it may not be hard to extend it so that user defined python modules could also be incorporated.  If so, it would become possible to create standalone Python apps that run in the browser.   The process is likely to be inefficient, but the gumbyapp site shows that it might be good enough for some purposes.</span></font></div>
<div><font color="#444444" face="Arial, 'Helvetica Neue', sans-serif"><span style="font-size:15px;line-height:19px"><br></span></font></div></div></blockquote><div><br><br>There's also Skulpt, an implementation of Python in Javascript (no idea how complete it is but I saw some impressive demos a while ago):<br>
<br>    <a href="http://code.google.com/p/skulpt/">http://code.google.com/p/skulpt/</a><br><br>I've no idea how skulpt handles imports (or even if it does).<br><br>There is also pyjamas which translates Python code to Javascript:<br>
<br>    <a href="http://pyjs.org/">http://pyjs.org/</a><br><br>Pyjamas translates dependencies too, but I guess it can't do dynamic imports.<br><br>Plus IronPython runs in the Silverlight runtime. Probably of less interest to this crowd though. :-)<br>
<br>All the best,<br><br>Michael Foord<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;"><div>
<font color="#444444" face="Arial, 'Helvetica Neue', sans-serif"><span style="font-size: 15px; line-height: 19px;"></span></font></div><font color="#888888"><div><font color="#444444" face="Arial, 'Helvetica Neue', sans-serif"><span style="font-size:15px;line-height:19px"><br>
</span></font></div><div><font color="#444444" face="Arial, 'Helvetica Neue', sans-serif"><span style="font-size:15px;line-height:19px">Raymond</span></font></div><div><div><span style="color:rgb(68, 68, 68);font-family:Arial, 'Helvetica Neue', sans-serif;font-size:15px;line-height:19px;background-color:rgb(255, 255, 255)"><br>
</span></div></div></font></div><br>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><pre cols="72"><a href="http://www.voidspace.org.uk/" target="_blank">http://www.voidspace.org.uk/</a><br><br>May you do good and not evil<br>May you find forgiveness for yourself and forgive others<br>
May you share freely, never taking more than you give.<br>-- the sqlite blessing <a href="http://www.sqlite.org/different.html" target="_blank">http://www.sqlite.org/different.html</a></pre>
<br>