{"id":216,"date":"2011-02-28T21:48:26","date_gmt":"2011-02-28T13:48:26","guid":{"rendered":"http:\/\/konsolscript.sf.net\/web\/?p=216"},"modified":"2011-02-28T22:11:28","modified_gmt":"2011-02-28T14:11:28","slug":"internals-of-libquixie","status":"publish","type":"post","link":"http:\/\/konsolscript.sourceforge.net\/web\/2011\/02\/28\/internals-of-libquixie\/","title":{"rendered":"Internals of libQuixie"},"content":{"rendered":"<p>It&#8217;s been (at least) 9 months since I started prototyping <a href=\"http:\/\/konsolscript.svn.sourceforge.net\/viewvc\/konsolscript\/libQuixie\/\">libQuixie<\/a>, the will-be KonsolScript scripting engine supporting Object-Oriented Programming.<\/p>\n<p>As much as I&#8217;d like to <a href=\"http:\/\/konsolscript.sf.net\/web\/2010\/02\/26\/idea-list-for-gsoc-2010\/\">implement it in C<\/a>, String-handling with dynamic memory allocation kept me from any progress.<\/p>\n<p>Having been convinced by <a href=\"http:\/\/gnashdev.org\/\">Gnash<\/a> developer <a href=\"http:\/\/en.wikipedia.org\/wiki\/Rob_Savoye\">Rob Savoye<\/a>, I decided to use C++ instead, which indeed made the progress to move forward.<\/p>\n<p>Still wanting to support C, I designed the C++ code to be easily ported\/adapted by C programmers. But having been working on-and-off on libQuixie with C++ for about 4 months, the whole code seems to be a mess. So I decided to draw a diagram of how things work inside libQuixie, which would hopefully help get a better visualization of its inner workings.<\/p>\n<p><a href=\"http:\/\/konsolscript.sf.net\/img\/design\/libQuixie\/variable_handling.png\"><img decoding=\"async\" src=\"http:\/\/konsolscript.sf.net\/img\/design\/libQuixie\/variable_handling.png\" alt=\"libQuixie's variable-handling\" width=\"480px\" height=\"303px\" border=\"0\"\/><\/a><br \/>\n<center>Click image to view larger<\/center><\/p>\n<p>Above is the architecture (if you may) of libQuxie&#8217;s variable handling, showing how it will support Object-Oriented Programming.<\/p>\n<p>A quick walk through: If a user declares an instance of a class (given that it&#8217;s pre-existing), this new instance will be handled by <code>ClassInstancesArray<\/code> where the index is kept in <code>VariablesArray<\/code>; then all reference to the newly created class-instance will have an ID of the <code>VariablesArray<\/code>-index, that points to which <code>ClassInstanceArray<\/code>-index it&#8217;s kept.<\/p>\n<p>Basically, the <code>{whatever-type}Arrays<\/code> are the <code>Manager<\/code> class of each <code>{whatever-}type<\/code>, which would handle the checking of variable-duplicates and such.<\/p>\n<p>This might be confusing, and it is, but this design is made with easy C-porting\/adaptation in mind. Also, this is a prototype &#8212; and so arises the question <i>&#8220;will it be performing fast?&#8221;<\/i> that is answered with <i>&#8220;I&#8217;m not sure but I hope so&#8221;<\/i>.<\/p>\n<p>If you have any concern about the design, feel free to discuss it below &#8212; I do need your inputs on this.<\/p>\n<p>Still working on the code. Everything is way too preliminary, so an announcement of an alpha release is way too early.<\/p>\n<p>Will try to SVN-commit the draft and messy-prototypic code this week.<\/p>\n<p>~creek23<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been (at least) 9 months since I started prototyping libQuixie, the will-be KonsolScript scripting engine supporting Object-Oriented Programming. As much as I&#8217;d like to implement it in C, String-handling with dynamic memory allocation kept me from any progress. Having been convinced by Gnash developer Rob Savoye, I decided to use C++ instead, which indeed [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":250,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[35,19],"_links":{"self":[{"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/posts\/216"}],"collection":[{"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":0,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/media\/250"}],"wp:attachment":[{"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/konsolscript.sourceforge.net\/web\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}