<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">Currently the VM is built via C, correct. The core of the VM is written in Smalltalk, which is translated to C using the VMMaker package. The generated C files are compiled to machine code using some C compiler (and also linked with platform-specific hand-written C files).</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">So what we actually want is machine code, that is, code executable by the CPU in your machine. There is no intrinsic need for C at all. Machine code could be produced directly from our Smalltalk sources. In fact, that is how BEE Smalltalk works (<a href="http://esug.org/data/ESUG2014/IWST/Papers/iwst2014_Design%20and%20implementation%20of%20Bee%20Smalltalk%20Runtime.pdf">http://esug.org/data/ESUG2014/IWST/Papers/iwst2014_Design%20and%20implementation%20of%20Bee%20Smalltalk%20Runtime.pdf</a>), and COLA was imagined (<a href="http://piumarta.com/software/cola/colas-whitepaper.pdf">http://piumarta.com/software/cola/colas-whitepaper.pdf</a>).</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">These papers also give good reasons why having all this in Smalltalk is great.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">The reason Squeak is using an external C compiler is to leverage the amount of work people put in to make this work on any imaginable platform. Being based on C is part of what makes Squeak so portable. Someone else (the C implementer) is taking care of producing the right machine code for all kinds of processors, and all ABIs (the convention used to call system libraries). All of this would have to be implemented for every CPU and every operating system in Smalltalk - we just don't have the man power for that.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">- Bert -</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 22 May 2018 at 21:46, Jeremy Landry <span dir="ltr"><<a href="mailto:hakyoku@gmail.com" target="_blank">hakyoku@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm not at the level where this would mean anything to me in a practical sense, but I was curious about the VM and compiling the VM and the fact VM exports C-code (DJGPP or something?).  I was curious as to whether it would be beneficial at all to write a C compiler inside of squeak, at least for the common 'systems'. I suppose having an external compiler let's one ignore some of the more important details of the host system to compile for and probably contributes to a lack of one.  But I was curious if anyone's ever tried making any kind of compiler that spits out standalone VMs or other types of very specific-use external programs with squeak/smalltalk and if that was ever a consideration of something that any users had tried to tackle.<div><br></div><div>Again, keep it somewhat 'dumb' in the answer. Compilers and such are way over my head, but I had the thought about this question while reading repeatedly that the VM gets exported to be compiled by a C compiler rather than natively inside of the running system and wondered if there are any advantages to that other than just being a part of the puzzle that is handled much better by a 3rd party maintaining a compiler separately. </div><div><br></div><div>Thanks and sorry if this is in the wrong mailing list.</div></div>
<br>______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.<wbr>squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>