comp.lang.ada
 help / color / mirror / Atom feed
From: jan.de.kruyf@gmail.com
Subject: Re: Build language with weak typing, then add scaffolding later to strengthen it?
Date: Thu, 4 Jun 2015 08:31:14 -0700 (PDT)
Date: 2015-06-04T08:31:14-07:00	[thread overview]
Message-ID: <40b1c612-5430-4ea6-9291-197047b2423d@googlegroups.com> (raw)
In-Reply-To: <o9tuiaewwju3.194kn6e0z2zau.dlg@40tude.net>

On Sunday, May 31, 2015 at 10:52:03 AM UTC+2, Dmitry A. Kazakov wrote:

> 
> Yes, repeating the old saying - if C is a solution what was the problem?

Apparently writing a Linux Kernel?? (could not resist that one :)

> 
> As if social "science" could give answers.

I will tell my wife. 
To me they stumble and fall just like we do, but perhaps together we will gain a bit more knowledge.

> 
> Students aren't dumb, not as programmers are! (:-))

So then I am still a student that walks wide eyed into any crap. :)


> 
> That is strange because syntax is such a minor part and because in case of
> Ada it is very difficult (at least to me) to understand its BNF, because
> they tried to push precedence (and some other) rules into it.

That is one of the issues I tried to argue.

> Nothing lost,
> nothing gained. Some bad features added, but we are free not to use them.

I try just that and it has saved me from some more advanced stages of mental degradation. 


> what is wasted on so-called tool-chains.

Because complexity breeds toolchains. Or: mankind wants to be fooled so fool them.

> > But types hardly belong there.
> 
> They do. 

This is the main reason why I wanted to answer this post:
I tried to do some thinking while driving over the last few days. And I got the hint for what follows out of one of your old posts (I think) about having units of measurement as a type, etc.

I came to the conclusion that perhaps 2 things got confused over the years in the typing scheme:
1. structural equivalence. (i.e. a storage specification)
2. name equivalence. (as long as the type names are equivalent it will work)

These days we go for name equivalence and make new types or rename types to our hearts content. And so confuse things horribly for the person that tries to understand our code later, as I tried to indicate before.

The whole type system originated with structural equivalence. On which we can build some interesting tricks then. We can use the type structure to admit or not admit a variable to an algebraic algorithm, and if this record is equivalent to, or a subset of that record we can feed them to some procedure for processing. It is just an algebraic assurance that the calculation will be successful.

But the type system, as it has evolved over the years, has been overloaded with the name equivalence idea.

And this to me is important in this discussion: it has not succeeded in solving all our problems. Ada did not fully fulfil the Dod spec in this respect. Read the Steelman document. And you were complaining that you could not put any safeguards into your iso units software. And I just complain bitterly that at times that I do not see the wood for the trees when trying to interface Ada to the kernel.

So my solution would be to have, besides the "structural type" attribute to a variable, also a "what it is" or a "functional type" attribute to a variable.
(perhaps the "functional" word is a bit overloaded here, bit it will work for the purpose of the discussion)

The structural type is fine for the algebra and the storage.
The functional type would serve to help us with all the other issues we have.
Like naming the physical quality we deal with.
Like assuring that our formulas work out according to the International System of Units. And we dont multiply apples with apples, etc.
You name it, there is a wide field here.

And to put that into the symbol table parse tree of a compiler is trivial, it is just a copy more or less of the existing type tree. At least to my  understanding. But we will have to find the correct way of describing the operational interaction limitations of the different functional types we use.

In using the language we will now have a choice:
just use structural equivalence (what you blame me of :) or use the functional stuff as well. in order to build a secure program. 

In this way I would think that we will do away with a lot of 'unchecked conversions' which to my understanding were designed to fit a character onto an integer and the like. But at the moment 2 reasons for using them are confused: the perfectly legitimate ways (converting from one derived type to another) are mixed up with non-portable ways of use (fixing up the storage specification of a variable).

By the way I did look at your scanner and parser stuff, it is impressive. but I thought Sparre might perhaps be better served when he understands the very basics first, and perhaps it is enough for what he wants. Only he can judge.
 
> This is solvable without Unchecked_Conversion, e.g. by ad-hoc supertypes,
> if Ada had them.

Yes, I think what I described above would cater for that.

> 
> Really? I never saw such bosses. Usually a boss does not even know that
> there are types.

Ah, they made the salesman the boss, shame!

>  They are there, whether you wanted or not.

Yes, but not dreaming is deadly. So even if Ada might not see here way open to solve all this, perhaps her children might.

The Ada design basics are from 1977 - 1983. And today it is still very compatible, so what do we expect.  It is fantastic that it has stood up so long.

Read this if you want to get some perspective on the speed of development:

http://heerdebeer.org/ALGOL/The_History_of_ALGOL.pdf

cheers,

j.

  reply	other threads:[~2015-06-04 15:31 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21 19:11 Build language with weak typing, then add scaffolding later to strengthen it? Nasser M. Abbasi
2015-05-21 19:29 ` AdaMagica
2015-05-22  7:27   ` Dmitry A. Kazakov
2015-05-22  7:42 ` Georg Bauhaus
2015-05-22  8:54   ` Nasser M. Abbasi
2015-05-22 11:29 ` kalvin.news
2015-05-22 12:57   ` J-P. Rosen
2015-05-22 14:01     ` kalvin.news
2015-05-22 14:34       ` kalvin.news
2015-05-23 11:09         ` Peter Chapin
2015-05-22 15:37       ` J-P. Rosen
2015-05-22 16:29         ` kalvin.news
2015-05-22 17:39           ` Simon Clubley
2015-05-22 17:51             ` kalvin.news
2015-05-22 19:41               ` J-P. Rosen
2015-05-22 20:04                 ` kalvin.news
2015-05-22 20:32                   ` Jeffrey R. Carter
2015-05-22 21:22                     ` kalvin.news
2015-05-23 11:14                     ` Peter Chapin
2015-05-23 12:42                       ` Jeffrey R. Carter
2015-05-23 17:48                         ` Simon Wright
2015-05-25  8:34                           ` Pascal Obry
2015-05-25 10:22                             ` Simon Wright
2015-05-25 18:12                               ` Georg Bauhaus
2015-05-22 20:39                   ` jan.de.kruyf
2015-05-28 22:33                     ` Randy Brukardt
2015-05-29  6:56                       ` jan.de.kruyf
2015-05-23 12:40                   ` Georg Bauhaus
2015-05-25  7:14                     ` jan.de.kruyf
2015-05-25 12:26                       ` Georg Bauhaus
2015-05-25 18:44                       ` Shark8
2015-05-25 19:54                         ` jan.de.kruyf
2015-05-25 21:25                           ` Shark8
2015-05-26  7:46                           ` Georg Bauhaus
2015-05-26  8:12                           ` Georg Bauhaus
2015-05-25 20:01                         ` Nasser M. Abbasi
2015-05-25 20:04                           ` Nasser M. Abbasi
2015-05-25 20:37                             ` jan.de.kruyf
2015-05-26  7:52                               ` Jacob Sparre Andersen
2015-05-26 11:43                                 ` jan.de.kruyf
2015-05-26 15:38                                   ` jan.de.kruyf
2015-05-28 23:39                                   ` Randy Brukardt
2015-05-29  8:51                                     ` Stefan.Lucks
2015-05-29 18:04                                       ` Jeffrey R. Carter
2015-05-29 21:51                                       ` Randy Brukardt
2015-05-30 10:28                                         ` jan.de.kruyf
2015-05-30 11:12                                           ` Dmitry A. Kazakov
2015-05-30 13:21                                             ` jan.de.kruyf
2015-05-30 15:00                                               ` Simon Clubley
2015-05-30 18:40                                                 ` jan.de.kruyf
2015-05-30 16:40                                               ` Dmitry A. Kazakov
2015-05-30 20:52                                                 ` jan.de.kruyf
2015-05-31  8:31                                                   ` Nasser M. Abbasi
2015-05-31  8:52                                                   ` Dmitry A. Kazakov
2015-06-04 15:31                                                     ` jan.de.kruyf [this message]
2015-06-04 17:23                                                       ` Dmitry A. Kazakov
2015-06-04 20:14                                                         ` Shark8
2015-06-04 23:12                                                           ` Nasser M. Abbasi
2015-06-01 21:36                                                 ` Randy Brukardt
2015-06-04 15:22                                                   ` jan.de.kruyf
2015-05-27 13:41                                 ` jan.de.kruyf
2015-05-25 23:05                             ` Peter Chapin
2015-05-26  8:01                               ` Sylvain Laperche
2015-05-26  8:20                                 ` Georg Bauhaus
2015-05-26  8:49                                 ` J-P. Rosen
2015-05-26 12:36                                   ` Simon Clubley
2015-05-26 13:39                                     ` J-P. Rosen
2015-05-26 14:21                                       ` Dmitry A. Kazakov
2015-05-26 16:19                                       ` Shark8
2015-05-26 20:51                                         ` J-P. Rosen
2015-05-26 17:11                                   ` Jeffrey R. Carter
2015-05-28 23:49                                     ` Randy Brukardt
2015-05-29 21:54                                       ` Randy Brukardt
2015-05-29 22:32                                         ` Jeffrey R. Carter
2015-05-26  8:17                               ` Georg Bauhaus
2015-05-28 22:46                       ` Randy Brukardt
2015-05-28 23:18                         ` Nasser M. Abbasi
2015-05-29 21:27                           ` Randy Brukardt
2015-05-29  7:55                         ` jan.de.kruyf
2015-05-29  9:27                           ` Simon Wright
2015-05-29 10:23                             ` jan.de.kruyf
2015-05-29 12:01                               ` G.B.
2015-05-29 13:43                                 ` jan.de.kruyf
2015-05-29 15:32                             ` Simon Wright
2015-05-29 15:57                               ` jan.de.kruyf
2015-05-29  9:31                         ` Jacob Sparre Andersen
2015-05-29 10:37                           ` jan.de.kruyf
2015-05-29 10:56                           ` Björn Lundin
2015-05-29 12:03                             ` Peter Chapin
2015-05-29 21:00                               ` Shark8
2015-05-29 20:57                           ` Shark8
2015-05-29 21:36                             ` Randy Brukardt
2015-06-01 22:20                               ` Shark8
2015-05-29 21:45                           ` Randy Brukardt
2015-05-29 23:12                             ` Peter Chapin
2015-05-30  9:10                               ` Georg Bauhaus
2015-05-23 13:01                 ` Luke A. Guest
2015-05-22 17:57             ` Simon Wright
2015-05-22 18:31               ` jan.de.kruyf
2015-05-22 14:03     ` jan.de.kruyf
2015-05-22 15:21       ` David Botton
2015-05-22 15:23         ` jan.de.kruyf
2015-05-22 15:31       ` Bob Duff
2015-05-22 15:48         ` jan.de.kruyf
2015-05-22 14:25     ` G.B.
2015-05-22 15:04     ` Bill White
2015-05-22 15:28     ` Bob Duff
2015-05-22 17:46       ` Simon Clubley
2015-05-22 18:16         ` jan.de.kruyf
2015-05-22 19:01           ` Simon Wright
2015-05-22 19:41             ` jan.de.kruyf
replies disabled

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