[M3devel] Problems building CM3 from trunk.

Jay K jay.krell at cornell.edu
Sun Jun 5 23:38:16 CEST 2011


Again, no.


Modula-3 implementations have always depended on a C runtime. Always.
Removing such a dependency is a tedious error-prone target-dependent task.
And it buys you nothing.
Please stop this crazy thinking.



When there is a system that provides "m3core" from its "kernel", along with .i3 files, then you
can cut the C runtime dependency for that target. Just for that target.


Meanwhile, Linux, FreeBSD, NetBSD, OpenBSD, Solaris, Darwin, Cygwin, Interix, and
hypothetical AIX, Irix, HP-UX, VMS targets will always have a C runtime dependency.


Even on Win32/NT -- today we depend on very little, but on setjmp/longjmp.
A good C backend would use __try/__except/__finally -- still depending on a C runtime.



If you really want to cut the dependency, look perhaps at what was done for Go.
Good luck.


Keep in mind that e.g. Solaris and Apple don't allow for static linking the C runtime.
Which somewhat implies that the kernel interface is private/undocumented/unstable.
The C runtime is the blessed portability layer to target multiple revisions.
I do find that a bit unfortunate.


The Linux kernel does not implement pthreads. The C runtime does.
And many more examples of varying thickness.


Other ideas would be to generate Java or C#.
C# is more viable since it is selectively unsafe.
Java is probably not practical.

 > truly independent platform low level C-- 

No. Platform independence is mostly a matter of who all has done the porting for you already.
Or how much of the work you have done yourself without depending on a lower level.
Targeting a C compiler is far more compatible than anything else.


In the realm of C--, LLVM is probably better.
But again, C is much more portable.
Of course, LLVM might be portable enough.
C is also, again, more familiar. Would you rather maintain and debug code that
interfaces with LLVM or code that generates C?
Granted, both LLVM and the underlying C compiler will have bugs.


 - Jay


Date: Sun, 5 Jun 2011 19:23:38 +0100
From: dabenavidesd at yahoo.es
To: ttmrichter at gmail.com; m3devel at elegosoft.com; jay.krell at cornell.edu
Subject: Re: [M3devel] Problems building CM3 from trunk.

Hi all:
Yes, it would be nice, but you would need to understand that we don't want the RT to depend on specific implementations, but to be portable really and truly, having C underneath makes just another thing makes us to depend on C RT (that is less likely to be the best idea), instead of that, a clean low level but truly independent platform low level C-- is good to start with, you might see another implementation of this idea in portable Cedar (Modula-3 was ported to it), just that their idea was to make this even further to interact with that language, us here just need the portable low level interfaces same way (I don't deny Modula-3 C runtime, but making it safe ideally is C--), something I don't know it's quite platform dependent in inner C currently if I may say so (who can say that BTW). Even SPIN did  transfered their ideal C idiom to SPIN
 Modula-3 (just what it missed, later did the same in a distributed JVM an nowadays I think in C#)
Thanks in advance
 

--- El dom, 5/6/11, Jay K <jay.krell at cornell.edu> escribió:

De: Jay K <jay.krell at cornell.edu>
Asunto: RE: [M3devel] Problems building CM3 from trunk.
Para: dabenavidesd at yahoo.es, ttmrichter at gmail.com, "m3devel" <m3devel at elegosoft.com>
Fecha: domingo, 5 de junio, 2011 12:38




Depending on C is VASTLY preferable to depending on C--.
C is WIDELY understood, studied, implemented, optimized.
C-- is extremely "small" in comparison -- in terms of how many people have heard of it, understand it well, have implemented it.


Generating C should be our portable/slow solution, to replace gcc/m3cc/m3cg.
Extending our existing backend to other targets is probably then a good idea, to speed up the compiler.
It would be really great if our backend could inline though.


 - Jay

Date: Sun, 5 Jun 2011 17:16:58 +0100
From: dabenavidesd at yahoo.es
To: ttmrichter at gmail.com; m3devel at elegosoft.com; jay.krell at cornell.edu
Subject: Re: [M3devel] Problems building CM3 from trunk.

Hi all:

I would myself expect in m3core just not Unix nor Win interfaces (or
WeakRef), neither necessarily the Thread interface, I mean if we are
tied to the language definition, this are part of the standard
libraries and by that I mean as are IO and Floating point standard
interfaces. However Unix interfaces are not necessarily there too (as
are not part of the language it self), perhaps the possible c--backend
code generator interface could be there to let m3core interact with
appropriated data structures (dtoa) and maybe the higher level
interfaces (not UNSAFE) in libm3 at least at INTERFACE level. That is I
would prefer to interact via some sort of C-- (instead of C, well if
not verified, at least one of them, or the minimum bit possible of it). The idea is not to
break the dependency in C, but replace by C-- as much as possible, so it's good to start
there I believe.

Thanks in advance

--- El sáb, 4/6/11, Jay K <jay.krell at cornell.edu> escribió:

De: Jay K <jay.krell at cornell.edu>
Asunto: Re: [M3devel] Problems building CM3 from trunk.
Para: ttmrichter at gmail.com, "m3devel" <m3devel at elegosoft.com>
Fecha: sábado, 4 de junio, 2011 22:28




Your m3core is not up to date.

 - Jay

Date: Sun, 5 Jun 2011 10:19:13 +0800
From: ttmrichter at gmail.com
To: m3devel at elegosoft.com
Subject: [M3devel] Problems building CM3 from trunk.

=== package /home/michael/Development/Modula3/cm3/m3-libs/libm3 ===
 +++ cm3 -build -DROOT='/home/michael/Development/Modula3/cm3' $RARGS  && cm3 -ship $RARGS -DROOT='/home/michael/Development/Modula3/cm3'  +++
--- building in AMD64_LINUX ---
ignoring ../src/m3overrides

new source -> compiling ProcessPosixCommon.m3
"../src/os/POSIX/ProcessPosixCommon.m3", line 75: unknown qualification '.' (Fork)1 error encountered
new source -> compiling LowPerfTool.m3"../src/perftool/POSIX/LowPerfTool.m3", line 37: unknown qualification '.' (Fork)
"../src/perftool/POSIX/LowPerfTool.m3", line 39: case labels out of range"../src/perftool/POSIX/LowPerfTool.m3", line 44: case labels out of range
3 errors encounteredcompilation failed => not building library "libm3.a"
Fatal Error: package build failed *** execution of cm3 -build -DROOT='/home/michael/Development/Modula3/cm3' $RARGS  && cm3 -ship $RARGS -DROOT='/home/michael/Development/Modula3/cm3'  failed ***

The cm3 I'm using for this build is:
$ cm3 -version
Critical Mass Modula-3 version d5.9.0  last updated: 2010-07-21
  compiled: 2011-01-31 11:18:56  configuration: /usr/local/cm3/bin/cm3.cfg
  host: AMD64_LINUX  target: AMD64_LINUX

Does anybody have any suggestions what I'm doing wrong here?
-- 
"Perhaps people don't believe this, but throughout all of the discussions of entering China our focus has really been what's best for the Chinese people. It's not been about our revenue or profit or whatnot."

--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
 		 	   		  
 		 	   		  
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20110605/be0909c3/attachment-0002.html>


More information about the M3devel mailing list