[M3devel] C-like syntax for Modula-3 [was Re: "target specific pragmas"?]

Mika Nystrom mika at async.caltech.edu
Sun Feb 17 22:30:50 CET 2008


hendrik at topoi.pooq.com writes:
>On Sun, Feb 17, 2008 at 01:11:39PM -0500, Tony Hosking wrote:
>> Not to rain on this parade, but I hate the idea of Swiss-Army-knife  
>> programs that do a multitude of tasks.  Better to have a program do  
>> one thing well (and correctly) than many things badly (incorrectly).   
>> So the notion of one compiler handling two syntaxes does not sit well  
>> with me.  Why not just a preprocessor from C-like syntax, which  
>> observes Modula-3 typing and semantics, into regular Modula-3?  But,  
>> I echo Olaf's point -- there are way more important things to be  
>> worrying about than the color of the ceiling tiles, or in this case  
>> syntactic sugar.
>
>Even with a preprocessor from C-style syntax to Modula 3, there would 
>have to be some mechanism inserted into the Modula 3 compiler to 
>recognise the original line numbers for error messages and debuggers and 
>the like.
>
>Doing it this way might also make it possible to unify the Eiffel and 
>Modula 3 communities ... though tere are possible better ways to
>accomplish this.  I've always thought there's a lot of duplication of 
>effort in their run-time systems.
>
>-- hendrik

I agree entirely with Tony's comments.  I think a preprocessor (two
preprocessors M3-2-MC and MC-2-M3) would be the way to do it, and
I really don't mind Algol syntax.  But I can see the argument that
it might really do something for "marketing".

I believe the compiler already permits <* LINE *> pragmas??  I think
I saw it in the caltech-parser?

Also if you want to merge forces with another project, wouldn't a
good way be to do as in Stallman's nightmares, and start by "selling"
the compiler back ends to other languages?

     Mika



More information about the M3devel mailing list