public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] kernel API
@ 2003-04-22 15:53 Koeller, T.
  2003-04-22 16:31 ` Grant Edwards
  2003-04-22 21:32 ` Jonathan Larmour
  0 siblings, 2 replies; 16+ messages in thread
From: Koeller, T. @ 2003-04-22 15:53 UTC (permalink / raw)
  To: ecos-discuss (E-Mail)

Hi,

the question of which kernel API is the one officially
supported has been discussed before. As I remember,
the result of all those discussions was that only the
C API, as defined in kapi.h, has the status of an
officially supported API, and using the C++ kernel
API directly is discouraged.

The way that kapidata.h and thread.hxx declare the
same things in different ways and require both
declarations to always be in sync contradicts just
about everything that is generally considered good
programming practice ;-) It is IMO an ugly kludge, error-
prone and has indeed caused the very problems one would
expect during the transition from gcc-2.x to gcc-3.x.

Now everyone programming for eCos has a C++ compiler,
and I am quite sure that a significant number of us
code their applications in C++ (at least I do). In
this case using the C API only complicates things; I
get additional overhead and the above-mentioned
problems, but no benefits at all.

For all the reasons listed above, I am raising the
topic again. My proposal is to award the status of
an officially supported API to the C++ kernel API, too.

tk
----------------------------------------------- 
Thomas Koeller, Software Development 

Basler Vision Technologies 
An der Strusbek 60-62 
22926 Ahrensburg 
Germany 

Tel +49 (4102) 463-390 
Fax +49 (4102) 463-46390

mailto:Thomas.Koeller@baslerweb.com 
http://www.baslerweb.com 



-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: [ECOS] kernel API
@ 2003-04-23  9:31 Koeller, T.
  2003-04-24  2:27 ` Jonathan Larmour
  0 siblings, 1 reply; 16+ messages in thread
From: Koeller, T. @ 2003-04-23  9:31 UTC (permalink / raw)
  To: 'Jonathan Larmour', Koeller, T.; +Cc: ecos-discuss (E-Mail)

The current C API appears to be a 1:1 mapping of the C++
interfaces onto C functions, it does not provide much
abstraction anyway. I also cannot see how it would do this.
Imagine a thread class were extended to require an additional
constructor argument. This could be hidden by the C API
function by changing cyg_thread_create() to provide a
default value for the new parameter, preserving te original
function signature, and adding a new function named
cyg_thread_create_ex() that takes an additional argument.
However, C++ provides much more elegant mechanisms to
achieve this without namespace pollution (arguments with
default values, overloading), so the 'abstraction' provided
by the C API would in fact make things more difficult, not
easier.

I do not want to overly stress this point. I will continue to
use the C++ API, as will others. I guess the probability of
the C++ interfaces being removed and replaced by something
entirely different is rather low anyway, so it is probably
not all that important...

tk
----------------------------------------------- 
Thomas Koeller, Software Development 

Basler Vision Technologies 
An der Strusbek 60-62 
22926 Ahrensburg 
Germany 

Tel +49 (4102) 463-390 
Fax +49 (4102) 463-46390

mailto:Thomas.Koeller@baslerweb.com 
http://www.baslerweb.com 




> -----Original Message-----
> From: Jonathan Larmour [mailto:jifl@eCosCentric.com]
> Sent: Tuesday, April 22, 2003 11:28 PM
> To: Koeller, T.
> Cc: ecos-discuss (E-Mail)
> Subject: Re: [ECOS] kernel API
> 
> 
> Koeller, T. wrote:
> > [snip]
> > For all the reasons listed above, I am raising the
> > topic again. My proposal is to award the status of
> > an officially supported API to the C++ kernel API, too.
> 
> The problem is that we have to have flexibility to change how 
> the kernel 
> _implementation_ works, even if the _interface_ has to say 
> the same. Right 
> now the C++ stuff is just directly what is required by the 
> implementation. 
> Defining the internal API to be "official" will tie our hands 
> unreasonably 
> in the future if the API is to have any stability (and 
> stability is one of 
> the defining features of an API really!).
> 
> If there was a C++ API, it would have to be a separate veneer 
> over the 
> internal C++ API. In the first instance, using inline 
> functions etc. this 
> could be pretty much a  burden-free veneer over the internal 
> C++ API, but 
> if sensibly designed would give us the flexibility to change the 
> implementation without worrying about messing up the interface.
> 
> So that _could_ be a slight improvement over the C API by 
> removing some of 
> the overhead. But no-one has yet done such a thing of course 
> :-), and it 
> _isn't_ just a case of defining one to the other since there 
> does have to 
> be some level of abstraction in order to hide the internals.
> 
> Given that people are either happy with the C API, or not too worried 
> about using the internal C++ API directly, this hasn't been a 
> priority for 
> any of the main developers in the past. Personally I would have no 
> objections to a sensibly designed C++ API that fulfilled the 
> requirements 
> above. Nick G obviously might have a little bit more to say in how it 
> should be done of course ;-).
> 
> Jifl
> -- 
> eCosCentric    http://www.eCosCentric.com/    The eCos and 
> RedBoot experts
> --[ "You can complain because roses have thorns, or you ]--
> --[  can rejoice because thorns have roses." -Lincoln   ]-- 
> Opinions==mine
> 

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2003-05-01  1:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-22 15:53 [ECOS] kernel API Koeller, T.
2003-04-22 16:31 ` Grant Edwards
2003-04-22 21:32 ` Jonathan Larmour
2003-04-23 10:54   ` Sergei Organov
2003-04-23 14:32     ` Nick Garnett
2003-04-23 16:43       ` Sergei Organov
2003-04-23 16:51         ` Jonathan Larmour
2003-04-24  9:15           ` Sergei Organov
2003-04-24  9:35             ` [ECOS] Error with ARM cross-compiler Giovanni Perbellini
2003-04-24 11:22               ` QiangHuang
2003-04-28 10:21               ` [ECOS] Reading txt file Giovanni Perbellini
2003-04-28 11:30                 ` Andrew Lunn
     [not found]                   ` <010a01c30d89$98e43880$85f21b9d@CDC03>
2003-04-28 17:23                     ` Andrew Lunn
2003-05-01  1:19                       ` Jonathan Larmour
2003-04-23  9:31 [ECOS] kernel API Koeller, T.
2003-04-24  2:27 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).