[M3devel] thread local storage, but in C pieces of runtime... (jay, tony?)

Jay K jay.krell at cornell.edu
Fri May 10 20:03:26 CEST 2013


Posix defines a C source interface, not an ABI.The standard does not say enough to write portable .i3 files.Seriously.Look at the mess that was m3-libs/m3core/unix and compare it to today.Function names at the ABI level sometimes didn't match the source name.Structs had to be defined precisely.It was tedious, error-prone, not statically checked, and "very" unsafe.So many times I ported to a new system, only to find struct stat was wrong and my stack was getting corrupted. That problem is gone.  We probably now transparently adapt to 64bit time_t. I'd have to check.  Or the stuff we had for signal handling. Another mess. All clean and portable today. Tony fixed some of that, for the same reasons. When we get cooperative suspend, the portability will increase much further.And the setjmp buffer size thing. I should get to that soonish.  Things are much better for 64bit systems now, as they have been widely ported to and are in widespread use.   - Jay Subject: Re: [M3devel] thread local storage, but in C pieces of runtime... (jay, tony?)
From: dragisha at m3w.org
Date: Fri, 10 May 2013 19:04:12 +0200
CC: mika at async.caltech.edu; m3devel at elegosoft.com
To: jay.krell at cornell.edu

We are talking POSIX here. There are same chances for #define to change behavior of your C as are to change binding through EXTERNAL.
In 90s, when I did port of pm3 to LINUX_ALPHA, most problems I met were in C code, due to it's non-portability to RISC, 64bit, big-endian machine.

--Dragiša Durićdragisha at m3w.org



On May 10, 2013, at 6:56 PM, Jay K wrote:It is in C for portability. Like everything else.
 
 
Otherwise you have to duplicate the C headers in Modula-3, and they end up being system specific because there are too many ways to turn the portable C source interface into non-portable ABI -- #defines, #pragmas, etc.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20130510/8bebb5fc/attachment-0002.html>


More information about the M3devel mailing list