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.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!seas.gwu.edu!mfeldman From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: Keyboard input Message-ID: <2176@sparko.gwu.edu> Date: 25 Sep 90 15:10:00 GMT References: <39@screamer.csee.usf.edu> <920032@hpclapd.HP.COM> Reply-To: mfeldman@seas.gwu.edu () Organization: The George Washington University, Washington D.C. List-Id: In article <920032@hpclapd.HP.COM> defaria@hpclapd.HP.COM (Andy DeFaria) writes: >>/ hpclapd:comp.lang.ada / mfeldman@seas.gwu.edu (Michael Feldman) / 1:13 pm Sep 22, 1990 / > >I think it's pretty simple: If you have to resort to using C instead of >Ada then it's not Ada is it? What so hard to understand about that? And >what happens when you port this to a system that doesn't have C huh? I >mean, what if the poor guy doesn't have anything but Ada? It's a bit hard to understand why you are flaming. Let's see if we can cool tempers a bit. > >Yeah it's not standard, it's not contained in TEXT_IO and all that. Also, >I've probably done more pragma INTERFACE'ing than you have. But that don't >make it portable. At best it opens up opportunties for portablity >problems. Undoubtedly you've done more interfacing than I have; I'm only a professor. But I have done _some_ and understand what the issues are. I took the question as a serious one; obviously you meant it rhetorically because you knew the answer already. >But still how can you do this in Ada? (A: You can't.) Well what about >people who only have Ada? (A: They're stuck.) Or they can make a library call, if the library exists for their implementation. If it doesn't, they are stuck. That's why there should be a standard library (i.e. portable) for this. Unfortunately, I don't think this is possible, as the discussions on this group regarding the virtual impossibility of doing it on IBM mainframe iron point out. There are some things that just ain't portable. Period. No matter what language. This problem will persist until the end of time, or until OS designers all agree on a standard, whichever comes first (undoubtedly the former will). I don't want to get into a flame war over languages. Let's see if we can get an even-tempered discussion going. In my experience there are always things one can dream up to do that a high-level language doesn't support directly. The standard way to do this, it seems to me, is to jump into assembler, say, or use C to make direct calls to an operating system DEPENDENT library. There are C libraries for DOS machines that are different from the functionally similar ones on Unix; there are Unix libraries for functionalities that don't even exist in DOS (signals come to mind). A direct call to a Unix routine will NOT be portable if the same routine doesn't exist in DOS. We can go the other way, too: interrupt calls that work on DOS won't work under Unix, especially if the underlying CPU's are different. Indeed the Unix folks are embroiled in lengthy discussions on "merging" the main dialects of Unix. The preamble to the POSIX standard indicates that POSIX is not likely to be 100% compatible with ANY existing Unix. Since POSIX defines the programmer's interface to "something like Unix" - meaning a bunch of C-callable routines - it will be possible to write a C call which won't work on _some_ system that isn't POSIX-compliant. The bottom line is that complete portability is, for most nontrivial programs, an ideal to strive for but, in the end, only an ideal. We may bemoan this state of affairs, but we have to agree that it _is_ the state of affairs and is likely to continue to be so in our lifetimes. None of this is to defend the agonizingly slow development of standard Ada libraries that go beyond TEXT_IO. I know some of the folks working on numerics and understand some of the issues there, but I still wish we had a standard Ada library more-or-less equivalent to (although ain't entirely portable either!). I wish we had a standard library for string handling (the string stuff in ain't bad for starters, but could be improved upon). And I certainly wish we had a standard library for single-keystroke I/O. But we don't. And even if we did, there'd always be machines for which it would be useless (IBM iron again). The point I tried to make in the note that was so bitterly flamed is that Ada, like all the other languages, has hooks (like pragma INTERFACE) to let us write these other packages. And it is not sinful to use the hooks. I wish that the Ada compiler community would agree on specs for these packages and build them already. --------------------------------------------------------------------------- Prof. Michael Feldman Department of Electrical Engineering and Computer Science The George Washington University Washington, DC 20052 202-994-5253 mfeldman@seas.gwu.edu ---------------------------------------------------------------------------