[Hugs-users] Hugs Extension Proposed: Introspection Patch (p. 2)
Dimitry Golubovsky
dimitry at golubovsky.org
Sat Sep 25 22:47:15 EDT 2004
This message has been split into two because of 5 kb message size
limitations.
(continued)
interns.c anso has undergone serious changes. Most of the introspection
primitives return values of certain fields of Hugs' storage objects
wrapped as Integers, and the rest of processing is done in Interns.hs.
In storage.[ch] along with new fields in Hugs object structures I
changed the way internal variables are named. I implemented per-module
internal variables counters, and now names of those variables are stored
in the same way as regular variables' names. This is the most
unfortunate part because strings table size grew significantly: I had to
increase the setting in prelude.h for NUM_TEXT 10 times to be able to
compile fptools. The reason for this change: I need those internal
variables' names to be independent of the order modules are compiled,
and of the number of modules compiled. I do not see the immediate
solution of this problem. One possible solution might be to use the old
way for variables that are not exported, and the new way for those
exported (like implementations of instance methods and instance
builders, but not every lifted lambda or supercombinator).
Here are things I have not done yet or do not exactly understand how to
implement them.
These include kinds (I only use them to get arity), functional
dependencies (I do not understand how the graph is structured), RANK2
(same reason).
My final goals are to make it possible for a Haskell program to access
information sufficient:
a) externalize the Hugs' compilation results to be able to use them with
alternative runtime
b) create an external format for Hugs compilation results, so they might
be loaded into Hugs and simulate the situation as Hugs has just compiled
the source (i. e. how it is done in Java or Python).
I would like to get feedback form the Hugs users community whether there
is any interest in such an extension.
PS As an example of using these primitives, I have written an
experimental web-based application, "Hugs Insider":
http://www.golubovsky.org/software/hugs-insider/article.html
which allows to enter some Haskell code, and then runs a cross reference
generator over bytecodes and other parts of Hugs storage (written in
Haskell).
Dimitry Golubovsky
South Lyon, MI
More information about the Hugs-Users
mailing list