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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,d275ffeffdf83655 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,d275ffeffdf83655 X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: Ada vs C++ vs Java Date: 1999/02/08 Message-ID: <1999Feb8.180728.1@eisner>#1/1 X-Deja-AN: 442187282 X-Nntp-Posting-Host: eisner.decus.org References: <369C1F31.AE5AF7EF@concentric.net> <79nhe1$3n5@drn.newsguy.com> X-Trace: news.decus.org 918515251 22284 KILGALLEN [192.67.173.2] Organization: LJK Software Reply-To: Kilgallen@eisner.decus.org.nospam Newsgroups: comp.lang.ada,comp.lang.c++ Date: 1999-02-08T00:00:00+00:00 List-Id: In article <79nhe1$3n5@drn.newsguy.com>, mike writes: > In article , eachus@spectre.mitre.org > says... > >> Now a word about the c++ code example that started this discussion. >>I've written similar programs in Ada of similar size, mostly to test >>sort packages. So why hasn't anyone posted such an example to the >>list? >> >> I'll tell you why I haven't. There are no specified requirements >>provided, > > snip.. > >> Are there any concurrency requirements? In particular, what are >>the requirements, if any, for reading from a pipe or a terminal? >> > > Well. the C++ example was reading from stdin, and it had no tasking? Presumably the job is to write software to meet the requirements, rather than to write software that mimics the limitations of some other implementation. >> Is the input format limited such that Ada.Strings.Bounded may be >>used for better efficiency? >> > > The C++ example used the string standard class. so it is obvious that it will > map to Ada unbounded string? But is that the requirement, or just the way the programmer happened to write it? >> What are valid characters in the input, and what characters have >>special treatment requirements. (In particular for C++ compatibility, >>do I have to treat NUL specially?) >> > > >> Is the input small enough that I can sort in memory on the >>intended target? If not, can I keep the index/tree in memory while >>writing the data to disk? >>-- > > > But these questions are up to you to figure out. > > The whole point, is that your Ada program must "behave" the same way as the > C++ program. any input I give to the C++ program, should work with Ada, > as in a black box thing. Offcourse you must use generic data structures like > the C++ program ;) > > And if you are going to post code that does the same as those 8 lines of > C++ did, you need to show all the code used, UNLESS the code is part of the > Ada standard library. Writing Ada code to mimic C++ seems as awful as writing C++ code to mimic Ada. It is just not a meaningful exercise. Larry Kilgallen