[M3devel] the LONGINT proposal

Jay K jay.krell at cornell.edu
Sun Jan 10 21:34:59 CET 2010


> 2. There should be no mixed arithmetic between the types. The programmer must code conversions using ORD/VAL to make explicit the intention. Don't rely on some ill-remembered built-in conversion rule.
> 
> 4. WRT assignability, I think explicit conversions should be used.
> 

 

Have you seen the resulting diffs?

 

 

Would we just say, that the initial rd/wr interface was so wrong, that there

is a lot of "incorrect" code, so the ugly diff is the result?

That newer code wouldn't be so initially wrong, so would remain not so ugly?

Maybe.

 

 

VAR a:LONGINT;

      b:INTEGER;

INC(a, b);

 

 

doesn't that make perfect sense to even the most casual reader?

Many current proposals don't allow it.

  Though Randy's does allow it.

 

 

Indexing by LONGINT is also trivial.

Just do the usual range check and go.

Indexing by INTEGER also has a range check.

One difference would be that a subrange of LONGINTs that are all greater than LAST(INTEGER) could be a stack error, just as some indexing by INTEGER subranges can also be a static error (e.g. if the array element size times the all the elements of the subrange or enum are larger than the address space).

 

 

 > We need correct and maintainable software, especially at the systems level

 

Nearly all systems level software is written in a language or languages that manage to zero extend or sign extend integers to wider integers.

The Modula-3 compiler/runtime/garbage collector is the biggest exception I can think of, but so far it can't really handle large files.

 

 

 - Jay

 
> From: rcolebur at SCIRES.COM
> To: m3devel at elegosoft.com
> Date: Sun, 10 Jan 2010 15:00:58 -0500
> Subject: [M3devel] the LONGINT proposal
> 
> I've been trying to follow along on this topic.
> 
> Here are my thoughts:
> 
> 1. LONGINT should be a distinct type different from INTEGER.
> 
> 2. There should be no mixed arithmetic between the types. The programmer must code conversions using ORD/VAL to make explicit the intention. Don't rely on some ill-remembered built-in conversion rule.
> 
> 3. Overflow should be a checked run-time error, not silently wrapped around.
> 
> 4. WRT assignability, I think explicit conversions should be used.
> 
> These statements may make me unpopular with some who don't like to type much, but I've always hated the tradeoff of understandability for brevity in expression.
> 
> The important thing is not how fast we can type up a program, it is rather how hard is it to make a mistake. I think the spirit of Modula-3 is that the language makes you a better programmer by forcing you to make your intentions explicit rather than relying on the compiler to infer your intentions. We need correct and maintainable software, especially at the systems level. Whatever is decided about LONGINT, we need to keep to the original design tenants of the language. 
> 
> And yes, I do think we need a LONGINT type, not just to deal with large file sizes.
> 
> But even for long-lived readers/writers, whatever type you choose for the index will eventually be insufficient, so you have to code for the possibility that the range of the long lived reader/writer exceeds the range of your index type. That is just good programming.
> 
> I think sometimes that the new generation of programmers has been warped by what I call the "Microsoft Mentality" where you must expect that you need to reboot/restart every so often to maintain proper performance. Programs should be written to run forever or until their job is completed or they are commanded to stop. 
> 
> As "we" begin to converge on the design changes, I like having something concrete to look at, ala Rodney's proposal. Can we take that and keep tweaking it in these emails until we reach a final version acceptable to all? To me this keeps the discussion focused rather than the many different emails. Thus, what I am trying to say is put forth a numbered proposal and each subsequent email must show adjustment to that proposal rather than just a bunch of emails discussing various aspects. Perhaps we should vote on each proposed change, then decide to call a final vote on the whole thing. Who should be involved in such votes? Right now the main persons on the thread are Tony, Jay, Rodney, Mika, Hendrik, Olaf, John, and me.
> 
> My two cents.
> 
> Regards,
> Randy Coleburn
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100110/a6f5921b/attachment-0002.html>


More information about the M3devel mailing list