saving a Shen/Scheme image

70 views
Skip to first unread message

Mark Tarver

unread,
Sep 3, 2022, 4:48:21 PM9/3/22
to Shen
The Shen/Scheme image does not contain stlib;  I'm always loading it.  Is there a way of saving the image as in SBCL?

Mark

Bruno Deferrari

unread,
Sep 4, 2022, 11:11:45 AM9/4/22
to qil...@googlegroups.com
I don't know of any way of saving a running session with the Chez runtime, but there are some alternatives:

A) create an alternative boot image that already includes the stdlib code
B) create a precompiled library (in binary form) of the stdlib code that will load more quickly

Either of these options can (potentially) also give you better performance too (code that is loaded from the REPL cannot be optimized as well as code that is batch-compiled).

Let me think about how to provide a way to do this easily from Shen/Scheme.

On Sat, Sep 3, 2022 at 5:48 PM Mark Tarver <dr.mt...@gmail.com> wrote:
The Shen/Scheme image does not contain stlib;  I'm always loading it.  Is there a way of saving the image as in SBCL?

Mark

--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/qilang/4a1f6bb8-5ad4-4ccc-81aa-4c2d959d6b19n%40googlegroups.com.


--
BD

nha...@gmail.com

unread,
Sep 4, 2022, 1:56:12 PM9/4/22
to Shen
The boot image version has the benefit of moving all the data into a static GC generation that never gets collected.

Mark Tarver

unread,
Sep 5, 2022, 4:59:53 AM9/5/22
to Shen
If there was some sort of consult file that be loaded easily then that would do;  stlib
loads in just over a second.

Mark

Bruno Deferrari

unread,
Sep 5, 2022, 12:13:19 PM9/5/22
to qil...@googlegroups.com
How about a .bat file to launch shen? containing something like:

shen.exe eval -l init.shen -r

-l file <- loads that file at startup
-r <- launches the REPL



--
BD

Mark Tarver

unread,
Sep 6, 2022, 8:50:29 AM9/6/22
to Shen
That's great - it works.  However the REPL does jabber on when I load
stlib and I tried including (set *hush* true) in the init file, but it does
not work in Scheme/Shen.

Mark

Bruno Deferrari

unread,
Sep 6, 2022, 11:06:09 AM9/6/22
to qil...@googlegroups.com
Ok, the problem is that the optimized `pr` override is buggy and doesn't respect *hush* like the default implementation. I will push a new release with the fix soon.

Bruno Deferrari

unread,
Sep 6, 2022, 12:34:29 PM9/6/22
to qil...@googlegroups.com
You can try: https://github.com/tizoc/shen-scheme/releases/tag/v0.25.5

Btw, there is a command line flat "-q" that sets hush to true before continuing with the following steps (but you have to set it to false again somewhere in the code):

shen.exe eval -q -l init.shen -r
--
BD

Bruno Deferrari

unread,
Sep 6, 2022, 12:36:30 PM9/6/22
to qil...@googlegroups.com
These are the accepted commandline options btw:

commands:
repl
Launches the interactive REPL.
Default action if no command is supplied.

script <FILE> [<ARGS>]
Runs the script in FILE. *argv* is set to [FILE | ARGS].

eval <ARGS>
Evaluates expressions and files. ARGS are evaluated from
left to right and can be a combination of:
-e, --eval <EXPR>
Evaluates EXPR and prints result.
-l, --load <FILE>
Reads and evaluates FILE.
-q, --quiet
Silences interactive output.
-s, --set <KEY> <VALUE>
Evaluates KEY, VALUE and sets as global.
-r, --repl
Launches the interactive REPL after evaluating
all the previous expresions.
--
BD
Reply all
Reply to author
Forward
0 new messages