[squeak-dev] Modular Plugins

K. K. Subramaniam subbukk at gmail.com
Tue Dec 22 06:42:07 UTC 2009


On Monday 21 December 2009 11:06:51 am David T. Lewis wrote:
> > Currently, the *Plugin.c file is generated from Slang code which is
> > pre-loaded  into the vmm image and not distributed with the plugins/
> > directory. The first line in such generated files is a cryptic:
> >  /* Automatically generated from Squeak on #(7 March 2007 2:25:53 pm) */
> > 
> > This line contains no clue about the version of the slang code or the
> > vmm  which translated it to C.
> 
> Are you using an up to date VMMaker from SqueakSource? If so, you should
> be seeing comments that look like this:
> 
> /* Automatically generated from Squeak on 20 December 2009 11:41:57 pm
>    by VMMaker 3.11.10
>  */
I picked the header from 
./unix/plugins/VideoForLinuxPlugin/VideoForLinuxPlugin.c randomly from the 
unix*vmm.tar.gz sources distributed from squeakvm.org/unix. Even the new style 
header only includes the VM version and not the plugin source (cs) version. 
Shouldn't this appear in the intermediate .c or .so file for traceability?

>One thing I do have a strong opinion on: The generated C source
>code that is translated from Slang should not be treated as
>source code. It is intermediate code, like the *.o from a C compiler.
I fully agree. My suggestion was to put cs under version control and not the 
generated C code. The exact version control tool is not relevant as long as we 
can trace the object (.so or .c) to the source (.cs). The cs file, like .y or 
.lex needs a converter. AFAIK, the complication is that there is no command 
line converter to extract a version of .cs and convert it to .c so one cannot 
run it from a batch process like make(1) or cmake(1) say:
    squeak -headless vmm.image translate-plugin.st src p.cs obj p.c dir /tmp

Knowing Squeak, this should be a simple matter of programming (SMOP) but my 
Squeak skills are insufficient to figure this out :-(. I suppose the first 
interactive editing and regeneration of plugin .c file is tolerated because it 
changes rarely compared to porting changes to sq*.c files.

Subbu



More information about the Squeak-dev mailing list