comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: [Spark] Arrays of Strings
Date: 12 Apr 2003 19:51:37 -0400
Date: 2003-04-12T19:51:37-04:00	[thread overview]
Message-ID: <wcc8yufl1fa.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 1049986095.779228@master.nyc.kbcfp.com

Hyman Rosen <hyrosen@mail.com> writes:

> Matthew Heaney wrote:
> > Doesn't Spark have a #hide clause, to turn off Spark checking?  After
> > all, you're calling a C library function, so what difference does
> > Spark make?
> 
> Getting rid of features that are presumed to cause problems is a bit of
> hubris that language designers always seem to fall victim to. 

As one of the designers of Ada 95, I must say I wholeheartedly agree
with the sentiment here.  Language designers ought to make it easy to
write good programs, not try to make it hard to write bad programs.  Ada
is guilty of the latter in some cases.

However, I think you're being unfair to SPARK here.  SPARK does not say
"you can't do X".  It says, "If you don't do X, then we can prove some
useful properties of your program.  But if you need to do X, then you
can isolate that code, and apply #hide".  That doesn't strike me as
hubris; they're offering you a benefit, in those cases where you can
abide by some restrictions.  You hope that the vast majority of your
code can naturally abide by the restrictions, and isolate the rest in
small packages.

Rod Chapman said it well in another post:

>  The trick with bindings like this is to come up with a package
> specification which is pure SPARK, ...

Non-spark Ada does the same thing in many cases.  Ada does not say, "you
can't do bit-wise type conversions".  Instead it says, "if you want to
do bit-wise conversions, you have to say 'Unchecked_Conversion'".  That
doesn't seem like a restriction to me.  It seems liberating.  It allows
me to have some confidence that the code I'm reading obeys the type
model, so long as I don't see Unchecked_Conversion (or address clauses,
or...).

Contrast with C, where perfectly safe conversions use the same syntax as
potentially troublesome unsafe ones.

My point is:  The language designer should not say "you can't do X"
(assuming X is sometimes useful).  But it's perfectly reasonable for the
language designer to say "if you're going to do X, then you have to say
so".

Back to Hyman:

>...Ada itself
> had a huge problem because the designers thought that function pointers
> could be eliminated.

Agreed.  And C has a huge problem because nested functions are not
allowed.  And both languages (C and Ada) have a huge problem because you
can't pass [pointers to] nested procedures as parameters.

>... Spark gets rid of all pointers, Java gets rid of
> templates, and so on and so on.

I'm not sure Java's lack of templates/generics is due to hubris.
More likely, it's due to trying to [over]simplify the language.

> Then everyone who uses these languages has to figure out how to work
> around the lack of the feature they need, essentially duplicating it in
> some kludgy way. Meanwhile the language designers have their heads in the
> sand and their noses in the air while they pat themselves on the back (:-)
> in self-congratulation on how they have created perfection.

Agreed.

- Bob



  parent reply	other threads:[~2003-04-12 23:51 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-08 12:02 [Spark] Arrays of Strings Lutz Donnerhacke
2003-04-08 18:08 ` Martin Krischik
2003-04-09  9:23   ` Lutz Donnerhacke
2003-04-09 12:38     ` Hyman Rosen
2003-04-09 12:47       ` Vinzent Hoefler
2003-04-09 14:27         ` Hyman Rosen
2003-04-09 15:13           ` Vinzent Hoefler
2003-04-09 17:21         ` Hyman Rosen
2003-04-09 18:41           ` Vinzent Hoefler
2003-04-09 21:04           ` Randy Brukardt
2003-04-10 23:21           ` John R. Strohm
2003-04-11 12:19             ` Hyman Rosen
2003-04-11 13:14               ` John R. Strohm
2003-04-09  7:50 ` Eric G. Miller
2003-04-09  8:10   ` Lutz Donnerhacke
2003-04-09 18:23   ` Matthew Heaney
2003-04-09 17:42 ` Matthew Heaney
2003-04-09 21:06   ` Randy Brukardt
2003-04-10  8:23   ` Lutz Donnerhacke
2003-04-10 14:09     ` Matthew Heaney
2003-04-10 14:48       ` Hyman Rosen
2003-04-11  6:20         ` Chad R. Meiners
2003-04-11 12:31           ` Hyman Rosen
2003-04-11 18:27             ` Chad R. Meiners
2003-04-11  7:35         ` Phil Thornley
2003-04-11 12:05           ` Marin David Condic
2003-04-11 13:19             ` John R. Strohm
2003-04-12 23:09               ` Robert A Duff
2003-04-11 18:47             ` Chad R. Meiners
2003-04-12 23:51         ` Robert A Duff [this message]
2003-04-13  5:47           ` Hyman Rosen
2003-04-14  8:05             ` Lutz Donnerhacke
2003-04-10 15:02       ` Lutz Donnerhacke
2003-04-10 15:50         ` Hyman Rosen
2003-04-10 18:32           ` Randy Brukardt
2003-04-11  6:28         ` Chad R. Meiners
2003-04-11  8:11           ` Lutz Donnerhacke
2003-04-11 12:32 ` Rod Chapman
2003-04-11 14:50   ` Peter Amey
2003-04-11 18:41   ` Matthew Heaney
2003-04-11 21:25     ` Chad R. Meiners
2003-04-12 10:08     ` Peter Amey
replies disabled

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