[M3devel] static typing [WAS: JIT, WAS: Google Benchmark - anyone interested in an Modula 3 version?]

Henning Thielemann schlepptop at henning-thielemann.de
Sun Jul 24 20:51:17 CEST 2011


On 10.07.2011 15:32, Rodney M. Bates wrote:

> 1) Dynamic typing is seldom either needed or used.
>
> The majority of variables (1) in sensible programs are what I call
> _algorithmically statically typed_. By this, I mean, informally, that
> there is a natural type for the variable that can be inferred from its
> assignments and uses. Moreover, this is a static property, i.e.,
> independent of the program's inputs, and thus can be inferred from the
> code alone.

By the way, I remember the HiSoft Basic compiler on ZX spectrum that 
allowed you to run BASIC programs in a test mode, where the types of the 
variables were determined. In a sense (ZX Spectrum) BASIC is statically 
typed, since names of string variables must end with '$' and all 
alphanumeric variable names denote floating point numbers. The HiSoft 
Basic compiler had a richer set of numeric types: signed and unsigned 
8-bit and 16-bit numbers and floating point numbers. In the test run the 
compiler determined for every variable the most restrictive type that 
covers all numbers seen during the program execution.



More information about the M3devel mailing list