On Mon, Dec 11, 2023 at 02:35:06PM +0100, Ralf Hemmecke wrote:
> If I have a word to say...
>
> I definitely want ")read ..." and systemCommand("read ...) behave exactly
> the same. I used systemCommand only, because there I can programmatically
> specify the file to read.
Well, hopefully we agree that 'systemCommand' in
systemCommand("read ...)
and
a := 1; systemCommand("read ...); a := 2
should behave "the same". This forces some differences, for
example normal system command return no result, while FriCAS
functions including 'systemCommand' return a value. This
value is trivial, but it causes extra printout:
Type: Void
When ')set messages time on' is active timing system behaves
differently:
(1) -> )set messages time on
(1) -> )version
"FriCAS 2023-06-17 compiled at Mon Dec 4 23:24:12 UTC 2023"
(1) -> systemCommand("version")
"FriCAS 2023-06-17 compiled at Mon Dec 4 23:24:12 UTC 2023"
Type: Void
Time: 0 sec
I used 'version' above, but after fixing problem with skipped
statements similar thing will apply to 'read': plain system
commands are not subject to timing, while using 'systemCommand'
we have ordinary FriCAS statement which is timed. Closest
to "the same" probably would be recursive timing: suspending
timing of 'systemCommand' during actual execution of 'read',
timing expressions executed by 'read' like now (that is
each separately) and restarting timing of 'systemCommand'
after 'read' has finished. One can argue that timing
of 'systemCommand' does not mater much, but as you have
shown 'systemCommand' may be part of bigger expression
which should be timed as a single unit.
> Since also interpret_block popped up... yes, it is the question whether one
> wants to time each individual command or the whole as a block.
>
> How about having "timing each individual command" by default? That means
> that each time the REPL is completed, the stats are printed.
Do completition of expression in 'interpret_block' count as
"REPL completed"? One interpretation is that 'interpret_block'
is just a part of bigger expression and only when this bigger
expression is done "REPL is completed". But if you want to
use 'interpret_block' do get a kind of copy of FriCAS repl,
than it looks that each toplevel epression executed by
'interpret_block' counts as "REPL completed".
> Additionally, we could have something like
>
> )start-cumulative-statistics
>
> which wouldn't print any individual statistics, but rather sum the stuff
> until it reaches
>
> )print-cumulative-statistics
>
> for an intermediate output and
>
> )stop-cumulative-statistics
>
> for stopping the stats-taking and printing it?
Possibly. We could have extra argument to 'interpret_block' and
similar routines to decide how timinig is handled. The question
still remain: is such an argument worth enough to implement?
If no we should make sane rules how timing behaves. If yes we
still should have reasonable default behaviour.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/ZXcwTDqbMm2xTEWy%40fricas.org.