comp.lang.ada
 help / color / mirror / Atom feed
* How to make Ada popular. Get rid of ";" at end of statement.
@ 2019-07-19 21:41 Nasser M. Abbasi
  2019-07-19 22:09 ` Dmitry A. Kazakov
                   ` (3 more replies)
  0 siblings, 4 replies; 43+ messages in thread
From: Nasser M. Abbasi @ 2019-07-19 21:41 UTC (permalink / raw)


According to https://hackernoon.com/best-coding-languages-to-learn-in-2019-b49b49250a25

Python has become very popular because

"Part of the reason for Python’s popularity is that it
gets rid of the annoying conventions of other languages, such as
using semicolons to indicate the end of a statement. This may
explain why Python is replacing Java as the primary language
of instruction for teaching computer science — not just at
universities but in high school and elementary school programs too"

So I'd like to make a suggestion: Remove ";" from Ada.

I know this might be hard to do, as it might cause some bugs
in current programs, but a conversion tool should take care of
things.

Well. It is one way to try to make Ada popular :)

--Nasser

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-19 21:41 How to make Ada popular. Get rid of ";" at end of statement Nasser M. Abbasi
@ 2019-07-19 22:09 ` Dmitry A. Kazakov
  2019-07-20  6:47   ` J-P. Rosen
  2019-07-20 13:46   ` Dennis Lee Bieber
  2019-07-20  0:47 ` Matt Borchers
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 43+ messages in thread
From: Dmitry A. Kazakov @ 2019-07-19 22:09 UTC (permalink / raw)


On 2019-07-19 23:41, Nasser M. Abbasi wrote:
> According to 
> https://hackernoon.com/best-coding-languages-to-learn-in-2019-b49b49250a25
> 
> Python has become very popular because
> 
> "Part of the reason for Python’s popularity is that it
> gets rid of the annoying conventions of other languages, such as
> using semicolons to indicate the end of a statement. This may
> explain why Python is replacing Java as the primary language
> of instruction for teaching computer science — not just at
> universities but in high school and elementary school programs too"
> 
> So I'd like to make a suggestion: Remove ";" from Ada.
> 
> I know this might be hard to do, as it might cause some bugs
> in current programs, but a conversion tool should take care of
> things.
> 
> Well. It is one way to try to make Ada popular :)

Why not to remove just everything? Great minds already thought about it. 
Look at Whitespace:

    https://en.wikipedia.org/wiki/Whitespace_(programming_language)

It is far ahead of Python in terms of removing annoying stuff. The code 
is absolutely pristine, nothing disturbing catches your eye or distracts 
you from the exciting process of counting spaces...

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

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

* How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-19 21:41 How to make Ada popular. Get rid of ";" at end of statement Nasser M. Abbasi
  2019-07-19 22:09 ` Dmitry A. Kazakov
@ 2019-07-20  0:47 ` Matt Borchers
  2019-07-20 13:54   ` Dennis Lee Bieber
  2019-07-20 14:40 ` Stephen Davies
  2019-07-23 21:58 ` Ingo M.
  3 siblings, 1 reply; 43+ messages in thread
From: Matt Borchers @ 2019-07-20  0:47 UTC (permalink / raw)


Python does have a separator. It's the newline. Ada treats newline as whitespace same as space or tab.

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-19 22:09 ` Dmitry A. Kazakov
@ 2019-07-20  6:47   ` J-P. Rosen
  2019-07-20  8:42     ` Paul Rubin
  2019-07-20 17:08     ` Stéphane Rivière
  2019-07-20 13:46   ` Dennis Lee Bieber
  1 sibling, 2 replies; 43+ messages in thread
From: J-P. Rosen @ 2019-07-20  6:47 UTC (permalink / raw)


Le 20/07/2019 à 00:09, Dmitry A. Kazakov a écrit :
> On 2019-07-19 23:41, Nasser M. Abbasi wrote:
>> According to
>> https://hackernoon.com/best-coding-languages-to-learn-in-2019-b49b49250a25
>>
>>
>> Python has become very popular because
>>
>> "Part of the reason for Python’s popularity is that it
>> gets rid of the annoying conventions of other languages, such as
>> using semicolons to indicate the end of a statement. This may
>> explain why Python is replacing Java as the primary language
>> of instruction for teaching computer science — not just at
>> universities but in high school and elementary school programs too"

It's not because someone posts an unsupported stupid claim that it has
to be followed... Python's idea of using indentation for range of
statements is a typical false good idea.

-- 
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] 43+ messages in thread

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-20  6:47   ` J-P. Rosen
@ 2019-07-20  8:42     ` Paul Rubin
  2019-07-21  5:11       ` J-P. Rosen
  2019-07-20 17:08     ` Stéphane Rivière
  1 sibling, 1 reply; 43+ messages in thread
From: Paul Rubin @ 2019-07-20  8:42 UTC (permalink / raw)


"J-P. Rosen" <rosen@adalog.fr> writes:
> It's not because someone posts an unsupported stupid claim that it has
> to be followed... Python's idea of using indentation for range of
> statements is a typical false good idea.

It's certainly not about the semicolons, but Python code is very concise
and fluid to write.  It's also easy to learn and has a pleasant
interactive testing environment.  Lisp had similar attractions in an
earlier era, and it still does for some.

Python's indentation-based syntax is mostly a good thing though they did
paint themselves into a corner a few times.  Haskell has something
similar called "layout" where you can use indentation as an alternative
to curly brace syntax.  Haskell's version works better than Python's in
my opinion.

Python doesn't really try to compete in Ada's space of very big, highly
reliable, high performance systems.  It's for quickly banging out
something that is not too complicated, and that basically works or is
easy to fix when it throws an error.  In Ada circles that is sometimes
called rapid prototyping.

Here's a familiar old paper (you may have seen it) about a rapid
prototyping experiment comparing Haskell, Ada, and other languages:

  https://web.cecs.pdx.edu/~apt/cs457_2005/hudak-jones.pdf

The Ada solution for that problem needed around 10x as much code as the
Haskell solution.  Python wasn't included, but Python code for the same
problem would have looked fairly similar to the Haskell code.


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-19 22:09 ` Dmitry A. Kazakov
  2019-07-20  6:47   ` J-P. Rosen
@ 2019-07-20 13:46   ` Dennis Lee Bieber
  1 sibling, 0 replies; 43+ messages in thread
From: Dennis Lee Bieber @ 2019-07-20 13:46 UTC (permalink / raw)


On Sat, 20 Jul 2019 00:09:44 +0200, "Dmitry A. Kazakov"
<mailbox@dmitry-kazakov.de> declaimed the following:

>
>Why not to remove just everything? Great minds already thought about it. 
>Look at Whitespace:
>
>    https://en.wikipedia.org/wiki/Whitespace_(programming_language)
>
>It is far ahead of Python in terms of removing annoying stuff. The code 
>is absolutely pristine, nothing disturbing catches your eye or distracts 
>you from the exciting process of counting spaces...

	Lovely... And since FORTRAN IV ignores spaces on a line, one can embed
Whitespace code within F-IV keywords and identifiers, not just between
them...


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-20  0:47 ` Matt Borchers
@ 2019-07-20 13:54   ` Dennis Lee Bieber
  0 siblings, 0 replies; 43+ messages in thread
From: Dennis Lee Bieber @ 2019-07-20 13:54 UTC (permalink / raw)


On Fri, 19 Jul 2019 17:47:17 -0700 (PDT), Matt Borchers
<mattborchers@gmail.com> declaimed the following:

>Python does have a separator. It's the newline. Ada treats newline as whitespace same as space or tab.

	Not quite... a newline with unclosed paren/brace/bracket is just
logically another space/tab

x = f(a,
		b,
		c)

	Gets really fun with strings, as Python concatenates adjacent string
literals...

>>> longstr = (	"part one"
... 	"part two "
... 	"part three"	)
>>> longstr
'part onepart two part three'
>>> 
>>> longstr = [ "part one"
... 	"part two "
... 	"part three"	]
>>> longstr
['part onepart two part three']
>>> 
	{Difference being that the () just grouped the three, while [] defines
a list -- of one element, being the concatenated strings}


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-19 21:41 How to make Ada popular. Get rid of ";" at end of statement Nasser M. Abbasi
  2019-07-19 22:09 ` Dmitry A. Kazakov
  2019-07-20  0:47 ` Matt Borchers
@ 2019-07-20 14:40 ` Stephen Davies
  2019-07-20 15:45   ` Optikos
  2019-07-20 21:14   ` Keith Thompson
  2019-07-23 21:58 ` Ingo M.
  3 siblings, 2 replies; 43+ messages in thread
From: Stephen Davies @ 2019-07-20 14:40 UTC (permalink / raw)


On Friday, 19 July 2019 22:42:00 UTC+1, Nasser M. Abbasi  wrote:
> According to https://hackernoon.com/best-coding-languages-to-learn-in-2019-b49b49250a25
> 
> ... I'd like to make a suggestion: Remove ";" from Ada.
> 

I don't see this as being a problem given the numerous popular
languages that do use semicolons.

But I do think that maybe Ada would be less off-putting to people
who know other languages if it adopted some constructs that are
now standard in nearly all languages, e.g.:-

Allow 0x, 0b and 0o for Hex, Bin and Octal numbers
(with an optional extra parameter in Integer_IO.Put)

Allow == for equality, though obviously only allow := for assignment
(maybe make this the preferred form, similar to how
Mixed_Case took over from UPPER_CASE)

I also think that the annoying leading-space on Integer'Image is
off-putting to newbies too because it's those early programs where
you often just want to embed a number in an output string quickly.
Would it really be that hard to add a Trim_Image attribute or add
a Width parameter to Integer'Image?

Finally, not to be entirely negative, I realy like the new @ feature
and hope it makes people looking at Ada who are used to +=, etc
think "ooh, that's nice".

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-20 14:40 ` Stephen Davies
@ 2019-07-20 15:45   ` Optikos
  2019-07-20 17:24     ` joviangm
  2019-07-20 21:14   ` Keith Thompson
  1 sibling, 1 reply; 43+ messages in thread
From: Optikos @ 2019-07-20 15:45 UTC (permalink / raw)


On Saturday, July 20, 2019 at 9:40:56 AM UTC-5, Stephen Davies wrote:
> On Friday, 19 July 2019 22:42:00 UTC+1, Nasser M. Abbasi  wrote:
> > According to https://hackernoon.com/best-coding-languages-to-learn-in-2019-b49b49250a25
> > 
> > ... I'd like to make a suggestion: Remove ";" from Ada.
> > 
> 
> I don't see this as being a problem given the numerous popular
> languages that do use semicolons.
> 
> But I do think that maybe Ada would be less off-putting to people
> who know other languages if it adopted some constructs that are
> now standard in nearly all languages, e.g.:-
> 
> Allow 0x, 0b and 0o for Hex, Bin and Octal numbers
> (with an optional extra parameter in Integer_IO.Put)
> 
> Allow == for equality, though obviously only allow := for assignment
> (maybe make this the preferred form, similar to how
> Mixed_Case took over from UPPER_CASE)
> 
> I also think that the annoying leading-space on Integer'Image is
> off-putting to newbies too because it's those early programs where
> you often just want to embed a number in an output string quickly.
> Would it really be that hard to add a Trim_Image attribute or add
> a Width parameter to Integer'Image?
> 
> Finally, not to be entirely negative, I realy like the new @ feature
> and hope it makes people looking at Ada who are used to +=, etc
> think "ooh, that's nice".

None of these cosmetic syntax differences of historical opinion among the language families are what newbies find off-putting in Ada.

What newbies find off-putting (and this is what I have heard time & time again for decades from C++ers who find C++ “easier” than Ada—including at my alma mater university whose main language was Ada from the mid-1980s to the early 2000s) is the plethora of compile-time rule enforcement •••that require a language-lawyer memorization of the language international standard & its rationale instead of something automated in the toolchain akin to fix-its in Xcode where the compiler or IDE either in textual error message or even better by source-code regeneration that is aware of •all• the numerous hundreds of common pitfalls and the best-practice better design that actually compiles by obeying all of Ada's semantic rules•••.  It is the semantic challenge, not the surface syntax.

C++ in the early days thought of itself as Ada done right because it transferred this language-lawyer memorization problem-space into an obey-the-habitual-idioms problem-space by a network of C++ers in the know:  e.g., RAII, pimpl, the curiously-recurring template inheritance, the legend & lore handed down in don't-do-that immense coding standards, and so forth.

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-20  6:47   ` J-P. Rosen
  2019-07-20  8:42     ` Paul Rubin
@ 2019-07-20 17:08     ` Stéphane Rivière
  1 sibling, 0 replies; 43+ messages in thread
From: Stéphane Rivière @ 2019-07-20 17:08 UTC (permalink / raw)


> to be followed... Python's idea of using indentation for range of
> statements is a typical false good idea.

I second that.

-- 
Be Seeing You
Number Six

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-20 15:45   ` Optikos
@ 2019-07-20 17:24     ` joviangm
  2019-07-20 19:10       ` Optikos
  0 siblings, 1 reply; 43+ messages in thread
From: joviangm @ 2019-07-20 17:24 UTC (permalink / raw)


On Saturday, 20 July 2019 16:45:44 UTC+1, Optikos  wrote:

> What newbies find off-putting ... memorization of the language
> international standard & its rationale instead of something automated
> in the toolchain

Sounds like you're complaining more about the Ada tools than the language
but to get better tools we need to drastically increase the Ada userbase.
So anything that might help Ada code look more familiar to people used to
other languages has to at least be considered.


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-20 17:24     ` joviangm
@ 2019-07-20 19:10       ` Optikos
  2019-07-20 19:17         ` AdaMagica
  2019-07-20 22:24         ` Paul Rubin
  0 siblings, 2 replies; 43+ messages in thread
From: Optikos @ 2019-07-20 19:10 UTC (permalink / raw)


On Saturday, July 20, 2019 at 12:24:29 PM UTC-5, jovi...@gmail.com wrote:
> On Saturday, 20 July 2019 16:45:44 UTC+1, Optikos  wrote:
> 
> > What newbies find off-putting ... memorization of the language
> > international standard & its rationale instead of something automated
> > in the toolchain
> 
> Sounds like you're complaining more about the Ada tools than the language
> but to get better tools we need to drastically increase the Ada userbase.
> So anything that might help Ada code look more familiar to people used to
> other languages has to at least be considered.

First, •I• am not the one complaining; I am merely a reporter of what I have heard, even from C++ standards-body members and C++ luminaries, plus from debate between students & professors at my Ada-centric alma mater.

Second, surface spelling syntax has absolutely nothing to either worsen or rectify perceived-difficult-to-swallow •semantic meaning•.  People don't like Ada because it is a taskmaster of correctness.  Actually people don't mind Ada being a taskmaster of correctness per se; they mind that they cannot easily find & memorize & digest the quantity-x rules that it takes to satisfy the semantic restrictions without having a lengthy conversation with the compiler that gives perceived-arcane, perceived-oblique, and perceived-na-na-na-na-na-catch-me-if-you-can error messages (instead of best-practice fix-it transforms of their source code).  None of that is surface syntax of whether end-of-statement is spelled ; or newline syntactically, of whether assignment is spelled = or :=, of whether blocks are {}-bounded or begin/constructIntroducer-end-bounded, of whether comparison is via == or != versus = or /=, of whether comments are spelled -- versus //, nor of whether integer literals are spelled with 0x or 0 or 0b prefixes versus with 16# or 8# or 2# prefixes.

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-20 19:10       ` Optikos
@ 2019-07-20 19:17         ` AdaMagica
  2019-07-20 22:25           ` Paul Rubin
  2019-07-20 23:08           ` Optikos
  2019-07-20 22:24         ` Paul Rubin
  1 sibling, 2 replies; 43+ messages in thread
From: AdaMagica @ 2019-07-20 19:17 UTC (permalink / raw)


Am Samstag, 20. Juli 2019 21:10:27 UTC+2 schrieb Optikos:
> (instead of best-practice fix-it transforms of their source code).

What's that?

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-20 14:40 ` Stephen Davies
  2019-07-20 15:45   ` Optikos
@ 2019-07-20 21:14   ` Keith Thompson
  1 sibling, 0 replies; 43+ messages in thread
From: Keith Thompson @ 2019-07-20 21:14 UTC (permalink / raw)


Stephen Davies <joviangm@gmail.com> writes:
> On Friday, 19 July 2019 22:42:00 UTC+1, Nasser M. Abbasi  wrote:
>> According to https://hackernoon.com/best-coding-languages-to-learn-in-2019-b49b49250a25
>> 
>> ... I'd like to make a suggestion: Remove ";" from Ada.
>> 
>
> I don't see this as being a problem given the numerous popular
> languages that do use semicolons.
>
> But I do think that maybe Ada would be less off-putting to people
> who know other languages if it adopted some constructs that are
> now standard in nearly all languages, e.g.:-
>
> Allow 0x, 0b and 0o for Hex, Bin and Octal numbers
> (with an optional extra parameter in Integer_IO.Put)
>
> Allow == for equality, though obviously only allow := for assignment
> (maybe make this the preferred form, similar to how
> Mixed_Case took over from UPPER_CASE)

I think that having two different symbols for equality, with no
guidance for which one to use in what circumstances, would add
no value.

I can see an argument for using := for assignment and == for
equality, with = being a syntax error (or perhaps used for something
else), but the time to do that would have been when the language was
first being designed.  Likewise for alternatives for based literals.

> I also think that the annoying leading-space on Integer'Image is
> off-putting to newbies too because it's those early programs where
> you often just want to embed a number in an output string quickly.
> Would it really be that hard to add a Trim_Image attribute or add
> a Width parameter to Integer'Image?

I also find the leading space annoying.  I don't think adding
Integer'Image(42, Width => 0) would break anything.  (TeleSoft's Ada
compiler had a 'Extended_Image attribute that handled this and other
things with optional named parameters.)

> Finally, not to be entirely negative, I realy like the new @ feature
> and hope it makes people looking at Ada who are used to +=, etc
> think "ooh, that's nice".

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-20 19:10       ` Optikos
  2019-07-20 19:17         ` AdaMagica
@ 2019-07-20 22:24         ` Paul Rubin
  1 sibling, 0 replies; 43+ messages in thread
From: Paul Rubin @ 2019-07-20 22:24 UTC (permalink / raw)


Optikos <optikos@verizon.net> writes:
> People don't like Ada because it is a taskmaster of correctness.
> Actually people don't mind Ada being a taskmaster of correctness per
> se; they mind that they cannot easily find & memorize & digest the

I think it's simpler than that.  They don't like Ada because Ada
programs are very verbose for what they do.  Haskell is a taskmaster of
correctness that is hard to learn, but its code is concise, and its
users like it and its non-users mostly respect it.  Java is not
particularly a taskmaster of correctness and is not hard to learn, but
it is verbose and I don't think anyone (even its users) particularly
likes it.  People like Rust, but I'm not familiar with it enough to
compare it with Ada on these scales.


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-20 19:17         ` AdaMagica
@ 2019-07-20 22:25           ` Paul Rubin
  2019-07-20 23:08           ` Optikos
  1 sibling, 0 replies; 43+ messages in thread
From: Paul Rubin @ 2019-07-20 22:25 UTC (permalink / raw)


AdaMagica <christ-usch.grein@t-online.de> writes:
>> (instead of best-practice fix-it transforms of their source code).
> What's that?

Error messages that say "you did incorrect thing X, where you probably
meant correct thing Y instead".  I.e. that tell you how to fix the problem.


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-20 19:17         ` AdaMagica
  2019-07-20 22:25           ` Paul Rubin
@ 2019-07-20 23:08           ` Optikos
  1 sibling, 0 replies; 43+ messages in thread
From: Optikos @ 2019-07-20 23:08 UTC (permalink / raw)


On Saturday, July 20, 2019 at 2:17:39 PM UTC-5, AdaMagica wrote:
> Am Samstag, 20. Juli 2019 21:10:27 UTC+2 schrieb Optikos:
> > (instead of best-practice fix-it transforms of their source code).
> 
> What's that?

Although primarily utilized by Apple in Xcode to regurgitate deprecated old source code into the new-era breaking-change refreshed source code to permit Swift source-code bases in the user community to not get fossilized in some earlier revision of the language (so that no shop has an excuse to lag behind in language versions), fix-its can also be utilized to transform common programming anti-pattern/bad-habit idioms into best-practice idioms within the same era of Swift, not crossing revision-of-language boundaries.  It is fix-its that motivate thinking of Xcode as pronounced trans*-code instead of pronounced ecks code.

* trans(form), as in xlat short for translat(ion tables) in EE & assembly-language subcultures

https://www.lynda.com/Xcode-tutorials/Correct-errors-Fix-it/504071/558556-4.html

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-20  8:42     ` Paul Rubin
@ 2019-07-21  5:11       ` J-P. Rosen
  2019-07-23  9:24         ` darek
  0 siblings, 1 reply; 43+ messages in thread
From: J-P. Rosen @ 2019-07-21  5:11 UTC (permalink / raw)


Le 20/07/2019 à 10:42, Paul Rubin a écrit :
> It's certainly not about the semicolons, but Python code is very concise
> and fluid to write.
... but terrible to modify. Moving code around creates a lot of
opportunities for introducing errors.

> Python doesn't really try to compete in Ada's space of very big, highly
> reliable, high performance systems.  It's for quickly banging out
> something that is not too complicated, and that basically works or is
> easy to fix when it throws an error.  In Ada circles that is sometimes
> called rapid prototyping.
Agreed, but I'd call that "Kleenex" code: use it once and throw it away.

-- 
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] 43+ messages in thread

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-21  5:11       ` J-P. Rosen
@ 2019-07-23  9:24         ` darek
  0 siblings, 0 replies; 43+ messages in thread
From: darek @ 2019-07-23  9:24 UTC (permalink / raw)


Maybe you are aware this the language (or not). Some time ago a team at Uof Toronto developed a ";"-free  language of Pascal/Ada flavour:

  https://en.wikipedia.org/wiki/Turing_(programming_language)

Unfortunately, the system is no longer actively maintained. 

The language report: 
 Turing:  http://research.cs.queensu.ca/home/cordy/pub/downloads/tplus/Turing_Report.pdf
Turing+:
http://research.cs.queensu.ca/home/cordy/pub/downloads/tplus/Turing_Plus_Report.pdf

Regards,
  Darek






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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-19 21:41 How to make Ada popular. Get rid of ";" at end of statement Nasser M. Abbasi
                   ` (2 preceding siblings ...)
  2019-07-20 14:40 ` Stephen Davies
@ 2019-07-23 21:58 ` Ingo M.
  2019-07-23 23:56   ` Paul Rubin
  2019-07-24 14:06   ` John Perry
  3 siblings, 2 replies; 43+ messages in thread
From: Ingo M. @ 2019-07-23 21:58 UTC (permalink / raw)


Am Freitag, 19. Juli 2019 23:42:00 UTC+2 schrieb Nasser M. Abbasi:
> "Part of the reason for Python’s popularity is that it
> gets rid of the annoying conventions of other languages, such as
> using semicolons to indicate the end of a statement.

Python is popular because it is the "Basic" of our time. Basic was popular in the 70s because it was easy to handle for beginners who wanted to learn programming. Javascript (the "Basic" for the Web) is more complex for beginners since it requires basic knowledge how to deal with a web server. So Python is a good language for education.

Ada however is on the other end of the scale. It was developed for professionals who need a safe language for long-term mission-critical applications.

> So I'd like to make a suggestion: Remove ";" from Ada.

This is a bad idea. Semicolons may be annoying for small applications (which is typical for Python). However, if you deal with larger code bases then you realize that verbose syntax benefits maintainability. 

There are languages like OCaml which use even _double_ semicolons. This looks also annoying at the beginning. However, when you understand the design of OCaml then those double semicolons really make sense, and they don't look so annoying anymore. Many people are also disgusted by Lisp (all these strange parentheses). However, when you have realized the beauty of Lisp then those seemingly annoying parentheses get out of your focus quickly. They become just natural. In the same way Ada semicolons are just natural. In Ada you don't need to fear to insert larger code into your application since the compiler gets all information for clean inserts. Try to do that in Python (or Nim, see below), and you will get nervous at a certain code size.

I have the impression that newer languages like Python, Rust and Haskell are favored by some developers because it helps to develop "throw-away" software. Our industry is producing new devices rapidly which implies rapid code changes. It makes no sense for many products to deal with legacy code bases. It is more profitable just to write new software, and that explains also why anti-verbose languages with convenient toolboxes are so popular today. Bugs don't really matter if the product cycles are just short enough.

I think the larger a code base is the more a developer will esteem "boring" features like a verbose "archaic" syntax like Ada which eases readibility and maintainability. As for me, I have no problems at all to understand my own Ada95 code which I wrote decades ago. On the other hand, I had serious problems to understand my own Haskell code which I wrote just ten days ago :-) Regarding Haskell, someone condemned it as a "joke" regarding practically. This is a harsh statement. However, it is not that wrong. Try to write an MS office clone in Haskell -- good luck!

By the way, if you dislike languages with semicolon you should take a look at Nim (nim-lang.org). It is a Python-like language with native C performance. However, I wouldn't use it for big applications because of the whitespace indentation.

Regards,
Ingo

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-23 21:58 ` Ingo M.
@ 2019-07-23 23:56   ` Paul Rubin
  2019-07-24 14:06   ` John Perry
  1 sibling, 0 replies; 43+ messages in thread
From: Paul Rubin @ 2019-07-23 23:56 UTC (permalink / raw)


"Ingo M." <announce@amkade.com> writes:
> There are languages like OCaml which use even _double_
> semicolons. This looks also annoying at the beginning. However, when
> you understand the design of OCaml then those double semicolons really
> make sense, and they don't look so annoying anymore. Many people are
> also disgusted by Lisp (all these strange parentheses). However, when
> you have realized the beauty of Lisp then those seemingly annoying
> parentheses get out of your focus quickly. They become just
> natural.

Even better than that, if you want to start a Lisp comment at the
beginning of a line, it's customary to prefix it with a *triple*
semicolon.  That's better than Ada's single semicolon or even Ocaml's
double one.

There are rumors that the NSA is working on a secret programming
language for use against terrorists.  The details are classified but
some well known PLT geeks have whispered that it uses quadruple
semicolons.  Putin complained over the Moscow-Washington hot line that
any more than 3 semicolons is banned by a 1957 treaty, resulting in
Trump supposedly offered to relax the curly brace rule in exchange for a
concession about the semicolons.

The Bulletin of the Atomic Scientists last month published a scathing
editorial denouncing this new escalation, but so far, the setting of the
Doomsday Clock has not changed.

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-23 21:58 ` Ingo M.
  2019-07-23 23:56   ` Paul Rubin
@ 2019-07-24 14:06   ` John Perry
  2019-07-24 14:51     ` Ingo M.
  2019-07-25  7:26     ` Maciej Sobczak
  1 sibling, 2 replies; 43+ messages in thread
From: John Perry @ 2019-07-24 14:06 UTC (permalink / raw)


On Tuesday, July 23, 2019 at 4:58:12 PM UTC-5, Ingo M. wrote:
> Am Freitag, 19. Juli 2019 23:42:00 UTC+2 schrieb Nasser M. Abbasi:
> > "Part of the reason for Python’s popularity is that it
> > gets rid of the annoying conventions of other languages, such as
> > using semicolons to indicate the end of a statement.
> 
> Python is popular because it is the "Basic" of our time. Basic was popular in the 70s because it was easy to handle for beginners who wanted to learn programming. Javascript (the "Basic" for the Web) is more complex for beginners since it requires basic knowledge how to deal with a web server. So Python is a good language for education.

In support of this assertion, I submit that the main reasons for Python's popularity are:

1) Variable types don't have to be declared.

2) Code doesn't have to compile.

3) The code is written for situations where there are no bad consequences if the system crashes.

[Java requires types and compilation. I don't know about #3, but I remember that it used to come with a warning that you shouldn't use it in critical places like, say, trains, planes, and nuclear plants. (IIRC the warning on "nuclear plants" was explicit.)]

4) You don't care that much about speed.

5) You don't need any parallelism that isn't built-in, or isn't available through a module programmed in another language. (See: Global Interpreter Lock.)

I know many programmers who use this model: start with Python; if it's too slow, try compiling with Cython; if it's still too slow, assign types to certain variables; if it's still too slow, analyze the algorithm; if it's still too slow, think about implementing it in C or C++.

> So I'd like to make a suggestion: Remove ";" from Ada.

Won't make a dent in Ada's popularity.

The bandwagon effect is a really big deal: almost everyone who has heard of Ada, has heard that DoD commissioned it, and that most people dislike it. That's about it. Ask for a concrete example why they dislike it, and you'll probably get, "It's complicated."

Anyone who's actually used Ada these days might reply, "Complicated? Compared to what, C++?"

The one concrete reason I've ever heard for using C or C++ instead of Modula-2 or Ada is that C/C++ allow you to perform pointer arithmetic, which one person I spoke to thought was essential for his work. I don't know enough about Ada to know how to address his situation, but even if it did allow it, I don't think it would matter.

I had a conversation with a computer science professor the other day about security in automobiles, where a lot of people are using C or C++. At the end I asked why they don't use Ada, and if I could distill the answer, it was that Ada is perceived as passé, sort of like working as a comedian without relying on profanity: good luck with that career. Sure, you *can* do it, but almost no one does, because... well, "it's complicated."

john perry


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-24 14:06   ` John Perry
@ 2019-07-24 14:51     ` Ingo M.
  2019-07-24 15:29       ` Dmitry A. Kazakov
  2019-07-24 19:52       ` Ingo M.
  2019-07-25  7:26     ` Maciej Sobczak
  1 sibling, 2 replies; 43+ messages in thread
From: Ingo M. @ 2019-07-24 14:51 UTC (permalink / raw)


Am Mittwoch, 24. Juli 2019 16:06:07 UTC+2 schrieb John Perry:

> Sure, you *can* do it, but almost no one does, because... well, "it's complicated."

In analogy, if you travel somewhere, do you leave your house open, let all things lay around and let all devices run unobserved? Or do you close all doors and windows, hide all important things, and ask your trustworthy neighbor to observe your house? The former strategy is quick and convenient while the latter one is complicated -- but safe!

Regarding cars, if the industry really depends on C/C++ for safety critical devices, I should reconsider my way of driving in the future. Ada or Rust (when mature) should be standard here!

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-24 14:51     ` Ingo M.
@ 2019-07-24 15:29       ` Dmitry A. Kazakov
  2019-07-25 10:58         ` Ingo M.
  2019-07-24 19:52       ` Ingo M.
  1 sibling, 1 reply; 43+ messages in thread
From: Dmitry A. Kazakov @ 2019-07-24 15:29 UTC (permalink / raw)


On 2019-07-24 16:51, Ingo M. wrote:

> Regarding cars, if the industry really depends on C/C++ for safety critical devices, I should reconsider my way of driving in the future. Ada or Rust (when mature) should be standard here!

It is worse than C/C++. It is largely model-driven design with software 
written or drawn in the form of diagrams which prevent even C/C++ 
rudimentary safety checks. Assorted chunks of code generated from 
diagrams are then piled together into one system.

But do not worry, autonomous driving is on the horizon, you will not 
have drive it yourself, a neuronal network will. The code the NN 
effectively runs is not even written ...

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

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-24 14:51     ` Ingo M.
  2019-07-24 15:29       ` Dmitry A. Kazakov
@ 2019-07-24 19:52       ` Ingo M.
  2019-07-24 20:31         ` J-P. Rosen
  1 sibling, 1 reply; 43+ messages in thread
From: Ingo M. @ 2019-07-24 19:52 UTC (permalink / raw)


Am Mittwoch, 24. Juli 2019 16:51:30 UTC+2 schrieb Ingo M.:
> Am Mittwoch, 24. Juli 2019 16:06:07 UTC+2 schrieb John Perry:
> 
> > Sure, you *can* do it, but almost no one does, because... well, "it's complicated."
> 

Regarding the complexity of Ada, M. Ben Ari has a good explanation:

"The Ada language is complex because it is intended for developing complex systems, and its advantages are only apparent if you are designing and developing such a system. Then, and only then, will you have to face numerous dilemmas, and you will be grateful for the Ada constructs that help you resolve them: ..."

Source:  Ada for Software Engineers, Weizmann Institute of Science

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-24 19:52       ` Ingo M.
@ 2019-07-24 20:31         ` J-P. Rosen
  2019-07-25 13:34           ` gautier_niouzes
  0 siblings, 1 reply; 43+ messages in thread
From: J-P. Rosen @ 2019-07-24 20:31 UTC (permalink / raw)


Le 24/07/2019 à 21:52, Ingo M. a écrit :
> Regarding the complexity of Ada, M. Ben Ari has a good explanation:
> 
> "The Ada language is complex because it is intended for developing complex systems, and its advantages are only apparent if you are designing and developing such a system. Then, and only then, will you have to face numerous dilemmas, and you will be grateful for the Ada constructs that help you resolve them: ..."
> 
I wouldn't say that Ada is complex. It is big, it is rich, but it is
very consistent. The first step is higher than for other languages, but
once you understand the principles and passed that first step, there are
few surprises.

-- 
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] 43+ messages in thread

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-24 14:06   ` John Perry
  2019-07-24 14:51     ` Ingo M.
@ 2019-07-25  7:26     ` Maciej Sobczak
  2019-07-25 10:47       ` Ingo M.
                         ` (3 more replies)
  1 sibling, 4 replies; 43+ messages in thread
From: Maciej Sobczak @ 2019-07-25  7:26 UTC (permalink / raw)


> The one concrete reason I've ever heard for using C or C++ instead of Modula-2 or Ada is that C/C++ allow you to perform pointer arithmetic

Really? I would never consider that reason myself.
But I have two others that I consider important:

1. C or C++ allow to reuse the existing C or C++ libraries, of which there are too many to ignore them. In fact, in some areas like embedded systems (which is where Ada tries to compete) those libraries are essential to get anything done. Chips are too complex to program them via their register-level interfaces and vendors deliver only C libraries for their products.
No, the Ada's Interfaces.C does not even come close to be reasonably useful. It can be used only with those C interfaces that were specifically designed to facilitate such use. With others it is too much trouble.

2. Again with regard to embedded systems, hardware vendors provide their own IDEs. It's not just about libraries, see above, it's about the whole integrated approach to use the hardware from configuration to synthesis to programming. These IDEs are oriented towards C and C++ and with each new generation using any other language is more and more difficult. That is, it is genuinely *easier* to use C and C++.

> I had a conversation with a computer science professor the other day about security in automobiles, where a lot of people are using C or C++.

This is another source of misconception. Critical systems (not only automotive, but also medical, aviation, etc.) do not rely on programming languages to achieve reliability. They rely on independent verification processes, which also happen to account for most (like in >95%) of expenses. And Ada does nothing to make these processes any easier, because while belonging to the same family of programming technologies (3rd gen, imperative, etc.), its required verification technology is essentially the same. So why bother?

I would never consider semicolons or pointer arithmetic to be the decision-making points, but the above two subjects are killing the prospects for making Ada more popular in my domain.

-- 
Maciej Sobczak * http://www.inspirel.com

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-25  7:26     ` Maciej Sobczak
@ 2019-07-25 10:47       ` Ingo M.
  2019-07-25 16:18       ` John Perry
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 43+ messages in thread
From: Ingo M. @ 2019-07-25 10:47 UTC (permalink / raw)


Am Donnerstag, 25. Juli 2019 09:26:29 UTC+2 schrieb Maciej Sobczak:

Your statements are correct for the status quo. However, things begin to change. Systems are getting more and more complex so that test cases and basic verification is not sufficient anymore. There is a real demand for better languages than C++ (there is not even a basic verification standard for C++ compilers). The rising popularity of languages like Rust and Zig speaks for itself. Even Microsoft is evaluating Rust right now. They must have good reasons for that.

Regarding C however I believe it will stay much longer than C++ (if not forever) because of its simplicity, and because developers like me consider it a "high-level assembler".

According to the demand for better languages, Ada (2012 and 2020) gets reconsidered even by world class embedded systems professionals. Jack Ganssle, a guy who is pretty well known in the embedded world, confessed to be a huge fan of Ada. Guess why.

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-24 15:29       ` Dmitry A. Kazakov
@ 2019-07-25 10:58         ` Ingo M.
  2019-07-25 12:16           ` Dmitry A. Kazakov
  2019-07-26 10:54           ` antispam
  0 siblings, 2 replies; 43+ messages in thread
From: Ingo M. @ 2019-07-25 10:58 UTC (permalink / raw)


Am Mittwoch, 24. Juli 2019 17:29:06 UTC+2 schrieb Dmitry A. Kazakov:

> It is worse than C/C++. It is largely model-driven design with software 
> written or drawn in the form of diagrams which prevent even C/C++ 
> rudimentary safety checks. Assorted chunks of code generated from 
> diagrams are then piled together into one system.

If that is usual then it should not matter which language the code generator uses to produce the final result. It would not matter if the object code language is C, or C++, or Ada, or whatever. So, why not use a _safe_ language for that?


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-25 10:58         ` Ingo M.
@ 2019-07-25 12:16           ` Dmitry A. Kazakov
  2019-07-26 10:54           ` antispam
  1 sibling, 0 replies; 43+ messages in thread
From: Dmitry A. Kazakov @ 2019-07-25 12:16 UTC (permalink / raw)


On 2019-07-25 12:58, Ingo M. wrote:
> Am Mittwoch, 24. Juli 2019 17:29:06 UTC+2 schrieb Dmitry A. Kazakov:
> 
>> It is worse than C/C++. It is largely model-driven design with software
>> written or drawn in the form of diagrams which prevent even C/C++
>> rudimentary safety checks. Assorted chunks of code generated from
>> diagrams are then piled together into one system.
> 
> If that is usual then it should not matter which language the code generator uses to produce the final result. It would not matter if the object code language is C, or C++, or Ada, or whatever. So, why not use a _safe_ language for that?

The language in effect is the diagrams, safety (against human errors) 
applies here. Whatever you generate from that is too late.

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


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-24 20:31         ` J-P. Rosen
@ 2019-07-25 13:34           ` gautier_niouzes
  0 siblings, 0 replies; 43+ messages in thread
From: gautier_niouzes @ 2019-07-25 13:34 UTC (permalink / raw)


> I wouldn't say that Ada is complex. It is big, it is rich, but it is
> very consistent.

Agreed. Ada is a large toolbox where different tools have not too many ties with other ones.
In other toolboxes, if you grab any tool, you end up quickly with things like object-oriented programming and heap allocation that are not necessarily useful for solving your problem.

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-25  7:26     ` Maciej Sobczak
  2019-07-25 10:47       ` Ingo M.
@ 2019-07-25 16:18       ` John Perry
  2019-07-25 18:31         ` Dennis Lee Bieber
                           ` (2 more replies)
  2019-07-26 19:16       ` Niklas Holsti
  2019-07-27  1:27       ` Lucretia
  3 siblings, 3 replies; 43+ messages in thread
From: John Perry @ 2019-07-25 16:18 UTC (permalink / raw)


On Thursday, July 25, 2019 at 2:26:29 AM UTC-5, Maciej Sobczak wrote:
> > The one concrete reason I've ever heard for using C or C++ instead of Modula-2 or Ada is that C/C++ allow you to perform pointer arithmetic
> 
> Really? I would never consider that reason myself.

My question regarded the late 80s and early 90s, when (as I perceived it then) Turbo Pascal was still taught at some universities, Modula-2 was established in some places and still had a chance, C++ was only getting started, and Ada was required for DoD work. Also, we were discussing a certain kind of academic research, where the libraries you're talking about often don't exist. So, of the point of my question was more along the lines of: with all the safety problems C has (and which C++ often carries over), why didn't safe(r) languages get anywhere?

That said, your point on libraries rings true. In 1992 or thereabouts I had to set up an Ingres/SQL database using the C language interface. I remember being frustrated with the number of times the program crashed because I forgot an ampersand (for example). And my interlocutor would certainly agree about libraries, as he's a huge fan of the C++ STL.

> 2. Again with regard to embedded systems, hardware vendors provide their own IDEs. It's not just about libraries, see above, it's about the whole integrated approach to use the hardware from configuration to synthesis to programming. These IDEs are oriented towards C and C++ and with each new generation using any other language is more and more difficult. That is, it is genuinely *easier* to use C and C++.

I haven't used one of these with C or C++, but I have done some work in Java & Kotlin on IntelliJ (Android Studio, though AS seems really slow in comparison), and the difference between that IDE and my previous setup was an eye-opener. I may embarrass myself here, but I was impressed that it reports errors as you type, recommends more idiomatic code, even more efficient constructs...

GPS, at least as shipped by AdaCore with the Community Edition, doesn't offer nearly as much.

john perry


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-25 16:18       ` John Perry
@ 2019-07-25 18:31         ` Dennis Lee Bieber
  2019-07-26 18:04         ` Shark8
  2019-07-26 18:53         ` Niklas Holsti
  2 siblings, 0 replies; 43+ messages in thread
From: Dennis Lee Bieber @ 2019-07-25 18:31 UTC (permalink / raw)


On Thu, 25 Jul 2019 09:18:20 -0700 (PDT), John Perry <john.perry@usm.edu>
declaimed the following:

>
>My question regarded the late 80s and early 90s, when (as I perceived it then) Turbo Pascal was still taught at some universities, Modula-2 was established in some places and still had a chance, C++ was only getting started, and Ada was required for DoD work. Also, we were discussing a certain kind of academic research, where the libraries you're talking about often don't exist. So, of the point of my question was more along the lines of: with all the safety problems C has (and which C++ often carries over), why didn't safe(r) languages get anywhere?
>

	In around that same time period, the program I was on was planning to
replace the real-time (command/control/telemetry) system -- which was
Macro-11 on PDP-11s -- by a higher-level language to run on VAX-11. At the
time, the real-time group was around 30 programmers, the rest of the
program was in FORTRAN-77 and had some 80+ programmers.

	They (real-time group) ran a survey/study to select the language (which
was only distributed to the rest of the program AFTER they made their
choice). The choices were: keep it in assembler, C, F77, and Pascal.
Wisely, they did reject C as being too error-prone, and rejected assembler
as "why bother to rewrite". They ignored the massive F77 expertise in the
department, and chose VAX Pascal -- prime justification: new hires probably
learned (Turbo) Pascal in school (with a second justification being that
one of the programmers threatened to quit if Pascal was not selected --
manager caved in).

	At the time, doing complicated math in Pascal required importing
functions from the F77 runtime library!

	After seeing the "report" I responded with an email that mentioned that
there was such a wealth of F77 expertise available which would have been
able to assist the real-time group, and then included a conclusion that "as
long as you decided to walk a mile to select Pascal, you should have fallen
the extra five feet to go with DEC Ada" -- a language whose roots were in
Pascal, yet designed for safety-critical systems, and wouldn't have been
any more of a learning curve for existing staff.


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-25 10:58         ` Ingo M.
  2019-07-25 12:16           ` Dmitry A. Kazakov
@ 2019-07-26 10:54           ` antispam
  2019-07-26 11:35             ` Niklas Holsti
  1 sibling, 1 reply; 43+ messages in thread
From: antispam @ 2019-07-26 10:54 UTC (permalink / raw)


Ingo M. <announce@amkade.com> wrote:
> Am Mittwoch, 24. Juli 2019 17:29:06 UTC+2 schrieb Dmitry A. Kazakov:
> 
> > It is worse than C/C++. It is largely model-driven design with software 
> > written or drawn in the form of diagrams which prevent even C/C++ 
> > rudimentary safety checks. Assorted chunks of code generated from 
> > diagrams are then piled together into one system.
> 
> If that is usual then it should not matter which language the code generator uses to produce the final result. It would not matter if the object code language is C, or C++, or Ada, or whatever. So, why not use a _safe_ language for that?

IME any restriction in target language tends to complicate generator.
Ada gives you bundled deal.  Some safety rules make sense whatever language you use, but some other are just arbitrary
complication.  For example, IIRC Ada function can not have
output parameters.  So, less restrivtive target language
is more convenient for generaator.

Also, macros in target language simplify generator.  Theoretically
you may think that generator can do expansion.  It can, but
in practice macros in target language make difference.

-- 
                              Waldek Hebisch

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-26 10:54           ` antispam
@ 2019-07-26 11:35             ` Niklas Holsti
  2019-07-26 16:07               ` Simon Wright
  0 siblings, 1 reply; 43+ messages in thread
From: Niklas Holsti @ 2019-07-26 11:35 UTC (permalink / raw)


On 19-07-26 13:54 , antispam@math.uni.wroc.pl wrote:
> Ingo M. <announce@amkade.com> wrote:
>> Am Mittwoch, 24. Juli 2019 17:29:06 UTC+2 schrieb Dmitry A.
>> Kazakov:
>>
>>> It is worse than C/C++. It is largely model-driven design with
>>> software written or drawn in the form of diagrams which prevent
>>> even C/C++ rudimentary safety checks. Assorted chunks of code
>>> generated from diagrams are then piled together into one system.
>>
>> If that is usual then it should not matter which language the code
>> generator uses to produce the final result. It would not matter if
>> the object code language is C, or C++, or Ada, or whatever. So, why
>> not use a _safe_ language for that?
>
> IME any restriction in target language tends to complicate
> generator. Ada gives you bundled deal.  Some safety rules make sense
> whatever language you use, but some other are just arbitrary
> complication.  For example, IIRC Ada function can not have output
> parameters.

They can, today. And of course there were ways to get the same effect, 
before.

> So, less restrivtive target language is more convenient
> for generaator.

I would be afraid that generating the less restrictve language could 
hide and mask bugs in the generator.

> Also, macros in target language simplify generator.  Theoretically
> you may think that generator can do expansion.  It can, but in
> practice macros in target language make difference.

Of course there are any number of macro systems that could be used in 
the generator Ada, although Ada has no macro system built in. But again, 
I would be afraid that extensive use of macros in the generated code 
would make it harder to review for generator errors, and could also hide 
inefficient generated code.

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


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-26 11:35             ` Niklas Holsti
@ 2019-07-26 16:07               ` Simon Wright
  0 siblings, 0 replies; 43+ messages in thread
From: Simon Wright @ 2019-07-26 16:07 UTC (permalink / raw)


Niklas Holsti <niklas.holsti@tidorum.invalid> writes:

> On 19-07-26 13:54 , antispam@math.uni.wroc.pl wrote:
>> Ingo M. <announce@amkade.com> wrote:

>> So, less restrivtive target language is more convenient for
>> generaator.
>
> I would be afraid that generating the less restrictve language could
> hide and mask bugs in the generator.
>
>> Also, macros in target language simplify generator.  Theoretically
>> you may think that generator can do expansion.  It can, but in
>> practice macros in target language make difference.
>
> Of course there are any number of macro systems that could be used in
> the generator Ada, although Ada has no macro system built in. But
> again, I would be afraid that extensive use of macros in the generated
> code would make it harder to review for generator errors, and could
> also hide inefficient generated code.

There's an unavoidable amount of complication involved in the mapping from
model to executable code. In my experience[1] some of that ends up in
the generator, and some in generics (not that far distant from macros, in
this context) in the runtime support.

In [1] generation is a complex process involving extraction from a model
(UML) to a more amenable form, XSLT stylesheets, makefiles. There's a
great deal of conditionality in the stylesheets; for example, the
difference between a class whose instances are identified by a string
(needs a map) and one whose instances are identified by an enumeration
(needs an array).

In hindsight, I'm not at all sure that using XSLT was the right
long-term solution (it's not at all easy to reason about it).

[1] https://github.com/simonjwright/coldframe


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-25 16:18       ` John Perry
  2019-07-25 18:31         ` Dennis Lee Bieber
@ 2019-07-26 18:04         ` Shark8
  2019-07-26 18:53         ` Niklas Holsti
  2 siblings, 0 replies; 43+ messages in thread
From: Shark8 @ 2019-07-26 18:04 UTC (permalink / raw)


On Thursday, July 25, 2019 at 10:18:22 AM UTC-6, John Perry wrote:
> I haven't used one of these with C or C++, but I have done some work in Java & Kotlin on IntelliJ (Android Studio, though AS seems really slow in comparison), and the difference between that IDE and my previous setup was an eye-opener. I may embarrass myself here, but I was impressed that it reports errors as you type, recommends more idiomatic code, even more efficient constructs...
> 
> GPS, at least as shipped by AdaCore with the Community Edition, doesn't offer nearly as much.

This is true; and one item I'd like to address in a true Ada IDE. / The other being better tooling than other systems -- I'm particularly attracted to the idea of implementing the system outlined here ( http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.26.2533&rep=rep1&type=pdf ) as it would make for a much nicer Continuous Integration experience *AND* a much nicer Version Control experience. [NOTE: With the hierarchical-DB system presented, the history of the root-node *IS* the system in a compilable state; IOW, (a) no more "my commit broke the build" and (b) you have a record of all compilable-states of the codebase.]


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-25 16:18       ` John Perry
  2019-07-25 18:31         ` Dennis Lee Bieber
  2019-07-26 18:04         ` Shark8
@ 2019-07-26 18:53         ` Niklas Holsti
  2 siblings, 0 replies; 43+ messages in thread
From: Niklas Holsti @ 2019-07-26 18:53 UTC (permalink / raw)


On 19-07-25 19:18 , John Perry wrote:
> On Thursday, July 25, 2019 at 2:26:29 AM UTC-5, Maciej Sobczak
> wrote:
    ...
>
>> 2. Again with regard to embedded systems, hardware vendors provide
>> their own IDEs. It's not just about libraries, see above, it's
>> about the whole integrated approach to use the hardware from
>> configuration to synthesis to programming. These IDEs are oriented
>> towards C and C++ and with each new generation using any other
>> language is more and more difficult. That is, it is genuinely
>> *easier* to use C and C++.
>
> I haven't used one of these with C or C++, but I have done some work
> in Java & Kotlin on IntelliJ (Android Studio, though AS seems really
> slow in comparison), and the difference between that IDE and my
> previous setup was an eye-opener. I may embarrass myself here, but I
> was impressed that it reports errors as you type, recommends more
> idiomatic code, even more efficient constructs...

I'm going to sound like an old reactionary fart (come to think of it, 
that may be an accurate description...) but this reminds me that in my 
experience a very large part of coding errors comes from copy-paste, 
where the programmer was not careful to adapt the pasted code to its new 
role and new environment, or simply forgot to do that.

This suggests that some "convenience" features of IDEs and editors may 
be dangerous, if they make it too easy to create masses of code that 
_seems_ correct, because it compiles, but was not really thought out, 
designed, and written carefully.

I would say "yes" to better IDE analysis of errors, but "no" to 
automatically generated recommendations and a strong "no" to automatic 
"fixes". (GPS has an automatic fix feature -- the "wrench" -- but I do 
not often use it because its effect is often not what I want to do.)

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


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-25  7:26     ` Maciej Sobczak
  2019-07-25 10:47       ` Ingo M.
  2019-07-25 16:18       ` John Perry
@ 2019-07-26 19:16       ` Niklas Holsti
  2019-07-27  1:27       ` Lucretia
  3 siblings, 0 replies; 43+ messages in thread
From: Niklas Holsti @ 2019-07-26 19:16 UTC (permalink / raw)


On 19-07-25 10:26 , Maciej Sobczak wrote:
>> The one concrete reason I've ever heard for using C or C++ instead
>> of Modula-2 or Ada is that C/C++ allow you to perform pointer
>> arithmetic
>
> Really? I would never consider that reason myself. But I have two
> others that I consider important:
>
> 1. C or C++ allow to reuse the existing C or C++ libraries, of which
> there are too many to ignore them. In fact, in some areas like
> embedded systems (which is where Ada tries to compete) those
> libraries are essential to get anything done.

Well, that depends. It may be true for short, small projects, but IME 
for longer projects one can well do without the libraries. Of course it 
also depends on the nature of the project, for example whether some 
network connectivity is needed (which was not the case in most of my 
projects).

> Chips are too complex
> to program them via their register-level interfaces and vendors
> deliver only C libraries for their products. No, the Ada's
> Interfaces.C does not even come close to be reasonably useful. It can
> be used only with those C interfaces that were specifically designed
> to facilitate such use.

That, again, depends. A colleague successfully used the GNAT "dump Ada 
specs" function to create an Ada API for a large customer-supplied C 
library of "driver" functions and linked it to an Ada application with 
very few problems.

When I tried it on another C library, the result was very ugly, partly 
because the library aimed to provide register-level access in addition 
to some higher-level functions, and partly because the names of the C 
entities used various prefixing and suffixing schemes to compensate for 
the lack of a module system in C, and so the corresponding 
package-qualified Ada names were really ugly... Instead, we wrote our 
own HW register definitions and higher-level functions (and as a side 
effect found and reported some errors in the HW documentation) giving a 
pure Ada solution that, in addition, is portable between the big-endian 
SPARC target and little-endian x86 development systems.

For ARM Cortex chips I believe there is a standard HW register 
description language and a tool to generate the corresponding Ada 
declarations.

> This is another source of misconception. Critical systems (not only
> automotive, but also medical, aviation, etc.) do not rely on
> programming languages to achieve reliability. They rely on
> independent verification processes, which also happen to account for
> most (like in >95%) of expenses. And Ada does nothing to make these
> processes any easier, because while belonging to the same family of
> programming technologies (3rd gen, imperative, etc.), its required
> verification technology is essentially the same. So why bother?

Hmm. I recall that the developers of SPARK wrote, somewhere, that they 
tried to develop a similar tool for C, but gave up because the 
properties of C where so much less amenable to formal analysis and proof 
than the properties of Ada. Now it may be that advances in proof 
systems, C "sanitizers" and lint-like tools have reduced this prooblem, 
but it would surprise me if there would be no difference left.

And of course there is the well-know empirical evidence that development 
in Ada, rather than C, leads to fewer errors and errors that are less 
costly to fix.

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

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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-25  7:26     ` Maciej Sobczak
                         ` (2 preceding siblings ...)
  2019-07-26 19:16       ` Niklas Holsti
@ 2019-07-27  1:27       ` Lucretia
  2019-07-27  1:34         ` Keith Thompson
  3 siblings, 1 reply; 43+ messages in thread
From: Lucretia @ 2019-07-27  1:27 UTC (permalink / raw)


On Thursday, 25 July 2019 08:26:29 UTC+1, Maciej Sobczak  wrote:
> > The one concrete reason I've ever heard for using C or C++ instead of Modula-2 or Ada is that C/C++ allow you to perform pointer arithmetic
> 
> Really? I would never consider that reason myself.

Me neither, but then  you can do pointer arithmetic in Ada, you just use normal numbers and convert to an address.


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-27  1:27       ` Lucretia
@ 2019-07-27  1:34         ` Keith Thompson
  2019-07-27  3:11           ` Randy Brukardt
  0 siblings, 1 reply; 43+ messages in thread
From: Keith Thompson @ 2019-07-27  1:34 UTC (permalink / raw)


Lucretia <laguest9000@googlemail.com> writes:
> On Thursday, 25 July 2019 08:26:29 UTC+1, Maciej Sobczak  wrote:
>> > The one concrete reason I've ever heard for using C or C++ instead
>> > of Modula-2 or Ada is that C/C++ allow you to perform pointer
>> > arithmetic
>> 
>> Really? I would never consider that reason myself.
>
> Me neither, but then you can do pointer arithmetic in Ada, you just
> use normal numbers and convert to an address.

I'm fairly sure there's no guarantee that the result of any such
conversion (which would have to use Unchecked_Conversion or something
equivalent, unless I've missed something) would be meaningful.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-27  1:34         ` Keith Thompson
@ 2019-07-27  3:11           ` Randy Brukardt
  2019-07-27  4:06             ` Keith Thompson
  0 siblings, 1 reply; 43+ messages in thread
From: Randy Brukardt @ 2019-07-27  3:11 UTC (permalink / raw)


"Keith Thompson" <kst-u@mib.org> wrote in message 
news:lnh8785kge.fsf@kst-u.example.com...
> Lucretia <laguest9000@googlemail.com> writes:
>> On Thursday, 25 July 2019 08:26:29 UTC+1, Maciej Sobczak  wrote:
>>> > The one concrete reason I've ever heard for using C or C++ instead
>>> > of Modula-2 or Ada is that C/C++ allow you to perform pointer
>>> > arithmetic
>>>
>>> Really? I would never consider that reason myself.
>>
>> Me neither, but then you can do pointer arithmetic in Ada, you just
>> use normal numbers and convert to an address.
>
> I'm fairly sure there's no guarantee that the result of any such
> conversion (which would have to use Unchecked_Conversion or something
> equivalent, unless I've missed something) would be meaningful.

And there is in C?? ;-)

Package System.Storage_Elements includes operations for directly doing 
address arithmetic - you would have to do the multiplies on values of 
Storage_Offset (which is an integer type) and then add/subtract those from 
values of System.Address.

One could use Address_to_Access_Conversions to turn an address into an 
access value (which can then be dereferenced), as well as the reverse. 
That's better than Unchecked_Conversion as any representation differences 
can be handled properly, but admittedly there isn't much difference in the 
safety of the result.

In any case, pointer arithmetic can be done in Ada more-or-less directly. 
One wonders why it would be necessary (compiler optimizers can turn a lot of 
loops on arrays into pointer arithmetic code anyway, so there's likely to be 
little or no performance difference) - it sounds a lot like a combination of 
premature optimization and a convinient (and wrong) excuse not to consider 
Ada. (A lot of people out there are mainly looking for reasons not to use 
Ada or Rust or whatever language so that they can use whatever they have 
already decided on.)

                        Randy.


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

* Re: How to make Ada popular. Get rid of ";" at end of statement.
  2019-07-27  3:11           ` Randy Brukardt
@ 2019-07-27  4:06             ` Keith Thompson
  0 siblings, 0 replies; 43+ messages in thread
From: Keith Thompson @ 2019-07-27  4:06 UTC (permalink / raw)


"Randy Brukardt" <randy@rrsoftware.com> writes:
> "Keith Thompson" <kst-u@mib.org> wrote in message 
> news:lnh8785kge.fsf@kst-u.example.com...
>> Lucretia <laguest9000@googlemail.com> writes:
>>> On Thursday, 25 July 2019 08:26:29 UTC+1, Maciej Sobczak  wrote:
>>>> > The one concrete reason I've ever heard for using C or C++ instead
>>>> > of Modula-2 or Ada is that C/C++ allow you to perform pointer
>>>> > arithmetic
>>>>
>>>> Really? I would never consider that reason myself.
>>>
>>> Me neither, but then you can do pointer arithmetic in Ada, you just
>>> use normal numbers and convert to an address.
>>
>> I'm fairly sure there's no guarantee that the result of any such
>> conversion (which would have to use Unchecked_Conversion or something
>> equivalent, unless I've missed something) would be meaningful.
>
> And there is in C?? ;-)

No.  Did I imply that there is?

But C pointer arithmetic (without conversion to and from an integer
type) is well defined as long as you stay within a single (array)
object.  This isn't comp.lang.c, so I won't go into the details.

> Package System.Storage_Elements includes operations for directly doing 
> address arithmetic - you would have to do the multiplies on values of 
> Storage_Offset (which is an integer type) and then add/subtract those from 
> values of System.Address.

So it does.  The standard doesn't seem to say much about
what operations are well defined beyond suggesting that they
"should reflect the target environment semantics as closely as
is reasonable".

(C *needs* to go into a lot more detail about pointer arithmetic
because so much of the language depends on it.)

[snip]

To be clear, I'm not making any arguments for or against C or Ada.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

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

end of thread, other threads:[~2019-07-27  4:06 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-19 21:41 How to make Ada popular. Get rid of ";" at end of statement Nasser M. Abbasi
2019-07-19 22:09 ` Dmitry A. Kazakov
2019-07-20  6:47   ` J-P. Rosen
2019-07-20  8:42     ` Paul Rubin
2019-07-21  5:11       ` J-P. Rosen
2019-07-23  9:24         ` darek
2019-07-20 17:08     ` Stéphane Rivière
2019-07-20 13:46   ` Dennis Lee Bieber
2019-07-20  0:47 ` Matt Borchers
2019-07-20 13:54   ` Dennis Lee Bieber
2019-07-20 14:40 ` Stephen Davies
2019-07-20 15:45   ` Optikos
2019-07-20 17:24     ` joviangm
2019-07-20 19:10       ` Optikos
2019-07-20 19:17         ` AdaMagica
2019-07-20 22:25           ` Paul Rubin
2019-07-20 23:08           ` Optikos
2019-07-20 22:24         ` Paul Rubin
2019-07-20 21:14   ` Keith Thompson
2019-07-23 21:58 ` Ingo M.
2019-07-23 23:56   ` Paul Rubin
2019-07-24 14:06   ` John Perry
2019-07-24 14:51     ` Ingo M.
2019-07-24 15:29       ` Dmitry A. Kazakov
2019-07-25 10:58         ` Ingo M.
2019-07-25 12:16           ` Dmitry A. Kazakov
2019-07-26 10:54           ` antispam
2019-07-26 11:35             ` Niklas Holsti
2019-07-26 16:07               ` Simon Wright
2019-07-24 19:52       ` Ingo M.
2019-07-24 20:31         ` J-P. Rosen
2019-07-25 13:34           ` gautier_niouzes
2019-07-25  7:26     ` Maciej Sobczak
2019-07-25 10:47       ` Ingo M.
2019-07-25 16:18       ` John Perry
2019-07-25 18:31         ` Dennis Lee Bieber
2019-07-26 18:04         ` Shark8
2019-07-26 18:53         ` Niklas Holsti
2019-07-26 19:16       ` Niklas Holsti
2019-07-27  1:27       ` Lucretia
2019-07-27  1:34         ` Keith Thompson
2019-07-27  3:11           ` Randy Brukardt
2019-07-27  4:06             ` Keith Thompson

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