[M3devel] cm3: what are *.mc files
Rodney M. Bates
rodney_bates at lcwb.coop
Sat Jun 13 20:27:00 CEST 2015
On 06/13/2015 03:40 AM, Elmar Stellnberger wrote:
> Am 12.06.15 um 22:10 schrieb Jay:
>> No guarantees on any of this imho. Nor the extension. The files are usually temporary. What are the magic bytes for .c? What is the purpose here? We could add 4 ignored bytes or even a guid but it'd be a waste.
> human readable text files do not need any magic
> but binaries do (though auto-generated text files
> by a program will need a header, too).
>
> A cm3 and middle end version numbers for a
> compatibilty check if not also a creation timestamp
> after the magic would be very beneficial, too.
>
> It is unprofessional and a bad habit to emit a binary
> stream without a header and versioning information.
> Have you never used a ready compiled cm3cg for
> compiling a new frontend? - There should be a
> middle end version number to check whether this
> is prone to fail (and possibly one trying to force
> application of cm3cg on a newer intermediate code
> stream. ).
Actually, we have had such a version number, from very early.
But it had never changed, until recently, when I changed it to
detect this very problem. Now, if you use mismatched cm3cg,
you will get an informative error message, instead of something
similar to "unrecognized op code" (I paraphrased that.)
>
--
Rodney Bates
rodney.m.bates at acm.org
More information about the M3devel
mailing list