corinthia-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian C <...@amham.net>
Subject Re: C99 versus C++ (limited)
Date Mon, 10 Aug 2015 12:26:50 GMT
Hi all,

my day job is as a C++ programmer, I was finding it quite refreshing
to go back to straight C.
In some respects it is easier.

I think we need to look at whether there really are any major benefits
to using one over the other with respect to the goals of Coriinthia,
not as a flame war like debate on the merits of a given language.

However, I am not sure that I can clearly identify the goals well
enough to give a considered opinion.

Thinking aloud ...

Corinthia takes an input document (ignore the type for the moment) and
converts/represents it in its own tree structure, The DF nodes. Which
are then aimed at an HTML form to be displayed/edited.

After an edit the HTML document is converted back to its DF node form
and either merged into the original as an edit or saved in it entirety
in a new form?

At least that is how I think of it.

The internal DF nodes lend themselves to being C++ objects, but I
think the way they currently implemented is more than adequate. So
what do we gain there?

The transformation of OOXML, ODF, Latex, HTML or whatever into the DF
nodes is basically a mapping exercise. As is the reverse. Do we gain
if that is done in C++? I can think of automatically generating
classes for the DOM nodes as the ODF Toolkit does for Java. That may
provide a way to create a more comprehensive and measurable mapping?
But we could just as easily generate C code too? I can even envisage a
kind of higher level mapping definition language to describe the
mappings and then the majority of the thing could be automatically
generated? That would be some task though.

So I go around in circles with no conclusion....

What do OO languages provide.... abstraction, inheritance,
encapsulation, interface management. Do we need all of that ... we can
and do to some extent create C modules that model that. I suspect we
may be able to make the lens functions a bit clearer in C++?

Ok, I'll stop driveling now....

Does the possible editor have any influence on the language choice? If
we choose X will it align more easily with....???

Ok really stopping now.... :-)



On Mon, Aug 10, 2015 at 7:57 PM, Harry Bachmann
<harry.bachmann@powerapp.eu> wrote:
> Hi
>
> I spend some time and tested a little C99 versus C++ on the Arm-Core and found out C99
makes some times much better code.
>
> Hope this Helps ;-)
>
> rgs
>
> Harry
>> Am 10.08.2015 um 19:26 schrieb jan i <jani@apache.org>:
>>
>> Hi
>>
>> Peter and I talked the other day and among others about the benefits of
>> using C++ instead of sticking to C99.
>>
>> This would be a major change in the project (less in the code, more in the
>> "how to"), and it is
>> not something we should "just" do.
>>
>> I favor C++, but not unlimited, I see 2 places where C++ can give us more
>> stable code:
>> - Interfaces.
>> Using classes to group our functions (like e.g. platform, core, filters/odf
>> etc.),
>> would make it very clear where the function originates. It would also allow
>> group global variables that are private to the rest of the world.
>> I would not use real interface classes, for our internal grouping, that is
>> not needed. But e.g. the DocFormats API should be a real interface class
>> - Automatic.
>> At the moment we have a lot of code managing construction/deconstruction,
>> that could be totally automated by use of C++ smart pointers.
>> - Object model (filters, flat and core)
>> would be more logically represented as objects, and suddenly copying etc.
>> would be a lot easier.
>>
>> I would not like to see big inheritance (especially not multiple
>> inheritance).
>>
>> I fail to see what we loose by making the change, but please give your
>> opinion.
>>
>> rgds
>> jan i.
>>
>> Ps. This is in no way a vote thread, but simply a way to gather opinions.
>



-- 
Cheers,

Ian C

Mime
View raw message