[M3devel] [M3commit] CVS Update: cm3

Daniel Alejandro Benavides D. dabenavidesd at yahoo.es
Wed Jul 7 06:30:06 CEST 2010


Hi all:
I could be wrong but if the mapped structures of original CM3 v4.1 were to detect compile time errors and runtime errors those ones no checked in M3 would be like to be checked at the CM3 JVM runtime (which abide CM3 itself at the time) then as the runtime JVM micro-ops were even possibly checked at java process runtime and possibly scanned at the lowest Modula-3 execution trace lower levels, we can I guess map those of the M3CG (even if are at the lowest level they did something like to match some structures at least they did that level of matching of two semantic structures and work as one like the CISC stack based JVM machine and the "RISC" stack class machine of M3CG) at the compile time back traces and so on interpretation (it would be not just not a M3CG VM like JVM but to get type info of the system and detect the probably undetectable otherwise Modula-3 runtime overflows i.e map some undetectable otherwise expressions meant to be not overflowed
actually overflowed in the runtime). I guess in that way we can reserve more energies for both tasks compiler enhancement and m3cg tracing tree debugger ability if thats what you are looking for.
In other short words I am proposing instead of the idea of initialize everything either manually or semi automatically get into the idea of a proper type system for M3CG and get rid of this kind of errors people are seeing meaningful if someone tells what else.
I have a history of Modula-3, Java and JVM friendly leaving but to get into this properly I guess I would need more than energies I would like to get to check specially the implementation of the JVM lower level of CM3 and even better than that state or propose a type system for M3CG assembly language if we can call like that so no matters what we can have a better and systematic and reasonable (as JVM does) way of checking the M3CG code checking and generation if at all changes.
Let me have a chance of asking of this more, probably first I  need to check this paper wrote in DEC SRC about 1998 to see if the type system is pretty straight forward
http://www.hpl.hp.com/techreports/Compaq-DEC/SRC-RR-158.pdf

Thanks in advance

--- El mar, 6/7/10, Tony Hosking <hosking at cs.purdue.edu> escribió:

> De: Tony Hosking <hosking at cs.purdue.edu>
> Asunto: Re: [M3devel] [M3commit] CVS Update: cm3
> Para: hendrik at topoi.pooq.com
> CC: m3devel at elegosoft.com
> Fecha: martes, 6 de julio, 2010 12:00
> I agree.
> 
> If Modula-3 was being designed today it would impose the
> same ban on uninitialized use of variables that Java does.
> We have a language that does not impose that ban, but
> instead assures that every ininitialized variable holds a
> valid value.
> I much prefer to see
> 
> VAR x: INTEGER
> 
>  as an *explicit* marker that the variable holds an
> indeterminate but valid value.
> 
> Seeing
> 
> VAR x := 0
> 
> implies to me that there is something especially
> significant about the initial value 0.
> 
> 
> On 6 Jul 2010, at 12:53, hendrik at topoi.pooq.com
> wrote:
> 
> > On Tue, Jul 06, 2010 at 10:05:43AM +0000, Jay K
> wrote:
> >> 
> >>> used it should be a giant red flag to the
> reader that the variable x is
> >>> going to be initialized with a value that the
> programmer doesn't know
> >>> at the time of declaration. What on earth do
> you gain from x := 0?
> >>> A "little correctness"?
> >> 
> >> You are making the code more expensive to
> maintain, by making
> >> it harder for a human to analyze. For the benefit
> of microoptimization.
> > 
> > Microoptimisation as a purpose?  Didn't he just
> explain that
> >   VAR x : INTEGER;
> > is intended to signal to the *reader* that the initial
> value is 
> > irrelevant?  The fact that a naive compiler might
> compile it slightly 
> > more efficiently is a side effect, not a
> purpose.  If he were interested 
> > in microoptimisation, he would better feed it into a
> flow-analysing 
> > compiler, which could even detect when an explicit
> initialization like
> >   VAR x := 0;
> > is irrelevant and suppress it.
> > 
> > It's not *about* optimisation.
> > 
> > Indeed, they syntactic awkwardness of declaring
> variables with WITH 
> > (to make sure they're initialized where they're
> declared) is one of 
> > the problems of Modula 3, and one of the few places
> where C did it 
> > better.  Granted C, didn't do this at all
> initially, and took it from 
> > Algol 68 in one of C's rounds of standardisation.
> > 
> > -- hendrik
> 
> 


      




More information about the M3devel mailing list