<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi all:<br>if a pre processor is more powerful than the language we are designing is a design mistake or we are not getting the whole picture here, the language code generator is to maintain portability in one way using different code generator for each platform.<br>Other approaches are not recommended for this scenario (but are possible), or if you want why you don't use C Code Generating - Modula-3 compiler (it will make compiler faster?), you can remove the m3cg step and be quicker if you might on that agreeing in that M3CG is minded for light weight fast turn around backend or slow high quality back-end compiler.<br>Why do you think writing high quality compiler is better in C than in Modula-3? Of course C is far better to hack, but if you can write **same** purpose compiler in Modula-3, that's better IMHO.<br>What do you think Jay? See M3CG interface
generator speed versus C compiling speed perhaps using a standard complexity test of grammars will tell the truth. I believe that's the idea in M3CG to make the lowest complexity making biggest speed up, I believe the same for C but not for the speed but for space of memory, that was its design goal.<br>SO if you ask about expressive power of the language both are about the same, but for speed and complexity (in grammar terms is an open question:<br>http://event.cwi.nl/pem/2011/2011-02-24-Zaytsev.pdf<br><br>) due its different scenario is not fair to compare<br>Thanks in advance<br><br><br><br><br>--- El <b>vie, 21/9/12, Jay Krell <i><jkrell@elego.de></i></b> escribió:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>De: Jay Krell <jkrell@elego.de><br>Asunto: [M3commit] CVS Update: cm3<br>Para: m3commit@elegosoft.com<br>Fecha: viernes, 21 de septiembre, 2012 21:20<br><br><div
class="plainMail">CVSROOT: /usr/cvs<br>Changes by: jkrell@birch. 12/09/22 02:20:37<br><br>Modified files:<br> cm3/m3-sys/m3middle/src/: M3CG_MultiPass.i3 M3CG_MultiPass.m3 <br><br>Log message:<br> significant work in progress on data structures<br> useful to backends -- storing up all the m3cg<br> in memory, to be looped over/played back, in order<br> to get it into the order needed<br> <br> This is a LOT of tedious work.<br> It was SO much easier to do in m3cc via the preprocessor.<br> A macro processor can be incredibly useful. Really.<br> <br> Three or so modes are allowed for (which does increase the tedium).<br> One can loop over the array of refs and use
ISTYPE/NARROW/LOOPHOLE.<br> ISTYPE/NARROW would be unnecessarily slow, LOOPHOLE would be fast<br> One can loop pver and switch on a type tag (not all filled in).<br> One can pass in a M3CG and the data will all be passed to<br> its appropriate functions (work in progress).<br> And then pass in a different M3CG, that shares state with the first.<br> Like, "mini" M3CGs that do nothing (inherit from M3CG_DoNothing)<br> but pay attention to only a few functions, like e.g. to accumulate<br> a list of all struct sizes.<br> <br> I will probably use that last option.<br> <br> This will give us the power to fix several things:<br> - support arbitrary struct sizes as parameters<br> - pass and esp. return structs by
value letting the C compiler do the work,<br> as well as being ABI compliant (what we haven't isn't a violation per se,<br> for our code, as you can write your C this way; it is a violation for <*extern*> though.)<br> - only declare/implement static helper functions that we use<br> - support uplevel locals in nested blocks -- to enable building the whole system!<br> - forward declare all imports ahead of all functions, and therefore<br> - just once<br> - honor begin/end_block; stop tacking numbers onto identifiers<br> - maybe honor free_temp<br> - generate valid C++ for the module globals (w/o an extra indirection)<br> - possibly use real structs and infer real field accesses<br> - maybe more (there is more to improve, not sure if this
stuff<br> needed for it; e.g. move globals out of the "segment" would be nice<br> remove obviously unused functions; fix shifts by greater than size<br> (requires symbolic expressions instead of strings)<br> - much better stock debugging! (due to the structs)<br> `<br><br></div></blockquote></td></tr></table>