Is there any way to convince PolyML to stop reporting startup information?
For example, I created a child database, and overrode the "onEntry" method per the FAQ to call my "hello world" function. If I run, I still get lots of helpful data about PolyML:
brent@hopper:/opt/shootout/shootout/bench/hello/tmp$ poly hello.test_dbase Poly/ML RTS version I386-4.1.3 (23:03:15 Oct 2 2004) Copyright (c) 2002 CUTS and contributors. Running with heap parameters (h=10240K,ib=2048K,ip=100%,mb=6144K,mp=20%) Mapping ./hello.test_dbase Mapping /usr/lib/poly/ML_dbase Poly/ML 4.1.3 Release hello world The standard function is OS.Process.exit
I add a new runtime option "-q" for quiet, to silence some of the output (by adding some "if (! be_silent) { proper_printf.... }" stuff):
brent@hopper:/opt/shootout/shootout/bench/hello/tmp$ poly -q hello.test_dbase Poly/ML 4.1.3 Release hello world The standard function is OS.Process.exit
This works a bit better, but it looks like the "startupFn" still wants to report it's release value. Can I override this somehow when creating my child database?
Also, can I get PolyML to stop reporting "The standard function is OS.Process.exit" when I call "PolyML.quit()" ?
Thanks,
-Brent
The attached patch adds a couple of flags to the poly driver program:
-q = "Quiet Mode", which just silences some of the self-reporting. -v = "Version", prints the version information and exits.
To get things to work the way I wanted, I had to modify the ML sources and rebuild my Database. This obviously works, but it would be much cleaner if I could somehow do this "on-the-fly".
If I could override the "startupFn" in the INITIALISE_ struct, I think this would work, but it doesn't seem to be accessible from a running system.
Thanks,
-Brent
<driver.diff>
Brent, Thanks for the various patches. I've included them in my CVS version. I wonder if the easiest way to silence the messages from the ML part would be to have the ML call a function in the RTS (driver) to find out whether the "quiet" switch had been set. It should be fairly easy to add.
David.
Brent Fulgham wrote:
The attached patch adds a couple of flags to the poly driver program:
-q = "Quiet Mode", which just silences some of the self-reporting. -v = "Version", prints the version information and exits.
To get things to work the way I wanted, I had to modify the ML sources and rebuild my Database. This obviously works, but it would be much cleaner if I could somehow do this "on-the-fly".
If I could override the "startupFn" in the INITIALISE_ struct, I think this would work, but it doesn't seem to be accessible from a running system.
Thanks,
-Brent
Brent Fulgham wrote:
Also, can I get PolyML to stop reporting "The standard function is OS.Process.exit" when I call "PolyML.quit()" ?
Use "OS.Process.exit OS.Process.success". I didn't want to remove PolyML.quit completely but once there was a standard basis function to do the same job it seemed unnecessary to keep a non-standard function. I guess PolyML.quit is shorter to type. Does anyone have any feelings either way?
David.
--- David Matthews wrote:
Brent Fulgham wrote:
Also, can I get PolyML to stop reporting "The standard function is OS.Process.exit" when I call "PolyML.quit()" ?
Use "OS.Process.exit OS.Process.success".
I did try this, but unfortunately the signature for the "onEntry" function wants a return value of {}, while the OS.Process.exit method returns a success status.
Furthermore, if you do exit the process using the OS.Process.exit function, you get additional runtime system output:
" Warning: The type of (it) contains a free type variable. Setting it to a unique monotype. "
This would also be nice to silence in "quiet" mode.
I didn't want to remove PolyML.quit completely but once there was a standard basis function to do the same job it seemed unnecessary to keep a non-standard function. I guess PolyML.quit is shorter to type. Does anyone have any feelings either way?
I would prefer to use the basis function. But some of the PolyML plumbing needs to be changed slightly to allow this to happen (as I described above).
Thanks,
-Brent