Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!swrinde!ucsd!ucbvax!DECWRL.DEC.COM!mwm From: mwm@DECWRL.DEC.COM (Mike Meyer, My Watch Has Windows) Newsgroups: comp.society.futures Subject: Re: C's sins of commission (was: (pssst...fortran?)) Message-ID: <9009202104.AA21146@raven.pa.dec.com> Date: 20 Sep 90 21:04:29 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 46 >> I think you had in mind casting the pointer to an int and looking at >> the raw address - the ANSI standard leaves this process undefined. You keep acting like "undefined" means "unusable". That's not the case. It means that the compiler can do whatever it wants, which may or may not be usefull in your environment. If there's an environment where the C compiler does something usefull that some "replacement" can't do, then that replacement is lacking. One of the reasons C became popular was because operations were undefined originally, and compiler writers were free to do whatever made sense on their machines. The ANSI standard holds true to that spirit, but marks such areas clearly, so that you have a fighting chance of writing code that will port to multiple environments. Used in that light, as a high level, semi-portable assembler, (aka a "systems" language) C is acceptable. If you're working on a replacement for it in that sense, then you have to be able to allow users to do things that they do in C in their environment, even if those things are "undefined" by the standard. I'd be interested in any such attempt. As a general-puprose programming language, C is old and has a large number of problems (many of which are shared by lots of language from that era). However, there are a large number of replacements around, and so far, I've seen nothing in your proposals that are new. If you haven't yet, you might take a look at Euclid and peoples comments on it to see how some of your proposed features work in practice. You've as yet to answer my questions about garbage collection, and what constructs would be provided for working with sequences. As an addendum to that list, I'd be interested to know how you would recode the following C sequence with undefined behavior using your proposed constructs so that it would do what it's author intended: long word ; char *pointer ; word = '1234' ; pointer = (char *) word ; printf("%c %c %c %c\n", pointer++, pointer++, pointer++, pointer++) ; The intent was to determine the byte ordering of the machine the code was running on.