Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!husc6!m2c!wpi!jhallen From: jhallen@wpi.wpi.edu (Joseph H Allen) Newsgroups: comp.lang.misc Subject: Re: Arrays in languages (was: Anyone want to design a language?) Message-ID: <9230@wpi.wpi.edu> Date: 28 Feb 90 05:51:20 GMT References: <3528@tukki.jyu.fi> <14251@lambda.UUCP> <8836@boring.cwi.nl> <14255@lambda.UUCP> <8849@boring.cwi.nl> Reply-To: jhallen@wpi.wpi.edu (Joseph H Allen) Organization: Worcester Polytechnic Institute, Worcester ,MA Lines: 39 Here's something else to think about in this discussion... I'm most interested in a language which is close to what you do in assembly language. So as far as arrays... Several points: If the language has dynamic arrays then library functions (possibly inline ones) arn't any slower so the language doesn't need them to be built in. If the language has static arrays, you can simulate them painlessly with macros anyway. In fact, to call fortran library functions from C I just use macros to make arrays which are compatible with fortran's. I don't care about bounds checking. If the language is powerful enough to have bounds checking it should also be powerful enough to have fully dynamic arrays. I'm not considering optimizations you can make by assuming non-aliased arrays (I.E., I know this can be a big improvement, but for most things (and this argument) I don't care) The only advantage of having static arrays built into the language is for type checking purposes. But this isn't valid since you can just make a type 'array' which is really a pointer (or more accurately, an address)... (the nicest array language I've ever used was a version of BASIC which didn't have a DIM statement but which handled arrays of arbitrary dimension and size. I.E., you could just say 'A(1,5,10)=7' and it would allocate the array for you. You could then say 'A(1,5,10,8)=9' and it would make the element A(1,5,10) contain a sub-array... Is there any other language with this power? APL maybe? Or do you have to declare arrays in APL also... (I don't know APL)) (which version BASIC was that you ask? Why, my own... (Joe's slow BASIC) :-) -- "Come on Duke, lets do those crimes" - Debbie "Yeah... Yeah, lets go get sushi... and not pay" - Duke