🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #2621

Re: Report on defect in M2 vs C (Was Modula-2, Modula-3, C or C++)

#2621
From: Kai Henningsen
Date: Sat, 14 Oct 1995 13:53
43 lines
2736 bytes
vluu@lagrange.uwaterloo.ca (Viet-Trung Luu)  wrote on 11.10.95 in <Pine.SUN.3.91.951011133320.1821B-100000@lagrange.uwaterloo.ca>:

> On Tue, 10 Oct 1995, Robert A Duff wrote:
>
> > No, I don't think it's true (that checking in C/C++ is the same as in
> > other languages).  For example, in C, a variable declared as
> > pointer-to-something might be the sort of pointer that links through
> > heap objects (a linked list, or whatever), or it might be the sort of
> > pointer that steps through an array.  It's very difficult (and in the
> > general case, impossible), to tell which is which.  So, for a C compiler
> > to check array bounds, it has to include several words of extra dope
> > with every pointer, just in case it *might* be the sort that steps
> > through an array.  Other languages (e.g., Ada, Pascal, etc) make this
> > bounds-checking much simpler, and much more efficient.
>
> Yes, I agree. However, that's if you think it's necessary to check
> *everything*. Does anyone know how bullet-proof the checking in other
> languages is?

It *is* necessary. I'm involved in a nontrivial Turbo Pascal program, ane  
whenever Borland introduced aditional checking code to the compiler, we  
found new bugs in the program - by the way, it's delivered with all  
runtime checks enabled ...

As to how bullet-proof checking is, that's of course an implementation  
issue. However, language design is responsible to answering how bullet- 
proof it can be made.

For instance, lisp is usually completely bullet-proof. For a more  
"mainstream" language, M3 *guarantees* (if it's implemented correctly)  
that as long as you keep to writing "safe" modules, you *cannot* crash the  
program, at worst you'll get a runtime error. (That makes life somewhat  
harder for people writing "unsafe" modules, of course, as they have to  
keep that guarantee - even the most idiotic use of their modules has to  
stay safe.)


Kai
--
>>> PFM-Mainz.de distributes mail bombs. <<<
Internet: kai@khms.westfalen.de
Bang: major_backbone!khms.westfalen.de!kai
http://www.westfalen.de/private/khms/
Technical Details
Message-ID: <5vpKEsfzcsB@khms.westfalen.de>
Path: arc1-ca.pugleaf.net!khms.westfalen.de!kai
References: <DG920p.L2K@world.std.com> <Pine.SUN.3.91.951010144335.13726A@lagrange.uwaterloo.ca> <DG920p.L2K@world.std.com> <Pine.SUN.3.91.951011133320.1821B-100000@lagrange.uwaterloo.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!khms.westfalen.de!kai
Date: 14 Oct 1995 15:53:00 +0200
From: kai@khms.westfalen.de (Kai Henningsen)
Newsgroups: comp.lang.modula2,comp.lang.c,comp.lang.ada,comp.lang.c++,comp.lang.modula3
Message-ID: <5vpKEsfzcsB@khms.westfalen.de>
References: <DG920p.L2K@world.std.com>
 <Pine.SUN.3.91.951010144335.13726A@lagrange.uwaterloo.ca>
 <DG920p.L2K@world.std.com>
 <Pine.SUN.3.91.951011133320.1821B-100000@lagrange.uwaterloo.ca>
Subject: Re: Report on defect in M2 vs C (Was Modula-2, Modula-3, C or C++)
X-Newsreader: CrossPoint v3.1 R/C435
Organization: Organisation? Me?! Are you kidding?