[Cuis-dev] getting a Squeak VM for macOS
Mark Volkmann
r.mark.volkmann at gmail.com
Tue Jun 25 07:48:01 PDT 2024
I solved this by creating the following shell script in my PATH that I
named "cuis":
#!/usr/bin/env bash
# Runs a file containing Smalltalk code in headless mode using Cuis
Smalltalk.
if [ $# -ne 1 ]; then
echo usage: cuis {file-name}
exit 1
fi
CUIS_DIR=$LANG_DIR/smalltalk/Cuis-Smalltalk-Dev
VM=$CUIS_DIR/CuisVM.app/Contents/MacOS/Squeak
IMAGE=$CUIS_DIR/CuisImage/Cuis7.1-6452.image
$VM -headless $IMAGE -s $1
As an example, I created the file "command-line.st" containing the
following:
| stdout |
stdout := StdIOWriteStream stdout.
stdout nextPutAll: 'Hello, World!'; newLine.
Smalltalk quit
To run this I just enter "cuis command-line.st".
On Mon, Jun 24, 2024 at 8:58 PM Mark Volkmann <r.mark.volkmann at gmail.com>
wrote:
> Apparently I can just copy Smalltalk.app/Contents/MacOS/Squeak to
> /usr/local/bin which is in my PATH. No need to create a symbolic link. But
> it still doesn't work. After doing that, when I enter "Squeak -h" it just
> hangs.
>
> Does anyone on the mailing list have experience running Smalltalk programs
> from the command line?
>
> On Mon, Jun 24, 2024 at 8:04 PM Mark Volkmann <r.mark.volkmann at gmail.com>
> wrote:
>
>> Can someone that uses Smalltalk on a Mac confirm whether this is the
>> correct way to obtain a VM executable?
>>
>> - Browse https://github.com/OpenSmalltalk/opensmalltalk-vm
>> - Under "Releases" on the right side, click "Latest".
>> - Click the proper file for your operating system and processor.
>> For example, `squeak.cog.spur_macos64ARMv8.dmg`.
>> - Double-click the downloaded file to install it which will result in
>> Squeak.app
>> - Create a symbolic link to the virtual machine that is inside this app
>> by entering the following:
>>
>> ln -s "./Squeak.app/Contents/MacOS/Squeak" squeak-vm
>>
>> - Execute a file containing Smalltalk code using that VM executable with
>> the following:
>>
>> squeak-vm {path-to-cuis-base-image} -s demo.st
>>
>> where demo.st contains something like the following:
>>
>> | stdout |
>> stdout := StdIOWriteStream stdout.
>> stdout nextPutAll: 'Hello, World!'.
>> Smalltalk quit
>>
>> When I do this, I don't get an error, but I don't get any output and the
>> VM doesn't exit.
>>
>> R. Mark Volkmann
>> Object Computing, Inc.
>>
>
>
> --
> R. Mark Volkmann
> Object Computing, Inc.
>
--
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240625/a7b1ba16/attachment-0001.htm>
More information about the Cuis-dev
mailing list