[M3devel] LONGINT

Olaf Wagner wagner at elegosoft.com
Thu Jul 19 08:23:50 CEST 2007

On Wed, Jul 18, 2007 at 11:53:38PM -0400, Tony Hosking wrote:
> I've successfully bootstrapped a CM3 compiler that supports LONGINT  
> as a 64-bit integer type (equivalent to "long long" in C) in addition  
> to INTEGER (same as "long" in C).  This will be useful for  
> simplifying interfaces to C library routines that expect to be able  
> to treat 64-bit integers such as "off_t" for lseek, etc.
> Currently, the compiler does not treat LONGINT as an ordinal type  
> (I'm not sure this would ever be a good idea) so it cannot be used to  
> index arrays, define enumerations etc., though the simple operations  
> ABS, MAX, MIN, addition, comparisons, MOD, multiplication,  
> subtraction, assignment, are all supported.  This includes changes to  
> m3core (with support for Long.T similar to Word.T, plus RTTipe and  
> RTTypeMap, etc.) and libm3 for Pickle2, as well as to m3middle,  
> m3front, and the gcc-based compiler backend.  There is still work  
> that needs to be done to support and test all the other M3 tools such  
> as network objects, etc., with support and testing needed in m3tk for  
> the new type, as well as in other tools like m3browser.

This sounds great! As this topic had been discussed several times,
and nothing ever came of it, I'd rather thought that it wouldn't
be different this time. So at last we have explicit 64 bit support.
I assume that this works on 32 bit platforms as well as an 64 bit
platforms? 32 bit backends were the main problem when I tried to
build code generation support some years ago, as suddenly everything 
needed to be 64 bit long in the CG interfaces.

> How best should I proceed to get this out to the community.  I am  
> tempted to push it into the CVS head just so that it gets some  
> testing, but perhaps that is premature. I can confirm a complete  
> bootstrap via "do-cm3-std.sh" that appears to produce perfectly  
> functional executables, including mentor, etc.

Well, as there are no other major projects ongoing in development
as far as I know there principally is no need for special care.
If you can produce a working core system on two or three target
platforms and provide upgrading instructions, we can put it in the
main trunk. I'd strongly suggest to tag _everything_ before and
after commit of the new code though, for example with

  cvs tag devel_LONGINT_start
  cvs commit
  cvs tag devel_LONGINT_RC01

just to make sure that we can easily revert to prior versions.

We'll have to update the M3 language specs, too, and put up
some HTML documentation on the servers.

Thanks for all the work,

Olaf Wagner -- elego Software Solutions GmbH, Ohmstr. 9, 10179 Berlin, Germany
phone: +49 30 23 45 86 96  mobile: +49 177 23 45 869  fax: +49 30 23 45 86 95
http://www.elegosoft.com  |  Geschäftsführer: Olaf Wagner  |   Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194

More information about the M3devel mailing list