On Fri, Sep 07, 2001 at 07:50:38PM -0500, Steve Siegfried wrote:
> 
> Sorry, folks... I can't let this one pass uncommented upon.
> 
> Florin Iucha wrote:
> > 
> > On Fri, Sep 07, 2001 at 05:55:05PM -0500, Nate Straz wrote:
> > > On Fri, Sep 07, 2001 at 05:21:18PM -0500, Florin Iucha wrote:
> > > > And don't get me started on pointer in Pascal or I/O in Pascal...
> > > 
> > 
> > Most of my problems come from knowing and loving C. I approached Pascal open-harted.
> 
> Open hearted? Or openly hated?

I was truly curious about Pascal then, the way I was truly curious about C
two years before, Perl two years ago, Python now... I am a curious person :)

>                                 Muppet news flash for ya, Florin:  The
> language wars are over.  C won.  Now everyone has to live with that victory,
> especially the C bigots, who _still_ can't get and/or keep their code
> running bug-free.

That's not the fault of the language, as of people. You cannot invent a 
fool-proof language, a language that any fool can write only correct programs.

All the programming languages have equal expressing power (and equivalent to
Turing machines) so the only differences are in the quality of the 
implementation and the "conveniences"... All of them can lock a machine 
without letting you know :)

You cannot invent the "universal-convenient" language either, because
problems are different and people way of thinking are different.

> > They are more like references: you can't add constants to pointers, and you
> > can't do a lot of wizardries.
> 
> Most of which is the source of countless trouble. 

Knives and scissors too. And also they are usefull tools in the hands of a 
craftsman.

>                                                    You're leaving out nice
> stuff like full type checking, full range checking, full pointer checking...

And a certain runtime overhead I might need to dispense of sometimes.

You can verify ranges in C, you can verify pointers for null in C.

I am still debugging now _JAVA_ code that throws NullPointerException left
and right because people do not check for null. Instead of SIGSEGV I get a
nicely packaged exception: what is the difference? You still have to check
for null and still have to catch somewhere the exception.

> All the stuff that basically let you write 1000 lines of "production
> quality" code a day if you put your mind to it.

There is _no_ language that enforces correct programs. It can't be.

> > And "string"? Oh, please... Strings of at most 255 chars. And conversion between
> > chars and integers were a pain - "ord" / "chr".
> 
> In substandard implementations, yes, strings were limited on 255 chars in
> length.  Most decent implementations (read: Not Borland) did a better job
> with strings than that.  The last Pascal compiler I worked on (Cray's)
> supported strings of any length in the range [0..4294967295] (i.e.: up to
> (2^32)-1 characters).  Most folks _still_ don't have that much memory.

We were talking about Turbo Pascal. It had to run on 286 with 640k memory.
It did that well.

> Had the implementors of AT&T's Portable C instead chosen to implement
> Pascal-style character strings (a length field + max length field + a packed
> array of characters),

The implementors of the original C implemented as less features possible so
the compiler can be very simple.

>                       90+% of all U*ix security problems due to buffer
> overruns would _NEVER_ been possible in the first place... they'd have all
> become run-time errors instead of security holes.  Oh yeah... and the oft'
> used "strlen' function would be reduced to a single memory reference, too.

I won't get into that. That is sloppy programming in the first place.

You know my argument when somebody praises me the virtues of "garbage
collecting"? I ask - if the programmer can't be bothered to keep track of
the references to the objects he created, what else can't he be bothered to
keep track of?

> > > I didn't think there was anything wrong with I/O in TP.  It has been
> > > quite a number of years since I did anything with I/O in TP.  What was
> > > your problem exactly?
> > > </devil's advocate>
> > 
> > After the logical "open" / "close" / "read" / "write" from the C library,
> > "Assign"/"Reset" and what read and write were called made me puke.
> 
> Again, in substandard implementations (read: Borland).  Most good Unix-based
> implementations also had open/close/read/write/yadda/yadda/yadda.  Dec
> Pascal from Digital^H^H^H^H^H^H^H Compaq^H^H^H^H^H^H H.P.(for both the Vax
> and the Alpha under Digital Unix) still does.

I went to college into Eastern Europe. We didn't have UNIX or Alphas there.
Just a bunch of diskless 286 with a 386 as a server. Running DOS/Novell.
Turbo Pascal/Turbo C was all you could get.

> Borland's implementation of Pascal was so poor, it basically killed the
> language.  Maybe that was the real intent all along.

Borland Pascal still lives in the mainstream due to Delphi...

> -S
>  (a compiler guy who's also a former X3J9/IEEE/ISO Pascal committee member)

My hat off to you,
florin

-- 

"If it's not broken, let's fix it till it is."

41A9 2BDE 8E11 F1C5 87A6  03EE 34B3 E075 3B90 DFE4