mailing-list for TeXmacs Users

Text archives Help


Re: Reference counting in TeXmacs


Chronological Thread 
  • From: Stéphane Payrard <address@hidden>
  • To: address@hidden
  • Subject: Re: Reference counting in TeXmacs
  • Date: Wed, 11 Jun 2003 14:45:26 +0200

On Tue, Jun 10, 2003 at 07:44:50PM -0400, Leo wrote:
> Salman,
> please, read some tutorial texts on reference counting.
> Scott Meyers "Effective C++" and "More Effective C++" should help.
> You obviously do not understand the concept of object sharing
> and multiple references. In regard to couple of your previous emails,
> a little bit of tolerance and more friendly attitude would help.
>
> --Leo--


I should probably shut up because I am not an active contributor
because I disagree about coding style and still waiting that
Joris publish an API so one can use TeXmacs as a library.
but here is my 2 cents anyway.

1/ Reference counting is a dog on modern architecture. For many reason
it trashes the cache. One may criticize the current implementation,
but the underlying problem in not an implementation one but an
architectural one. Reference counting is to be avoided on modern
architectures. It also makes debugging more complex because on
has to step thru that code.

2/ I read all the litterature about C++ (Stroustrup, Meyers, Sutter,
Alexandrescu...) and my conclusion is that TeXmacs use of C++
is at best inadequate. Using it as Scheme leverage none of the
quality of either Scheme or C++. I wish Joris get his code audited
by an C++ authoritave code... He will probably hear stuff that
David Allouche and some other people has already touche.


3/ I hope that Joris will someday act as an architect by publishing
specs and let more leeway to people proficient in C++ for pure
question of coding. Joris has obviouly put a lot of thought
in the issue of interactive typesetting and in this respect
TeXmacs is a complete success and probably a unique one in
the Open Source field. If it was not so I would not be reading
that list or TeXmacs dev.

--
stef



>
>
> On Tuesday June 10 2003 21:50, Salman Khilji wrote:
> > Following up my previous post, I am looking at the reference counting
> > mechanism. I suppose I am neglecting something because I fail to
> > undersand one thing.
> >
> > Teh reference count is incremented in the constructor and the equality
> > operator and decremented in the destructor of abstract_struct and
> > concrete_struct.
> >
> > When the reference count drops to 0, the object in question is deleted.
> > Why do we do this? Notice that to decrement the reference, the
> > destructor must be called. The only way to call the destructor is to
> > call delete on the object. If you have to delete to object by calling
> > delete on the object, then why have reference counting in the first
> > place?
> >
> > I am thinking about that for "my own copy" of TeXmacs, I would get rid of
> > basic.hh and remove all the reference counting mechnism. Would I break
> > anything by doing this? basic.hh has lots of preprocessor generated code
> > some of which I haven't looked at close enough. But I think getting rid
> > of macros like "CONCRETE_NULL" would definitely make the code easier to
> > understand.
> >
> >
> >
> > Salman
>



Archive powered by MHonArc 2.6.19.

Top of page