Any issues with C in Sugar and XO?

Bert Freudenberg bert at freudenbergs.de
Sat May 8 14:27:30 EDT 2010


On 08.05.2010, at 11:12, Chris Ball wrote:
> 
> Hi,
> 
>> Hey, I am wondering if there are some major issues or technical
>> problems that doesn't make Sugar compatible with C. For example,
>> if a program is written in C, are there going to be at least some
>> complications with running it?
> 
> No.  Several activities are currently written in C, although most
> (e.g. Browse and Abiword) have a small Python wrapper sitting on top
> of the C code.
> 
>> Can we run the program after installing gcc, but I don't think
>> gcc would be easy to install in it, will it?
> 
> You do not need to install gcc to run a C program.  gcc's just a
> compiler, not a runtime library.
> 
>> So, one more question, please - What are the consequences and
>> effects on performance of a C program as compared to a Python
>> program?
> 
> The largest consequence is that you lose access to our python
> libraries for the datastore and collaboration, which affects how
> integrated your activity will be with the rest of Sugar.  You can
> work-around this by speaking the dbus protocols that we use from C
> directly, but this is by no means trivial.

Not trivial, true, but not exactly rocket science either :)

Pure C might be a bit cumbersome, but by using something like glib to speak to DBus I'd think it is quite possible to keep the effort reasonable.

Have a look at the stuff you need to implement:

http://wiki.sugarlabs.org/go/Development_Team/Low-level_Activity_API

This could be made into a library, basically a Sugar toolkit implementation in C.

- Bert -




More information about the Devel mailing list