You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Tim Ellison <t....@gmail.com> on 2006/02/13 18:07:56 UTC

[classlib] using cpp

The jaasnix natives are written to require the C++ compiler (at least on
Linux).  May I suggest that we stick with good old C?

The dependency only appears to be to the C++ JNI bindings, so the patch
is essentially:

sed -e's/jenv->\([^(]*\)(/(*jenv)->\1 (jenv, /' <jaasnix.cpp >jaasnix.c

and minor edits to fix up some declarations.

The resulting library is then only 75% the size it was before.

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Re: [classlib] using cpp

Posted by Alexey Petrenko <al...@gmail.com>.
Yep, agreed.

2006/2/21, Tim Ellison <t....@gmail.com>:
> yes, let me refine my position.
>
> I don't object to using the C++ language where it makes sense, e.g. to
> simplify things.  IMHO the jaasnix native code's usage is somewhat
> gratuitous, and results in a larger binary for no great benefit.
>
> If people want to use vanilla C++ features then sure, but we have to be
> mindful of portability problems that would be caused by the areas of C++
> that typically vary amongst implementations -- so dependencies on a
> particular STL, use of C++ exceptions / RTTI, etc. are all areas asking
> for portability trouble in the future.
>
> Regards,
> Tim

--
Alexey A. Petrenko
Intel Middleware Products Division

Re: [classlib] using cpp

Posted by Tim Ellison <t....@gmail.com>.
yes, let me refine my position.

I don't object to using the C++ language where it makes sense, e.g. to
simplify things.  IMHO the jaasnix native code's usage is somewhat
gratuitous, and results in a larger binary for no great benefit.

If people want to use vanilla C++ features then sure, but we have to be
mindful of portability problems that would be caused by the areas of C++
that typically vary amongst implementations -- so dependencies on a
particular STL, use of C++ exceptions / RTTI, etc. are all areas asking
for portability trouble in the future.

Regards,
Tim

Paulex Yang wrote:
> Instead of introducing this strict language rule, I suggest to consider
> this restriction case by case with some principles.
> 
> One of the principles should be that our codes can be easily ported to
> as many platforms as possible. Obviously ANSI C has  more compatibility
> on multi platforms and is much easier to support for platform provider
> than C++, and because we have few native codes in classlib written by
> c++ so far,  it's not a bad idea that we consider ANSI C as the first
> choice to implement native codes in classlib.
> 
> And of course, if someday in some cases, the implementation by C++ is
> obviously much better(elegant, simple, high performance, or anything
> else) than counterpart by C, so that the compatibility/complexity issue
> introduced can be ignored, I have no objection to use C++.
> 
> Mikhail Loenko wrote:
>> I'm OK with this change in the jaasnix.
>>
>> As for the whole classlib, I'm afraid that having such a strict
>> language rule at this
>> point might hold some potential contributors.
>>
>> Thanks,
>> Mikhail
>>
>>
>>
>> On 2/14/06, Tim Ellison <t....@gmail.com> wrote:
>>  
>>> Alexey Petrenko wrote:
>>>    
>>>> You suggest not to use C++ in Harmony at all?
>>>>       
>>> As Geir says elsewhere, I mean in classlib in particular.
>>>
>>> Regards,
>>> Tim
>>>
>>> -- 
>>>
>>> Tim Ellison (t.p.ellison@gmail.com)
>>> IBM Java technology centre, UK.
>>>
>>>     
>>
>>   
> 
> 

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Re: [classlib] using cpp

Posted by Paulex Yang <pa...@gmail.com>.
Instead of introducing this strict language rule, I suggest to consider 
this restriction case by case with some principles.

One of the principles should be that our codes can be easily ported to 
as many platforms as possible. Obviously ANSI C has  more compatibility 
on multi platforms and is much easier to support for platform provider 
than C++, and because we have few native codes in classlib written by 
c++ so far,  it's not a bad idea that we consider ANSI C as the first 
choice to implement native codes in classlib.

And of course, if someday in some cases, the implementation by C++ is 
obviously much better(elegant, simple, high performance, or anything 
else) than counterpart by C, so that the compatibility/complexity issue 
introduced can be ignored, I have no objection to use C++.

Mikhail Loenko wrote:
> I'm OK with this change in the jaasnix.
>
> As for the whole classlib, I'm afraid that having such a strict
> language rule at this
> point might hold some potential contributors.
>
> Thanks,
> Mikhail
>
>
>
> On 2/14/06, Tim Ellison <t....@gmail.com> wrote:
>   
>> Alexey Petrenko wrote:
>>     
>>> You suggest not to use C++ in Harmony at all?
>>>       
>> As Geir says elsewhere, I mean in classlib in particular.
>>
>> Regards,
>> Tim
>>
>> --
>>
>> Tim Ellison (t.p.ellison@gmail.com)
>> IBM Java technology centre, UK.
>>
>>     
>
>   


-- 
Paulex Yang
China Software Development Lab
IBM



Re: [classlib] using cpp

Posted by Mikhail Loenko <ml...@gmail.com>.
I'm OK with this change in the jaasnix.

As for the whole classlib, I'm afraid that having such a strict
language rule at this
point might hold some potential contributors.

Thanks,
Mikhail



On 2/14/06, Tim Ellison <t....@gmail.com> wrote:
> Alexey Petrenko wrote:
> > You suggest not to use C++ in Harmony at all?
>
> As Geir says elsewhere, I mean in classlib in particular.
>
> Regards,
> Tim
>
> --
>
> Tim Ellison (t.p.ellison@gmail.com)
> IBM Java technology centre, UK.
>

Re: [classlib] using cpp

Posted by Alexey Petrenko <al...@gmail.com>.
> > You suggest not to use C++ in Harmony at all?
> As Geir says elsewhere, I mean in classlib in particular.
I do not think that is good idea...
I agree that it's almost does not matter for JNI code. But C++ code
looks nicer there :)
But if native code will use some native class library this restriction
will make developers life much harder.

--
Alexey A. Petrenko
Intel Middleware Products Division

Re: [classlib] using cpp

Posted by Tim Ellison <t....@gmail.com>.
Alexey Petrenko wrote:
> You suggest not to use C++ in Harmony at all?

As Geir says elsewhere, I mean in classlib in particular.

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Re: [classlib] using cpp

Posted by Geir Magnusson Jr <ge...@pobox.com>.
I think Tim just meant in the native implementations for the 
classlibrary since we don't have any already, and that amount should be 
minimal relative to the rest.

As for Harmony as a whole?  I wouldn't think we'd need to ban any 
language in general, except for Pascal.

:)


Alexey Petrenko wrote:
> You suggest not to use C++ in Harmony at all?
> 
> 

Re: [classlib] using cpp

Posted by Alexey Petrenko <al...@gmail.com>.
You suggest not to use C++ in Harmony at all?