
Hi there, Is it possible to set all/some Prelude modules to untrusted in Hat? (So I can see exactly what calls what) Thanks, Kate

Kate Krastev
Is it possible to set all/some Prelude modules to untrusted in Hat? (So I can see exactly what calls what)
In src/hatlib/Makefile, search for occurrences of the flag '-trusted' and delete them. Then you need to recompile the Hat prelude and libraries from scratch (make clean; make hat-lib) and re-install. Regards, Malcolm

On Wed, 2005-07-13 at 09:56 +0100, Malcolm Wallace wrote:
Kate Krastev
writes: Is it possible to set all/some Prelude modules to untrusted in Hat? (So I can see exactly what calls what)
In src/hatlib/Makefile, search for occurrences of the flag '-trusted' and delete them. Then you need to recompile the Hat prelude and libraries from scratch (make clean; make hat-lib) and re-install.
If you don't call too many Prelude functions then a _possibly_ cheaper solution is to just duplicate the code for Prelude functions which you /do/ use. Put them in some dummy module if necessary and import them instead (maybe hiding the Prelude imports if you don't want to rename them). This gets a bit messy (nigh impossible) when you want to see calls made to derived instances of type classes, but you may not need that level of sophistication. Cheers, Bernie.

On Wed, 2005-07-13 at 09:56 +0100, Malcolm Wallace wrote:
Kate Krastev
writes: Is it possible to set all/some Prelude modules to untrusted in Hat? (So I can see exactly what calls what)
Buddha has the same problem. One idea that was floating around in my head was to supply trusted and untrusted versions of all the standard libs, and disambiguate them using the hierarchical module namespace. For instance you might have a Trusted hierarchy and a Suspicious hierarchy. Then it is up to the user to import one or the other. The default would be to make standard libs as trusted of course. I don't know how this all fits into the brave new world of packages and so on, since I'm a little bit behind on that regard. Cheers, Bernie.

Bernard Pope
Is it possible to set all/some Prelude modules to untrusted in Hat?
Buddha has the same problem.
One idea that was floating around in my head was to supply trusted and untrusted versions of all the standard libs, and disambiguate them using the hierarchical module namespace.
It would probably be easier to just make two separate object archives, one trusted, one suspect, then use a compile-time flag to decide which one to link against.
For instance you might have a Trusted hierarchy and a Suspicious hierarchy. Then it is up to the user to import one or the other.
I don't think it is a good idea to ask the user to modify their own code - they might introduce a new fault, or accidentally mask the one they were trying to investigate. Regards, Malcolm

On Wed, 2005-07-13 at 13:18 +0100, Malcolm Wallace wrote:
Bernard Pope
writes: One idea that was floating around in my head was to supply trusted and untrusted versions of all the standard libs, and disambiguate them using the hierarchical module namespace.
It would probably be easier to just make two separate object archives, one trusted, one suspect, then use a compile-time flag to decide which one to link against.
Yes that is a better idea, and it saves on potential re-compilation. Thanks, Bernie.
participants (3)
-
Bernard Pope
-
Kate Krastev
-
Malcolm Wallace