🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #785

Re: An Interesting View of "Strong" Vs. "Weak" Typing

#785
From: Reino de Boer
Date: Fri, 12 Jan 1990 10:40
52 lines
2713 bytes
lgm@cbnewsc.ATT.COM (lawrence.g.mayka) writes:

>In article <1990Jan5.084746.17836@cs.eur.nl> reino@cs.eur.nl (Reino de Boer) writes:
>>	all interpreters (CL, Smalltalk, etc.) by definition do only
>>	run-time checking (not being able to compile at all).

>Common Lisp programs are typically compiled into native machine
>instructions. 
>An interpreter is usually also available but most CL programmers
>use it primarily to execute top-level environment commands such as
>ED, COMPILE-FILE, LOAD, TRACE, DESCRIBE, INSPECT, and DISASSEMBLE.

The point I was trying to make, is that an interpreter can BY DEFINITION
do no compile-time checking.
Some `compilers' allow a form of run-time checking because they include
a run-time interpreter in the compiled code. I would like to classify
these compilers under interpreters.
Some `interpreters' allow a form of compile-time checking because they
interpret some kind of internal code. Depending on the semantics of the
internal code, these could be classified under compilers.

The only reasonable way for a compiler to allow run-time type checking
would be to include type-checking code in the compiled code.

However, there is more than one issue being discussed here:
1. What would be reasonable definitions for
   o run-time type checking;
   o compile-time type checking.
2. Given a solution to (1), what are the advantages and disadvantages of
   both kinds of type-checking.
3. Given an answer to (2),
   o what would be the best way to let a programmer influence the
	 checking mechanism (e.g., type declarations as in Pascal, or
	 polymorphic typing as in Miranda)
   o does type checking have to be `strong' or `weak' (and what would be
	 suitable definitions for `strong' and `weak').
	 Example:
	 Strong type checking in Pascal would give the programmer the
	 opportunity to get a compiler error on the following:
	 program wrong( output );
	 type distance = real;
		  money    = real;
	 var  d        : distance;
		  m        : money;
	 begin d := 5.5; m := 10.0; writeln( d + m : 10 : 2 ) end.

Any comments? -- Reino

-- 
Reino R. A. de Boer
Erasmus University Rotterdam ( Informatica )
e-mail: reino@cs.eur.nl
Technical Details
Message-ID: <1990Jan12.104012.4426@cs.eur.nl>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!hp4nl!eurtrx!euraiv1!reino
References: <1990Jan5.084746.17836@cs.eur.nl> <12608@cbnewsc.ATT.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!hp4nl!eurtrx!euraiv1!reino
From: reino@cs.eur.nl (Reino de Boer)
Newsgroups: comp.lang.misc,comp.software-eng
Subject: Re: An Interesting View of "Strong" Vs. "Weak" Typing
Keywords: typing, Ada, Lisp, definitions, evidence
Message-ID: <1990Jan12.104012.4426@cs.eur.nl>
Date: 12 Jan 90 10:40:12 GMT
References: <1990Jan5.084746.17836@cs.eur.nl> <12608@cbnewsc.ATT.COM>
Organization: Erasmus Universiteit Rotterdam, dept. CS (Informatica)
Lines: 52