Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!samsung!munnari.oz.au!brolga!uqcspe!batserver.cs.uq.oz.au!brendan From: brendan@batserver.cs.uq.oz.au (Brendan Mahony) Newsgroups: comp.society.futures Subject: Re: C's sins of commission (was: (pssst...fortran?)) Message-ID: <4905@uqcspe.cs.uq.oz.au> Date: 18 Sep 90 05:51:26 GMT References: <1990Sep14.212806.8131@abcfd20.larc.nasa.gov - <63218@lanl.gov> Sender: news@uqcspe.cs.uq.oz.au Reply-To: brendan@batserver.cs.uq.oz.au Lines: 52 jlg@lanl.gov (Jim Giles) writes: - 1) 'Atomic' types (floats (various sizes), ints (various sizes), booleans, - characters (various character sets), etc....) - 2) Enumerated data types. These are simply a vay to allow the user to - invent a new 'atomic' type. - 3) Arrays. Mappings from a tuple of indices to a typed value. Note: an - array of arrays is legal and is _NOT_ the same as a 2-d array (although - a little syntactic sugar could allow this later - no one has ever asked - for it). - 4) Sequences. An ordered collection of zero or more objects to be - accessed in a specific order. Obvious syntactic sugar (like direct - referencing of the last element or an arbitrary element) is permitted. - The usual implementation of character strings in C is an example of an - inefficient implementation of a sequence. You can have a sequence of - any data type (including a sequence of sequences - which is what a - dictionary is). - 5) Records. Like C struct. No difference at all really. - 6) Unions. These are _always_ discriminated. The compiler is - responsible for maintaining and checking the type tags. Note that - this only _seems_ inefficient: _legal_ C programs should always - explicitly maintain a tag anyway. - 7) Recursive types. These may be given the attribute 'aliased' in order - to allow circular and overlapping references. Other than that, we have - discussed these before. - In addition, all variables can be declared with a 'dynamic' attribute, - which means that they must be allocated before use (dynamic arrays give - their size at allocation time). It might be desireable for sequences - and recursive data type to be given the dynamic attribute automatically. - I can demonstrate sample syntax for these if anyone thinks it is required. - Anyone who proposes a C data object that he claims is not representable - here is invited to do so (I'm not joking - I'm designing a language with - these features - this challenge is an attempt to find out whether I'm - leaving something out). Yes you are. You are leaving out memory mapped I/O and operating system vectors and other disgusting cludges that make the computing world go round. Other than than you are spot on! -- Brendan Mahony | brendan@batserver.cs.uq.oz Department of Computer Science | heretic: someone who disgrees with you University of Queensland | about something neither of you knows Australia | anything about.