cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
AAbel
Observer
Observer
563 Views
Registered: ‎07-09-2020

C or C++? Xilinx Vitis

Hello, 

 

I read and read and I didn't find any information that says C is better to use because it's the preferred language for embedded systems. I am not quite sure why I should chose C or C++.

Does anyone know why I should chose C over C++ or the other way around? 

 

Thank you for your time.

Tags (3)
0 Kudos
3 Replies
harahika
Participant
Participant
509 Views
Registered: ‎10-17-2019

Hi,

The choice depends on a lot of factors, e.g. what is your and your team's competency in either language and specifically in the embedded space? What is the application domain? You can get a lot of subjective and more or less educated opinions on the language choice.

I'm not a user of Vitis, but rather 2019.1 SDK, but in that version all the example code is in C. For C++, only empty application template. Support for C seems better in that sense. That may be a thing to note if the platform is new to you.
The toolchain's are modern enough to support both well.
There are some gotchas to both languages and their efficient use.
Also, if you plan for it, the two languages also mix pretty well and you can build nicer abstractions over C based foundations. This is the approach I tend to go for and work in C++ when I can.

This is just my 2 cents. I think the competency and need of support are the important factors to clarify here.

BR,
Harri
AAbel
Observer
Observer
479 Views
Registered: ‎07-09-2020

Hello @harahika,

 

Thank you for the response. 

Well, I am looking into embedded space. 

As for that I am not sure what exactly to choose. This could be either C or C++, but to say one is more appropriate than the other I have no idea. Any ideas or facts can really help me to educate myself?

Thanks!

0 Kudos
harahika
Participant
Participant
447 Views
Registered: ‎10-17-2019

Hi again,

By looking into embedded space, what do you mean? Do you have any background in programming for embedded / resource-constrained devices? I would say that Xilinx platforms are not very beginner friendly as you have to manage the hardware platform dependency as well.

Any embedded system programming course or material will probably cover topics in C. For complete beginners, something like AVR/Arduino hobbyist stuff might ease the learning curve to embedded C/C++. Maybe familiarize yourself with the field and get a feel for yourself.

BR,
Harri
0 Kudos