<div dir="ltr">Hi Frank,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 15, 2013 at 2:14 AM, Frank Shearar <span dir="ltr">&lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@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 class="HOEnZb"><div class="h5">On 15 November 2013 02:54, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br>

&gt; On Thu, Nov 14, 2013 at 4:27 PM, Frank Shearar &lt;<a href="mailto:frank.shearar@gmail.com">frank.shearar@gmail.com</a>&gt; wrote:<br>
&gt;&gt; We talk past each other every time we have this argument.<br>
&gt;<br>
&gt; Not every time -- I&#39;ve learned a few things from y&#39;all in this community.  :)<br>
&gt;<br>
&gt;&gt; On 14 November 2013 20:47, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt; I know module-heads like to say it&#39;s all about modularity and not size<br>
&gt;&gt;&gt; but I think it being about size is unavoidable.  (And, when I say<br>
&gt;&gt;&gt; &quot;size&quot; I&#39;m talking only talking about disk and memory but also<br>
&gt;&gt;&gt; coherence which is a valuable thing).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Because otherwise &quot;so what&quot; if FFI includes the constants and VMMaker<br>
&gt;&gt;&gt; depends on it solely for that portion of it?  How many methods making<br>
&gt;&gt;&gt; up FFI are we talking about?  There are plenty of _other_ methods in<br>
&gt;&gt;&gt; the image which are not being used by VMMaker, what about them?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Acknowledged or not, at some point we&#39;re forced to assume a balance<br>
&gt;&gt;&gt; between number of extra methods and number of extra packages.  The<br>
&gt;&gt;&gt; hand-made-micro-packages approach puts these two metrics at inverse of<br>
&gt;&gt;&gt; each other, trading domain complexity for package complexity.<br>
&gt;&gt;<br>
&gt;&gt; We can argue about the granularity of the packages. I don&#39;t really<br>
&gt;&gt; care about that. I argue about small packages in the base image only<br>
&gt;&gt; because you cannot break the cycles without distinguishing about the<br>
&gt;&gt; parts.<br>
&gt;<br>
&gt; Yes, we&#39;re in agreement that should be a criteria for determining<br>
&gt; package boundaries / granularities.<br>
&gt;<br>
&gt;&gt; Please, please show me that I&#39;m wrong so that I stop tilting at<br>
&gt;&gt; the tangle web of windmills. Just take System. That would be a good<br>
&gt;<br>
&gt; Ha, I knew it!  You ALWAYS pick &quot;System&quot; every time we have this argument.   :)<br>
<br>
</div></div>It&#39;s one of the most egregious offenders, so I&#39;m bound to pick on it :)<br>
<div class="im"><br>
&gt;&gt; start. Show me how System makes sense as a package. Because all I see<br>
&gt;&gt; is a big fat mess of separate things that have no business being<br>
&gt;&gt; together. Projects? Change notifications? UI? Serialisation?<br>
&gt;<br>
&gt; &quot;big fat mess&quot; and &quot;no business being together&quot; are size / coherency<br>
&gt; judgements.  Busted!  :)<br>
<br>
</div>I use a pejorative term here only because System&#39;s (probably) the<br>
worst entangler we have. I want the Squeak base image to be like a<br>
layer cake. If you draw the dependencies between packages, and Kernel<br>
sits at the bottom, then all the dependency arrows point either<br>
sideways (with no cycles) or downwards. System is like a giant<br>
pineapple sitting in the middle of that cake. It cuts across these<br>
various layers, because it provides high level functionality (no good<br>
examples off the top of my head because I&#39;m at work and don&#39;t have an<br>
image open - Project maybe?), low level functionality (change<br>
notification), and &quot;support&quot; stuff (which largely looks like a &quot;useful<br>
things that we don&#39;t know where else to put&quot; bucket).<br></blockquote><div><br></div><div>First let me stress that I agree strongly with your desire to see the system properly modularized.  Personally I like the image of an onion, but then I like clams in white wine with onions and coriander much more than I like cake.  Second, I *think* it&#39;s impossible with a system like Smalltalk to meaningfully onionize the core of the system (i.e. System).  That&#39;s because it is recursively implemented.  None of the core libraries (arithmetic, collections) can exist without the kernel execution classes (behavior, method dictionary, compiled method),  None of the core execution classes can function without the core libraries (method dictionary is a collection, arithmetic is used throughout the core system).</div>
<div><br></div><div>Observe that having a separate development environment such as Spoon doesn&#39;t change much here.  We can easily extract the compiler (and a binary loader) from the system; it is then inert (cannot add more code) but still functional.  We can use Spoon to create methods in one image and upload them to another.  But within an image there will always be circularity which is fundamentally to do with teh system being implemented in itself, with everything (including code) being objects.  And this property of everything being an object is the single most valuable property of the system; it leads to the system&#39;s liveness.  So at some stage we have to accept the tangle that lies at the heart of the system.  It doesn&#39;t have to be a tangled mess, and can have clean boundaries.  But IMO inevitably at the core of the sytsem there will be some small number of packages which are inevitably interrelated, inseparable and unloadable.</div>
<div><br></div><div>I&#39;m probably teaching you to suck eggs but I had to let that brain fart free.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im"><br>
&gt; The truth is, I&#39;m pretty sure we&#39;ve agreed about System for a while.<br>
&gt; If all dependency cycles could be removed, I wouldn&#39;t care so much<br>
&gt; about System being &quot;big and fat&quot; because I see it as the &quot;Smalltalk<br>
&gt; programming system&quot;, but I think the cycles probably won&#39;t be able to<br>
&gt; be eliminated without breaking it up and so it&#39;s moot to disagree on<br>
&gt; System anyway.<br>
<br>
</div>Parts of System depending on other parts of System in a cyclic manner<br>
(&quot;intra-package&quot; cycles) don&#39;t matter. Unless you try to break up the<br>
package, of course, in which case you can&#39;t load the parts without<br>
weird preambles and non-MC-friendly things.<br>
<br>
I understand why you see System as being &quot;the Smalltalk programming<br>
system&quot;. I&#39;m trying to untangle what exactly &quot;the Smalltalk<br>
programming system&quot; actually means, and how it&#39;s built. I suppose I&#39;m<br>
looking at the packages through a microscope?<br></blockquote><div><br></div><div>As you well know that won&#39;t work.  We need to look at it in large chunks.  For me its core class libraries (essentially Object (so one can add new classes that integrate with the system), arithmetic, collections and streams), the execution classes, environments (Smalltalk, SharedPools), exceptions and some base error reporting facility.  Above that one can add System (managing the evolution of the environment) &amp; Compiler.  Above that the programming tools.  Etc.</div>
<div><br></div><div>This works (I think) by looking at functionality.  Smalltalk is a programming system used to express programs.  The most elemental programs use arithmetic and/or collections; the next most elemental programs add new classes rooted at Object.  All these elements are themselves expressed as objects.  These programs may run, and in doing so may raise errors which need to be reported.  Note that I *haven&#39;t* included how those programs are created in the elemental soup.  Whether the image just is, or whether code is created by the Compiler/ClassBuilder, or loaded via a binary loader isn&#39;t elemental; the fact that there are at least three ways to go about it proves this.</div>
<div><br></div><div>So IMO if you want to break the system into modules you first come up with a model of the system&#39;s functionality, and you design modules around that model. All forms of shrinkage, unloading, loading, compiling, remote debugging, etc, etc are merely arcs in the functionality model.  IMO an elegant functionality model is one where the atom of functionality is small and can easily be used to create other compound functionalities in as few steps as possible.</div>
<div><br></div><div>So a base headless image with arithmetic, collections, file streams, execution classes, exceptions, compiler, read-eval-print-loop and error reporting to standard out seems close.  Another could be arithmetic, collections, file streams, execution classes, exceptions, error reporting to standard out, a binary loader and a command-line argument parser such that one can specify packages to load.  Another might be arithmetic, collections, file streams, execution classes, exceptions, and error reporting to standard out, that requires Spoon to load code into it.</div>
<div><br></div><div>Once one&#39;s chosen one or more of these bases then other functionalities such as a squeak trunk image with the programming tools and morphic, or a squeak trunk with MVC, or a headless scripting environment with a read-eval-print-loop and lots of file system utilities, can be constructed by loading modules, and hence those modules can be derived from what it would take to construct a functionality.</div>
<div><br></div><div>If I&#39;m missing the point of this discussion forgive me, but it seems to me that without a clear notion of what the atom is there&#39;s endless scope for confusion and delay.</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 class="im">&gt; You had brought up a one-class package which is what got this going<br>
&gt; this time..  :)<br>
<br>
</div>Yes, I did kinda deliberately do that, didn&#39;t I? :)<br>
<div class="im"><br>
&gt;&gt;&gt; This is why want Spoon to make micro-packaging less important.  Let<br>
&gt;&gt;&gt; the machine imprint a truly &quot;optimal&quot;, application-specific, image<br>
&gt;&gt;&gt; that no amount of human-wrangling could ever come close.<br>
&gt;&gt;<br>
&gt;&gt; Shrinking is useless. You have no idea what you deploy. I _do not<br>
&gt;<br>
&gt; Dabble DB who wanted to run hundreds of images.  I also have cases<br>
&gt; where I need to run many images.  For that, shrinking is not useless.<br>
<br>
</div>By &quot;useless&quot; I mean &quot;you have no idea what makes up a running process,<br>
except by actually inspecting that process.&quot;<br>
<div class="im"><br>
&gt; The idea of Spoon is to deploy only one single &quot;fat&quot; image (with<br>
&gt; everything you know you need and more) from which as many minimal<br>
&gt; images can imprint from.  Since they only download methods they need,<br>
&gt; as they get called, memory usage is optimized.<br>
<br>
</div>Well. That inflate-as-needed approache requires you have a persistent,<br>
reliable network connection between the deployed artifact and some<br>
server somewhere. That&#39;s pretty much exactly the opposite of what I<br>
consider sane deployment practice. I know I&#39;m taking a really strong<br>
stance here, and I apologise if I end up sounding harsh. (I can<br>
sort&#39;ve half-see a possible use case where the &quot;single fat image&quot; is<br>
on the same machine as the mini images... in which case I&#39;d rather see<br>
the mini images constructed explicitly.)<br>
<br>
In particular, the kind of thing that I&#39;d like to see is an automated<br>
and explicit build process that assembles some binary artifact. That<br>
goes into CI, which throws stones at it. If that binary artifact<br>
passes muster, it&#39;s turned into a Debian package (replace with<br>
suitable replacement concept for your platform) with a hard version.<br>
That package is then deployed to the target machine, and in prod you<br>
know _exactly_ what your server&#39;s running. (An alternative approach<br>
would be to use Docker, in which case you assemble and test a &quot;virtual<br>
machine lite&quot; that you can just start running on your target machine.)<br>
<br>
The first step here is actually being able to assemble that artifact,<br>
and that comes down to a ConfigurationOf/Installer script that takes a<br>
well-known base image and builds it up to whatever you need.<br>
<br>
Now my obsession is applying this same process to the base image itself.<br>
<div class="im"><br>
&gt;&gt; care_ about this theoretically minimal image, because otherwise I&#39;d<br>
&gt;&gt; just copy with Guille Polito&#39;s doing, and building up a whole new<br>
&gt;&gt; object space starting with nil. _That_ is minimal.<br>
&gt;<br>
&gt; I&#39;m not aware of his work..<br>
<br>
</div>This looks like a good starting point:<br>
<a href="http://playingwithobjects.wordpress.com/2013/05/06/bootstrap-revival-the-basics/" target="_blank">http://playingwithobjects.wordpress.com/2013/05/06/bootstrap-revival-the-basics/</a><br>
<div class="im"><br>
&gt;&gt; I&#39;ve been rolling out clearly versioned code, with well-understood<br>
&gt;&gt; dependencies, for years now in every language I know except for the<br>
&gt;&gt; one I love the most. And in every one of these languages (C#, Ruby,<br>
&gt;&gt; Java, Scala) I have had _no_ serious pain in managing dependencies.<br>
&gt;&gt; You define your immediate dependencies, and you&#39;re _done_.<br>
&gt;<br>
&gt; Yes, we seem to be getting there.<br>
<br>
</div>We are, slowly.<br>
<span class="HOEnZb"><font color="#888888"><br>
frank<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>