<br><br><div class="gmail_quote">On Thu, Jul 2, 2009 at 4:29 PM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2009/7/3 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; Hi Igor,<br>
&gt;<br>
&gt; On Thu, Jul 2, 2009 at 1:26 PM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; 2009/7/2 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Thu, Jul 2, 2009 at 1:43 AM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; 2009/7/2 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; On Thu, Jul 2, 2009 at 12:06 AM, Ralph Johnson &lt;<a href="mailto:johnson@cs.uiuc.edu">johnson@cs.uiuc.edu</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; The tendency to fork is a product of all Smalltalks, not just<br>
&gt;&gt; &gt;&gt; &gt;&gt; Squeak.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; as others have observed in the current spate of discussion the need<br>
&gt;&gt; &gt;&gt; &gt; to<br>
&gt;&gt; &gt;&gt; &gt; fork<br>
&gt;&gt; &gt;&gt; &gt; can be minimised or avoided altogether by providing a small kernel<br>
&gt;&gt; &gt;&gt; &gt; image<br>
&gt;&gt; &gt;&gt; &gt; that can load packages, and getting into the habit of writing one&#39;s<br>
&gt;&gt; &gt;&gt; &gt; application as a set of packages and regularly building them up into<br>
&gt;&gt; &gt;&gt; &gt; an<br>
&gt;&gt; &gt;&gt; &gt; image (nightly, weekly) starting from the kernel.<br>
&gt;&gt; &gt;&gt; &gt; This approach also allows the VM and image representation to evolve<br>
&gt;&gt; &gt;&gt; &gt; (and<br>
&gt;&gt; &gt;&gt; &gt; even fork!) because the kernel is amenable to transformation.  So one<br>
&gt;&gt; &gt;&gt; &gt; can<br>
&gt;&gt; &gt;&gt; &gt; create different forms of the kernel image with exactly the same<br>
&gt;&gt; &gt;&gt; &gt; apparent<br>
&gt;&gt; &gt;&gt; &gt; image contents, but with object representations adapted for specific<br>
&gt;&gt; &gt;&gt; &gt; uses,<br>
&gt;&gt; &gt;&gt; &gt; such as an extremely compact representation for embedded applications<br>
&gt;&gt; &gt;&gt; &gt; and a<br>
&gt;&gt; &gt;&gt; &gt; simple one for performance and normal development, and one can have<br>
&gt;&gt; &gt;&gt; &gt; purely<br>
&gt;&gt; &gt;&gt; &gt; interpreted VMs for hostile or memory-limited machines (iPhone does<br>
&gt;&gt; &gt;&gt; &gt; not<br>
&gt;&gt; &gt;&gt; &gt; allow one to enable execution permission on mmap&#39;ed memory) and JITs<br>
&gt;&gt; &gt;&gt; &gt; for performance and normal development.<br>
&gt;&gt; &gt;&gt; &gt; IMO it is also easier building up a kernel than carving it out of a<br>
&gt;&gt; &gt;&gt; &gt; monolithic image to architect the necessary modularity support to<br>
&gt;&gt; &gt;&gt; &gt; allow<br>
&gt;&gt; &gt;&gt; &gt; packages to be loaded that make major transformations such as adding<br>
&gt;&gt; &gt;&gt; &gt; a<br>
&gt;&gt; &gt;&gt; &gt; GUI<br>
&gt;&gt; &gt;&gt; &gt; and replacing a standard i/o stack dump with an interactive debugger.<br>
&gt;&gt; &gt;&gt; &gt; I hope that if such a beast becomes available that the community will<br>
&gt;&gt; &gt;&gt; &gt; make<br>
&gt;&gt; &gt;&gt; &gt; the effort to port to it, which involves packaging their code, and we<br>
&gt;&gt; &gt;&gt; &gt; can<br>
&gt;&gt; &gt;&gt; &gt; branch to our heart&#39;s content because images will be constructed not<br>
&gt;&gt; &gt;&gt; &gt; constricting.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Yes, and all Squeak forks could use such kernel as a base, except<br>
&gt;&gt; &gt;&gt; those who making own changes to VM.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I&#39;m actually working on a kernel image _so_ I can make changes to the<br>
&gt;&gt; &gt; base<br>
&gt;&gt; &gt; VM.  If the kernel is expressed first as source from which an image is<br>
&gt;&gt; &gt; generated then one can create a different image format from that source.<br>
&gt;&gt; &gt;  So<br>
&gt;&gt; &gt; my route to a faster object format, and to a fast 64-bit format, is<br>
&gt;&gt; &gt; through<br>
&gt;&gt; &gt; the kernel.  So I disagree.  I think the kernel can also be used by<br>
&gt;&gt; &gt; those<br>
&gt;&gt; &gt; working on their own VMs, and it can be much easier than using e.g. a<br>
&gt;&gt; &gt; SystemTracer-based approach.<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; Ageed.<br>
&gt;&gt; Except cases, like changing the core primitives (don&#39;t ask me why one<br>
&gt;&gt; would do that),<br>
&gt;&gt; and other basic VM&lt;-&gt;image interfaces.<br>
&gt;&gt; This is actually what i had in mind , saying about &#39;own changes to VM&#39;.<br>
&gt;<br>
&gt; OK, so let me expand a little and I think you&#39;ll see that there aren&#39;t many<br>
&gt; exceptional cases.<br>
&gt; This is all being derived from John Maloney&#39;s MicroSqueak, but my kernel<br>
&gt; image will be much more of a MilliSqueak, because it&#39;ll include the<br>
&gt; compiler, a command-line interface, etc.  i.e. it&#39;ll resemble Gnu Smalltalk.<br>
&gt; In the image is a &quot;shadow&quot; class hierarchy rooted in MObject or<br>
&gt; MProtoObject.  This code can be in the bytecode set of the host system or<br>
&gt; not.  If not, you can&#39;t run it directly but instead have to interpret it<br>
&gt; with a special version of ContextPart.  This interpreter can allow one to<br>
&gt; test the code before producing a kernel; image form it, and the interpreter<br>
&gt; can allow one to test new system primitives etc.<br>
<br>
</div></div>Exactly! I know exactly what you are talking about.<br>
Because i doing so in Moebuis. This is good way (keeping a core class<br>
hierarchy as a source in image)<br>
- enables you to use common smalltalk tools (browser &amp; friends) to develop it.<br>
And of course, enables to maintain it as a package.<br>
<br>
The one, huge, difference between us in this regard, that i&#39;m using a<br>
&#39;CV&#39; prefix, not &#39;M&#39; :)</blockquote><div><br></div><div>:) :)  What does CV stand for?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">&gt; An additional tool (the MilliSqueak image builder) reads this class<br>
&gt; hierarchy and constructs an image in whatever format one defines.  It<br>
&gt; renames all the MFoo classes on generating the image so that in the new<br>
&gt; image they&#39;re called Object, ProtoObject et al, and fixes up any special<br>
&gt; methods such as compilerClass that have to be hacked to work as one desires<br>
&gt; in the host system.<br>
<br>
</div>Right, and again, i have envision nearly the same things. :)<br>
<div class="im"><br>
&gt; If one wants e.g. to be able to run MCompiler to produce methods in a<br>
&gt; bytecode set then there are a couple of ways to approach it.  One way is for<br>
&gt; MBehavior to effectively provide two method dictionaries, one holding<br>
&gt; methods in the host system&#39;s bytecode set, one in the new system&#39;s.  One<br>
&gt; wouldn&#39;t need to store the extra methodDictionary in the MBehavior<br>
&gt; instances, instead it would be some global dictionary maintained by the<br>
&gt; MilliSqueak building/maintennance code, and the MilliSqueak image builder<br>
&gt; would substitute the new methodDictionary for the old when producing an<br>
&gt; image.  The compilerClass method would be special.  It would invoke a<br>
&gt; compiler that compiled two versions, one using MCompiler, and one using<br>
&gt; Compiler, to populate the two dictionaries.  The image builder would fixup<br>
&gt; the compilerClass method when producing the image.  Another way is simply to<br>
&gt; have two copies of MCompiler, one the MCompiler from which the kernel image<br>
&gt; with be generated, and one, say, HostMCompiler, and just keep the two in<br>
&gt; sync.  HostMCompiler&#39;s methods are in the host format but it generates<br>
&gt; methods in the new format.  MBehavior compilerClass answers HostMCompiler,<br>
&gt; but the image generator fixes this up.<br>
<br>
</div>Nearly the same what i did. Yes there should be two compilers - one<br>
serves for host platform, as usual, while other is for producing new<br>
code &amp; methods in different format.  ( Btw i looking &amp; developing<br>
towards a unified compiler model, which could serve for both<br>
environments, and depending on providing it a different &#39;environment&#39;<br>
object - it could produce methods for one or another environment,<br>
without much hassle). I&#39;d call it: a compiler module :)<br>
<br>
In order to minimize the coding which glueing the stuff (like things<br>
you describing - compilerClass, host format &amp; other),<br>
a format of objects in a newly generated memory is extracted from<br>
behavior of special classes, which i called Species.<br>
So, by gathering stuff together:<br>
- class hierarchy<br>
- modular compiler<br>
- environment (aka &#39;image builder&#39;)<br>
- species<br>
<br>
you are know everything about object formats and can work<br>
transparently in both domains (host/target), because the code i put in<br>
Species is made ultimately invariant to environment it runs in, and<br>
depends only on arguments which you passing to them.<br>
<br>
In this way, i implemented things like #ivarAt: , #ivarAt:put: ,<br>
#header , and rest such stuff in species using functional(stateless)<br>
way - so all what you doing is compiling (and in case of VMMaker -<br>
translating) this code to VM , and voila , you have your own object<br>
format.<br>
<div class="im"><br>
&gt; An additional VMMaker package allows one to develop a new VM for that<br>
&gt; format, and at least check if it starts up.  The VM simulator could actually<br>
&gt; provide i/o if the image is headless.  It would be easy to write a little<br>
&gt; console for the VM simulator to do i/o with the simulated headless image.<br>
&gt;  Then the new VM would be the means by which one executed the new bytecode<br>
&gt; and primitive set.<br>
&gt; This is all half-baked but you get the idea.  There&#39;s lots of ways to pull<br>
&gt; this off.  And I&#39;m sure there are some tricky bits here (e.g. making<br>
&gt; senders/implementors work in the host on the new format methods).  But the<br>
&gt; idea of having a source tree for the image one wants is a good one, and it<br>
&gt; means that the kernel image is produced from source, not by transformation<br>
&gt; of some existing image.  One can choose precisely the base class library,<br>
&gt; the bytecode set, etc and one can test it in image using either the VM<br>
&gt; simulator and/or by constructing a special Context interpreter.<br>
&gt; If one uses a special Context interpreter, which one needs to develop anyway<br>
&gt; if one is developing a new bytecode set because in the new kernel<br>
&gt; InstructionStream et al must interpret the new bytecode instruction set,<br>
&gt; then it also needs either the two dictionary or the duplication approach.  I<br>
&gt; haven&#39;t decided which is best yet.<br>
&gt;<br>
&gt; If this scheme can be made to work I think one will be able to experiment to<br>
&gt; ones heart&#39;s content and have considerable freedom experimenting with<br>
&gt; different kernel images, for example ones that implement a novel namespace<br>
&gt; scheme, or a new language, or simply a well-defined ANSI subset, or a format<br>
&gt; making good use of 64-bits, or...<br>
&gt;<br>
<br>
</div>Eliot, just say, if you wish any help on that. I see we have a lot of<br>
synergy about an idea, how things should be made.<br>
So, i&#39;d like to offer my help to make this bright future a bit closer :)</blockquote><div><br></div><div>We should definitely work together.  At the least we should exchange code.  I have yet to commit mine/John&#39;s to any shared repository.  I&#39;m busy preparing an open source release of the Stack VM and then will be doing some FFI work so the MilliSqueak work will be in te background.  But once I&#39;ve got the STack VM ready I&#39;ll at least take some time to commit the code.  </div>
<div><br></div><div>Great!</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<br>
&gt;&gt; &gt;&gt;<br>
<br>
[snip]<br>
<font color="#888888"><br>
<br>
--<br>
</font><div><div></div><div class="h5">Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</div></div></blockquote></div><br>