[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: backup archive format saved to disk



On Tue, Dec 12, 2006 at 03:23:49PM -0600, Mike McCarty wrote:
> [snip]
> 
> >Eiffel eliminates that problem with its "expanded" classes.
> >Modula-3 avoids that problem by having data structures that are *not* 
> >made of objects (in the technical OO sense) and that can be places off 
> >the heap, and in other objects.
> >
> >Modula-3 even goes the whole way to low-level system programming with 
> >its "unsafe" features.  The difference between these and C++ or C is 
> >that you can't use them by accident; you have to explicitly mark the 
> >code that uses them as "unsafe".
> 
> Modula-3 I'm not familiar with. There were two problems with Modula-II
> (1) it was named Modula-II instead of Pascal-II

Yeah.  Wirth even wrote a paper about the mistakes made in the design of 
Pascal, and then with Modula he repeated many of them.

> (2) it came along 10 years too late
> 
> When C took over from Pascal, it was evident to all with eyes to see
> that it was an inferior language /as a language/ to Pascal. However,
> Pascal was also deliberately hamstrung. The language was designed for
> beginning programmers, and had so many restraints and safety nets
> that it couldn't be used for systems programming.

It was originally designed for the 60-bit CDC processors.
A lot of its weirder restrictions derive directly from implementation 
limits.  Roughly speaking, it likes its data to for in 60-bit words.
Arrays and records seem to be an exception to this.  But so-called sets 
were not.

ROughly speaking, Pascal encourages you to think in abstract, 
machine-independent concepts, and then restrictsl the implementation so 
you can't.

> Another issue
> is that the language definition specified p-code as the output,
> but one can leave that aside.

The language definition never specified p-code.  The first 
implementation wend straight to CDC Cyber machine code.

p-code was defined for a so-called portable Pascal compiler.
Better technologies for portable object code existed, but Wirth chose to 
ignore them.

> 
> What one cannot leave aside, for systems programming, is the places
> where strong typing could not be broken when one needed to,
> and where separate compilation was not supported.

But strong typing could be broken, and that is one of the real flaws in 
Pascal.  You just use record variants.  You end up breaking it all the 
time without intending to.  Horrible.  And when you need to break it, 
it's syntactically and semantically awkward, and not at all obvious what 
you're doing.

> 
> Another flaw in Pascal was that it was based on the successive
> refinement model for software development, which was a failure.
> In particular, nested procedures are a bad idea.

I don't think nested procedures have anything to do with successive 
refinement.  I've found then quite useful, especially when you want to 
pass procedures as parameters to other procedures.  Pascal actually got 
the semantics of this somewhat right.

> So are local
> variables hiding global variables, but C also has that defect.

Occasionally useful, but you don't want to get it by accident.

> But these features of the language can just not be used. No one
> forces you to write nested procedures.
> 
> But when C came along, Pascal was just not up to systems programming.
> The only other alternative was assembler.

There were, I believe, alternatives to C even in the early 70's.
C spread because it was the implementation language for Unix.

> C, bad as it is, is
> superior to assembler.

For most purposes, yes.  But it has severe deficiencies when it comes to 
initialized static data, and for anything involving data structures 
that contain code.

> 
> Had Modula-II come along in a timely manner, and been named Pascal-II
> so people would have had a "warm fuzzy" feeling of familiarity,
> then C would, I belive, have been the backwater, and not Modula-II.

I think it was intended to give people a warm fuzzy feeling because they 
were familiar to Modula.

Modula III is a different language entirely.  It is superficially 
similar to the earlier Modulas, but
  (1) it was not designed ny Wirth
  (2) it *was* strongly types and had a garbage collector
  (3) it has a machanism for object types and inheritance which did 
*not* replace the older, well-known data structures.  And yes, it did 
allow breaking type security, but you had to be explicit about doing 
that.

> 
> >Although I find these languages wordy, I still think it a great pity 
> >that C++ took off instead of them.
> 
> Well, you've got my take on why that happened.

Your take was about C.  Modula 3 was a mature systems language with 
object-oriented stuff in the 80's, before C++ was really properly off 
the ground.

-- ehndrik

> 
> Mike
> -- 
> p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}

Is this legal C?  Isn't the type of p implicitly int?  Am I missing 
something?

-- hendrik



Reply to: