SQUEAK(1) Squeak Smalltalk System SQUEAK(1) NAME squeak, inisqueak - Unix Squeak virtual(5,8) machine and installer SYNOPSIS inisqueak squeak [ option... ] [ image ] [ script [ argument... ] ] DESCRIPTION squeak is the virtual(5,8) machine for the Squeak Smalltalk system. It requires three files to operate correctly: an image file(1,n) containing a `snapshot' of a live Squeak session, a changes file(1,n) containing the source code for modified methods in(1,8) the image, and a copy of (or a link(1,2) to) a shared system sources file(1,n) containing the source code for methods that have not been modified since the last major version(1,3,5) increment. The image and changes files contain the state of a user's Squeak ses- sion, which is persistent between consecutive sessions. Private copies of these files are therefore normally required. The inisqueak script checks that the local Squeak installation appears sane, and then copies the required files to the current working directory. If inisqueak encounters no problems, it will finish by running squeak to start a Squeak session using the newly copied image and changes files. inisqueak should be run once, when using Squeak for the first time(1,2,n), to create a new 'personal' Squeak session. Afterwards, squeak should be run each time(1,2,n) that session is to be resumed. INVOCATION inisqueak has no options or arguments. Simply 'cd' to the directory that is to contain the working copies of the image and changes files, then run it. squeak accepts various options (described below), and then an optional image name (which must not begin with a minus sign '-'). If an image name is given on the command line then squeak tries to run that image. Otherwise squeak checks the environment variable SQUEAK_IMAGE and, if(3,n) it is set(7,n,1 builtins), uses its value as the name of the image to run. Otherwise squeak looks for an image called 'squeak.image' in(1,8) the current direc- tory. If the image file(1,n) does not exist then squeak prints a message indicating which image file(1,n) it failed to find and then exits. If the extension '.image' is missing in(1,8) the image argument or in(1,8) the value of the SQUEAK_IMAGE variable, it will be appended automatically. The image argument can be followed by a script name. This is the name of a 'document' that should contain Smalltalk code to be executed on startup. The document can be either the name of a file(1,n) or a URL start- ing with 'http:'. Any arguments that appear after the script name are ignored, but are made available to the script from within Squeak via the method getSystemAttribute:. (See the section SCRIPTS below.) If image is given as '--' then squeak immediately stops argument pro- cessing (and behaves as if(3,n) image was not specified). This is useful to specify a script (possibly with script arguments) without specifying an explicit image. OPTIONS Command line options fall into two categories: 'common' options that are recognised by the base VM and 'specific' options that are tied to a particular display or sound driver. Common options will always be recognised by squeak, whereas a given specific option will be recog- nised only after squeak has loaded the driver to which it relates. Refer to the '-vm' option below for more details. The common options recognised by squeak are as follows: -encoding enc specifies the internal character encoding(3,n) to be used by Squeak. This affects the translation that the VM performs when importing text (from the keyboard or via 'paste' from an external selec- tion) or exporting text (pasting text from Squeak to another application, or when generating filenames containing special characters). In other words, it affects the correspondence between what Squeak displays on the screen and what it sends to (or receives from) external applications. The correct value depends on the way Squeak's internal fonts are encoded. Current images are delivered with traditional Macintosh 'New York' fonts that use Mac Roman encoding(3,n), and so this is the default internal encoding. If other fonts (from X11 or elsewhere) are imported into the image and used as system fonts then the this default translation will give incorrect results for diacritical marks and special characters. In such cases the -encoding option can be used to change the internal encoding(3,n), for example -encoding ISO-8859-15 (aka Latin9) which would be appropriate for many of the fonts designed for European languages. -help prints a short summary of the command-line syntax, options and available drivers, then exits. -memory size[mk] requests that a fixed heap of size bytes be allocated for the Squeak image. If the suffix `k' is given then the argument is expressed in(1,8) kilobytes. If the suffux `m' is given then the argument is expressed in(1,8) megabytes. This option SHOULD NOT be used, unless there is a good reason to do so, since it places an arbitrary limit on Squeak's object memory size. -mmap size[mk] requests that a variable heap of at most size bytes be allo- cated. (The suffixes are as described for the '-memory' option.) squeak will initially allocate a heap that is large enough to hold the image, with a small amount of headroom. If at any time(1,2,n) Squeak requires more memory for its image then addi- tional space will be allocated dynamically. Likewise, when mem- ory is no longer needed it will deallocated and returned to the system. The size argument places an upper limit on how big the heap can grow in(1,8) this fashion. squeak uses a dynamic heap by default with the maximum size set(7,n,1 builtins) to 75% of the available vir- tual(5,8) memory or 1 gigabyte, whichever is smaller. -noevents disables the new (image 2.8 and later) event-driven input mecha- nism. This option is only useful for testing backwards compati- bility with older images and should not be used. -notimer disables the use of the interval timer for keeping track of low- resolution time. (If you are having problems with file(1,n), sound or socket(2,7,n) i/o reporting `interrupted system call' then setting this flag might help.) -pathenc enc specifies the external character encoding(3,n) to be used by Squeak when accessing the filesystem (file(1,n) and directory pathnames). The correct value depends on the local platform's characteris- tics. If no encoding(3,n) conversion should be performed then this should be set(7,n,1 builtins) to the same encoding(3,n) as Squeak uses internally (see the -encoding option). Otherwise ISO-8859-15 (aka Latin9) might make sense on a filesystem supporting 8-bit characters, and UTF-8 for filesystems that use Unicode-based pathnames. The default is UTF-8 which is correct for Mac OS X and very recent GNU/Linux distributions, and which (in(1,8) an ideal world) will eventually be adopted by all Unix variants. -plugins path specifies an alternative location for external plugins (collec- tions of named(5,8) primitives) and drivers (for display and sound). The path argument contains a pattern in(1,8) which any occurrences of `%n' will be replaced by the name of the plugin or driver being loaded. The path can name either a directory or the plugin itself and can be absolute or relative (to the directory in(1,8) which squeak was run). If a plugin or driver cannot be found in(1,8) the location specified by path then the search continues in(1,8) the default locations. -textenc enc specifies the external character encoding(3,n) to be used by Squeak when exchanging clipboard text with other applications. The default is UTF-8 on Mac OS X and ISO-8859-15 (aka Latin9) on other Unix systems. Note that X11 applications requesting the selection converted to UTF8_STRING data will (correctly) receive the clipboard text encoded as UTF-8, regardless of this setting. Squeak recognises a subset of the encoding(3,n) names defined by the IANA. (If you prefer to use the international currency symbol rather than the Euro symbol in(1,8) external text then you might want to set(7,n,1 builtins) this to ISO-8859-1, aka Latin1.) -version prints three or more lines of version(1,3,5) information, as follows: the architecture configured for the virtual(5,8) machine at compile time(1,2,n), the compilation `sequence number', the time(1,2,n) and date of compilation, and the name (and version(1,3,5), if(3,n) known) of the compiler that was used to compile squeak; the complete uname(1,2)(1) information for the host(1,5) on which the virtual(5,8) machine was compiled; the default installed location for plugins and drivers; After printing the above, the virtual(5,8) machine exits. -vm driver asks squeak to load(7,n) a sound/display driver. For each supported device there is a corresponding driver that squeak loads during initialisation. Unless told otherwise, squeak will figure out sensible default drivers to load. This choice can be overridden using this option. The driver argument is a list of one or more 'assignments' of the form class=device separated by spaces or commas. The supported combinations are currently: display=X11 to display the Squeak window on a local or remote X Win- dow System server. display=Quartz to display on the local Mac OS X desktop. display=none to disable the display (and keyboard/mouse) entirely. (This driver is useful primarily for running 'server' applications in(1,8) Squeak.) sound=OSS provides sound input and output via the Open Sound Sys- tem. (If you have a device called '/dev/dsp' then this is likely the one you want.) sound=MacOSX provides sound input/output via Core Audio on Mac OS X. sound=NAS provides sound i/o via the Network Audio System. sound=Sun provides sound on Sun Microsystems hardware. sound=none disables sound entirely. squeak will not attempt to play or record sounds when this driver is loaded. Note that only those drivers relevant to the local platform will be available. Attempting to load(7,n) an unsupported driver will cause squeak to exit(3,n,1 builtins) with an error(8,n) message. A list of available drivers is printed by the '-help' option. If a particular driver cannot load(7,n) system libraries on which it depends then it will neither be listed nor be available to load(7,n) at runtime. Note also that on Mac OS X both the X11 and Quartz display driv- ers are supported, although the former will refuse to load(7,n) if(3,n) the X11 client libraries are not installed on the local machine. The Quartz driver will happily load(7,n) (and Squeak will run as a fully-fledged application) even when squeak is invoked from the command line. Exercise caution when logged into Mac OS X from another machine: forgetting to set(7,n,1 builtins) DISPLAY before trying to run squeak on the remote display could cause embarrassement. Options specific to the X11 display driver are as follows: -browserWindow id specifies the id of the window that squeak should use for its display. This option is intended for use when Squeak is running as a web browser plugin. -display server specifies that Squeak should connect to the given display server instead of looking in(1,8) the environment variable DISPLAY (the default behaviour) to find the name of the server to use. -fullscreen causes the Squeak window to occupy as much of the screen area as possible. Implies '-notitle'. -headless disables the graphical display and mouse/keyboard input. This mode of operation is useful primarily for servers. -iconic asks the window manager to iconify the Squeak window at startup. -lazy causes Squeak to `snooze' whenever the main winodw is unmapped. This can be used if(3,n) Squeak appears to be using consuming CPU time(1,2,n) while idling (which should not normally be the case). Note that if(3,n) this option is in(1,8) effect, when the Squeak window is unmapped squeak will not respond to any external stimuli (other than to provide the X selection to requestors, when Squeak is the owner). -mapdelbs maps the Delete key onto Backspace. Backspace deletes the char- acter to the left of the cursor and Delete normally deletes the character to the right of the cursor. With this option, Deletes will behave like Backspace. The behaviour of Backspace is not changed. -nointl disables the handling of dead keys on international keyboards. Without this option, dead key handling is enabled if(3,n) either LC_ALL or LC_CTYPE is set(7,n,1 builtins) in(1,8) the environment. -notitle disables the title bar on the Squeak window (if(3,n) the window man- ager supports it). This option is implied by '-fullscreen'. -swapbtn swaps the yellow and blue buttons. (Traditionally, the red button is on the left, yellow in(1,8) the middle and blue on the right. The colourful names come from the Xerox Alto on which Smalltalk was first implemented.) Squeak normally maps X but- tons 1, 2 and 3 to the red, yellow and blue buttons, in(1,8) that order. With this option, it maps X buttons 1, 2 and 3 to the red, blue and yellow buttons.) -xasync causes Squeak to use asynchronous display updates. The virtual(5,8) machine normally flushes and synchronises the display connection at regular intervals. Using this option disables synchronisa- tion, which will be performed only when the image explicitly requests it. -xshm enables the use of the X Shared Memory extension on servers that support it. This can dramatically improve display performance, but works only when Squeak is running on the server. Options specific to the FBDev display driver are as follows: -fbdev device Use the given framebuffer device instead of the default '/dev/fb0'. -kbmap mapfile Load the keyboard map from the given mapfile instead of reading it from the running kernel. Note that squeak cannot (currently) read(2,n,1 builtins) compressed or 'shorthand' map files (as found in(1,8) /usr/share/keymaps or /lib/kbd/keymaps). To generate a keymap file(1,n) usable by squeak, execute the following program from the console: dumpkeys -f -n --keys-only > key.map If squeak encounters a problem while trying to load(7,n) mapfile, it will print an error(8,n) message and exit. See keymaps(5) for more information about the keymap file(1,n) format. The programs dump- keys(1), loadkeys(1), and showkey(1) can be used to modify the keyboard map before creating a keymap file(1,n) for squeak. -msdev device Use the given mouse device instead of the default. The default is to try '/dev/psaux', '/dev/input/mice' and '/dev/adbmouse', in(1,8) that order, and to use the first one that has a physical device attached. -msproto protocol Use the given mouse protocol instead of the default. The sup- ported protocols are 'ps2' and 'adb'. The default is 'ps2' for mice attached to '/dev/psaux' or '/dev/input/mice', and 'adb' for mice attached to '/dev/adbmouse'. -vtlock Disallows VT switching, regardless of whether the request comes from the keyboard or from another program such as chvt(1). -vtswitch Enables keyboard VT switching. Note that this option is effec- tively disabled if(3,n) the '-vtlock' option is also enabled. Options specific to the OSS and MacOSX sound drivers are as follows: -nomixer disables the primitives that change mixer (sound) settings. If you prefer that Squeak leave these alone (they are, after all, really the reponsibility of whichever mixer program or sound control panel(1,3x,3x bottom_panel) you use) then this option is for you. Several common options are deprecated and are provided only for back- ward compatibility. These options should not be used and will be removed in(1,8) a future release: -display dpy is equivalent to '-vm display=X11 -display dpy'. -headless is equivalent to '-vm display=X11 -headless'. -nodisplay is equivalent to '-vm display=none'. -nosound is equivalent to '-vm sound=none'. -quartz is equivalent to '-vm display=Quartz'. ENVIRONMENT Many of the options that can be set(7,n,1 builtins) on the command line can also be set(7,n,1 builtins) from environment variables. SQUEAK_ASYNC if(3,n) set(7,n,1 builtins) in(1,8) the environment then equivalent to the '-xasync' flag. (The value is ignored.) SQUEAK_ENCODING the name of the internal character encoding(3,n) used by Squeak. Equivalent to giving the '-encoding' command-line option if(3,n) set. SQUEAK_FBDEV the name of the framebuffer device to use when running on the console. See the '-fbdev' option. SQUEAK_FULLSCREEN equivalent to '-fullscreen' if(3,n) set. SQUEAK_ICONIC equivalent to the '-iconic' flag. SQUEAK_IMAGE the name of the image file(1,n) to execute if(3,n) no image argument is given on the command line. SQUEAK_KBMAP the name of the keymap file(1,n) to use when running on the console. See the '-kbmap' option. SQUEAK_LAZY equivalent to the '-lazy' flag. SQUEAK_MAPDELBS equivalent to the '-mapdelbs' flag. SQUEAK_MEMORY the initial size of the heap, with optional 'k' or 'm' suffix. Equivalent to the '-memory size[km]' flag. SQUEAK_MSDEV the name of the mouse device to use when running on the console. See the '-msdev' option. SQUEAK_MSPROTO the name of the mouse protocl to use when running on the con- sole. See the '-msproto' option. SQUEAK_VTLOCK if(3,n) set(7,n,1 builtins) then equivalent to specifying the '-vtlock' option on the command line. SQUEAK_VTSWITCH if(3,n) set(7,n,1 builtins) then equivalent to specifying the '-vtswitch' option on the command line. SQUEAK_NOEVENTS if(3,n) set(7,n,1 builtins), equivalent to '-noevents'. SQUEAK_NOINTL equivalent to '-nointl' if(3,n) set. SQUEAK_NOMIXER equivalent to '-nomixer' if(3,n) set. SQUEAK_NOTIMER equivalent to '-notimer' if(3,n) set. SQUEAK_NOTITLE if(3,n) set(7,n,1 builtins), equivalent to '-notitle'. SQUEAK_PATHENC the name of the character encoding(3,n) used to construct file(1,n) and directory names. Equivalent to giving the '-pathenc' command- line option if(3,n) set. SQUEAK_PLUGINS see '-plugins'. SQUEAK_SWAPBTN equivalent to '-swapbtn' if(3,n) set. SQUEAK_TEXTENC the name of the character encoding(3,n) used to copy/paste text from/to external applications. Equivalent to giving the '-tex- tenc' command-line option if(3,n) set. SQUEAK_VM contains the names of one or more drivers to be loaded during initialisation. See the '-vm' option for details. SQUEAK_XSHM equivalent to '-xshm'. If an environment variable and a command-line option conflict over a particular value then normally the value in(1,8) the command line takes precedence. The exception to this rule is the '-vm' option. Environ- ment variables are processed before command-line arguments and '-vm' cannnot be used to unload a driver that was loaded while processing the contents of 'SQUEAK_VM'. squeak also checks the environment for LC_ALL and LC_CTYPE. If either of these variables is set(7,n,1 builtins) then support for international keyboards (including dead keys for diacritical marks) is enabled. To prevent this support being enabled even when one or both of these variables is set(7,n,1 builtins), use the '-nointl' option (or set(7,n,1 builtins) SQUEAK_NOINTL in(1,8) the environ- ment). For example, to start squeak with support for dead keys on Spanish keyboards, with Latin-1 encoding(3,n) of external characters and the default MacRoman internal font encoding(3,n), run squeak like this: export LC_CTYPE=es_ES export SQUEAK_TEXTENC=latin1 squeak SCRIPTS Squeak can load(7,n) and execute a 'script' file(1,n) containing Smalltalk code at startup. The name of the file(1,n) should be given as the script argu- ment to squeak. For example, assuming that the image 'foo.image' con- tains an open(2,3,n) Transcript window, then the following represents the 'hello world' program for Squeak: Transcript cr; show: 'Hello, world'. If this script is in(1,8) a file(1,n) called 'hello.sq', then it could be run like this: squeak foo.image hello.sq It is also possible to make 'self interpreting' scripts by adding an 'interpreter line' to the start of the script. The 'hello.sq' file(1,n) could be changed to #![bindir]/squeak -- Transcript cr; show: 'Hello, world'. and then made executable with chmod(1,2) +x hello.sq and then invoked by running the script file(1,n) directly: SQUEAK_IMAGE="foo.image" export SQUEAK_IMAGE ./hello.sq If any arguments are present after the script name then they can be retrieved from within the script using the method Smalltalk getSystemAttribute: n where n is the index of the argument, starting at 3 for the first argu- ment. (See the method comment for SystemDictionary>>getSystemAttribute: in(1,8) the image for an explanation of the meanings of the indices.) As an example of this, here is the 'echo(1,3x,1 builtins)' program written as a Squeak script: #![bindir]/squeak -- "Echo arguments to the Transcript." | i a | i := 2. [(a := Smalltalk getSystemAttribute: (i := i + 1)) notNil] whileTrue: [Transcript space; show: a]. When run as ./echo.sq one two three this would print 'one two three' in(1,8) the Transcript window. DIAGNOSTICS inisqueak prints several informational messages while doing its stuff. If it encounters a problem it prints an appropriate message before bailing out. The messages should be self-explanatory. squeak normally does not print anything at all. If it prints something then there is a problem. The messages should be self-explana- tory. FILES [imgdir]/SqueakV[major].sources Shared system sources file(1,n) for the Squeak image. There must be a copy of (or link(1,2) to) this file(1,n) in(1,8) the working directory when running squeak. [imgdir]/Squeak*.image [imgdir]/Squeak*.changes Distributed image and changes files holding a `shapshot' of a live Squeak session. (The contents of these files change during a session, and so private copies should always be made before running squeak for the first time. See inisqueak(1)). ./SqueakV[major].sources A link(1,2) to the system sources file. ./name.image ./name.changes Private copies of image and changes files. [plgdir]/*.so [plgdir]/*.la Virtual machine 'plugins' (containing primitives that are loaded on demand) and drivers (for different types of display and sound hardware). [bindir]/squeak [bindir]/inisqueak The Squeak virtual(5,8) machine and personal image installer script. [mandir]/squeak.1 This manual page. [docdir]/* Miscellaneous documentation. NOTES This manual page documents version(1,3,5) [version(1,3,5)] of Unix Squeak. It may not be appropriate for any other version. The image and changes files containing a saved Squeak session are inti- mately related. They should always be used together, never be sepa- rated, and under no circumstances should an image be run with a changes file(1,n) that has been used with a different image. Failure to adhere to the above could cause the source code for the methods in(1,8) the image to become garbled and impossible to retrieve. The Unix Squeak virtual(5,8) machine fully supports OpenGL in(1,8) both the X11 and Quartz display drivers. Open Croquet will run just fine with either of these drivers (and many Mac OS X users(1,5) will even have the choice of which driver to use :). BUGS If a 'binary' option is enabled by an environment variable, there is no way to disable it on the command line. Similarly, drivers specified in(1,8) the SQUEAK_VM environment variable can- not be overridden by passing options on the command line. squeak should never crash. In the unlikely event that it does crash, or prints any kind of message that does not appear to be caused by incorrect arguments or illegal operations from within a Squeak program, please send(2,n) a bug report to: <ian.piumarta@inria.fr>. (Reports sent or copied to this address, rather than just to the Squeak mailing list, will stand a much better chance of being seen and dealt with in(1,8) a timely fashion.) AUTHOR This manual page was written by Ian Piumarta. SEE ALSO Dan Ingalls, Ted Kaehler, John Maloney, Scott Wallace and Alan Kay, Back to the Future: The Story of Squeak, A Practical Smalltalk Written in(1,8) Itself. Proc. OOPSLA'97. The official Squeak home page: http://squeak.org The archives of the Squeak mailing list: http://squeak.cs.uiuc.edu/mail(1,8)/squeak The latest source and binary distributions of Unix Squeak: http://www-sor.inria.fr/~piumarta/squeak Squeak Smalltalk System SQUEAK(1)