语言

Menu
Sites
Language
Is it possible use C++ for development

Hi,

Tizen SDK v2.3 has C++ compiler and IDE supports C++. I wrote appplication with C++ classes and it works well. 
But the release notes "https://developer.tizen.org/ru/tizen-2.3-sdk-release-notes" in the "Native Framework" section contains text:
"The primary development language for native applications has changed from C++ to C. However, the C++ standard library has been provided as an open source library, so C++ can still be used to create the application logic that does not use any Tizen platform features". This sentence raises some doubts...

So I would like to clarify situation with C++. Could you please answer on the following questions?
- Is it allowed to use C++ to create native applcation? 
- Is it allowed to use Tizen platform features from C++ code?
- Is it allowed to use C++ compiler even C++ classes is not used?
- Is it planned to remove C++ support (IDE/compiler/standard library) from Tizen SDK in the next releases?

 

Thank you in advance,

Dmitry

查看选择的答案

响应

13 回复
John Ixion

Hi Dmitry,

C++, Lua, Python, Rust and OCaml will be supported: https://wiki.tizen.org/wiki/EFL_Tutorials

John Ixion

more info here: https://phab.enlightenment.org/F13970

Dmitry Vasin

Hi Olivier,
Unfortunately I did not find out answers on my questions at these links:

 "//wiki.tizen.org/wiki/EFL_Tutorials" it is just a tutorial 

"//phab.enlightenment.org/F13970" leads to empty presentation without any significant information

Could you please check that these links are correct? 

 

Thanks,

Dmitry

John Ixion

click on download file https://phab.enlightenment.org/F13970

Dmitry Vasin

I look at the "eo_devday_na_15.pdf" document. It just meniones that EFL developers do not like C++ (without any explanation) and further generators in core EFL will support C++...

Alex Dem

Hi,
According to my understanding: Are you fear that C++ usage could be declared deprecated in futher Tizen releases and C++ support could be cancelled at all?
And you need to get confirmation: will C++ be supported in Tizen or not?
Alexey.

Dmitry Vasin

Yes. Absolutely right.

daniel kim

Hi,

I would recommend you to send your question to the mailing list as below.

  https://lists.tizen.org/listinfo/application-dev

Regards,

John Ixion

the forum has replaced this mailing list, which should be deleted btw

daniel kim

Hi,

I would recommend you to develop your native application by C as C++ is not allowed to be used in Tizen 2.3( I couldn't find the way to add&compile C++ code in the tizen project) and I found that EFL has the C++ binding but there was no details about it anymore.

As per this link(page 21), there is no posibillty to make a code by C++ so far. pleaes refer to this.

   http://download.tizen.org/misc/media/conference2014/slides/tdc2014-core-object-model-eo-efl.pdf

Regards,

Dmitry Vasin

Hi Daniel,

In the first post I wrote that latest SDK supports C++: it is possible to create cpp files, build project, invoke EFL functionality and run application on emulator and device; also SDK includes C++ standard library ... Could you please list issues that can be raised in case of C++ usage?

 

Thank you for useful presentation.
The #21 slide mentioned that EFL will not be ported to C++. Does it mean that EFL cannot be used in C++ classes at all?
If yes it would be nice to know the reason why EFL functionality cannot be used... In my understanding it is a C library and I do not know reason why C function cannot be invoked inside C++ code...

 

Mark as answer
Carsten Haitzler

Those presentations are talking about features to come in the future for Tizen. Not Tizen 2.3. They detail that EFL is a C library - we don't like ot use C++ ourselves (much like the Linux kernel)  and are not going to go port EFL to C++ just to make C++ developers happy (as some people keep saying we should). This would instantly alienate all developers sticking to C (including ourselves) and be a huge amount of work with lots of consequences. The reverse is not true though. A C++ app or library can use C functions all it likes (how do you think malloc, printf, open, etc. work from C++?). This is why it does not seem much of an issue as this keeps the APi available to both C and C++ (where a C++ API is only available from C++ - half the language space).

The same is true of EFL. All the EFL C APIs are available to C++ apps or libraries to use as they see fit. Same for all the other Tizen Native APIs. This is the case in Tizen 2.3 (and has been for a long time). As detailed, we recognize that developers like to use other languages than C (not just C++ but Javascript, Lua, Python etc.) and we don't want to continue, forever, to force our choices of language on them.

Thus at a FUTURE point (the infra and code are being worked on ad already working now actually and that is what that presentation is talking about - you want to be AT the conference and attend to get the context - slides are for the purposes of outlining points, not being a detailed document) we will have both a C, and C++ API, where the C++ API looks and feels like native C++ with templates, classes and so on. So THEN you can stop using the C APIs exposed and use C++ APIs then exposed - if you want.

We are also doing work to support Lua, Javascript and even looking into Python support. The bindings are auto-generated from an IDL system that is designed with these languages in mind, as well as what EFL has as core features (like every object having event callbacks). The nice thing is that the same classes, methods, callbacks, etc. appear the same in all languages so you can understand how to do something in your chosen language even if you read documentation with examples for another language. It also saves lots of manual binding work which is boring, slow, and error-prone.

How much of this appears in Tizen in future and when depends on how much we get done, by when, and other Tizen platform constraints and decisions. So you are safe to use C++ for your application - no problems. In future you could switch to using a C++ when that happens (the way it is done actually allows you to mix-and-match the C object API and a C++ one too).

 

So your questions with direct answers:

- Is it allowed to use C++ to create native applcation?  - YES

- Is it allowed to use Tizen platform features from C++ code?- YES

- Is it allowed to use C++ compiler even C++ classes is not used? - YES

- Is it planned to remove C++ support (IDE/compiler/standard library) from Tizen SDK in the next releases? - NO

Dmitry Vasin

Hi Carsten,

Thank you very much for detailed explanation.