<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Why would the compiler know anything about jmpbuf in general? (Yes, I know it is used for exception handling). I would prefer that we had table-based exception handling as on SOLgnu for all targets, but that depends on support for stack unwinding for each target. I would hate for the compiler to inject a type for something like jmpbuf which is an *internal* detail of the exceptions implementation rather than a language-defined type. Also, there are advantages in the current approach, which decouples communication of information amongst the tool-chain components.<div><br></div><div>Why would you use setcontext, getcontext, etc. for exception handling. setjmp/longjmp are perfectly adequate to the task. setcontext/getcontext are intended for user-thread switching, etc.</div><div><br></div><div>I think you'll find there already is a compiler mode that does not invoke cm3cg.<br><div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><font class="Apple-style-span" color="#0000FF"><font class="Apple-style-span" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: Gill Sans; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: Gill Sans; ">Antony Hosking</span></span></font></font><font class="Apple-style-span" face="Gill Sans"><span class="Apple-style-span" style="font-family: Gill Sans; "><span class="Apple-style-span" style="font-family: Gill Sans; "> | </span></span><span class="Apple-style-span" style="font-family: Gill Sans; "><span class="Apple-style-span" style="font-family: Gill Sans; ">Associate Professor</span></span><span class="Apple-style-span" style="font-family: Gill Sans; "><span class="Apple-style-span" style="font-family: Gill Sans; "> | Computer Science | Purdue University</span></span></font></div><div><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; ">305 N. University Street | West Lafayette | IN 47907 | USA</span></font></div><div><font class="Apple-style-span" color="#0000FF" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: Gill Sans; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: Gill Sans; ">Office</span></span></font><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-style-span" style="font-family: GillSans-Light; "> +1 765 494 6001 | </span></span></font><font class="Apple-style-span" color="#0000FF" face="Gill Sans"><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: Gill Sans; "><span class="Apple-style-span" style="color: rgb(0, 0, 255); font-family: Gill Sans; ">Mobile</span></span></font><font class="Apple-style-span" face="GillSans-Light"><span class="Apple-style-span" style="font-family: GillSans-Light; "><span class="Apple-style-span" style="font-family: GillSans-Light; "> +1 765 427 5484</span></span></font></div><div><font class="Apple-style-span" face="GillSans-Light"><br class="khtml-block-placeholder"></font></div></span></span></span></span></span></span></span><br class="Apple-interchange-newline"></span></div></span> </div><br><div><div>On 8 Jan 2009, at 00:36, Jay wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">duplication between compiler, m3makefile, and libraries.<br> <br><br>I propose that there should be reduced or no duplication<br>among the compiler, m3makefile, and libraries.<br> <br><br>I propose that the compiler reveal (some) of what it knows.<br> <br><br>For example, m3makefile shall not specify WORD_SIZE.<br>The compiler should.<br>Granted, this buys very little.<br> <br><br>m3makefile shall not contain tables identifiying endianness.<br>Compiler shall defined TARGET_ENDIAN to "BIG" or "LITTLE",<br>or perhaps "big" or "little".<br>Granted, this buys very little.<br> <br><br>Libraries shall not define jumpbuf, in a sense.<br>Compile shall define, something like:<br> TARGET_JUMPBUF_ELEMENT = "INTEGER" or "LONGINT".<br> aka jmpbuf alignment.<br> TARGET_JUMPBUF_SIZE = a decimal integer.<br>Leaving library to say:<br> TYPE jmpbuf = ARRAY [1..size] OF element<br>which m3makefile shall produce.<br> <br><br>or perhaps even compiler shall inject the type itself,<br>as it injects a few things like INTERFACE Word functions.<br> <br><br>or compiler shall define TARGET_JUMPBUF_ALIGN = 32 or 64,<br>and TARGET_JUMPBUF_SIZE in bytes<br>leaving m3makefile to map 32 to Ctypes.int and 64 to LONGINT itself.<br><br> <br>The jumpbuf size/align bothers me more than word size and endianness.<br>Word size and endianness are more widely known to humans I think.<br>Endianness and word size are usually fairly obvious, though<br>not 100%. I didn't know the endianness of e.g. 88k, vax, and the historically<br>terse names don't make it obvious.<br><br> <br>However, let me not confuse "jumpbuf" with "Thread.State" or such.<br>Assume user threads stops using setjmp/longjmp and modify<br>or generalize proposal accordingly.<br><br>Wonder if exception handling should use set/get/make/swapcontext also??<br>Assume jumpbuf might remain on some platforms?<br><br> ?<br><br>As well, one should be able to specify m3config on the command line.<br>One should be able to specify target on the command line.<br>Compiler shall take specified target and search /somehow/ for the right config file.<br>Perhaps in path to cm3\..\config\target.<br>Don't probe like crazy -- not like I have it coded in Quake currently.<br>That really bites when there is more than one, and you edit the wrong one.<br><br>Probably something like,<br> probe for path to cm3\..\config\target.<br><br>but if defined $CM3_CONFIG_DIRECTORY, search instead $CM3_CONFIG_DIRECTORY\target.<br>however this is perhaps colon or semicolon delimited, so maybe CM3_CONFIG_PATH.<br>(In particular, I have nearly all my config files in m3-sys/cminstall/src/config-no-install,<br>except NT386, which I'd really like to move, but will probably break something and<br>doesn't seem important).<br><br>Reasonable ideas?<br><br> <br>Personally what I do is my Python scripts accept a target name anywhere on the<br>command line, and if present, they set $M3CONFIG.<br>So I have what I want via python already.<br>You know, kind of a successful (imho) prototype, that should perhaps be elevated<br>into the "real" stuff?<br> <br><br>You know, make it easier and easier to contruct cross-capable installations,<br>where switching targets is changing environment variables and/or command lines,<br>and not editing/copying files.<br><br> <br>If there isn't already, there should be a mode that doesn't run cm3cg.<br>And possibly can still ship.<br>That way /any/ system can do a bunch of cross-build "checking".<br>And the file system layout for creating a "boot" archive becomes<br>about the same as the layout of a "real" system.<br> Not like what I use -- I use one flat directory, since Modula-3<br> requires that every..basically ever .i3, .m3, .o file have a unique name.<br> (.i3 and .m3 can clash with each other, once each, that's it).<br><br> - Jay<br><br><br></div></span></blockquote></div><br></div></div></body></html>