On Thu, Jan 20, 2005 at 03:36:28PM -0700, Steve Wampler wrote:
> [EMAIL PROTECTED] wrote:
> Icon bytecode is rather high-level and the translation step is not
> that complicated.
That is true. By the way, I am in the process of adding to the
description of icont, which will go into the forthcoming
"Implementation of Icon and Unicon" compendium.
> Icon's goal-directed-evaluation model was implemented
> below the icode level
Yes, the backtracking is all implicit in the bytecode; this translation
model cannot be supported by JVM or .Net.
> Doesn't the JVM version of Icon translate Icon into Java (not
> JVM bytecode)?
I think Jcon started out translating to Java source but may have been
modified to generate .class files directly. In any case, Proebsting's
1996 PLDI paper gives us the code generation model for JVM or .Net,
to handle the backtracking and goal-direction in explicitly generated
code on these platforms.
> it may take some thought (or blatant stealing from the jcon work...).
It is not stealing when we use ideas from research papers; one could try
to port jcon to .net directly, but presumably if that were easy or feasible
Proebsting would have done it.
> Co-expressions *may* also introduce some complexity.
Jcon presumably implements them using Java threads, and by the way,
I would like Icon/Unicon to have a posix thread implementation of
co-expressions as part of a default, portable implementation. The
native assembler co-expression switches should probably be retained
since they are much faster.
> I could of course take every
> icode instruction and transform it a (method) call in .Net into some
> library implemented in whatever language. This approach would suffer
> in performance, IMHO.
Yes, this sounds expensive.
> Does it not seem feasible to just "expand" icode instructions into
> lower-level bytecode instructions using the interpreter as a
> collection of "macros" producing the bytecode?
That would be another approach, but Proebsting's model appears more
attractive because it solves the primary semantic problem. I guess
this implementation approach is not mutually exclusive to Probsting's
model.
> feeling of how complex it is to compile Icon code into (a) icode or
> (b) .Net bytecode.
So the answers were (a) easy and (b) non-trivial but Sudarshan has done
some preliminary examination of this topic and it appears quite feasible.
> support creation of Icon procedures at run-time.
> Has anyone implemented this?
No. This would be a major addition to the language, and would be "way cool".
> It seems that would require linking the
> icont into the iconx, and allowing icont code to create (and garbage
> collect) procedures dynamically in the iconx.
ProIcon for the Mac had icont/iconx bundled together with a simple IDE,
all in a single executable.
If the load() function were extended to allow newly loaded code to be
linked into the current program, that would be a valuable start in the
direction you are headed.
> An alternative would be to create an Icon translator from scratch,
> implementing it in Icon itself and then exporting the translator
> through the IPL. For that I could probably re-use the Unicon
> preprocessor code (with {u,i}code generation instead of plain Icon)
> And experiences here?
This past semester my graduate class examined icont's code generator
and I concluded that it would not be hard to migrate the itran portion
(that generates .u files) into the Unicon translator. The tree traversal
to generate code just isn't that complicated. The linker code
(ilink) would be somewhat more work to reproduce. I thought about
merging it into iconx, if we can't get rid of it entirely. But, all
this is vaporware and pipe dreams.
Good luck with your ideas; I certainly encourage you to break the big
goal into small, do-able pieces, and then share the results with us. :-)
Cheers,
Clint
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group