[Vm-dev] Underscore for assignment in VMMaker and related plugins

David T. Lewis lewis at mail.msen.com
Tue Aug 10 13:17:04 UTC 2021

Hi Marcel,

On Mon, Aug 09, 2021 at 08:37:38AM +0200, Marcel Taeumel wrote:
> Hi Dave,
> thanks for the thorough explanation of this issue.
> +1 for allowing underscore assignments in a fully-packaged VMMaker image
> One should follow the plugin-specific coding conventions anyway when contributing to the particular sub-project.
> After loading code that needs underscore assignments, one can easily turn off that preference again. Well, "recompile all" situations would become tricky. Not sure whether this is an issue here.
> How does the non-plugin code look like for the??VectorEnginePlugin? Is there some?

The VectorEnginePlugin does not have any support code at all, it
is 100% Smalltalk. The only thing that was needed in the platforms
directory was a Makefile.inc that turns off compiler optimization
for the plugin. This turned out to be an issue for llvm, although
not for gcc.


> Best,
> Marcel
> Am 09.08.2021 02:40:33 schrieb David T. Lewis <lewis at mail.msen.com>:
> Background: By convention the assignment operator in modern day Squeak
> is ':=' and it Cuis it is '_'. The actual fonts are rendered nicely in
> either case for Cuis and Squeak.
> The VMs used for Cuis and Squeak consist of the VM proper along with various
> VM plugins such as OSProcessPlugin and VectorEnginePlugin. The VM plugins
> are written in Smalltalk ("slang") with supporting external code as needed.
> The Smalltalk code for each VM plugin is translated to C code, and the
> resulting C code is expected to be correct regardless of the dialect of
> Squeak/Cuis in which the plugin is written.
> The generated C code for a VM plugin is the same regardless of whether the
> Smalltalk source is written in the '_' or ':=' convention. However, mixing
> these two conventions in the same VMMaker image may be confusing, especially
> if the (Squeak) image has disabled its 'Allow underscore selectors' preference.
> OK, enough background. The question I want to present is this:
> The new VectorEnginePlugin is being developed in Cuis, and therefore uses
> the '_' convention in its Smalltalk source code. When building a new
> opensmalltalk-vm VMMaker image from primary sources, the 'Allow underscore
> selectors' preference' is disabled, presumably in order to catch VM plugin
> code that accidentally uses the '_' convention. However, in the case of
> VectorEnginePlugin, the use of '_' is intentional, and we can expect it
> to be used for current and future versions of the plugin Smalltalk code
> as development proceeds.
> So should we:
> 1) Relax the restriction and allow VectorEnginePlugin to be loaded without
> modification in a VMMaker image
> or:
> 2) Convert current and future versions of the VectorEnginePlugin Smalltalk
> to use ':=' for assigments prior to loading in a Squeak VMMaker image
> (method author/timestamps would be preserved).
> I personally prefer 1) but consider either option to be reasonable and doable.
> Comments? Preferences?
> Dave

More information about the Vm-dev mailing list