From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,70414f56d810c10c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.33.71 with SMTP id p7mr7263916pbi.1.1317255361671; Wed, 28 Sep 2011 17:16:01 -0700 (PDT) Path: lh7ni7100pbb.0!nntp.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news-out.readnews.com!transit3.readnews.com!feeder1-1.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 29 Sep 2011 02:01:44 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: discriminant questions References: <9f37b726-d80b-4d24-bf3f-28a14255f7fd@s20g2000yql.googlegroups.com> <34d856bd-19a3-4bbf-b9d8-c0f100000ef4@k7g2000vbd.googlegroups.com> <1tpl2pc36ptr4$.txv4v3wmkjlm.dlg@40tude.net> <1malv6h6q31j3.uz9ws5j0glnm.dlg@40tude.net> <4e81a2f4$0$7624$9b4e6d93@newsspool1.arcor-online.net> <4e81e788$0$6542$9b4e6d93@newsspool4.arcor-online.net> <4e8210ab$0$6550$9b4e6d93@newsspool4.arcor-online.net> In-Reply-To: Message-ID: <4e83b568$0$7620$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 29 Sep 2011 02:01:44 CEST NNTP-Posting-Host: 6e497130.newsspool1.arcor-online.net X-Trace: DXC=XLKZo^56Tg2^cW`WBF>WQ4Fo<]lROoR1<`=YMgDjhg2dMS0GUMGbM7PCY\c7>ejV8740?O@\9Nb5U;l X-Complaints-To: usenet-abuse@arcor.de Xref: news1.google.com comp.lang.ada:18189 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2011-09-29T02:01:44+02:00 List-Id: On 27.09.11 21:06, Dmitry A. Kazakov wrote: >> I had been talking about programming constructs, not specialized >> mathematical functions that may or may not be expressed in terms >> of more primitive mathematical functions. > > A difference? Huge difference. A programming language such as Ada is about a universal computing apparatus. Mathematical language can do without such an apparatus, an Ada program is typically written to need one. Also, square root has no place in the core of a general purpose programming language, because its purpose is not general; it is from some application domain with such a language. Sqrt in the core of math oriented languages seems fine to me. Same difference. >> That is, I'm assuming that programmers want a loop construct >> in Ada, not just goto. > > Or recursion, or callbacks from some hidden iteration loop? Quite possibly recursion. OCaml marks functions as "rec" or not, recent Fortran, too, IIRC. >> I'm assuming that they don't want to have to define loop in >> terms of goto, even when this has certain advantages. > > Do you think that they want to iterate containers using iterators? Sequence comprehensions (with conditional) are popular, too. Control of the control structure of comprehension is far less frequently requested, I should think. > My point is that loop as primitive should apply to user-defined stuff, In a way, that's my point, too: language primitives exist if they express common programming situations. If iterating a process for a selection of elements of a container is a common programming situation, then selection and iteration should be available via language primitives. > like > containers. That means that the language should allow to "override" not > only the loop's body, but also its continue-or-exit part. I'm not sure I understand. Sather iterators? Or Lisp macros (sorry, implementation of loop interface) for controlling in which way the meaning of "if" becomes operational? > Sorry, but this is what parallel programming is about. Nitpick: Parallel programs do not seem so interesting insofar as parallel programs don't communicate. Nothing fancy there. But with tasks, perhaps I have a different meaning of "primitive" in my mind: a task type can be a primitive of some Ada concurrency model. But seen from the viewpoint of concurrency theory (not that I know that much about it), insofar as it is about controlling the cooperation of a set of "primitive" universal computers, Ada task types already handle too much detail to be called "primitive". (Else no one would have discussed "abstraction inversion" in Ada tasking?) The level of detail in a concept is the biggest factor in "heavy" IMO. Heavy things might be useful, they might feel right, they might be efficient (or free). > Don't confuse language construction with the Hilbert's program! Building upwards from "primitive thoughts" influences the way programming languages develop, but which thoughts are allowed as primitive thoughts? The domain of primitives is indeed not just that of formalism vs machine, where one thinks of a formalism, and also has a machine and then these correspond by magic with all other requirements of the (multiperson) programming situation. But Ada is a general purpose programming language made for the primitive electrical things in particular. That's a useful hint at what general purpose should mean, and how general purpose drives the choice of core primitives of the language. For example, in Ada, there is no built-in mechanism for scanning a database of facts like there is in Prolog. The built-in array operators are rather primitive when compared to the built-in operators of APL, even though there is overlap. But conversely, APL's or Prolog's language cores do not let us say 'Compontent_Size, TTBOMK. Their notion of machine (and of time) is different than that of Ada. "Delay" is a key word of Ada the language (and not in Ada the library) whereas this is not usually the case with other languages: their "primitive thoughts" have been different, and have not considered the same requirements of control. Should there be an "interface" that allows programmers to implement the meaning of "delay" instead of the language doing it?