[Glass] Curious about GemStone 3.5

Dale Henrichs dale.henrichs at gemtalksystems.com
Wed Apr 10 17:41:10 PDT 2019

On 4/10/19 4:51 PM, BrunoBB via Glass wrote:
> Martin/Norm/Dale,
> Got it. Thanks for your answers.
> How will work the readonly restriction ?
I believe that commits will fail or are disabled ... basically you will 
be running "normally" in the topaz vm ... so all of the smalltalk 
functionality will work ... with the restriction that you won't be able 
to save your work to disk ...
> It will be possible to anything but the commit will fail. Or some feature
> will be disabled ?
> I mean if it is possible to execute GS code then is possible to create
> classes but classes are persistent.
> So this will be disable or a commit will fail ?
> If the commit will fail then it will possible to create objects attach them
> to class vars but no commit available.
I think that this is the model ...
> What was the main motivation to create a solo Gem ?
> * To ease the development of Gs_devKit ?
> * To execute GS code without performance penalties for persistence ?
> * To use a solo Gem for development ?

I think it was mainly the general case of being able to write executable 
smalltalk scripts without *requiring* that a stone be up and running ... 
internally we have a number shell scripts and perl scripts that we use 
for test drivers and the like and it would be real nice to be able write 
and maintain these scripts in gemstone smalltalk ...

so GsDevKit_home is one of the use cases ... the Pharo3.0 vm that gets 
built and run in GsDevKit_home is a good example that there are some 
things that you can't do in bash --- like extract information from .ston 
files ... with topaz solo, we could distribute and extent file with the 
GsDevKit_home code preloaded and quite a lot can be done without ever 
having to have a live stone running ... you do get to the point where it 
might make sense to use a running stone to store some of the meta data 
for the system, but with topaz solo, we can run lightweight scripts 
without requiring a stone to be running ...

In preparation for topaz solo being available, I've started playing 
around with smalltalk shebang scripts[1] that are based on using a Tonel 
class file as a script that could be run using topaz solo or a live 

    Example executable script
    Class {
          #name : 'Sample',
          #superclass : 'StashScript',
          #category : 'Stash-Scripts'

    { #category : 'script execution' }
    Sample >> scriptOptions [
    	^ {
    			#('help' $h #'none').
    			#('print' $p #'optional').

    { #category : 'script execution' }
    Sample >> executeScript [

    		at: 'help'
         ifAbsent: [
    			| stream |
    			stream := WriteStreamPortable on: String new.
    			args size > 0
    				ifTrue: [
    					stream nextPutAll: '|args| '.
    					args do: [:arg | stream nextPutAll: arg; space ] ]
    				ifFalse: [ stream nextPutAll: 'no args ' ].
    			opts at: 'print'
    				ifPresent: [:optionalArg |
    					stream nextPutAll: ' |print| ', optionalArg asString ]
    				ifAbsent: [ stream nextPutAll: ' || no --print ' ].
    			^ stream contents ]
         ifPresent: [ ^ self usage ]

    { #category : 'usage' }
    Sample >> usage [
    	| dashes |
    	dashes := '----------------------------------------------------
       ^ dashes,
    		(self manPageClass
    	sample - example script
    	sample [-h|--help] [-p [<arg>] | --print[=<arg>]] [ <positional-args> ]\
    		[ -- <topaz-specific-options> ]

    	This example script shows how to define command options and positional arguments.

    	Use the env var GEMSTONE_SCRIPT_ARGS to define default <stone-name> and other
    	topaz arguments (<startTopaz-specific-options>) to be used when running scripts.

    	sample.st --help
    	sample.st -h

    	sample.st --print=\`hi there\`
    	sample.st -p \`hi there\` arg1

    	sample.st --print=hi arg1 arg2
    	sample.st -p hi

    	sample.st --print
    	sample.st -p

    	sample.st arg1 arg2 arg3
    ') printString, dashes

You might recognize that the above script is similar to what I've been 
doing for tODE scripts ... this is all fairly experimental at this point 
... I'm basically trying to see how far I can go without having to 
resort to bash:) So far I've been working with a live stone ... when 
writing some scripts it is very convenient to be able to use a smalltalk 
development environment (Jadeite and Rowan in my case) to write the 
scripts, but I anticipate that you should be able to target a smalltalk 
shebang script at a live stone or topaz solo ...


[1] https://github.com/dalehenrich/stash
[2] https://github.com/dalehenrich/stash/blob/master/bin/sample.st
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20190410/5f11ab2a/attachment-0001.html>

More information about the Glass mailing list