Xref: utzoo comp.arch:10512 comp.lang.misc:3041 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!ames!purdue!mentor.cc.purdue.edu!l.cc.purdue.edu!cik From: cik@l.cc.purdue.edu (Herman Rubin) Newsgroups: comp.arch,comp.lang.misc Subject: Re: Double Width Integer Multiplication and Division Summary: Neither problem is adequately answered Message-ID: <1388@l.cc.purdue.edu> Date: 6 Jul 89 13:32:24 GMT References: <57125@linus.UUCP> <1989Jun24.230056.27774@utzoo.uucp> <13946@haddock.ima.isc.com> Followup-To: comp.arch,comp.lang.misc Organization: Purdue University Statistics Department Lines: 64 In article <13946@haddock.ima.isc.com>, suitti@haddock.ima.isc.com (Stephen Uitti) writes: > In article <1387@l.cc.purdue.edu> cik@l.cc.purdue.edu (Herman Rubin) writes: > >What languages, other than Lisp and some similar ones, have the idea that > >an operation or function can return a string of values? > > C. One can pass structures and unions back & forth by name or > value. NO!. For the n-th time, a list is not a struct. A struct is a memory allocation scheme. It presumes a particular "physical" ordering of the items. Even if one can implement a struct in registers, it still restricts which registers are used far more than a list does. For example, on a machine in which there is division yielding a quotient and a remainder, I want to write q,r = x/y; On the VAX, for example, q could be in register 3 and r in register 10. Since the hardware allows simple things like this, the language should. At the present time and in the future, loads and stores must slow things down unless they can be overlapped. The overlapping problem is greatly exascerbated by having to do too many of them. > > Now you want the language to use syntax that YOU defined? > Compiler writers are doing that now too. I'd rather they spent > their time on designing unambiguous and coherant languages for > which code can be easily written, read and modified, that have > real scope rules for libraries and other seperately compiled > environments, and produce more optimal code for real machines, > and provide for special needs of real people in the way of > specialized preprocessors (lex, yacc) and prewritten library > code. How many people would have difficulty with the above quotient-remainder notation even without explanation? With commenting, lots more could be done without difficulty. A struct is more complicated than a new type. > > >What languages allow the user to introduce additional operator > >symbols? A few allow additional types. Now these deficiencies > >in languages go back to day 1. > > C++ and Ada. My wristwatch (Casio) has more compute resources > than was available on day 1. I don't expect it to allow > additional operators and types either. It does have a 64 bit > (BCD) divide. Throw out your '205 and get a Casio. > I am not very familiar with Ada. C++ allows the introduction of new types, although they are not called types. The stupid use of the word "typedef" in C rather than the more accurater "typealias" is responsible for this. But I do not believe that C++ or Ada allows one to define symbols or symbol combinations as infix operators. As a simple case, I should be able to tell the compiler that \ is the bit clear operation, which &~ may or may not handle properly, and has the same machine structure as OR on the VAX (or any other machine which has it in hardware.) If I am using a 205, I will use an algorithm appropriate for the 205. If I am using a CRAY, I will use an appropriate one. If it involves double precision multiplication or square root, I will try hard to find a workaround on the CRAY. -- Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907 Phone: (317)494-6054 hrubin@l.cc.purdue.edu (Internet, bitnet, UUCP)