comp.lang.ada
 help / color / mirror / Atom feed
* Ada and Java/C++
@ 2012-08-27 10:46 kalvin.news
  2012-08-27 11:48 ` Dmitry A. Kazakov
                   ` (6 more replies)
  0 siblings, 7 replies; 31+ messages in thread
From: kalvin.news @ 2012-08-27 10:46 UTC (permalink / raw)


Hi All,

I am not sure whether this idea has been discussed before, but I am writing this down anyway.

Java is a very popular language along C/C++. Ada has fine qualities for writing robust code, that Java and c/C++ languages are missing. It seems that Ada and other Pascal family of languages are not popular among programmers because programmers consider Pascal as a toy language suitable only for academic purposes, and Ada has also a burden of being DoD language and being complex, slow etc.

The idea that came to my mind was that if Ada language is implemented in syntax similar to Java and C++, this might attract more programmer to adapt Ada. This would mean creating Jada (Java-Ada) an/or Cava (C-Ada) languages, that look like Java/C++, but actually they are Ada. So, no matter what language programmer would use Ada/Jada/Cava, the result would be the same - robust code which has all Ada's good features.

Any comments on this?

Br,
Calvin



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

* Re: Ada and Java/C++
  2012-08-27 10:46 Ada and Java/C++ kalvin.news
@ 2012-08-27 11:48 ` Dmitry A. Kazakov
  2012-08-27 13:44   ` kalvin.news
  2012-08-27 14:35   ` Nomen Nescio
  2012-08-27 14:09 ` Niklas Holsti
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 31+ messages in thread
From: Dmitry A. Kazakov @ 2012-08-27 11:48 UTC (permalink / raw)


On Mon, 27 Aug 2012 03:46:33 -0700 (PDT), kalvin.news@gmail.com wrote:

> I am not sure whether this idea has been discussed before,

Yes, many times a year.

> Java is a very popular language along C/C++. Ada has fine qualities for
> writing robust code, that Java and c/C++ languages are missing.

Popularity of a language, programming or natural, has nothing to do with
its syntax.

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



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

* Re: Ada and Java/C++
  2012-08-27 11:48 ` Dmitry A. Kazakov
@ 2012-08-27 13:44   ` kalvin.news
  2012-08-27 14:33     ` Dmitry A. Kazakov
                       ` (2 more replies)
  2012-08-27 14:35   ` Nomen Nescio
  1 sibling, 3 replies; 31+ messages in thread
From: kalvin.news @ 2012-08-27 13:44 UTC (permalink / raw)
  Cc: mailbox

> Popularity of a language, programming or natural, has nothing to do with
> its syntax.
> Regards,
> 
> Dmitry A. Kazakov
> 
> http://www.dmitry-kazakov.de

I have a contrary opinion on this. It is about perception and familiarity: If something looks familiar to something that you already know, it appears more appealing compared to something that you don't know. Lisp, Forth and APL are good examples of this. If Java wouldn't be so similar to C/C++, it may have not become the mainstream language. Think about situation in which Java would have used syntax similar to APL or Forth. 

Think about learning a new language: It is easier to learn a new language that has resemblance to the language you already know and speak.

- Calvin



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

* Re: Ada and Java/C++
  2012-08-27 10:46 Ada and Java/C++ kalvin.news
  2012-08-27 11:48 ` Dmitry A. Kazakov
@ 2012-08-27 14:09 ` Niklas Holsti
       [not found] ` <al1n38tdd0tq6p1os6p6angt91mginhoup@invalid.netcom.com>
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 31+ messages in thread
From: Niklas Holsti @ 2012-08-27 14:09 UTC (permalink / raw)


On 12-08-27 13:46 , kalvin.news@gmail.com wrote:
> Hi All,
> 
> I am not sure whether this idea has been discussed before, but I am
> writing this down anyway.
> 
> Java is a very popular language along C/C++. Ada has fine qualities
> for writing robust code, that Java and c/C++ languages are missing.
> It seems that Ada and other Pascal family of languages are not
> popular among programmers because programmers consider Pascal as a
> toy language suitable only for academic purposes, and Ada has also a
> burden of being DoD language and being complex, slow etc.

Ada may have a *reputation* of being complex and slow, but it isn't really.

> The idea that came to my mind was that if Ada language is implemented
> in syntax similar to Java and C++, this might attract more programmer
> to adapt Ada. This would mean creating Jada (Java-Ada) an/or Cava
> (C-Ada) languages, that look like Java/C++, but actually they are
> Ada. So, no matter what language programmer would use Ada/Jada/Cava,
> the result would be the same - robust code which has all Ada's good
> features.
> 
> Any comments on this?

IMO, Ada syntax is just as close to C and Java as it needs to be, and
also no less different than it should be.

The syntax expresses the semantics. Ada semantics is different from C
and Java and richer than both. You could perhaps use C/Java syntax to
express the subset of Ada that corresponds to C/Java, but then you would
be stuck and would have to invent new syntax to express the rest, or the
programmers would have to switch to original Ada syntax to use the more
powerful features of Ada.

How do you define a new integer type in C syntax? How do you write an
exception handler in C syntax?

So, I think it is a bad idea.

Besides, learning that similar things can be expressed in different ways
is an essential part of understanding what programming is and what
programming languages are.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
      .      @       .



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

* Re: Ada and Java/C++
  2012-08-27 13:44   ` kalvin.news
@ 2012-08-27 14:33     ` Dmitry A. Kazakov
  2012-08-27 15:26     ` J-P. Rosen
  2012-08-27 23:16     ` Randy Brukardt
  2 siblings, 0 replies; 31+ messages in thread
From: Dmitry A. Kazakov @ 2012-08-27 14:33 UTC (permalink / raw)


On Mon, 27 Aug 2012 06:44:07 -0700 (PDT), kalvin.news@gmail.com wrote:

>> Popularity of a language, programming or natural, has nothing to do with
>> its syntax.
>> Regards,
>> 
> I have a contrary opinion on this. It is about perception and familiarity:

No, it is all about indoctrination.

> Think about learning a new language: It is easier to learn a new language
> that has resemblance to the language you already know and speak.

And this has no relation to popularity as well. People do not learn
languages easiest to learn. There are far more important motives to learn a
language.

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



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

* Re: Ada and Java/C++
  2012-08-27 11:48 ` Dmitry A. Kazakov
  2012-08-27 13:44   ` kalvin.news
@ 2012-08-27 14:35   ` Nomen Nescio
  2012-08-27 21:23     ` gautier_niouzes
  1 sibling, 1 reply; 31+ messages in thread
From: Nomen Nescio @ 2012-08-27 14:35 UTC (permalink / raw)


I rarely disagree with "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> but
when he wrote:

> > Java is a very popular language along C/C++. Ada has fine qualities for
> > writing robust code, that Java and c/C++ languages are missing.
> 
> Popularity of a language, programming or natural, has nothing to do with
> its syntax.

Sure it does! Anything based on C will be popular.

That does not mean it's good...but it will be popular. And conversely,
anything not based on C will probably not be popular.




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

* Re: Ada and Java/C++
       [not found] ` <al1n38tdd0tq6p1os6p6angt91mginhoup@invalid.netcom.com>
@ 2012-08-27 14:49   ` kalvin.news
  2012-08-27 14:53   ` kalvin.news
  1 sibling, 0 replies; 31+ messages in thread
From: kalvin.news @ 2012-08-27 14:49 UTC (permalink / raw)


maanantai, 27. elokuuta 2012 17.43.52 UTC+3 Dennis Lee Bieber kirjoitti:
> On Mon, 27 Aug 2012 03:46:33 -0700 (PDT), kalvin.news@gmail.com
> 
> declaimed the following in comp.lang.ada:
> 
> 
> 
> 	{pulls out crucifix, wooden stake, and mallet}
> 
> > 
> 
> > The idea that came to my mind was that if Ada language is implemented in syntax similar to Java and C++, this might attract more programmer to adapt Ada. This would mean creating Jada (Java-Ada) an/or Cava (C-Ada) languages, that look like Java/C++, but actually they are Ada. So, no matter what language programmer would use Ada/Jada/Cava, the result would be the same - robust code which has all Ada's good features.
> 
> > 
> 
> > Any comments on this?
> 
> >
> 
> 
> 
> 	What? A syntax that has optional blocking constructs leading to
> 
> potential dangling else situations, arguments over the "proper" place to
> 
> put {, } on the lines, etc.
> 
> 
> 
> 	If I wanted that, I'd use C#...
> 
> 
> 
> 	Ada /fixed/ the problems Pascal had with blocking. Why would one
> 
> want to revert to a language that allows for such ambiguous and error
> 
> prone coding styles.
> 
> 
> 
> -- 
> 
> 	Wulfraed                 Dennis Lee Bieber         AF6VN
> 
>         wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

I did not state, that the Cada/Jada should be *identical* to C/Java, but as close as possible. This dangling else problem can be solved by fixing the syntax.



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

* Re: Ada and Java/C++
       [not found] ` <al1n38tdd0tq6p1os6p6angt91mginhoup@invalid.netcom.com>
  2012-08-27 14:49   ` kalvin.news
@ 2012-08-27 14:53   ` kalvin.news
  2012-08-27 19:46     ` Shark8
  2012-08-27 20:11     ` gautier_niouzes
  1 sibling, 2 replies; 31+ messages in thread
From: kalvin.news @ 2012-08-27 14:53 UTC (permalink / raw)


maanantai, 27. elokuuta 2012 17.43.52 UTC+3 Dennis Lee Bieber kirjoitti:
> On Mon, 27 Aug 2012 03:46:33 -0700 (PDT), kalvin.news@gmail.com
> 
> declaimed the following in comp.lang.ada:
> 
> 
> 
> 	{pulls out crucifix, wooden stake, and mallet}
> 
> > 
> 
> > The idea that came to my mind was that if Ada language is implemented in syntax similar to Java and C++, this might attract more programmer to adapt Ada. This would mean creating Jada (Java-Ada) an/or Cava (C-Ada) languages, that look like Java/C++, but actually they are Ada. So, no matter what language programmer would use Ada/Jada/Cava, the result would be the same - robust code which has all Ada's good features.
> 
> > 
> 
> > Any comments on this?
> 
> >
> 
> 
> 
> 	What? A syntax that has optional blocking constructs leading to
> 
> potential dangling else situations, arguments over the "proper" place to
> 
> put {, } on the lines, etc.
> 
> 
> 
> 	If I wanted that, I'd use C#...
> 
> 
> 
> 	Ada /fixed/ the problems Pascal had with blocking. Why would one
> 
> want to revert to a language that allows for such ambiguous and error
> 
> prone coding styles.
> 
> 
> 
> -- 
> 
> 	Wulfraed                 Dennis Lee Bieber         AF6VN
> 
>         wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

for example, in Jada/Cada the if-else-statement would require open { and closing }. Also Jada/Cada could introduce elif.



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

* Re: Ada and Java/C++
  2012-08-27 13:44   ` kalvin.news
  2012-08-27 14:33     ` Dmitry A. Kazakov
@ 2012-08-27 15:26     ` J-P. Rosen
  2012-08-27 15:46       ` Georg Bauhaus
  2012-08-27 16:08       ` kalvin.news
  2012-08-27 23:16     ` Randy Brukardt
  2 siblings, 2 replies; 31+ messages in thread
From: J-P. Rosen @ 2012-08-27 15:26 UTC (permalink / raw)


Le 27/08/2012 15:44, kalvin.news@gmail.com a �crit :
> 
>If something looks familiar to something that you already know, it
> appears more appealing compared to something that you don't know.
> Lisp, Forth and APL are good examples of this. If Java wouldn't be so
> similar to C/C++, it may have not become the mainstream language.
> Think about situation in which Java would have used syntax similar to
> APL or Forth.

Number 1 quality of Ada is readability: if you change the syntax, you
will badly hurt it. And to not surprise C-programmers, you'll have to
reintroduce the crazy syntax of switch statements, with mandatory break...

Also, what often frightens C-ers is that types cannot be mixed at will.
Would you reintroduce automatic type promotion? No thanks.

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr



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

* Re: Ada and Java/C++
  2012-08-27 15:26     ` J-P. Rosen
@ 2012-08-27 15:46       ` Georg Bauhaus
  2012-08-27 16:08       ` kalvin.news
  1 sibling, 0 replies; 31+ messages in thread
From: Georg Bauhaus @ 2012-08-27 15:46 UTC (permalink / raw)


On 27.08.12 17:26, J-P. Rosen wrote:
> Number 1 quality of Ada is readability: if you change the syntax, you
> will badly hurt it.


Uhm, well, actually Ada 2012 changes Ada syntax a bit, I'd think,
by introducing "of" in loops, round brackets around conditional
expressions, etc. Again, the new syntax is less suited to writing
in a densely crowded style, but they have some potential to appease
programmers who are used to delivering "clever" compactions of
rather boring source text.



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

* Re: Ada and Java/C++
  2012-08-27 15:26     ` J-P. Rosen
  2012-08-27 15:46       ` Georg Bauhaus
@ 2012-08-27 16:08       ` kalvin.news
  1 sibling, 0 replies; 31+ messages in thread
From: kalvin.news @ 2012-08-27 16:08 UTC (permalink / raw)


maanantai, 27. elokuuta 2012 18.26.26 UTC+3 J-P. Rosen kirjoitti:

> Number 1 quality of Ada is readability: if you change the syntax, you
> will badly hurt it. And to not surprise C-programmers, you'll have to
> reintroduce the crazy syntax of switch statements, with mandatory break...

Like Java extended and modified original C syntax for its needs, Jada/Cada can do the same. Our hands are not tied to Java/C syntax too much, so that we couldn't fix C/Java syntax where needed. Java resembles to C, but it is still not C.
 
> Also, what often frightens C-ers is that types cannot be mixed at will.
> Would you reintroduce automatic type promotion? No thanks.

Jada/Cada is not supposed to be C, but vastly improved version of C with Ada's robust type handling. The programmers can use Java or Misra C if they don't want to create robust software :)

> -- 
> 
> J-P. Rosen
> 
> Adalog
> 
> 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
> 
> Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
> 
> http://www.adalog.fr

- Calvin



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

* Re: Ada and Java/C++
  2012-08-27 10:46 Ada and Java/C++ kalvin.news
                   ` (2 preceding siblings ...)
       [not found] ` <al1n38tdd0tq6p1os6p6angt91mginhoup@invalid.netcom.com>
@ 2012-08-27 19:41 ` Shark8
  2012-08-27 20:06 ` gautier_niouzes
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 31+ messages in thread
From: Shark8 @ 2012-08-27 19:41 UTC (permalink / raw)


On Monday, August 27, 2012 4:46:33 AM UTC-6, kalvi...@gmail.com wrote:
> Hi All,
> 
> Java is a very popular language along C/C++. Ada has fine qualities for writing robust code, that Java and c/C++ languages are missing. It seems that Ada and other Pascal family of languages are not popular among programmers because programmers consider Pascal as a toy language suitable only for academic purposes, and Ada has also a burden of being DoD language and being complex, slow etc.
> 
> The idea that came to my mind was that if Ada language is implemented in syntax similar to Java and C++, this might attract more programmer to adapt Ada. 

Well, there's a big problem here. Much of the safety/robustness comes from the syntax. the easy/trivial example is that Ada has no problem with the dangling-else problem precisely because its syntax requires "end if;"

> This would mean creating Jada (Java-Ada) an/or Cava (C-Ada) languages, that look like Java/C++, but actually they are Ada. So, no matter what language programmer would use Ada/Jada/Cava, the result would be the same - robust code which has all Ada's good features.

Why not just target the JVM with your Ada compiler?

> 
> Any comments on this?

Aside from those given? Not really.



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

* Re: Ada and Java/C++
  2012-08-27 14:53   ` kalvin.news
@ 2012-08-27 19:46     ` Shark8
  2012-08-27 20:11     ` gautier_niouzes
  1 sibling, 0 replies; 31+ messages in thread
From: Shark8 @ 2012-08-27 19:46 UTC (permalink / raw)


On Monday, August 27, 2012 8:53:07 AM UTC-6, kalvi...@gmail.com wrote:
> maanantai, 27. elokuuta 2012 17.43.52 UTC+3 Dennis Lee Bieber kirjoitti:
> 
> for example, in Jada/Cada the if-else-statement would require open { and closing }. Also Jada/Cada could introduce elif.

So you want to rename elsif to elif?



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

* Re: Ada and Java/C++
  2012-08-27 10:46 Ada and Java/C++ kalvin.news
                   ` (3 preceding siblings ...)
  2012-08-27 19:41 ` Shark8
@ 2012-08-27 20:06 ` gautier_niouzes
  2012-08-28  5:35 ` kalvin.news
  2012-08-29 10:52 ` kalvin.news
  6 siblings, 0 replies; 31+ messages in thread
From: gautier_niouzes @ 2012-08-27 20:06 UTC (permalink / raw)


The popularity of C, C++, Java has more to do with tradition than syntax.
99% of people are followers (not to use a word with 's' ;-) ).
Add to it that a new member of a team has often to use the language that is already in use, that the boss has learned that language, and that decades ago the boss was a beginner and had to use the language that was already in use, etc. etc.

Usually if you need to work on projects with non-programmers, they will understand quickly what's happening in an Ada program and find a C or C-like program difficult to understand.
If you remove the readable and unambiguous syntax of Ada, you will lose an important part of its advantages.
_________________________ 
Gautier's Ada programming 
http://sf.net/users/gdemont



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

* Re: Ada and Java/C++
  2012-08-27 14:53   ` kalvin.news
  2012-08-27 19:46     ` Shark8
@ 2012-08-27 20:11     ` gautier_niouzes
  1 sibling, 0 replies; 31+ messages in thread
From: gautier_niouzes @ 2012-08-27 20:11 UTC (permalink / raw)


Le lundi 27 août 2012 16:53:07 UTC+2, kalvi...@gmail.com a écrit : 

> for example, in Jada/Cada the if-else-statement would require open { and closing }.

And you would still have the "dangling else" problem (and also other nuisances, like the need to over-bracket to feel safer) that Ada solved more than 30 years ago by having only the closing '}' (called "end if")... 
_________________________ 
Gautier's Ada programming 
http://sf.net/users/gdemont



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

* Re: Ada and Java/C++
  2012-08-27 14:35   ` Nomen Nescio
@ 2012-08-27 21:23     ` gautier_niouzes
  0 siblings, 0 replies; 31+ messages in thread
From: gautier_niouzes @ 2012-08-27 21:23 UTC (permalink / raw)


Le lundi 27 août 2012 16:35:23 UTC+2, Nomen Nescio a écrit :

> Sure it does! Anything based on C will be popular.

Mmmh - but there are plenty of unpopular C-based languages, especially in the "yet-another-safer-C" area...
You need marketing, timing (a new technology appearing), and often support from a large company to have a chance of making a popular language.

> That does not mean it's good...but it will be popular.
> And conversely, anything not based on C will probably not be popular.

I rather agree with the latter ("popular => [has good chances to be] based on C") than the former ("based on C => popular").
The tradition is your friend ;-) ...
Basically, you need the following for your brand new popular language:
- the PDP-11 macro-assembler syntax
- force almost all objects to be heap-allocated (optionally, if you want to look a bit modern, you hide the explicit pointers and provide a garbage collector).
- something else (anyone ?...) ?
With some business talent you make uncompatible versions of the language over time and provide costly services for the upgrades to your captive customers.
_________________________ 
Gautier's Ada programming 
http://freecode.com/users/gdemont



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

* Re: Ada and Java/C++
  2012-08-27 13:44   ` kalvin.news
  2012-08-27 14:33     ` Dmitry A. Kazakov
  2012-08-27 15:26     ` J-P. Rosen
@ 2012-08-27 23:16     ` Randy Brukardt
  2012-08-28  2:14       ` Adam Beneschan
  2 siblings, 1 reply; 31+ messages in thread
From: Randy Brukardt @ 2012-08-27 23:16 UTC (permalink / raw)



<kalvin.news@gmail.com> wrote in message 
news:513d6efb-6aad-4013-8b21-37c75aa6aaf7@googlegroups.com...
>Dmitry A. Kazakov wrote:
>> Popularity of a language, programming or natural, has nothing to do with
>> its syntax.

>I have a contrary opinion on this. It is about perception and familiarity: 
>If something looks
> familiar to something that you already know, it appears more appealing 
> compared to something
> that you don't know. Lisp, Forth and APL are good examples of this. If 
> Java wouldn't be so
> similar to C/C++, it may have not become the mainstream language. Think 
> about situation in
> which Java would have used syntax similar to APL or Forth.

I agree with you here (but also see below). But the syntax of a language is 
a very important part of the foundation of the language. Ada's syntax is 
designed to minimize the possibility for inadvertant errors, which is not 
the case with the C syntax. (See, for instance, the discussion in Rationale 
2012 about this: 
http://www.ada-auth.org/standards/12rat/html/Rat12-3-2.html.)

You can build huge ediface on top of any sort of foundation, but if the 
foundation is rotten (as I believe it is in the case of the C syntax), you 
are going to have problems. Personally, I think a substantial part of the 
benefit of using Ada is from the much safer syntax. (I'm well aware that 
this does not match conventional wisdom; so you'll have to draw your own 
conclusions.)

>Think about learning a new language: It is easier to learn a new language 
>that has resemblance
> to the language you already know and speak.

Here I strongly disagree. The above might be true for natural languages, but 
for programming languages, you want the syntax of the various ones you use 
to be as different as possible. Speaking from my own experience, when 
Janus/Ada was originally constructed in Pascal, the subtle differences 
between the two languages (both in syntax and semantics) used to drive us 
nutty. We switched our development to Ada as soon as Janus/Ada was 
sufficiently capable.

I would expect similar experiences for people who have to regularly work in 
both C and Java, and I know I've seem people make comments to that effect.

To summarize: it might help for causal users to use a syntax closer to that 
of C (mainly because there are a lot of people that think that a programming 
language has to look like C), but such a syntax would reduce the value of 
Ada a lot. I suspect that it mostly would be used to write C-in-Ada, which 
would have no added benefit at all. (And that would probably have the 
opposite effect to that you suggest.)

In any case, nothing prevents one from creating a preprocessor that converts 
a C-like syntax to Ada. If you think it is such a good idea, go create it 
and prove it to the skeptics. If it gets a lot of use, compilers will adopt 
it (and if not, no harm done).

                                                 Randy.






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

* Re: Ada and Java/C++
  2012-08-27 23:16     ` Randy Brukardt
@ 2012-08-28  2:14       ` Adam Beneschan
  2012-08-28 10:50         ` Brian Drummond
  0 siblings, 1 reply; 31+ messages in thread
From: Adam Beneschan @ 2012-08-28  2:14 UTC (permalink / raw)


On Monday, August 27, 2012 4:16:39 PM UTC-7, Randy Brukardt wrote:

> I agree with you here (but also see below). But the syntax of a language is
> a very important part of the foundation of the language. Ada's syntax is
> designed to minimize the possibility for inadvertant errors, which is not
> the case with the C syntax. (See, for instance, the discussion in Rationale
> 2012 about this:
> http://www.ada-auth.org/standards/12rat/html/Rat12-3-2.html.)

Hmmm ... I guess it depends on just how much of the syntax the OP
is thinking of keeping.  I'd think that if we're just talking about
the "look and feel", one could probably develop a language that has
the functionality of Ada but using C-like keywords and operators,
without compromising safety.  I'm not saying it's a good idea.
Personally, if someone sent me a compiler for a language like that, I
wouldn't just delete it from my system, I'd print it out just so that
I could run it through a shredder and then stomp on it.

But some changes, like using [] instead of () for array indices or { }
instead of begin/end or expressing type conversions as
(type)expression instead of type(expression), wouldn't seem to have
any negative impacts on safety.  (Just on aesthetics.)  In other
cases, some of the unsafe syntax in C has been made safer or just
prohibited in languages like Java.  For example, Java doesn't allow a
lot of the type casts that you can get yourself into trouble with in
C; I don't believe it supports the unary * or & operators at all; and
while I think that in C programmers can and do run into problems using
binary & when they mean && or vice versa, Java eliminated this by
adding a real boolean type, and then decreeing that && could only be
used on booleans and & only on integers.

The point is that if the OP's premise is correct--that Java is popular
because it borrows from C syntax even though it eliminated some of the
unsafe and error-prone things from the language, then in theory, a
mutant Ada language with C-like syntax could do the same.  If I were
induced by a very large sum of money to help develop such a language,
I'd want to make some changes like (1) making assignment statements
statements rather than expressions, so that even if = is used as the
assignment operator instead of := you still can't mess yourself up by
using = in the middle of an expression when you're trying to compare
two things for equality, (2) not allowing functions with non-void
function results to appear as statements, without assigning the
result; (3) adding some sort of null statements that would have to be
used instead of "nothingness" to prevent goofups like

   for (i = 0; i < max; i++) ;
      sum += a[i];

(4) preventing fall-through in switch statements.  All of these would
help accomplish preventing errors and unsafe code.  I'd want to do
something about auto-increment and decrement and the dangling else
problem, too, which are other sources of errors.  But it's possible,
at least in theory, that some C programmers would still find this
appealing, and wouldn't miss the features too much that we yank out.
Or maybe they *would* miss them too much.  I don't know.  And I
personally don't think it's worth devoting any more thought to, so I'm
going to stop here.


> Here I strongly disagree. The above might be true for natural languages, but
> for programming languages, you want the syntax of the various ones you use
> to be as different as possible. Speaking from my own experience, when
> Janus/Ada was originally constructed in Pascal, the subtle differences
> between the two languages (both in syntax and semantics) used to drive us
> nutty.

That's a problem for natural languages, too.  Spanish and Italian are
similar in a lot of ways, and I've heard that back when Fernando
Valenzuela started pitching for the Dodgers, when Tom Lasorda would
occasionally interpret for him during post-game interviews, he mixed
Italian in with his Spanish.  I've heard similar things from others
who were fluent in Spanish and were trying to learn Italian.  But I
suppose this problem isn't a huge one in human speech--I don't think
Fernando ever stopped the interview to say "syntax error" when Lasorda
used the wrong word.  :)

                            -- Adam



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

* Re: Ada and Java/C++
  2012-08-27 10:46 Ada and Java/C++ kalvin.news
                   ` (4 preceding siblings ...)
  2012-08-27 20:06 ` gautier_niouzes
@ 2012-08-28  5:35 ` kalvin.news
  2012-08-28  6:57   ` Shark8
  2012-08-28  9:54   ` gautier_niouzes
  2012-08-29 10:52 ` kalvin.news
  6 siblings, 2 replies; 31+ messages in thread
From: kalvin.news @ 2012-08-28  5:35 UTC (permalink / raw)


Let's elaborate this subject a bit more. Facts:
- Embedded software and hardware deployed everywhere
- Software projects are getting bigger and more complex all the time
- Software is getting close to people each day
- Mission critical software is entering our daily lives in form on automation (like Google cars, home automation, nursing systems etc. just name it)

1. Ada (2005 and 2012) is ready for prime time
2. Ada is designed for mission critical and embedded software
3. Java and C are common languages in embedded systems
4. Java and C are weak languages for mission critical system eg. poor type checking, exception handling, tasks are not native in the language etc.
- C is notoriously poor language in terms of type checking, pointer arithmetics, arrays, packages, just name it
- Although efforts in Misra C, it is still C with its faults and shortcomings
- Java has some improvements to C, but it still can be improved
- Java is not designed for mission critical systems
5. Ada programmers are hard to find
- For example, DoD has faced the problem of finding Ada programmers, DoD has been force into situation that mission critical software is being implemented in Java
- Java and C programmers see Ada as a complex language
- Ada is perceived as military language
- Ada is perceived as a complex and heavy language

As you may see from list above, the points 1&2, and points 3-5 are contradicting. Could the situation be improved somehow, so that existing Java and C programmers can adopt Ada-mindset more easily, and can the Java and C syntax be fixed to allow more robust software engineering.

My suggestion here is to introduce Ada's good virtues for C and Java programmers in syntax that is familiar to most of the software engineers.

As many writers has well pointed out, it may not be easy or possible to represent full Ada features in Java and C syntax. What is required here, it that we retain as much Java and C syntax as possible, and then extend it and fix it as necessary - type definition, dangling else problem and switch-case-break are a good but simple examples of this.

- Calvin



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

* Re: Ada and Java/C++
  2012-08-28  5:35 ` kalvin.news
@ 2012-08-28  6:57   ` Shark8
  2012-08-28  8:28     ` kalvin.news
  2012-08-28  8:31     ` kalvin.news
  2012-08-28  9:54   ` gautier_niouzes
  1 sibling, 2 replies; 31+ messages in thread
From: Shark8 @ 2012-08-28  6:57 UTC (permalink / raw)


On Monday, August 27, 2012 11:35:28 PM UTC-6, kalvi...@gmail.com wrote:
> 
> 
> My suggestion here is to introduce Ada's good virtues for C and Java programmers in syntax that is familiar to most of the software engineers.

You aren't listening to the replies you're getting; it's a bad idea to try to gloss over (extend) C/Java syntax. Randy's reply is a good one in explaining why syntax itself matters.

> 
> 5. Ada programmers are hard to find
> - For example, DoD has faced the problem of finding Ada programmers, DoD has been force into situation that mission critical software is being implemented in Java

Having been looking for an Ada job, and applying to lots of listings to get lots of non-responses I'm going to call this one bullshit. (Besides, why is it when comparing languages the other way people always say "any programmer can learn C/C#/PHP/Java etc?" shouldn't they also be able to learn Ada if that's the case?) 

> - Java and C programmers see Ada as a complex language

Well, it's complex in some issues because it can't be any simpler. (Ok, that isn't strictly true; but take a good look at the rules and a lot of times the complexity comes from addressing a non-trivial issue. Example: Tasking.)

> 
> - Ada is perceived as military language

So? If you go back a few decades the Jeep was perceived as a military vehicle.

> 
> - Ada is perceived as a complex and heavy language

Again, that's because there are non-trivial problems being addressed. And it could be considered 'heavy' if you're looking at all possible combinations rather than realizing that the structured nature and orthogonality in which they are applied is very consistent (i.e. generics and compilation-units which can be nested in other such compilation-units).

> 
> As you may see from list above, the points 1&2, and points 3-5 are contradicting. Could the situation be improved somehow, so that existing Java and C programmers can adopt Ada-mindset more easily, and can the Java and C syntax be fixed to allow more robust software engineering.

[Warning: From here on sarcasm and hyperbole increase]

Possibly; but I'm going to have to say it's not likely. Why?
Because of an irksome psychological-tendency for programmers to make their life more difficult, especially WRT debugging. (Programming's supposed to be hard, right? And it really shows off how clever you are when you spend hours/days/weeks tracking down an obscure bug... and what's the best way to make a bug obscure? Make it so the compiler accepts the widest range of possible syntax-structures [which should be similar] and outputs a runnable executable: we need to increase the edit-compile-run loop!)

[End Warning]

That is the real reason that Ada (and Delphi and Object Pascal) isn't as popular as C-ish languages; the compiler is so stubborn that it complains with sensible error-messages until you fix things... which leaves the programmer with [almost] only logic-errors. And who wants to admit that they said "not in" instead of "in", "<" instead of "<=" or changed the code so that assumptions were no longer valid?

That's not programming! There's just not enough debugging involved -- the dragons are too small! In fact, if we were really clever we'd use a language consisting only of tabs and meaning could be inferred from context!

But on a more serious note; it might be interesting to build a [basically mufti-lingual] compiler that could, say, take a grammar and a source and compile the source. {Yeah, that'd be kinda like GCC, with all it's front-ends.} Then you could inexpensively try out different grammars until you find your Ada/C hybrid.



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

* Re: Ada and Java/C++
  2012-08-28  6:57   ` Shark8
@ 2012-08-28  8:28     ` kalvin.news
  2012-08-28 10:00       ` Niklas Holsti
  2012-08-28  8:31     ` kalvin.news
  1 sibling, 1 reply; 31+ messages in thread
From: kalvin.news @ 2012-08-28  8:28 UTC (permalink / raw)


tiistai, 28. elokuuta 2012 9.57.40 UTC+3 Shark8 kirjoitti:
> On Monday, August 27, 2012 11:35:28 PM UTC-6, kalvi...@gmail.com wrote:
> 
> > My suggestion here is to introduce Ada's good virtues for C and Java programmers in syntax that is familiar to most of the software engineers.
> 
> You aren't listening to the replies you're getting; it's a bad idea to try to gloss over (extend) C/Java syntax. Randy's reply is a good one in explaining why syntax itself matters.

I hear you, and I have read replies - Randy's too, and I could not agree more with the replies.

I do understand the fact, that the Ada's syntax is crafted for good readability and less error prone as Java/C.

We are standing at the shoulders of giants here: C, Java and Ada are all mature languages, and C's and Java's weaknesses are well documented. Ada has excellent document about the rationale behind the language and the decisions made during language development.

But if the programmers *want* to use or are *insiting in using* languages with resemble Java/C, then the best we can do is to fix the Java/C syntax as much as possible, and remove or fix the parts that are considered dangerous.

As many responders have pointed out, that it might not be possible to express Ada completely in C/Java-like syntax. Maybe we could come up with something, that is half-way between the languages. Someone in the thread suggested expressing a subset of Ada in C/Java-like syntax. That might be a good and reasonable solution. The result would be somewhere between Ada and Java/C: strong type checking, packages, free from error prone syntax like dangling-elses etc. 

If the programmer wants to get full Ada power, they should start using Ada instead. But they would already be half-way there: They would be accustomed with strict type checking, packages etc. and better software construction. And after that, the Ada might appear to be more natural to them.

Btw, the ideas on implementing a preprocessor and/or JVM compiler are excellent.

- Calvin



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

* Re: Ada and Java/C++
  2012-08-28  6:57   ` Shark8
  2012-08-28  8:28     ` kalvin.news
@ 2012-08-28  8:31     ` kalvin.news
  2012-08-28  9:15       ` Niklas Holsti
  1 sibling, 1 reply; 31+ messages in thread
From: kalvin.news @ 2012-08-28  8:31 UTC (permalink / raw)


tiistai, 28. elokuuta 2012 9.57.40 UTC+3 Shark8 kirjoitti:

> But on a more serious note; it might be interesting to build a [basically mufti-lingual] compiler that could, say, take a grammar and a source and compile the source. {Yeah, that'd be kinda like GCC, with all it's front-ends.} Then you could inexpensively try out different grammars until you find your Ada/C hybrid.

This is an excellent suggestion. In that way one could prototype with the ideas and see what works and what doesn't.




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

* Re: Ada and Java/C++
  2012-08-28  8:31     ` kalvin.news
@ 2012-08-28  9:15       ` Niklas Holsti
  0 siblings, 0 replies; 31+ messages in thread
From: Niklas Holsti @ 2012-08-28  9:15 UTC (permalink / raw)


On 12-08-28 11:31 , kalvin.news@gmail.com wrote:
> tiistai, 28. elokuuta 2012 9.57.40 UTC+3 Shark8 kirjoitti:
> 
>> But on a more serious note; it might be interesting to build a
>> [basically mufti-lingual] compiler that could, say, take a grammar
>> and a source and compile the source. {Yeah, that'd be kinda like
>> GCC, with all it's front-ends.} Then you could inexpensively try
>> out different grammars until you find your Ada/C hybrid.
> 
> This is an excellent suggestion. In that way one could prototype with
> the ideas and see what works and what doesn't.

Look up "metacompiler" or "compiler-compiler" or "compiler generator".
This area has been worked on for a long time, with some useful results,
but it is still not so easy to "try out a different grammar", except for
trivial (lexical) changes to the grammar, such as using curly brackets
instead of keywords.

Also, to see "what works", one would have to set up controlled
experiments involving many programmers using the various syntaxes for
various kinds of programs of non-trivial size. That becomes expensive,
unless you can interest teachers to force the experiments on students,
which, unfortunately, is not a realistic enviroment.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
      .      @       .



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

* Re: Ada and Java/C++
  2012-08-28  5:35 ` kalvin.news
  2012-08-28  6:57   ` Shark8
@ 2012-08-28  9:54   ` gautier_niouzes
  2012-08-28 14:08     ` kalvin.news
  1 sibling, 1 reply; 31+ messages in thread
From: gautier_niouzes @ 2012-08-28  9:54 UTC (permalink / raw)


Le mardi 28 août 2012 07:35:28 UTC+2, kalvi...@gmail.com a écrit :

> 5. Ada programmers are hard to find
> 
> - For example, DoD has faced the problem of finding Ada programmers, DoD has been force into situation that mission critical software is being implemented in Java
> 
> - Java and C programmers see Ada as a complex language
> - Ada is perceived as military language
> - Ada is perceived as a complex and heavy language

You are right and it is the usual old gossip you hear often.
It has all to do with image and IMHO rather linked to the kind of applications that are made (or people think are made) with Ada, much more than the syntax.
The only way to change that is having someone making a successful Web service or popular desktop applications with Ada and develop into a large software company using principally Ada.
So go for it with Jada or Cada, but use another name, otherwise people will think you are trying to make a complex, heavy, and military variant of C or Java ;-).
G.
__
PS: Note that SQL programmers like Ada as it looks familiar with what they already know...



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

* Re: Ada and Java/C++
  2012-08-28  8:28     ` kalvin.news
@ 2012-08-28 10:00       ` Niklas Holsti
  0 siblings, 0 replies; 31+ messages in thread
From: Niklas Holsti @ 2012-08-28 10:00 UTC (permalink / raw)


On 12-08-28 11:28 , kalvin.news@gmail.com wrote:
> tiistai, 28. elokuuta 2012 9.57.40 UTC+3 Shark8 kirjoitti:
>> On Monday, August 27, 2012 11:35:28 PM UTC-6, kalvi...@gmail.com
>> wrote:
>> 
>>> My suggestion here is to introduce Ada's good virtues for C and
>>> Java programmers in syntax that is familiar to most of the
>>> software engineers.
>> 
>> You aren't listening to the replies you're getting; it's a bad idea
>> to try to gloss over (extend) C/Java syntax. Randy's reply is a
>> good one in explaining why syntax itself matters.
> 
> I hear you, and I have read replies - Randy's too, and I could not
> agree more with the replies.

If you agree with the replies, none of which support your suggestion,
why do you persist with the idea?

> But if the programmers *want* to use or are *insiting in using*
> languages with resemble Java/C,

Any programmer who is that pig-headed about syntax is probably too
pig-headed to learn the new concepts that Ada provides, too. Good riddance.

Good programmers (well, people whom I consider good programmers) *like*
to learn new languages, with new syntax and all, as long as the new
things expand their programming abilities. I don't think Ada is held
back by its non-C/Java syntax. It is held back by inertia, poor
visibility, lack of compilers for many embedded systems, and by not
being aimed at web-based applications.

> As many responders have pointed out, that it might not be possible to
> express Ada completely in C/Java-like syntax. Maybe we could come up
> with something, that is half-way between the languages. Someone in
> the thread suggested expressing a subset of Ada in C/Java-like
> syntax. That might be a good and reasonable solution.

I spoke of such a subset, but only to reject it, because it would be a
dead end.

> If the programmer wants to get full Ada power, they should start
> using Ada instead. But they would already be half-way there:

No, they would be half-way *in the wrong direction*.

> They
> would be accustomed with strict type checking, packages etc. and
> better software construction.

The Ada features for these things are packages, the definition of new
types, type derivation, generics, and tagged types. There is no syntax
for such things in C, so they would not be in the "C subset".

If you want to help C programmers, IMO the best way forward is to
improve C. Many C programmers would like C to have a better concept of
modules, perhaps similar to Ada packages, and the same goes for many
other weaknesses of C. But they also need to have compatibility, which
is possible by adding new abilities to C, but is not possible by
switching to Ada with a C-look-alike syntax.

It seems to me that C++ is already moving in this direction, for example
by making it possible to prevent implicit use of conversion functions.

> Btw, the ideas on implementing a preprocessor and/or JVM compiler are
> excellent.

Ada compilers that target the JVM exist. They use the standard Ada
syntax. The target is irrelevant to your proposal.

Way back, there were Ada preprocessors (or perhaps even compilers?) to
let one write Ada programs with keywords in French, and perhaps other
languages. I don't think any remain.

For a preprocessor from C-like Ada to Ada, the basic problem remains:
since Ada has many features that C lacks, you would have to invent new
C-like syntax for these features, and then they would not be familiar to
C programmers.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
      .      @       .



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

* Re: Ada and Java/C++
  2012-08-28  2:14       ` Adam Beneschan
@ 2012-08-28 10:50         ` Brian Drummond
  2012-08-28 14:22           ` kalvin.news
       [not found]           ` <gcup38ldi4afrt9q2uj70qoe7l2lcn4rk1@invalid.netcom.com>
  0 siblings, 2 replies; 31+ messages in thread
From: Brian Drummond @ 2012-08-28 10:50 UTC (permalink / raw)


On Mon, 27 Aug 2012 19:14:39 -0700, Adam Beneschan wrote:

> On Monday, August 27, 2012 4:16:39 PM UTC-7, Randy Brukardt wrote:
> 
>> I agree with you here (but also see below). But the syntax of a
>> language is a very important part of the foundation of the language.
>> Ada's syntax is designed to minimize the possibility for inadvertant
>> errors, which is not the case with the C syntax. 

> Hmmm ... I guess it depends on just how much of the syntax the OP is
> thinking of keeping.  I'd think that if we're just talking about the
> "look and feel", one could probably develop a language that has the
> functionality of Ada but using C-like keywords and operators, without
> compromising safety.  

I suspect you are onto something here ... I believe the OP meant not the 
syntax, but the lexical level of the language. A lot of the "feel" of a 
page of source comes from the tokens used, rather than the order of their 
arrangement. 

Changing begin and end to { and } does not change the syntax a jot*, but 
makes the language look a lot more like C. And I suspect THAT is what the 
OP intended. 
(I appreciate that would leave a lot of work around things like 
conditional statements, to make them "look right" while preserving their 
syntactic advantages. But bear with me...)

Perhaps it could be run through a simple macro preprocessor and turned 
into Ada.

> I'm not saying it's a good idea. Personally, if
> someone sent me a compiler for a language like that, I wouldn't just
> delete it from my system, I'd print it out just so that I could run it
> through a shredder and then stomp on it.
> 
> But some changes, like using [] instead of () for array indices or { }
> instead of begin/end or expressing type conversions as (type)expression
> instead of type(expression), wouldn't seem to have any negative impacts
> on safety.  (Just on aesthetics.)  

And refactoring, when you substitute evaluation for lookup, or vice versa.

> The point is that if the OP's premise is correct--that Java is popular
> because it borrows from C syntax even though it eliminated some of the
> unsafe and error-prone things from the language, then in theory, a
> mutant Ada language with C-like syntax could do the same.  If I were
> induced by a very large sum of money to help develop such a language,
> I'd want to make some changes like (1) making assignment statements
> statements rather than expressions, ...

While agreeing with your list, I would go further and simply keep Ada's 
syntax largely intact*; restricting the changes to what can be 
accomplished at the lexical analysis stage.

* I don't see that transforming "a += b" into "a := a + b" etc would 
break this model...

- Brian



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

* Re: Ada and Java/C++
  2012-08-28  9:54   ` gautier_niouzes
@ 2012-08-28 14:08     ` kalvin.news
  0 siblings, 0 replies; 31+ messages in thread
From: kalvin.news @ 2012-08-28 14:08 UTC (permalink / raw)


tiistai, 28. elokuuta 2012 12.54.07 UTC+3 (tuntematon) kirjoitti:
 
> So go for it with Jada or Cada, but use another name, otherwise people will think you are trying to make a complex, heavy, and military variant of C or Java ;-).
> 
> G.
> 
> __
> 
> PS: Note that SQL programmers like Ada as it looks familiar with what they already know...

Yes, Jada / Cada are just work names used in this tread to represent the relationship with Java and C. :)

- Calvin



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

* Re: Ada and Java/C++
  2012-08-28 10:50         ` Brian Drummond
@ 2012-08-28 14:22           ` kalvin.news
       [not found]           ` <gcup38ldi4afrt9q2uj70qoe7l2lcn4rk1@invalid.netcom.com>
  1 sibling, 0 replies; 31+ messages in thread
From: kalvin.news @ 2012-08-28 14:22 UTC (permalink / raw)


tiistai, 28. elokuuta 2012 13.50.41 UTC+3 Brian Drummond kirjoitti:
> On Mon, 27 Aug 2012 19:14:39 -0700, Adam Beneschan wrote:
> 
> 
> 
> > On Monday, August 27, 2012 4:16:39 PM UTC-7, Randy Brukardt wrote:
> 
> > 
> 
> >> I agree with you here (but also see below). But the syntax of a
> 
> >> language is a very important part of the foundation of the language.
> 
> >> Ada's syntax is designed to minimize the possibility for inadvertant
> 
> >> errors, which is not the case with the C syntax. 
> 
> 
> 
> > Hmmm ... I guess it depends on just how much of the syntax the OP is
> 
> > thinking of keeping.  I'd think that if we're just talking about the
> 
> > "look and feel", one could probably develop a language that has the
> 
> > functionality of Ada but using C-like keywords and operators, without
> 
> > compromising safety.  
> 
> 
> 
> I suspect you are onto something here ... I believe the OP meant not the 
> 
> syntax, but the lexical level of the language. A lot of the "feel" of a 
> 
> page of source comes from the tokens used, rather than the order of their 
> 
> arrangement. 
> 
> 
> 
> Changing begin and end to { and } does not change the syntax a jot*, but 
> 
> makes the language look a lot more like C. And I suspect THAT is what the 
> 
> OP intended. 
> 
> (I appreciate that would leave a lot of work around things like 
> 
> conditional statements, to make them "look right" while preserving their 
> 
> syntactic advantages. But bear with me...)
> 
> 
> 
> Perhaps it could be run through a simple macro preprocessor and turned 
> 
> into Ada.
> 
> 
> 
> > I'm not saying it's a good idea. Personally, if
> 
> > someone sent me a compiler for a language like that, I wouldn't just
> 
> > delete it from my system, I'd print it out just so that I could run it
> 
> > through a shredder and then stomp on it.
> 
> > 
> 
> > But some changes, like using [] instead of () for array indices or { }
> 
> > instead of begin/end or expressing type conversions as (type)expression
> 
> > instead of type(expression), wouldn't seem to have any negative impacts
> 
> > on safety.  (Just on aesthetics.)  
> 
> 
> 
> And refactoring, when you substitute evaluation for lookup, or vice versa.
> 
> 
> 
> > The point is that if the OP's premise is correct--that Java is popular
> 
> > because it borrows from C syntax even though it eliminated some of the
> 
> > unsafe and error-prone things from the language, then in theory, a
> 
> > mutant Ada language with C-like syntax could do the same.  If I were
> 
> > induced by a very large sum of money to help develop such a language,
> 
> > I'd want to make some changes like (1) making assignment statements
> 
> > statements rather than expressions, ...
> 
> 
> 
> While agreeing with your list, I would go further and simply keep Ada's 
> 
> syntax largely intact*; restricting the changes to what can be 
> 
> accomplished at the lexical analysis stage.
> 
> 
> 
> * I don't see that transforming "a += b" into "a := a + b" etc would 
> 
> break this model...
> 
> 
> 
> - Brian

Brian, you were able to express my intention more clearly that I could do. And the idea of Jada-to-Ada translator is also a good for proof-of-concept. Ultimately the translator needs to be scrapped, as Ada is still a four letter word for many programmers (pun intended).

- Calvin



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

* Re: Ada and Java/C++
       [not found]           ` <gcup38ldi4afrt9q2uj70qoe7l2lcn4rk1@invalid.netcom.com>
@ 2012-08-28 23:00             ` Brian Drummond
       [not found]               ` <fouq38tqdp7fh86l2dp2pmr8jfdgi24i7j@invalid.netcom.com>
  0 siblings, 1 reply; 31+ messages in thread
From: Brian Drummond @ 2012-08-28 23:00 UTC (permalink / raw)


On Tue, 28 Aug 2012 13:09:24 -0400, Dennis Lee Bieber wrote:

> On Tue, 28 Aug 2012 10:50:40 +0000 (UTC), Brian Drummond
> <brian@shapes.demon.co.uk> declaimed the following in comp.lang.ada:
> 
>> Changing begin and end to { and } does not change the syntax a jot*,
>> but
> 
> 	But you would also be changing
> 
> begin			{
> then			{
> loop			{

(etc) ... you certainly would, as I conceded originally "it would take a 
lot of work" if the result was not to mess up badly - including error 
reporting, as you say.

> 	It would make a mess of compiler error reporting when the compiler
> can not identify if a missing "end" is an "end if", "end case", "end
> loop", "end whatever".

However the error report would originate in the compiler - not the 
preprocessor - and therefore it would be on the generated Ada (with a 
post-processor nod to the original code). It would say 
"missing } : end if" or such, and the coder would be responsible for 
counting his }}}}s. 

I think that would be of benefit, by pointing out how much easier it 
would be to write Ada directly!

- Brian




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

* Re: Ada and Java/C++
       [not found]               ` <fouq38tqdp7fh86l2dp2pmr8jfdgi24i7j@invalid.netcom.com>
@ 2012-08-29 10:39                 ` Brian Drummond
  0 siblings, 0 replies; 31+ messages in thread
From: Brian Drummond @ 2012-08-29 10:39 UTC (permalink / raw)


On Tue, 28 Aug 2012 22:22:54 -0400, Dennis Lee Bieber wrote:

> On Tue, 28 Aug 2012 23:00:27 +0000 (UTC), Brian Drummond
> <brian@shapes.demon.co.uk> declaimed the following in comp.lang.ada:
> 
> 
>> However the error report would originate in the compiler - not the
>> preprocessor - and therefore it would be on the generated Ada (with a
>> post-processor nod to the original code). It would say "missing } : end
>> if" or such, and the coder would be responsible for counting his }}}}s.
>>
> 	But it can't be sure which is missing if one has a nested mix --
> there is the possibility that, if a "end if" } is missing, the next }
> (meant for an "end loop") is taken to be the "end if", and the error for
> the "missing" "end loop" is only reported at the end of the procedure.
> Whereas Ada would detect the missing "end if" when it parses the "end
> loop".

Indeed so. When the preprocessor generates Ada, it would place "end if" 
in the place of "end loop", and it would be up to the programmer to 
notice that it was in the wrong place. If the code is suitably written, 
the indentation might make that clear, but there are no guarantees of 
that!

One can hope that the programmer would soon learn the advantages of Ada's 
uncannily accurate error messages, and take off the training wheels.

- Brian



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

* Re: Ada and Java/C++
  2012-08-27 10:46 Ada and Java/C++ kalvin.news
                   ` (5 preceding siblings ...)
  2012-08-28  5:35 ` kalvin.news
@ 2012-08-29 10:52 ` kalvin.news
  6 siblings, 0 replies; 31+ messages in thread
From: kalvin.news @ 2012-08-29 10:52 UTC (permalink / raw)


I would like to thank you all for your comments, suggestions, insight and criticism.

It looks like that my original idea representing Ada features in Java/C-syntax may not be feasible.

Anyway, thanks again.

Br,
- Calvin



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

end of thread, other threads:[~2012-08-29 10:52 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-27 10:46 Ada and Java/C++ kalvin.news
2012-08-27 11:48 ` Dmitry A. Kazakov
2012-08-27 13:44   ` kalvin.news
2012-08-27 14:33     ` Dmitry A. Kazakov
2012-08-27 15:26     ` J-P. Rosen
2012-08-27 15:46       ` Georg Bauhaus
2012-08-27 16:08       ` kalvin.news
2012-08-27 23:16     ` Randy Brukardt
2012-08-28  2:14       ` Adam Beneschan
2012-08-28 10:50         ` Brian Drummond
2012-08-28 14:22           ` kalvin.news
     [not found]           ` <gcup38ldi4afrt9q2uj70qoe7l2lcn4rk1@invalid.netcom.com>
2012-08-28 23:00             ` Brian Drummond
     [not found]               ` <fouq38tqdp7fh86l2dp2pmr8jfdgi24i7j@invalid.netcom.com>
2012-08-29 10:39                 ` Brian Drummond
2012-08-27 14:35   ` Nomen Nescio
2012-08-27 21:23     ` gautier_niouzes
2012-08-27 14:09 ` Niklas Holsti
     [not found] ` <al1n38tdd0tq6p1os6p6angt91mginhoup@invalid.netcom.com>
2012-08-27 14:49   ` kalvin.news
2012-08-27 14:53   ` kalvin.news
2012-08-27 19:46     ` Shark8
2012-08-27 20:11     ` gautier_niouzes
2012-08-27 19:41 ` Shark8
2012-08-27 20:06 ` gautier_niouzes
2012-08-28  5:35 ` kalvin.news
2012-08-28  6:57   ` Shark8
2012-08-28  8:28     ` kalvin.news
2012-08-28 10:00       ` Niklas Holsti
2012-08-28  8:31     ` kalvin.news
2012-08-28  9:15       ` Niklas Holsti
2012-08-28  9:54   ` gautier_niouzes
2012-08-28 14:08     ` kalvin.news
2012-08-29 10:52 ` kalvin.news

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