comp.lang.ada
 help / color / mirror / Atom feed
* C vs. ada for embeded system
@ 2009-03-07 12:23 abcd
  2009-03-07 13:16 ` Dmitry A. Kazakov
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: abcd @ 2009-03-07 12:23 UTC (permalink / raw)


why ada is better of  "C" language  for embeded system? 





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

* Re: C vs. ada for embeded system
  2009-03-07 12:23 C vs. ada for embeded system abcd
@ 2009-03-07 13:16 ` Dmitry A. Kazakov
  2009-03-07 18:12 ` Martin
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Dmitry A. Kazakov @ 2009-03-07 13:16 UTC (permalink / raw)


On Sat, 7 Mar 2009 13:23:32 +0100, abcd wrote:

> why ada is better of  "C" language  for embeded system?

That depends on many factors. What worked for us was:

1. Portability. We develop and test under Windows. The target platform is
used only incidentally. We use same code for both, no single line of
preprocessor;

2. Language standard;

3. Tasking support (yes, we needed tasks);

4. OOPL;

5. Excellent support (AdaCore).

Disadvantages:

1. Damn difficult to get a compiler;

2. Tool chain (IDE, debugger etc) for Ada is not that good. Well not bad
when compared with Workbench/Eclipse, but still no match to Visual Studio;

3. Initial costs are much higher than for C.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



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

* Re: C vs. ada for embeded system
  2009-03-07 12:23 C vs. ada for embeded system abcd
  2009-03-07 13:16 ` Dmitry A. Kazakov
@ 2009-03-07 18:12 ` Martin
  2009-03-07 18:18 ` Pascal Obry
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Martin @ 2009-03-07 18:12 UTC (permalink / raw)


On Mar 7, 12:23 pm, "abcd" <a...@aa.com> wrote:
> why ada is better of  "C" language  for embeded system?

For me the features which aid embedded systems in particular are:

1. Built-in real-time clock
2. Built-in fixed point numbers
3. Portability
4. Less buggy*

* that's taking an average bunch of engineers who know their chosen
language to a decent level. You can get dummies writing cr*p Ada and
super-programmers turning out bug-free C. Which matches your current
team? Which matches your future team?

The features that are in the 'pro' column for Ada that aren't specific
to embedded systems are:

1. Ranged elementary types (i.e. int and float with ranges that run-
time checks)
2. Built-in tasking
3. No pre-processor
4. Proper arrays (=> proper Strings)
5. Built-in container libraries
6. Exceptions
7. Packages (i.e. proper modules - not faked up with 'guard macros' =>
no unintentional dependencies via '#include')
8. Named parameter association

I could go on...

Cheers
-- Martin



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

* Re: C vs. ada for embeded system
  2009-03-07 12:23 C vs. ada for embeded system abcd
  2009-03-07 13:16 ` Dmitry A. Kazakov
  2009-03-07 18:12 ` Martin
@ 2009-03-07 18:18 ` Pascal Obry
  2009-03-07 18:29 ` Jeffrey R. Carter
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Pascal Obry @ 2009-03-07 18:18 UTC (permalink / raw)


abcd a �crit :
> why ada is better of  "C" language  for embeded system? 

Because Ada has been *designed* to meet criteria needed for embedded and
safety-critical systems. To my point of view it has not fails its goal.

See also SPARK if safety is just not an option.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B



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

* Re: C vs. ada for embeded system
  2009-03-07 12:23 C vs. ada for embeded system abcd
                   ` (2 preceding siblings ...)
  2009-03-07 18:18 ` Pascal Obry
@ 2009-03-07 18:29 ` Jeffrey R. Carter
  2009-03-07 19:54 ` Per Sandberg
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Jeffrey R. Carter @ 2009-03-07 18:29 UTC (permalink / raw)


abcd wrote:
> why ada is better of  "C" language  for embeded system? 
> 

Ada was designed for embedded SW. C was designed for writing Unix.

Where we have hard data, they show that Ada results in delivery at half the cost 
and with 1/4 the errors of C, and the errors cost 1/10 as much to correct. (Of 
course, that's not specific to embedded systems.)

-- 
Jeff Carter
"Sir Robin the not-quite-so-brave-as-Sir-Lancelot,
who had nearly fought the Dragon of Angnor,
who nearly stood up to the vicious Chicken of Bristol,
and who had personally wet himself at the
Battle of Badon Hill."
Monty Python & the Holy Grail
68



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

* Re: C vs. ada for embeded system
  2009-03-07 12:23 C vs. ada for embeded system abcd
                   ` (3 preceding siblings ...)
  2009-03-07 18:29 ` Jeffrey R. Carter
@ 2009-03-07 19:54 ` Per Sandberg
  2009-03-07 23:26 ` anon
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Per Sandberg @ 2009-03-07 19:54 UTC (permalink / raw)


Well  would say that that depends entirely where you think its worth 
spend your time. 100 Hours upfront designing and fighting the compiler 
or 500 hours after delivery fighting with the debugger.
And in my experience that counts for all kinds of systems.

abcd wrote:
> why ada is better of  "C" language  for embeded system? 
> 
> 



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

* Re: C vs. ada for embeded system
  2009-03-07 12:23 C vs. ada for embeded system abcd
                   ` (4 preceding siblings ...)
  2009-03-07 19:54 ` Per Sandberg
@ 2009-03-07 23:26 ` anon
  2009-03-08 10:43 ` Pascal Obry
  2009-03-09 16:02 ` mccormick
  7 siblings, 0 replies; 12+ messages in thread
From: anon @ 2009-03-07 23:26 UTC (permalink / raw)


Ada is a more perfect portable language while C has become a damaged language
by the use of macros and conditional statements. Which initially allowed 
C and other software written in C to become portable has now branched into 
a nightmare for programmers to maintain the older software.

Ada has no language defined macros or conditional statements only a number 
of packages that need to be rewritten for each platform and/or OS used. And 
the specific machine and platform dependent code of these packages are 
transparent to the programmers and their software. Giving a better and more 
portable language to use.

Plus, the built-in features like tasking and safety makes Ada a winner. Of 
course, the closer you get to perfection for a language the higher the cost.

To Correct "Jeffrey R. Carter" and a few others here.

AT&T with help from GE, and MIT created "unix" (all lowercase, was used for 
first version name) was written in 1969, using assembly for a GE-645 and 
rewritten again in assembly in 1970, for a PDP-7, before C existed.  C was 
written in 1972 for a general purpose language for the OS "unix". Later, in 
1973, AT&T rewrote "unix" in C and renamed it using uppercase letters. 

Also from "http://en.wikipedia.org/wiki/Unix".  
  "The migration from assembly language to the higher-level language C 
  resulted in much more portable software, requiring only a relatively small
  amount of machine-dependent code to be replaced when porting Unix to 
  other computing platforms."


So, "Jeffrey R. Carter" and a few others get the fact straight. AT&T 
developed "unix" using assembly. Then to help make their OS more 
portable they rewote the OS in C, three years later! So, C was not 
developed to write AT&T "unix"!



In <gotp01$kbm$1@news.metronet.hr>, "abcd" <aa@aa.com> writes:
>why ada is better of  "C" language  for embeded system? 
>
>




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

* Re: C vs. ada for embeded system
  2009-03-07 12:23 C vs. ada for embeded system abcd
                   ` (5 preceding siblings ...)
  2009-03-07 23:26 ` anon
@ 2009-03-08 10:43 ` Pascal Obry
  2009-03-09 16:02 ` mccormick
  7 siblings, 0 replies; 12+ messages in thread
From: Pascal Obry @ 2009-03-08 10:43 UTC (permalink / raw)
  To: abcd

abcd a �crit :
> why ada is better of  "C" language  for embeded system? 

BTW, such questions look like a troll. Would have been nice to have some
backgrounds about why you asked? Where are you coming from (C projects,
or Ada projects)? Do you plan switching to Ada?

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B



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

* Re: C vs. ada for embeded system
  2009-03-07 12:23 C vs. ada for embeded system abcd
                   ` (6 preceding siblings ...)
  2009-03-08 10:43 ` Pascal Obry
@ 2009-03-09 16:02 ` mccormick
  2009-03-10 17:33   ` Martin Krischik
  7 siblings, 1 reply; 12+ messages in thread
From: mccormick @ 2009-03-09 16:02 UTC (permalink / raw)


On Mar 7, 7:23 am, "abcd" <a...@aa.com> wrote:
> why ada is better of  "C" language  for embeded system?

You can seee the results of completion rates for a 10-15K line project
done in both C and Ada in my Real-Time Embedded Systems class over the
past 20 years.  The class runs for one semester (15 weeks).  The
bottom line is that NO student team ever completed the minimal project
requirements in C.  Over 80% of the teams working in Ada complted the
project.  My latest publications on the matter are

We've been working on the railroad: a laboratory for real-time
embedded systems
McCormick, J. W.
SIGCSE Bulletin
Volume 37, Number 1, Feb. 2005, Page(s): 530-534.

Instrumentation education through model railroading
McCormick, J.W.
Instrumentation & Measurement Magazine, IEEE
Volume 9, Issue 5, Oct. 2006 Page(s): 40 - 45

Model Railroading and Computer Fundamentals
McCormick, J.W.
Journal of Computer Science Education
Volume 17, Number 2, June 2007 Page(s): 129 - 139



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

* Re: C vs. ada for embeded system
  2009-03-09 16:02 ` mccormick
@ 2009-03-10 17:33   ` Martin Krischik
  2009-03-11 10:14     ` christoph.grein
  2009-03-11 14:07     ` John McCormick
  0 siblings, 2 replies; 12+ messages in thread
From: Martin Krischik @ 2009-03-10 17:33 UTC (permalink / raw)


Am 09.03.2009, 17:02 Uhr, schrieb <mccormick@cs.uni.edu>:

> On Mar 7, 7:23 am, "abcd" <a...@aa.com> wrote:
>> why ada is better of  "C" language  for embeded system?

> You can seee the results of completion rates for a 10-15K line project
> done in both C and Ada in my Real-Time Embedded Systems class over the
> past 20 years.  The class runs for one semester (15 weeks).  The
> bottom line is that NO student team ever completed the minimal project
> requirements in C.  Over 80% of the teams working in Ada complted the
> project.  My latest publications on the matter are

Interesting - where the studens alowed to choose the language or was it  
forced upon them?

Do the students know before hand of the dire C results?

Martin
-- 
Martin Krischik



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

* Re: C vs. ada for embeded system
  2009-03-10 17:33   ` Martin Krischik
@ 2009-03-11 10:14     ` christoph.grein
  2009-03-11 14:07     ` John McCormick
  1 sibling, 0 replies; 12+ messages in thread
From: christoph.grein @ 2009-03-11 10:14 UTC (permalink / raw)


Martin,

you can find the article here:
  http://www.adaic.com/atwork/trains.html

It's a very interesting reading and answers all your questions.



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

* Re: C vs. ada for embeded system
  2009-03-10 17:33   ` Martin Krischik
  2009-03-11 10:14     ` christoph.grein
@ 2009-03-11 14:07     ` John McCormick
  1 sibling, 0 replies; 12+ messages in thread
From: John McCormick @ 2009-03-11 14:07 UTC (permalink / raw)


On Mar 10, 12:33 pm, "Martin Krischik"
<krisc...@users.sourceforge.net> wrote:
>
> Interesting - where the studens alowed to choose the language or was it  
> forced upon them?

Forced  :)  Christoph pointed out an older article that is easy to
access.  We used C the first 7 years leading to a very frustrated
professor.  Even when I gave them over 50% of the C code, they still
failed.  Two attempts were made by Ada graduates to write the systems
in C++ and Real-Time Java.  Neither succeeded.

I have a video of the laboratory at http://www.cs.uni.edu/~mccormic/RealTime/
You can also see a user's manual that describes the system the
students implement.

John



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

end of thread, other threads:[~2009-03-11 14:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-07 12:23 C vs. ada for embeded system abcd
2009-03-07 13:16 ` Dmitry A. Kazakov
2009-03-07 18:12 ` Martin
2009-03-07 18:18 ` Pascal Obry
2009-03-07 18:29 ` Jeffrey R. Carter
2009-03-07 19:54 ` Per Sandberg
2009-03-07 23:26 ` anon
2009-03-08 10:43 ` Pascal Obry
2009-03-09 16:02 ` mccormick
2009-03-10 17:33   ` Martin Krischik
2009-03-11 10:14     ` christoph.grein
2009-03-11 14:07     ` John McCormick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox