Hi Yoshiki,<br><br><div class="gmail_quote">On Tue, Dec 28, 2010 at 2:19 AM, Yoshiki Ohshima <span dir="ltr">&lt;<a href="mailto:yoshiki@vpri.org">yoshiki@vpri.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
  Hi,<br>
<br>
  We&#39;ve been playing with John&#39;s MicroSqueak and it occured to me that<br>
having a bytecode compiler that is implemented outside of Squeak opens<br>
some possibilities, such as generate a growable image file from all<br>
text files, or make deep changes to the system without shooting<br>
yourself.<br>
<br>
I wrote a longer explanation so if you are interested, please go to:<br>
<br>
<a href="https://github.com/yoshikiohshima/SqueakBootstrapper" target="_blank">https://github.com/yoshikiohshima/SqueakBootstrapper</a><br>
<br>
and check it out.<br></blockquote><div><br></div><div>I simply don&#39;t see the benefit of putting energy into other languages.  I see the benefit of a textual bootstrap.  But why is it worth-while implementing that in C instead of Smalltalk?  If Smalltalk is more productive (which it is) then writing such a bootstrap in C is a waste of effort, reinvents several wheels at considerable expense and produces an artifact that is less flexible, less extensible, less useful than implementing the same functionality in Smalltalk.</div>
<div><br></div><div>On the other hand, as Andreas suggests, trying to implement something using the simulator looks to be really powerful.  Recent;y I&#39;ve been playing tangentally in this area.  In recent days I&#39;ve produced a new code generator for Cog that has some useful speedups (Compiler recompileAll ~ 9% faster, benchFib 2x).  To test the code generator I needed to check stack depths at various points in JIT compilation and execution of the JITted code.  I have a Smalltalk class StackDepthFinder that answers the stack depths for each bytecode of a method.  By adding two classes VMObjectProxy and VMCompiledMethodProxy I could apply StackDepthFinder to methods in the simulator&#39;s heap and hence derive stack depths for any method in the simulators image.  To test the JIT it was also convenient to be able to JIT methods in my work image, synthesised test cases etc, not just methods in the simulated image.  Again a facade class allows the simulator to JIT any method in my work image.  This worked well and was easy to implement.  Extending in this direction seems straight-forward.</div>
<div><br></div><div>One starts up wit a simulator and an empty heap and bootstraps objects into that heap, using whatever bytecode set and object format one chooses.  One can test the image using the simulator which should be quite fast enough if the image is a small kernel.  All the implementation is useful and adds to the simulator/VMMaker ecosystem.  All the code is Squeak and can reuse substantial parts of the system.  Seems like a win to me.  I think I&#39;ll take this approach in implementing the new object format.  It could be a new backend to MicroSqueak.</div>
<div>cheers</div><div>Eliot</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
  Thank you!<br>
<font color="#888888"><br>
-- Yoshiki<br>
<br>
</font></blockquote></div><br>