Hi Igor,<br><br><div class="gmail_quote">On Thu, Jul 2, 2009 at 1:26 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;">
<div><div></div><div class="h5">2009/7/2 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Jul 2, 2009 at 1:43 AM, 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 12:06 AM, Ralph Johnson &lt;<a href="mailto:johnson@cs.uiuc.edu">johnson@cs.uiuc.edu</a>&gt;<br>
&gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; The tendency to fork is a product of all Smalltalks, not just Squeak.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; as others have observed in the current spate of discussion the need to<br>
&gt;&gt; &gt; fork<br>
&gt;&gt; &gt; can be minimised or avoided altogether by providing a small kernel image<br>
&gt;&gt; &gt; that can load packages, and getting into the habit of writing one&#39;s<br>
&gt;&gt; &gt; application as a set of packages and regularly building them up into an<br>
&gt;&gt; &gt; image (nightly, weekly) starting from the kernel.<br>
&gt;&gt; &gt; This approach also allows the VM and image representation to evolve (and<br>
&gt;&gt; &gt; even fork!) because the kernel is amenable to transformation.  So one<br>
&gt;&gt; &gt; can<br>
&gt;&gt; &gt; create different forms of the kernel image with exactly the same<br>
&gt;&gt; &gt; apparent<br>
&gt;&gt; &gt; image contents, but with object representations adapted for specific<br>
&gt;&gt; &gt; uses,<br>
&gt;&gt; &gt; such as an extremely compact representation for embedded applications<br>
&gt;&gt; &gt; and a<br>
&gt;&gt; &gt; simple one for performance and normal development, and one can have<br>
&gt;&gt; &gt; purely<br>
&gt;&gt; &gt; interpreted VMs for hostile or memory-limited machines (iPhone does not<br>
&gt;&gt; &gt; allow one to enable execution permission on mmap&#39;ed memory) and JITs<br>
&gt;&gt; &gt; for performance and normal development.<br>
&gt;&gt; &gt; IMO it is also easier building up a kernel than carving it out of a<br>
&gt;&gt; &gt; monolithic image to architect the necessary modularity support to allow<br>
&gt;&gt; &gt; packages to be loaded that make major transformations such as adding a<br>
&gt;&gt; &gt; GUI<br>
&gt;&gt; &gt; and replacing a standard i/o stack dump with an interactive debugger.<br>
&gt;&gt; &gt; I hope that if such a beast becomes available that the community will<br>
&gt;&gt; &gt; make<br>
&gt;&gt; &gt; the effort to port to it, which involves packaging their code, and we<br>
&gt;&gt; &gt; can<br>
&gt;&gt; &gt; branch to our heart&#39;s content because images will be constructed not<br>
&gt;&gt; &gt; constricting.<br>
&gt;&gt;<br>
&gt;&gt; Yes, and all Squeak forks could use such kernel as a base, except<br>
&gt;&gt; those who making own changes to VM.<br>
&gt;<br>
&gt; I&#39;m actually working on a kernel image _so_ I can make changes to the base<br>
&gt; VM.  If the kernel is expressed first as source from which an image is<br>
&gt; generated then one can create a different image format from that source.  So<br>
&gt; my route to a faster object format, and to a fast 64-bit format, is through<br>
&gt; the kernel.  So I disagree.  I think the kernel can also be used by those<br>
&gt; working on their own VMs, and it can be much easier than using e.g. a<br>
&gt; SystemTracer-based approach.<br>
&gt;<br>
<br>
</div></div>Ageed.<br>
Except cases, like changing the core primitives (don&#39;t ask me why one<br>
would do that),<br>
and other basic VM&lt;-&gt;image interfaces.<br>
This is actually what i had in mind , saying about &#39;own changes to VM&#39;.</blockquote><div><br></div><div>OK, so let me expand a little and I think you&#39;ll see that there aren&#39;t many exceptional cases.</div>
<div>This is all being derived from John Maloney&#39;s MicroSqueak, but my kernel image will be much more of a MilliSqueak, because it&#39;ll include the compiler, a command-line interface, etc.  i.e. it&#39;ll resemble Gnu Smalltalk.</div>
<div><br></div><div>In the image is a &quot;shadow&quot; class hierarchy rooted in MObject or MProtoObject.  This code can be in the bytecode set of the host system or not.  If not, you can&#39;t run it directly but instead have to interpret it with a special version of ContextPart.  This interpreter can allow one to test the code before producing a kernel; image form it, and the interpreter can allow one to test new system primitives etc. </div>
<div><br></div><div>An additional tool (the MilliSqueak image builder) reads this class hierarchy and constructs an image in whatever format one defines.  It renames all the MFoo classes on generating the image so that in the new image they&#39;re called Object, ProtoObject et al, and fixes up any special methods such as compilerClass that have to be hacked to work as one desires in the host system.</div>
<div><br></div><div>If one wants e.g. to be able to run MCompiler to produce methods in a bytecode set then there are a couple of ways to approach it.  One way is for MBehavior to effectively provide two method dictionaries, one holding methods in the host system&#39;s bytecode set, one in the new system&#39;s.  One wouldn&#39;t need to store the extra methodDictionary in the MBehavior instances, instead it would be some global dictionary maintained by the MilliSqueak building/maintennance code, and the MilliSqueak image builder would substitute the new methodDictionary for the old when producing an image.  The compilerClass method would be special.  It would invoke a compiler that compiled two versions, one using MCompiler, and one using Compiler, to populate the two dictionaries.  The image builder would fixup the compilerClass method when producing the image.  Another way is simply to have two copies of MCompiler, one the MCompiler from which the kernel image with be generated, and one, say, HostMCompiler, and just keep the two in sync.  HostMCompiler&#39;s methods are in the host format but it generates methods in the new format.  MBehavior compilerClass answers HostMCompiler, but the image generator fixes this up.</div>
<div><br></div><div>An additional VMMaker package allows one to develop a new VM for that format, and at least check if it starts up.  The VM simulator could actually provide i/o if the image is headless.  It would be easy to write a little console for the VM simulator to do i/o with the simulated headless image.  Then the new VM would be the means by which one executed the new bytecode and primitive set.</div>
<div><br></div><div>This is all half-baked but you get the idea.  There&#39;s lots of ways to pull this off.  And I&#39;m sure there are some tricky bits here (e.g. making senders/implementors work in the host on the new format methods).  But the idea of having a source tree for the image one wants is a good one, and it means that the kernel image is produced from source, not by transformation of some existing image.  One can choose precisely the base class library, the bytecode set, etc and one can test it in image using either the VM simulator and/or by constructing a special Context interpreter.</div>
<div><br></div><div>If one uses a special Context interpreter, which one needs to develop anyway if one is developing a new bytecode set because in the new kernel InstructionStream et al must interpret the new bytecode instruction set, then it also needs either the two dictionary or the duplication approach.  I haven&#39;t decided which is best yet.</div>
<div><br></div><div><br></div><div>If this scheme can be made to work I think one will be able to experiment to ones heart&#39;s content and have considerable freedom experimenting with different kernel images, for example ones that implement a novel namespace scheme, or a new language, or simply a well-defined ANSI subset, or a format making good use of 64-bits, or...</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">&gt;&gt;<br>
&gt;&gt; This is another reason for having a package-based development model.<br>
&gt;&gt; I remember we have discussed this before, but this idea &amp; especially<br>
&gt;&gt; benefits which it could bring to us,<br>
&gt;&gt; were leaked from my mind :)<br>
&gt;&gt;<br>
&gt;&gt; P.S. can&#39;t resist CC-ing this to Pharo list.  :)<br>
&gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; There is a company in town that developed a commercial product on<br>
&gt;&gt; &gt;&gt; VisualWorks 2.0.   They customized it heavily.  It is a sound<br>
&gt;&gt; &gt;&gt; generater, in fact the world&#39;s fastest synthesizer in which you can<br>
&gt;&gt; &gt;&gt; specify each waveform.  It is used by musicians and for sound effects<br>
&gt;&gt; &gt;&gt; in movies.  All the programming is done by two people.  It provide a<br>
&gt;&gt; &gt;&gt; very nice UI in which you drag and drop sound objects to create your<br>
&gt;&gt; &gt;&gt; piece.  When you say &quot;play&quot;, the sound objects are converted into code<br>
&gt;&gt; &gt;&gt; for an array of DSPs, which execute the code to play the sounds.  The<br>
&gt;&gt; &gt;&gt; process is nearly instantaneous.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; This company made a fork over ten years ago, and last I heard, had not<br>
&gt;&gt; &gt;&gt; caught up.  They would like to run their software on Unix.  It only<br>
&gt;&gt; &gt;&gt; runs on PC and Macs, and I think they have hacked the VM themselves to<br>
&gt;&gt; &gt;&gt; run on newer OSs.  The binary, that is.  But it was just too much<br>
&gt;&gt; &gt;&gt; trouble to convert their image, and didn&#39;t seem like it provided<br>
&gt;&gt; &gt;&gt; enough benefits.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; There are still a lot of companies running VSE applications in spite<br>
&gt;&gt; &gt;&gt; of the fact that it hasn&#39;t been supported for a decade.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; One of the great things about Smalltalk is that it is so open.  You<br>
&gt;&gt; &gt;&gt; can change everything about it; the way the compiler works, the UI,<br>
&gt;&gt; &gt;&gt; the programming environment tools, what it means to send a message to<br>
&gt;&gt; &gt;&gt; an object that is not understood.  You can change arrays, strings,<br>
&gt;&gt; &gt;&gt; booleans.  Of course, if you do this then you are not longer<br>
&gt;&gt; &gt;&gt; compatible.  If you hack Behavior and ClassDescription then the odds<br>
&gt;&gt; &gt;&gt; are that your hacks will not be compatible with other people&#39;s hacks.<br>
&gt;&gt; &gt;&gt; Every time a new version of the platform comes out, you&#39;ll have to go<br>
&gt;&gt; &gt;&gt; back and make sure none of your hacks are broken.  Often they will be.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Sometimes it is worth the pain.  But often people just fork.  They<br>
&gt;&gt; &gt;&gt; will lose all the nifty new features that come out, but it just isn&#39;t<br>
&gt;&gt; &gt;&gt; worth the trouble to keep up.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I think the reason there is so much forking with Smalltalk is that<br>
&gt;&gt; &gt;&gt; application programmers don&#39;t have to depend on vendors.  They can<br>
&gt;&gt; &gt;&gt; craft the environment to suit their own needs, and don&#39;t need to<br>
&gt;&gt; &gt;&gt; depend on someone who doesn&#39;t really understand their needs.  There<br>
&gt;&gt; &gt;&gt; are disadvantages to forking, but it is easy and there are enough<br>
&gt;&gt; &gt;&gt; advantages that people will continue to do it.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; So, we need to learn to live in a world of forks.  Seaside shows how<br>
&gt;&gt; &gt;&gt; it can be done.  Squeak and VisualWorks, after all, are different<br>
&gt;&gt; &gt;&gt; forks from the original Xerox Smalltalk-80.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; -Ralph Johnson<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Best regards,<br>
&gt;&gt; Igor Stasenko AKA sig.<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</div></div></blockquote></div><br>