{"id":54,"date":"2008-01-10T11:19:37","date_gmt":"2008-01-10T17:19:37","guid":{"rendered":"http:\/\/www.philhassey.com\/blog\/2008\/01\/10\/64k-tinypy-now-with-vm-included\/"},"modified":"2008-02-19T01:13:54","modified_gmt":"2008-02-19T07:13:54","slug":"64k-tinypy-now-with-vm-included","status":"publish","type":"post","link":"https:\/\/www.philhassey.com\/blog\/2008\/01\/10\/64k-tinypy-now-with-vm-included\/","title":{"rendered":"64k tinypy &#8211; now with VM included"},"content":{"rendered":"<p>I&#8217;ve managed to build a simple VM into tinypy &#8211; modeled after the lua VM.  It&#8217;s register based and &#8220;stackless&#8221; in the &#8220;it doesn&#8217;t use the C-stack&#8221; sense of the word.  (Not in the, it does anything fancy like &#8220;stackless python&#8221; does sense.)<\/p>\n<p>&#8216;ve just reached the 64k mark, so that means anything I add into the code will require me to clean up other code to save space.  I&#8217;ve already done a bit of that with good results.  The one rule I follow in shortening code is that the code must retain readability, if not improve it.<\/p>\n<p>Garbage collection is rather complicated, so I think I&#8217;ve decided to continue to leave that to libgc.  I read some literature on the matter, and it sounds like I could write one, but it probably wouldn&#8217;t be very good.  I&#8217;ve put it at the bottom of my TODO.txt list in the section labeled &#8220;Probably not going to happen&#8221;.<\/p>\n<p>At present tinypy supports basic python code with functions and loops and lists and dicts and classes.  At least, in some basic form.  I&#8217;m looking towards adding in list comprehensions and *args **nargs to tinypy as those are two of my favorite python features.  After that I&#8217;ve got a handful of functions I want to write and then some packaging work.<\/p>\n<p>For the curious svn:\/\/www.imitationpickles.org\/tinypy\/trunk &#8211; .\/run_julia_o3 to see it all happen.  It depends on python to compile the bytecode (we&#8217;re not bootstrapped yet), libgc, and SDL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve managed to build a simple VM into tinypy &#8211; modeled after the lua VM. It&#8217;s register based and &#8220;stackless&#8221; in the &#8220;it doesn&#8217;t use the C-stack&#8221; sense of the word. (Not in the, it does anything fancy like &#8220;stackless python&#8221; does sense.) &#8216;ve just reached the 64k mark, so that means anything I add [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,6,19,8,2,32],"tags":[],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-crazy","category-development","category-gamedev","category-languages","category-python","category-tinypy"],"_links":{"self":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":0,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}