texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Bigloo?


From: Gabriel Dos Reis
Subject: Re: [Texmacs-dev] Bigloo?
Date: 24 May 2004 20:04:04 +0200

David MENTRE <address@hidden> writes:

| Hello,
| 
| Joris van der Hoeven <address@hidden> writes:
| 
| > I discovered some other disadvantages:
| >
| > 1) It seems that the implementation relies on Boehme's GC,
| >    which we now know to behave badly in combination with TeXmacs
| >    (well, some further studies are going on, we'll see...).
| 
| I would not count that as a bad point for Bigloo (or any other scheme
| implementation using Boehm GC like Stalin). 
| 
| The problem with TeXmacs is the problem with languages like C/C++ that
| were not designed for the ground-up to interact with a GC.

Sentences like those are at best misleading and do not really shed
light on the core issues.

Free store is a very weird thing.

At the Adobe Technical Summit held in San Jose last month, Hans Boehm
made a really nice presentation on collectors and some language issues.   

It is not uncommon to hear claims that C-family languages cannot cope
with collectors; however, it remains also a fact that there are
various collector implementations around, used successfully in large
scale applications.

The best, cleanest, collector really depends on the target application.
In particular, it critically depends on the programming style adopted
and allocation pattern.  If for example, you're processing data that
have some "nesting scope" protocol, then usually, it might make sense
to release memory only when you're done with the toplevel node -- at
which point, you may no longer need the enclosed nodes. 

C has a very simple minded but effective collector built-in: The stack.
Create local variables; put your stuff in; when you're done, i.e. when
you exit the function, the memory gets automatically reclaimed.
Very efficient and clean.  
Next are pool allocators, whose startegies pretty much ressemble old
FORTRAN static arenas.  That may not be the cleanest strategy but
again, it is efficient.

I've seen Boehm's collector successfully used in large scale
application.  It may not be the best collector for TeXmacs, but again
I would suspect that that may have to do with some programming style.
But, if I were a TexMacs developer who care about memory, I would get
into contact with Boehm.  Also, I would consider some native styles,
as far as C++ is concerned -- or replace that with yoru favorite
language if you're using it as the implementation language.

| This is not
| the case for Scheme and I suppose the designer of the compiler has
| incorporated relevant assumptions in the compiler to make the GC work
| well.

usually, people who claim that C cannot cope with collectors have
their own languages running on top of virtual machines written either
in C or in C++, and furthermore dictate some programming styles.

| But if you want a good GC, take the one of OCaml, it is under LGPL. The
| only big issue is that this GC needs integer to be stored with bit 0 set
| to 1 (to avoid to mistake them for pointers). And of course, I doubt it
| could work with languages like C & C++.

-- Gaby




reply via email to

[Prev in Thread] Current Thread [Next in Thread]