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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-ArrivalTime: 2001-08-17 13:08:51 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!headwall.stanford.edu!feeder.via.net!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.bc.home.com.POSTED!not-for-mail From: kaz@ashi.footprints.net (Kaz Kylheku) Newsgroups: comp.lang.ada,comp.lang.c++ Subject: Re: How Ada could have prevented the Red Code distributed denial of service attack. References: <3b690498.1111845720@news.worldonline.nl> <9kbu15$9bj@augusta.math.psu.edu> <9kbvsr$a02@augusta.math.psu.edu> <3B69DB35.4412459E@home.com> <9kp9n7$ivm$1@nh.pace.co.uk> <3B73337F.862F8D93@home.com> <9lb7hu$72h$1@norfair.nerim.net> <3B7C6977.3648F061@home.com> <3B7C79FA.89E62321@globetrotter.qc.ca> <3B7C9288.6CD8C288@home.com> <3B7D2033.1C780DF5@home.com> Organization: Psycho-Neurotic Institute for the Very, Very Nervous Reply-To: kaz@ashi.footprints.net User-Agent: slrn/0.9.6.3 (Linux) Message-ID: Date: Fri, 17 Aug 2001 20:08:51 GMT NNTP-Posting-Host: 24.68.85.82 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.bc.home.com 998078931 24.68.85.82 (Fri, 17 Aug 2001 13:08:51 PDT) NNTP-Posting-Date: Fri, 17 Aug 2001 13:08:51 PDT Xref: archiver1.google.com comp.lang.ada:12072 comp.lang.c++:83515 Date: 2001-08-17T20:08:51+00:00 List-Id: In article <3B7D2033.1C780DF5@home.com>, Warren W. Gay VE3WWG wrote: >Kaz Kylheku wrote: >> In article <3B7C9288.6CD8C288@home.com>, Warren W. Gay VE3WWG wrote: >> >When you can show the compiler's yacc grammer that specifically >> >addresses specific aspects of the STL (ie. specific to certain >> >class names), then you might have something. >> >> The C++ language is no defined by a yacc grammar. > >I'd be _real_ surprised if gcc does not use yacc to implement the C++ >compiler. But even so, then let's move on.. GCC uses bison. GCC does not define the C++ language. >> In the terminology that I'm using, a programming language is a broader >> container which contains components like ``grammar'' and ``library''. >> >> To call the language a grammar is to mistake the part for the whole. > >I agree with you on this, but you are putting words in my mouth. The >grammer does indeed help to define the language (its form and its >rules), but obviously is not the language itself. > >But what about this: What language does the STL use? Use in what sense? The library is kind of lexicon which makes available certain identifiers in certain categories. These categories come from the C++ syntax. Because those identifiers are available, the rest of my program which uses those identifers has a meaning which can be inferred from the semantic descriptions of those identifers in the standard. >Hmmm.. lemme guess, it's probably C++ and perhaps a sprinkling of >is a _translated_ library, that is shipped with "include" files. >Again, the "include" files are written in C++. I can't infer this requirement in the C++ standard. Can you cite a reference that standard headers must be files that are written in C++, or that there must must exist previously translated libraries as visible components? As far as I can tell, when you write #include that is simply a magic incantation which makes certain identifiers available. Those identifiers behave ``as if'' they were introduced by C++ declarations. >But wait a minute? You cannot define something in terms of itself. >So this leads to one of two conclusions: > >The language that the STL is written in is: The language that the library it's written in is English. How it's implemented is just an artifact of an implementation. Such artifacts do not define the language and do not necessarily provide a framework for clear, platform-independent reasoning about a language. Note that many components of a standard library cannot be written in that language. Only their interface can be expressed as a declaration that language. (How can you write, say, the time() function in C without invoking some platform-specific system service, or accessing clock hardware?) The C99 standard has introduced a new header containing type-generic macros for math functions . There is no way to write these type-generic macros in C99! So tell me, what language are they ``written'' in? Lastly, same languages have very little syntax at all; everything is done with standard functions, or forms that resemble them. You could argue that (cons ...) is not part of Lisp, but merely a library function for constructing and initializing a cons cell; the only things that are part of the language are parentheses, macro characters, quotes and a few other elements of the read syntax. Yet, the majority of programs would lose their meaning if (cons) were removed. There are special operators, but any of those could be implemented using macros. So there is no way to draw the division about what is core and what can be implemented as a library. The syntax alone doesn't provide that core, because you'd have nothing to bootstrap with. There are may ways of choosing the core subset of special forms that will be intrinsic; it's an implementation choice. > - or the STL is not part of the C++ language proper. As such, it > only enhances the usefulness of the C++ language, as a _library_ ``language proper'' is just a synonym for ``grammar'' or ``syntax''. It's not a synonym for ``language''. Look, why don't you try to convince people on the street that ``water'' is not really part of the English language, because it's doesn't play a role in the syntax?