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

Jay jayk123 at hotmail.com
Tue Feb 19 15:34:55 CET 2008


 > I would have though your input was most appropriate since your a     
I thought I was mostly just pissing people off.> > make assignment an expression> > no, that changes the abstract syntax, which is something we're trying > to avoid.
Well.. are there no transforms allowed? Or, no growth of the abstract syntax and Modula-3 doesn't necessarily generate every node type, nor maybe does Modula-C generate every node type, but union them?
For example version 1 of Modula-C probably doesn't have "objects", and maybe always unsafe, no optional safety?
Though, granted, enabling you to state everything in Modula-C that you can state in Modula-3 is probably important.
You don't want people chosing one or the other based on needing certain features, only based on taste.
 
(Someone else said "Codula-3". :))
 
I guess maybe a more important useful angle here is the interop with C headers.
 
VAR parameters..are roughly just pointers, ok.
Or like C++ references.
 
btw, while we are on the subject..I like C's looping constructs, the three expression for loop, do, while, break, continue.
Is "exit" what I use in Modula-3 for break? I've been writing loops that could terminate once they find something but have to look this up, otherwise have been letting the loop run longer than necessary..which I saw existing code do anyway.
 
  - Jay



> CC: wagner at elegosoft.com; m3devel at elegosoft.com> From: darko at darko.org> To: jayk123 at hotmail.com> Subject: Re: [M3devel] C-like syntax for Modula-3 [was Re: "target specific pragmas"?]> Date: Tue, 19 Feb 2008 21:04:09 +1100> > I agree that there should be a pre-processor between M3 syntax and C > syntax, but this should also be integrated into the build system so > that it is transparent. I think the '.mc' extension is already taken > though, which is a bummer.> > I think we should also be aiming to use this tool to automatically > convert C header files (with limitations) to M3.> > The more I think about it the more I wonder if C programers will > swallow it: for example VAR params?> > Further comments are embedded...> > On 18/02/2008, at 3:26 PM, Jay wrote:> > I've been trying to stay out of this...> > I would have though your input was most appropriate since your a > member of the target audience.> > > If a comment at the top of the file can make the Modula-3 syntax > > more like C then..> > Not really what we're aiming for. We're looking for a separate C like > syntax in separate files.> > > replace = with ==> > yes> > > replace := with => > yes> > > make assignment an expression> > no, that changes the abstract syntax, which is something we're trying > to avoid.> > > lowercase the keywords> > yes> > > try to make braces work (with some alteration for C)> > yes> > > use type name instead of name : type> > yes> > > separate function parameters with commas and require each to state > > its type> > yes> > > for that matter, subset C and require all declarations be separate > > like that?> > Do you think C programmers would object?> > > put back ++, --, -=, +=, etc.> > yes> > > superset C and let . be used in place of ->> > yes> > > new coding style is four space indent with opening braces on their > > own line :)> > I don't do that even in C> > > Hm. I think if anyone really wants to do this, instead of nit > > picking about Modula-3 syntax here and there, go about it in a > > slightly different way?> > We're really not looking to change M3 in any way, just provide an > alternate syntax.> > > > Pick apart what defines Modula-3 through much discussion.> > Optional safety -- probably but that for these purposes> > optional garbage collection -- maybe that too> > "object orientation" that is a subset of C++> > try to use C++ syntax?> > generics (generic modules)> > independently and relatively easily parsable interface definitions > > (!)> > these are both important, but I think "independent" is more > > important> > and "relatively easily" could be omitted for the goals of this > > exercise> > compiles to native code> > sizeof(integer) == sizeof(address) (minor detail)> > built in sets and good enumerations> > arrays; I don't like them starting at non-zero, but enums for their > > index are interesting> >> > Take the existing definition of C and alter it to have these > > characteristics very very much like Modula-3 but with very very very > > much Modula-3 syntax> > > > > > 
_________________________________________________________________
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080219/31121ad6/attachment-0002.html>


More information about the M3devel mailing list