Re: [TCLCORE] Cloverfield references (was Re: Variable access)
by fbonnet other posts by this author
May 21 2008 2:58AM messages near this date
Re: [TCLCORE] Cloverfield references (was Re: Variable access)
|
Re: [TCLCORE] Cloverfield references (was Re: Variable access)
Hi David,
David Welton wrote:
> For those wishing to play around with something, I think that Hecl is
> in some ways a bit simpler and easier to hack than Tcl, and might be a
> fun sandbox for people. Hecl currently has references, as we wanted
> to be able to handle references to Java objects without using a hash
> table to look them up.
I've had a look at Hecl a while back and I think it works remarkably well.
Contrary to Cloverfield, which keeps Tcl's copy-on-write semantics, Hecl
uses references exclusively, as does Java, so it shifts away from Tcl
semantics (for example, [incr $i] increments variable i, and [list $a $b
$c] is a "live" list), but this totally makes sense since it's closely
tied to Java. However I remember that an early version allowed both
values and references, the latter using an ampersand instead of a
dollar. Can you confirm this?
My goal with Cloverfield is to keep the existing Tcl semantics
(copy-on-write, pass-by-value) while adding references. This implies
that the string rep of a structure holding references may change over
time. This would be grossly inefficient if the whole string rep had to
be recreated over and over again, especially for large structures, so we
need an efficient string representation that allows for selective
invalidation of substrings. Unfortunately Java doesn't seem to be
suitable for this task because of its everything-is-an-object,
all-reference approach: locality of reference is poor and would kill the
performances in this critical part of the implementation. That is why I
plan to build the reference implementation from scratch using either C
or (sanitized) C++, the primary runtime target being the LLVM
infrastructure. However Java is a very likely secondary target because
of its ubiquity. The string representation I have in mind is based on
immutable, constant strings, so this is a good match with the Java model.
I'll take a look at the Hecl code base to see whether it can make a
suitable experimental testbed. Having a prototype implementation of
Cloverfield references would certainly help people grasp the concept and
eliminate the design errors.
Cheers, Fred.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tcl-Core mailing list
Tcl-Core@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-core
Thread:
fbonnet
fredericbonnet
Neil Madden
fbonnet
Neil Madden
fbonnet
Lars Hellstrom
fbonnet
Neil Madden
fredericbonnet
David Welton
fbonnet
David Welton
Larry McVoy
Alexandre Ferrieux
Andreas Leitgeb
fbonnet
Neil Madden
Donal K. Fellows
Alexandre Ferrieux
Larry McVoy
Neil Madden
Gustaf Neumann
Neil Madden
Larry McVoy
Neil Madden
Alexandre Ferrieux
fbonnet
Neil Madden
Alexandre Ferrieux
Donal K. Fellows
Larry McVoy
Alexandre Ferrieux
Donal K. Fellows
Alexandre Ferrieux
|