<div dir="ltr">So, here is an idea, start the VM from scratch, and, redo the entire project to allow what we want in Squeak, and the compiler.&nbsp; I know that is a really crazy idea, but I think it could be possible.&nbsp; I have been thinking about a couple of very unlikely, but, possible, maybe, VM ideas, but, what do you guys think about that?<br>
<br><div class="gmail_quote">On Mon, Sep 1, 2008 at 7:56 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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2008/9/2 Kjell Godo &lt;<a href="mailto:squeaklist@gmail.com">squeaklist@gmail.com</a>&gt;:<br>
<div class="Ih2E3d">&gt; Where is this new compiler project? &nbsp;Where is NewCompiler? &nbsp;I would like to<br>
&gt; see it.<br>
&gt; Does anybody know where that book about the Squeak Compiler went to?<br>
&gt;<br>
&gt; the rest down below is all nonsense and I wouldn&#39;t read it if I were you.<br>
&gt;<br>
&gt; i knew this was going to cost me.<br>
&gt;<br>
&gt; What is atomic loading? &nbsp;Does it mean no dependencies or dependencies are<br>
&gt; handled?<br>
&gt; It seems to me that there needs to be some kind of intellegent dependencies<br>
&gt; manager that works a lot better and is a lot smarter than what has been put<br>
&gt; out there so far.<br>
&gt;<br>
<br>
</div>The atomic loading is not about handling dependencies (they are<br>
present and adressed as well, of course), but about installing a<br>
number of changes in system replacing old behavior in a single short<br>
operation, which can guarantee a safety from old/new behaviour<br>
conflicts.<br>
<div class="Ih2E3d"><br>
&gt; How can I learn about how a good Squeak compiler works? &nbsp;Without years and<br>
&gt; millions of dead hours?<br>
&gt;<br>
<br>
</div>Sure, you need some experience in compiling things, especially<br>
smalltalk. Or , at least , if you even don&#39;t have such experience, but<br>
using Parser/Compiler for own purposes, your experience is valuable as<br>
well, since you can highlight different problems or propose better<br>
interface or new functionality.<br>
<div class="Ih2E3d"><br>
&gt; Modularity is very good. &nbsp;I think that all of Squeak should be very self<br>
&gt; explaining. &nbsp;This can be done if you put your explanations of what is going<br>
&gt; on after the body of the method. &nbsp;Colored source is good too. &nbsp;See Dolphin.<br>
&gt; But without reformating.<br>
&gt;<br>
&gt; I am making picoLARC on <a href="http://sourceforge.net" target="_blank">sourceforge.net</a>. &nbsp;Each lisp/smalltalk expression<br>
&gt; gets compiled by an instance of a Compiler Class. &nbsp;Each expression( let if<br>
&gt; define etc ) has its own KEGLambdaLispCompiler subClass with one<br>
&gt; standard method and zero or more helper methods in it. &nbsp;Each Compiler<br>
&gt; outputs an instance of a subClass of the Eval Class. &nbsp;An Eval can be<br>
&gt; evaluated at runtime by &gt;&gt;evalWithActivationRec: or it could generate byte<br>
&gt; codes which do the same thing via some method like<br>
&gt; EvalSubClass&gt;&gt;generateByteCodesOn:usingCodeWalker: where the CodeWalker<br>
&gt; could tie Evals together or do optimizations? &nbsp;Is this not a good design? &nbsp;I<br>
&gt; know I like the part about one Compiler Class for each expression and one<br>
&gt; corresponding Eval Class. &nbsp;But I haven&#39;t done any byte code generation yet<br>
&gt; so I don&#39;t know about that part. &nbsp;One Compiler per Eval is not strict. &nbsp;The<br>
&gt; ApplicationCompiler can output several different related kinds of Evals for<br>
&gt; the different function calls and message sends.<br>
&gt;<br>
&gt; What is this visitor pattern?<br>
<br>
</div><a href="http://en.wikipedia.org/wiki/Visitor_pattern" target="_blank">http://en.wikipedia.org/wiki/Visitor_pattern</a><br>
<div class="Ih2E3d"><br>
&gt; &nbsp;I don&#39;t like the idea of putting byte code<br>
&gt; generation into a single Class. &nbsp;But I feel like maybe I don&#39;t know what I&#39;m<br>
&gt; talking about. &nbsp;To modify the byte code generation for an expression you<br>
&gt; would subClass the Eval Class and modify the<br>
&gt;&gt;&gt;generateByteCodeOn: aCodeStream. &nbsp;The initial implementor would try to<br>
&gt;&gt;&gt; seperate out the parts that might be modified by someone into seperate<br>
&gt;&gt;&gt; methods that get called by<br>
&gt;&gt;&gt;generateByteCodeOn: so these helper methods would generally be overridden<br>
&gt;&gt;&gt; and not<br>
&gt;&gt;&gt;generateByteCodeOn: unless that method was really simple. &nbsp;So the initial<br>
&gt;&gt;&gt; implementor has to think about reuse and the places where modification might<br>
&gt;&gt;&gt; occure. &nbsp;So you would have a lot of simple<br>
&gt;&gt;&gt;generateByteCodeOn: methods instead of one big complex one.<br>
&gt;<br>
&gt; There are all different ways of calling a function or method or query etc in<br>
&gt; picoLARC and these are all subClasses of KEGLambdaLispApplicationEvalV6p1<br>
&gt; and it seems to work fine.<br>
&gt;<br>
&gt; But overriding &gt;&gt;generateByteCodesOn: is not good enough is it? &nbsp;The<br>
&gt; Compiler Classes can&#39;t have hard coded Eval instance creations either<br>
&gt; right? &nbsp;The Compiler Class has to be subClassed also and the<br>
<br>
</div>The problem in Squeak compiler that you will need to override much<br>
more classes than just Compiler to emit different bytecode, for<br>
instance.<br>
<div class="Ih2E3d"><br>
&gt;&gt;&gt;meaningOf:inEnviron: needs to have a<br>
&gt; ( self createEval ) expression in it that could be subClassed and<br>
&gt; overridden. &nbsp;And then that subClass has to be easily inserted into the<br>
&gt; expression dispatch table that pairs up expressions with expression<br>
&gt; Compilers. &nbsp;So when that table gets made there should be a<br>
&gt; ( tableModifier modify: table ) which could stick the &lt; expression Compiler<br>
&gt;&gt; pairs in that are needed.<br>
&gt;<br>
&gt; I think that is all that would be required to modify the compilation of an<br>
&gt; expression.<br>
&gt; I will have to make these changes to picoLARC so it will be more modifiable.<br>
&gt;<br>
&gt; I think the Compiler should be very modular. &nbsp;For picoLARC one Class per<br>
&gt; expression and one Class per Eval seems to work good. &nbsp;Stuffing lots of<br>
&gt; seperate things into a single Class and doing a procedural functional thing<br>
&gt; and not an OOP thing does not seem good to me.<br>
&gt;<br>
&gt; I think that the Compiler should be very clean and a best practices example<br>
&gt; with a long comment at the bottom of each method telling all about what it<br>
&gt; does. &nbsp;Writing it out and referencing other related methods helps to think<br>
&gt; about what is really going on and then a better design without hacks comes<br>
&gt; out. &nbsp;I don&#39;t think hacking should be encouraged at all. &nbsp;Hacking just makes<br>
&gt; a mess.<br>
&gt;<br>
</div>+1<br>
<br>
The design should allow replacing critical parts of compiler by<br>
subclassing without the need in modifying original classes.<br>
A so-called extensions , or monkey patching is very bad practice which<br>
in straightly opposite direction from modularity.<br>
<br>
I thinking, maybe at some point, to prevent monkey patching, a<br>
deployed classes can disallow installing or modifying their methods.<br>
<div class="Ih2E3d"><br>
<br>
&gt; And then this practice of not making any Package comments has got to stop.<br>
&gt; I think that people who do that should be admonished in some way. &nbsp;I think<br>
&gt; that the Package comment for the Compiler should contain the design document<br>
&gt; for it that tells all about how it is designed. &nbsp;If it needs to be long then<br>
&gt; it should be long. &nbsp;It should include: How to understand the Compiler.<br>
&gt; There should be a sequence of test cases that start simple and show how it<br>
&gt; all works.<br>
&gt;<br>
&gt; And that should go for the VM too. &nbsp;This idea that the VM can be opaque and<br>
&gt; only recognizable to a few is not good.<br>
&gt;<br>
<br>
</div>VM tend to be complex. And complexity comes from inability of our<br>
hardware/OS work in a ways how we need/want it.<br>
<div class="Ih2E3d"><br>
&gt; These should be works of art and not hacked up piles of rubbish to be hidden<br>
&gt; away into obscurity.<br>
&gt;<br>
&gt; There is this idea that one should only care about what something does. &nbsp;And<br>
&gt; the insides of it are a random black box that you tweek and pray on. &nbsp;But I<br>
&gt; think that the insides should be shown to the world. &nbsp;They should<br>
&gt; be displayed on a backdrop of velvet. &nbsp;Especially the Compiler and VM and VM<br>
&gt; maker. &nbsp;And then the whole Windowing thing should be modularized so you can<br>
&gt; have multiple different Windowing systems.<br>
&gt;<br>
&gt; And what about having multiple VMs? &nbsp;It would be cool if picoLARC could be<br>
&gt; inside of Squeak in that way. &nbsp;It would be cool if one VM was generalized so<br>
&gt; that it could support different dialects and languages. &nbsp;And another was<br>
&gt; specific and fast. &nbsp;And you could make various kinds of VMs and images and<br>
&gt; output them onto disk without a lot of trouble. &nbsp;It would come with gcc and<br>
&gt; all that junk all set up so it would just work. &nbsp;If you already had gcc you<br>
&gt; could tell it not to download it.<br>
&gt;<br>
<br>
</div>What is gcc? And why it required to make VM? ;)<br>
<div class="Ih2E3d"><br>
&gt; picoLARC has simple name spaces called Nodules where you can have Nodules<br>
&gt; inside of Nodules and Nodules can multiply inherit variables from others.<br>
&gt; Maybe such a thing could be used in Squeak? &nbsp;Then you could have multiple<br>
&gt; VMs. &nbsp;And VMs inside of VMs.<br>
&gt;<br>
&gt; I think that Dolphin Smalltalk could be held up as an example of pretty.<br>
&gt;<br>
<br>
</div>Maybe, if you know how to deal with license &amp; copyrights when taking<br>
their source and blindly putting it to Squeak :)<br>
<div class="Ih2E3d"><br>
&gt; I hope picoLARC will be another one.<br>
&gt;<br>
&gt; I think that Squeak is pretty in a somewhat cancerous sort of way.<br>
&gt; The cancer is all the hacking. &nbsp;That goes on.<br>
&gt; The vision is great but the hacking and undocumenting gum up all those big<br>
&gt; ideas.<br>
&gt;<br>
&gt; Sure it&#39;s quick but it rots away quickly too.<br>
&gt;<br>
&gt; Undocumented features. &nbsp;In Smalltalk this is less of a problem but in like<br>
&gt; Lisp say you make this great feature but then don&#39;t document it. &nbsp;You might<br>
&gt; as well have not even made it.<br>
&gt;<br>
<br>
<br>
<br>
</div>--<br>
<div><div></div><div class="Wj3C7c">Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>David Zmick<br>/dz0004455\<br><a href="http://dz0004455.googlepages.com">http://dz0004455.googlepages.com</a><br><a href="http://dz0004455.blogspot.com">http://dz0004455.blogspot.com</a><br>

</div>