>> Actually, the module declarations that come with Scheme 48 let you
>> create very small (if maybe not tiny) images. Admittedly, it's not
>> very well documented. But it's certainly not "quite an undertaking".
>
>Could someone please post the source files and scripts necessary to
>create a minimal "Hello, world" image out of scsh?
>
>How much more than
> (begin (display "Hello, world") (newline))
>do you need?
>
>I tried to do this once, but could never produce an image less than
>about 1MB that actually worked, despite trying very hard for several
>hours. Having a worked example of how to do this would be very useful.
>
>Thanks in advance,
>
> - Bill
I'm not sure exactly what you mean by 'image'. If you mean produce
a heap image for scshvm, then this is all you need to do:
In debug/ create these two files
; hello.scm
(define (start arg in out)
(write-string "Hello, world!" out)
(write-char #\newline out)
(force-output out)
0)
; end hello.scm
; hw-packages.scm
; (link-simple-system '(debug hw) 'start hw-system)
(define-structure hw-system (export start)
(define-all-operators)
(files hw))
; end hw-packages.scm
make this addition to the Makefile:
(ie, cut & paste debug/tiny.image, then do the appropriate s/tiny/hw/g)
debug/hw.image: $(LINKER_IMAGE) debug/hw-packages.scm debug/hw.scm
($(START_LINKER) \
echo \(load-configuration \"debug/hw-packages.scm\"\); \
echo \(link-simple-system \'\(debug hw\) \'start hw-system\)) \
| $(LINKER)
then
make debug/hw.image
will produce a heap image for you. On my system, it's quite small:
$ ls -l debug/hw.image
-rw-rw-r-- 1 sjenkins cc7656 8511 May 8 10:10 debug/hw.image
You can also produce the image by hand, but I find editing a Makefile
is easier for me -- I make enough typos as is.
To run it, just:
$ scshvm -i debug/hw.image
Correcting byte order of resumed image.
Hello, world!
(I'm not sure how to turn off the 'Correcting byte order of resumed image',
but I know others do..)
Now, if you mean 'how do I produce a standalone executable', then I can't
help you, as I haven't played around with that part of scsh.
Steven L. Jenkins
|