|
From: Cucinotta T. <cuc...@ss...> - 2007-01-19 23:39:36
|
Hi,
I just created a ML for the project and filled up the SF
cvs with some contents. I'm curious to hear these ideas
from your side.
Bye,
T.
On Thu, 18 Jan 2007 10:27:26 -0500
Wei Dong <wd...@Pr...> wrote:
>Nice to hear from you. The proposed syntax is pretty
>nice and I kind of have some idea about how encapsulation
>is realized. Waiting for more materials to appear in
>sourceforge.
>
>Thank you very much.
>
>- Wei
>
>Cucinotta Tommaso wrote:
>> Hi Wei,
>>
>> I'm just getting impressed from the fact of seeing a
>>potential
>> interest for the project before I actually knew it had
>>been approved
>> in the SF workflow.
>>
>> On Wed, 17 Jan 2007 12:57:31 -0800
>> "Wei Dong" <wdo...@us...> wrote:
>>
>>> finally come up to you project page. Are there any
>>>working
>>> source code available so far?
>>
>> Some. I have various reusable components which I'd like
>>to refactor
>> with a uniform API, especially with a generic API
>>(template-like),
>> through a heavy use of macros. Not really sure the macro
>>paradigm is
>> preferrable to the "void *" one, but I'd like to
>>experiment with it in
>> this project.
>>
>> Summarizing:
>> - queue
>> - synchronized queue
>> - debugging (with levels and the sort)
>> - array-based heap
>> - array-based quick-extractable heap
>> - tree-based heap
>> - exception handling
>>
>> Aim of the project: reaching a full-featured set of
>>commonly needed
>> functionality: containers, synchronized and non,
>>monitors/condition
>> vars (pthread-based), debugging, OO-typing, exceptions,
>>safe memory
>> management (leakages detection), ...
>>
>> Just an idea of the syntax, here is my heap sample
>>usage:
>> (from aquosa.sf.net LGPL license):
>>
>> #include "oml_heap.h"
>>
>> oml_define_heap(int, int); // template-like syntax
>>
>> #define HEAP_BITS 3
>> #define HEAP_SIZE (1 << HEAP_BITS)
>>
>> oml_heap_t(int, int) h;
>> rv = oml_heap_init(&h, HEAP_BITS);
>> rv = oml_heap_add(&h, 4, 20);
>> rv = oml_heap_get_min(&h, &k, &v);
>>
>> I'd like to exploit as much as possible GNU C extensions
>> in GCC, especially for macros, in order to attain a nice
>> syntax (I'm suspecting nested functions will help me
>>with
>> synchronization primitives, as an example).
>>
>>> I'm writing programs in C and am unhappy with the fact
>>>that
>>> there's not a good "template" library available.
>>
>> Agree of course.
>>
>>> Personally
>>> I find the "/sys/queue.h" is a good model to implement
>>> general data structure algorithms, and I'm thinking of
>>> implement some data structure (heap) that I need in that
>>> way.
>>
>> Not bad, even if arrays and queues are the most trivial
>> things to do. I see the focus is on embeddable
>>structures,
>> which are invasive on your data structures (ala
>>include/linux/list.h),
>> I'd prefer to
>> focus on a non-embeddable API, and see the capability of
>> providing an embeddable node as an add-on. API should
>>not have names
>> of structure fields used as params, IMHO, unless I'm
>>writing macros
>> for serialization.
>>
>> I love encapsulation, and I'd never have smth. like you
>> can see on the man page of sys/queue.h:
>>
>> for (np = head.lh_first; np != NULL; np =
>>np->entries.le_next)
>>
>> which is accessing internals of LIST and TQ macros.
>> Iterator should be completely abstracted; data type
>>should
>> be completely opaque to the programmer (cmp Java JCF).
>>
>>> I just don't want to waste my labor if there's already
>>> such code available. I'll also by happy if there's a
>>> project which I can contribute my code to.
>>
>> I'd be happy too if I had a contributor.
>>
>>> I also found an other library called sglib, which I
>>>think
>>> might have similar goal as OML. It's homepage is at
>>
>> So it seems. Doesn't seem to have been maintained for a
>>while. I'd
>> like to focus on synchronization and "portable"
>>kernel-level /
>> user-level code. Seems out of the scope of sglib.
>>
>> Bye,
>>
>> T.
>
|