From darko at darko.org Fri Jan 4 10:16:47 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 01:16:47 -0800 Subject: [M3devel] Bare Metal Modula-3 Message-ID: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko From jay.krell at cornell.edu Fri Jan 4 18:08:09 2013 From: jay.krell at cornell.edu (Jay K) Date: Fri, 4 Jan 2013 17:08:09 +0000 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> References: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> Message-ID: What is the system? It is possible to not need memory allocation or threading or garbage collection. You could use just globals and/or locals. It is possibe to not need garbage collection. Use unsafe and new/dispose for dynamic allocation. The garbage collector for example, doesn't need garbage collection. It is possible to not need threads. It is obvious how. But be aware that "libraries", including the garbage collector, create threads. Anyway, "yes". There are currently three usermode thread implementations. 1) "get/set/make/swapcontext" 2) "sigaltstack" 3) "setjmp/timers" This looks currently unused, and maybe deleted. I guess they all user timers. To start, see: jbook2:src jay$ pwd /dev2/cm3/m3-libs/m3core/src jbook2:src jay$ find . | grep c$ | grep -i thread ./thread/POSIX/ThreadPosixC.c OR ./thread/PTHREAD/ThreadPThreadC.c Really, providing pthreads wouldn't be a bad idea. For memory allocation, we use at least calloc, free, maybe malloc, and mmap/munmap. You could probably replace mmap/munmap with calloc/malloc/free. If you really want to link all of m3core and libm3, you'll need more, open/close/read/write, fork or vfork/exec. The way to know is probably just to try it. Do you have a working C compiler/libraries/headers? Can you just try it? nm against cm3 is probably useful. Some of these might be injected by "startup" code. Some are wrappers for other code to use -- might not be used. Some are implementation details of the C library. nm /cm3/bin/cm3 | grep " U " U ___error U ___gxx_personality_v0 U ___sF U ___stderrp U __exit U __longjmp U __setjmp U _abort U _access U _calloc U _ceil U _chdir U _close U _closedir U _dup2 U _execve U _execvp U _exit U _fcntl U _feclearexcept U _fegetround U _feraiseexcept U _fesetround U _fetestexcept U _fflush U _floor U _fork U _fprintf U _free U _fstat U _fsync U _fwrite U _getcwd U _getdtablesize U _getegid U _getenv U _geteuid U _gethostname U _getpid U _gettimeofday U _gmtime U _kill U _ldexp U _link U _llroundl U _localtime U _lseek U _lstat U _malloc U _memcmp U _memmove U _memset U _mkdir U _mktime U _mmap U _modf U _nanosleep U _open U _opendir U _pipe U _poll U _pthread_atfork U _pthread_attr_destroy U _pthread_attr_getstacksize U _pthread_attr_init U _pthread_attr_setstacksize U _pthread_cond_broadcast U _pthread_cond_destroy U _pthread_cond_init U _pthread_cond_signal U _pthread_cond_timedwait U _pthread_cond_wait U _pthread_create U _pthread_detach U _pthread_equal U _pthread_getspecific U _pthread_key_create U _pthread_kill U _pthread_mach_thread_np U _pthread_mutex_destroy U _pthread_mutex_init U _pthread_mutex_lock U _pthread_mutex_unlock U _pthread_self U _pthread_setspecific U _read U _readdir U _readlink U _rename U _rmdir U _sched_yield U _sigaction U _sigsetjmp U _sleep U _stat U _strcmp U _strtod U _symlink U _thread_abort_safely U _thread_get_state U _thread_resume U _thread_suspend U _time U _tzset U _uname U _unlink U _utimes U _waitpid U _write - Jay > From: darko at darko.org > Date: Fri, 4 Jan 2013 01:16:47 -0800 > To: m3devel at elegosoft.com > Subject: [M3devel] Bare Metal Modula-3 > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > - Darko > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Fri Jan 4 19:46:45 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Fri, 4 Jan 2013 18:46:45 +0000 (GMT) Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> Message-ID: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com> Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament.? and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Fri Jan 4 21:50:04 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Fri, 4 Jan 2013 20:50:04 +0000 (GMT) Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> Message-ID: <1357332604.47416.YahooMailClassic@web133103.mail.ir2.yahoo.com> Hi all: You need realtime core services otherwise your system won't be efficient unless that's not what you want, it is to run Modula-3 applications, isn't it? If not, what's the point of your device? (e.g SPIN GC, etc) If you need a real-time core server in a networked implementation, you need a DRTOS. Thanks in advance PS: I don't see any response to Jay --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: Re: [M3devel] Bare Metal Modula-3 Para: "Daniel Alejandro Benavides D." CC: "m3devel developers" Fecha: viernes, 4 de enero, 2013 15:09 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament.? and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Fri Jan 4 21:09:26 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 12:09:26 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com> References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com> Message-ID: <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: > Hi all: > I think you just need runtime executive on top a machine would be enough. > For instance VAXELN. > Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). > Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. > I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: > http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor > > My hypothesis is that you can't bring up a realtime application in an embedded device like you want. > I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. > Thanks in advance > > > --- El vie, 4/1/13, Darko escribi?: > > De: Darko > Asunto: [M3devel] Bare Metal Modula-3 > Para: "m3devel developers" > Fecha: viernes, 4 de enero, 2013 04:16 > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > - Darko > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Sat Jan 5 01:36:16 2013 From: jay.krell at cornell.edu (Jay K) Date: Sat, 5 Jan 2013 00:36:16 +0000 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com>, <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> Message-ID: Clarification regarding mmap. mmap has two fairly different purposes in Posix. 1) to "map a file" into memory 2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size). #1 is the more obvious probably better known use. The one I knew of. The one it sounds like. #2 is what we use it for. If we ever autoconf-m3core, it'd probably be reasonable to do something like: #if HAS_MMAPreturn mmap(...); #elif HAS_CALLOC void** p = (void**)calloc(size + sizeof(void*));if (!p) return p;p[0] = p;return p + 1; #else#error#endif #if HAS_MMAPmunmap(...); #elif HAS_CALLOC if (p) free(((void**)p)[-1]); #endif alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed.Including assert(0) in places.Invent your own value for "OS_TYPE". Maybe #define OS_TYPE_FOO #include ../POSIX/Foo.c and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. Sharing code can be good or bad. We don't actually use "memory protection".Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible.This is nice. It might be required for "safety".It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead.More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3.You make a much different system, you get to do the port.It is neither impossible nor a no-op. - Jay From: darko at darko.org Date: Fri, 4 Jan 2013 12:09:26 -0800 To: dabenavidesd at yahoo.es CC: m3devel at elegosoft.com Subject: Re: [M3devel] Bare Metal Modula-3 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote:Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Sat Jan 5 03:40:49 2013 From: jay.krell at cornell.edu (Jay K) Date: Sat, 5 Jan 2013 02:40:49 +0000 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com>, <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> , Message-ID: Get hello world running on your system first, written in C. Then get back to us. :)Seriously. Ok, maybe not with stdio.At least this: int main(){ malloc(1); return 0;} - Jay Subject: Re: [M3devel] Bare Metal Modula-3 From: darko at darko.org Date: Fri, 4 Jan 2013 16:45:27 -0800 CC: m3devel at elegosoft.com To: jay.krell at cornell.edu That's useful to know. It makes implementing memory allocation very straight forward. All I'd need to implement would be some calls for setting aside pages of memory and setting their read/write status, which would be directly supported by the hardware. It also occurs to me I'd have to write some sort of loader, which shouldn't be difficult as long as I can link the m3 program into some sort of monolithic "raw" format that I can just copy into a fixed place in memory and start executing. On Jan 4, 2013, at 4:36 PM, Jay K wrote:Clarification regarding mmap. mmap has two fairly different purposes in Posix. 1) to "map a file" into memory 2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size). #1 is the more obvious probably better known use. The one I knew of. The one it sounds like. #2 is what we use it for. If we ever autoconf-m3core, it'd probably be reasonable to do something like: #if HAS_MMAP return mmap(...); #elif HAS_CALLOC void** p = (void**)calloc(size + sizeof(void*)); if (!p) return p; p[0] = p; return p + 1; #else #error #endif #if HAS_MMAP munmap(...); #elif HAS_CALLOC if (p) free(((void**)p)[-1]); #endif alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed. Including assert(0) in places. Invent your own value for "OS_TYPE". Maybe #define OS_TYPE_FOO #include ../POSIX/Foo.c and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. Sharing code can be good or bad. We don't actually use "memory protection". Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible. This is nice. It might be required for "safety". It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead. More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3. You make a much different system, you get to do the port. It is neither impossible nor a no-op. - Jay From: darko at darko.org Date: Fri, 4 Jan 2013 12:09:26 -0800 To: dabenavidesd at yahoo.es CC: m3devel at elegosoft.com Subject: Re: [M3devel] Bare Metal Modula-3 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote:Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Fri Jan 4 21:07:43 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 12:07:43 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: References: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> Message-ID: <796EA17B-0861-4D9E-8D5E-476F41357D25@darko.org> The threading, GC and TCP/IP are required by my software, so they have to be implemented, the question is what is the minimum required to implement them. No other OS services are required, and no OS would be installed. Some external libraries would be required, like a TCP/IP stack, but those are available without OS dependencies. The target system is the Samsung Exynos 4 Quad SoC. It has a 4 ARM Cortex-A9 cores running at 1.6GHz and 2GB integrated DRAM. Added to that would be a gigabit ethernet port. The whole system would have a maximum power draw of something like 5W. The manual can be found here for those interested: http://www.samsung.com/global/business/semiconductor/file/product/Exynos_4_Quad_User_Manaul_Public_REV100-0.pdf The idea is to build a low cost, low power computing node that can deployed in large numbers. It would only run one threaded application and all I/O would be through the network port, so the OS would do little else than create overhead. So far, aside from hardware initialization, I know I'd have to write a timer interrupt for user threads, some code to assign threads to cores, and an implementation of mmap/munmap, but I imagine not a full one since from what I understand only some of the functionality is used to catch access to various parts of memory. I know I'd have to remove the many parts of m3core, libm3 and other libraries that reference OS services. On Jan 4, 2013, at 9:08 AM, Jay K wrote: > What is the system? > > > > It is possible to not need memory allocation or threading or garbage collection. > You could use just globals and/or locals. > > > > It is possibe to not need garbage collection. > Use unsafe and new/dispose for dynamic allocation. > The garbage collector for example, doesn't need garbage collection. > > > > It is possible to not need threads. > It is obvious how. > But be aware that "libraries", including the garbage collector, create threads. > > > > Anyway, "yes". > There are currently three usermode thread implementations. > 1) "get/set/make/swapcontext" > 2) "sigaltstack" > 3) "setjmp/timers" > This looks currently unused, and maybe deleted. > > > > I guess they all user timers. > > > > To start, see: > > > jbook2:src jay$ pwd > /dev2/cm3/m3-libs/m3core/src > > > jbook2:src jay$ find . | grep c$ | grep -i thread > ./thread/POSIX/ThreadPosixC.c > OR > ./thread/PTHREAD/ThreadPThreadC.c > > > > Really, providing pthreads wouldn't be a bad idea. > > > > For memory allocation, we use at least calloc, free, maybe malloc, > and mmap/munmap. You could probably replace mmap/munmap with calloc/malloc/free. > > > > If you really want to link all of m3core and libm3, you'll > need more, open/close/read/write, fork or vfork/exec. > > > > The way to know is probably just to try it. > Do you have a working C compiler/libraries/headers? > Can you just try it? > > > nm against cm3 is probably useful. > Some of these might be injected by "startup" code. > Some are wrappers for other code to use -- might not be used. > Some are implementation details of the C library. > > > nm /cm3/bin/cm3 | grep " U " > > > U ___error > U ___gxx_personality_v0 > U ___sF > U ___stderrp > U __exit > U __longjmp > U __setjmp > U _abort > U _access > U _calloc > U _ceil > U _chdir > U _close > U _closedir > U _dup2 > U _execve > U _execvp > U _exit > U _fcntl > U _feclearexcept > U _fegetround > U _feraiseexcept > U _fesetround > U _fetestexcept > U _fflush > U _floor > U _fork > U _fprintf > U _free > U _fstat > U _fsync > U _fwrite > U _getcwd > U _getdtablesize > U _getegid > U _getenv > U _geteuid > U _gethostname > U _getpid > U _gettimeofday > U _gmtime > U _kill > U _ldexp > U _link > U _llroundl > U _localtime > U _lseek > U _lstat > U _malloc > U _memcmp > U _memmove > U _memset > U _mkdir > U _mktime > U _mmap > U _modf > U _nanosleep > U _open > U _opendir > U _pipe > U _poll > U _pthread_atfork > U _pthread_attr_destroy > U _pthread_attr_getstacksize > U _pthread_attr_init > U _pthread_attr_setstacksize > U _pthread_cond_broadcast > U _pthread_cond_destroy > U _pthread_cond_init > U _pthread_cond_signal > U _pthread_cond_timedwait > U _pthread_cond_wait > U _pthread_create > U _pthread_detach > U _pthread_equal > U _pthread_getspecific > U _pthread_key_create > U _pthread_kill > U _pthread_mach_thread_np > U _pthread_mutex_destroy > U _pthread_mutex_init > U _pthread_mutex_lock > U _pthread_mutex_unlock > U _pthread_self > U _pthread_setspecific > U _read > U _readdir > U _readlink > U _rename > U _rmdir > U _sched_yield > U _sigaction > U _sigsetjmp > U _sleep > U _stat > U _strcmp > U _strtod > U _symlink > U _thread_abort_safely > U _thread_get_state > U _thread_resume > U _thread_suspend > U _time > U _tzset > U _uname > U _unlink > U _utimes > U _waitpid > U _write > > > > - Jay > > > > > > From: darko at darko.org > > Date: Fri, 4 Jan 2013 01:16:47 -0800 > > To: m3devel at elegosoft.com > > Subject: [M3devel] Bare Metal Modula-3 > > > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > > > - Darko > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Sat Jan 5 02:26:03 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 17:26:03 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <1357332604.47416.YahooMailClassic@web133103.mail.ir2.yahoo.com> References: <1357332604.47416.YahooMailClassic@web133103.mail.ir2.yahoo.com> Message-ID: <02ED8FD1-2AF7-4F8D-919D-7B0B76F4FFDC@darko.org> My understanding of a RTOS is that is provides low-latency interrupt response and accurate timing. These are not my requirements. I'm using the ARM SoC because it provides a lot of processing power at low cost and low power, two important considerations when deploying large numbers of servers. On Jan 4, 2013, at 12:50 PM, Daniel Alejandro Benavides D. wrote: > Hi all: > You need realtime core services otherwise your system won't be efficient unless that's not what you want, it is to run Modula-3 applications, isn't it? If not, what's the point of your device? (e.g SPIN GC, etc) > If you need a real-time core server in a networked implementation, you need a DRTOS. > Thanks in advance > > PS: I don't see any response to Jay > > > --- El vie, 4/1/13, Darko escribi?: > > De: Darko > Asunto: Re: [M3devel] Bare Metal Modula-3 > Para: "Daniel Alejandro Benavides D." > CC: "m3devel developers" > Fecha: viernes, 4 de enero, 2013 15:09 > > It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. > > > On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: > >> Hi all: >> I think you just need runtime executive on top a machine would be enough. >> For instance VAXELN. >> Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). >> Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. >> I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: >> http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor >> >> My hypothesis is that you can't bring up a realtime application in an embedded device like you want. >> I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. >> Thanks in advance >> >> >> --- El vie, 4/1/13, Darko escribi?: >> >> De: Darko >> Asunto: [M3devel] Bare Metal Modula-3 >> Para: "m3devel developers" >> Fecha: viernes, 4 de enero, 2013 04:16 >> >> I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. >> >> The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. >> >> The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? >> >> - Darko >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Sat Jan 5 04:05:36 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Sat, 5 Jan 2013 03:05:36 +0000 (GMT) Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <02ED8FD1-2AF7-4F8D-919D-7B0B76F4FFDC@darko.org> Message-ID: <1357355136.54828.YahooMailClassic@web133104.mail.ir2.yahoo.com> Hi all: the core OS services performance in any OS is critical good chips doesn't make things easier, lots of processing power (not modeled for Modula-3 language semantics) not good. see s. 29, 30: core, rt, lib, sal: http://web.yl.is.s.u-tokyo.ac.jp/meeting/doc/hamanaka010620.ppt If your core is slow then it will damage the performance of your applications. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: Re: [M3devel] Bare Metal Modula-3 Para: "Daniel Alejandro Benavides D." CC: "m3devel developers" Fecha: viernes, 4 de enero, 2013 20:26 My understanding of a RTOS is that is provides low-latency interrupt response and accurate timing. These are not my requirements. I'm using the ARM SoC because it provides a lot of processing power at low cost and low power, two important considerations when deploying large numbers of servers. On Jan 4, 2013, at 12:50 PM, Daniel Alejandro Benavides D. wrote: Hi all: You need realtime core services otherwise your system won't be efficient unless that's not what you want, it is to run Modula-3 applications, isn't it? If not, what's the point of your device? (e.g SPIN GC, etc) If you need a real-time core server in a networked implementation, you need a DRTOS. Thanks in advance PS: I don't see any response to Jay --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: Re: [M3devel] Bare Metal Modula-3 Para: "Daniel Alejandro Benavides D." CC: "m3devel developers" Fecha: viernes, 4 de enero, 2013 15:09 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament.? and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Sat Jan 5 01:45:27 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 16:45:27 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com>, <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> Message-ID: That's useful to know. It makes implementing memory allocation very straight forward. All I'd need to implement would be some calls for setting aside pages of memory and setting their read/write status, which would be directly supported by the hardware. It also occurs to me I'd have to write some sort of loader, which shouldn't be difficult as long as I can link the m3 program into some sort of monolithic "raw" format that I can just copy into a fixed place in memory and start executing. On Jan 4, 2013, at 4:36 PM, Jay K wrote: > Clarification regarding mmap. > > > mmap has two fairly different purposes in Posix. > > > 1) to "map a file" into memory > 2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size). > > #1 is the more obvious probably better known use. The one I knew of. The one it sounds like. > #2 is what we use it for. > > > If we ever autoconf-m3core, it'd probably be reasonable to do something like: > > > #if HAS_MMAP > return mmap(...); > > #elif HAS_CALLOC > > void** p = (void**)calloc(size + sizeof(void*)); > if (!p) return p; > p[0] = p; > return p + 1; > > #else > #error > #endif > > > #if HAS_MMAP > munmap(...); > > #elif HAS_CALLOC > > if (p) > free(((void**)p)[-1]); > > #endif > > > alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed. > Including assert(0) in places. > Invent your own value for "OS_TYPE". > > > Maybe > #define OS_TYPE_FOO > #include ../POSIX/Foo.c > > and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. > > > Sharing code can be good or bad. > > > We don't actually use "memory protection". > Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible. > This is nice. It might be required for "safety". > It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead. > More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. > > > > Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3. > You make a much different system, you get to do the port. > It is neither impossible nor a no-op. > > > - Jay > > > > > > From: darko at darko.org > Date: Fri, 4 Jan 2013 12:09:26 -0800 > To: dabenavidesd at yahoo.es > CC: m3devel at elegosoft.com > Subject: Re: [M3devel] Bare Metal Modula-3 > > It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. > > > On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: > > Hi all: > I think you just need runtime executive on top a machine would be enough. > For instance VAXELN. > Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). > Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. > I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: > http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor > > My hypothesis is that you can't bring up a realtime application in an embedded device like you want. > I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. > Thanks in advance > > > --- El vie, 4/1/13, Darko escribi?: > > De: Darko > Asunto: [M3devel] Bare Metal Modula-3 > Para: "m3devel developers" > Fecha: viernes, 4 de enero, 2013 04:16 > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > - Darko > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Sat Jan 5 09:24:00 2013 From: darko at darko.org (Darko) Date: Sat, 5 Jan 2013 00:24:00 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com>, <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> , Message-ID: <543B31C6-F239-46E4-96A5-446EC1565589@darko.org> That shouldn't be hard, there's a detailed guide here using GCC: http://www.state-machine.com/arm/Building_bare-metal_ARM_with_GNU.pdf Building an ARM cross compiler will be a bit more involved and although there don't seem to be any fundamental dependencies in the runtime I get the feeling separating the M3 minimalist portion from the OS dependent portion is going to be messy. On Jan 4, 2013, at 6:40 PM, Jay K wrote: > Get hello world running on your system first, written in C. Then get back to us. :) > Seriously. > > Ok, maybe not with stdio. > At least this: > > int main() > { > malloc(1); > return 0; > } > > > - Jay > > Subject: Re: [M3devel] Bare Metal Modula-3 > From: darko at darko.org > Date: Fri, 4 Jan 2013 16:45:27 -0800 > CC: m3devel at elegosoft.com > To: jay.krell at cornell.edu > > That's useful to know. It makes implementing memory allocation very straight forward. All I'd need to implement would be some calls for setting aside pages of memory and setting their read/write status, which would be directly supported by the hardware. > > It also occurs to me I'd have to write some sort of loader, which shouldn't be difficult as long as I can link the m3 program into some sort of monolithic "raw" format that I can just copy into a fixed place in memory and start executing. > > > > On Jan 4, 2013, at 4:36 PM, Jay K wrote: > > Clarification regarding mmap. > > > mmap has two fairly different purposes in Posix. > > > 1) to "map a file" into memory > 2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size). > > #1 is the more obvious probably better known use. The one I knew of. The one it sounds like. > #2 is what we use it for. > > > If we ever autoconf-m3core, it'd probably be reasonable to do something like: > > > #if HAS_MMAP > return mmap(...); > > #elif HAS_CALLOC > > void** p = (void**)calloc(size + sizeof(void*)); > if (!p) return p; > p[0] = p; > return p + 1; > > #else > #error > #endif > > > #if HAS_MMAP > munmap(...); > > #elif HAS_CALLOC > > if (p) > free(((void**)p)[-1]); > > #endif > > > alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed. > Including assert(0) in places. > Invent your own value for "OS_TYPE". > > > Maybe > #define OS_TYPE_FOO > #include ../POSIX/Foo.c > > and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. > > > Sharing code can be good or bad. > > > We don't actually use "memory protection". > Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible. > This is nice. It might be required for "safety". > It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead. > More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. > > > > Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3. > You make a much different system, you get to do the port. > It is neither impossible nor a no-op. > > > - Jay > > > > > > From: darko at darko.org > Date: Fri, 4 Jan 2013 12:09:26 -0800 > To: dabenavidesd at yahoo.es > CC: m3devel at elegosoft.com > Subject: Re: [M3devel] Bare Metal Modula-3 > > It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. > > > On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: > > Hi all: > I think you just need runtime executive on top a machine would be enough. > For instance VAXELN. > Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). > Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. > I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: > http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor > > My hypothesis is that you can't bring up a realtime application in an embedded device like you want. > I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. > Thanks in advance > > > --- El vie, 4/1/13, Darko escribi?: > > De: Darko > Asunto: [M3devel] Bare Metal Modula-3 > Para: "m3devel developers" > Fecha: viernes, 4 de enero, 2013 04:16 > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > - Darko > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Sat Jan 5 19:15:20 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Sat, 5 Jan 2013 18:15:20 +0000 (GMT) Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <543B31C6-F239-46E4-96A5-446EC1565589@darko.org> Message-ID: <1357409720.1464.YahooMailClassic@web133102.mail.ir2.yahoo.com> Hi all: the core services as here explained must be maintained CPU and memory management regardless of any other tasks, I don't think even Gnu/Linux is capable of doing this today: http://www.poppyfields.net/acorn/news/acopress/97-02-10b.shtml Core services independent of platform are the top part to maintain available during updates over network, interesting service. ?I would use their RT rather than CM3, which is nice but not for embedded OS kernel, certainly. Never released guess why? Thanks in advance --- El s?b, 5/1/13, Darko escribi?: De: Darko Asunto: Re: [M3devel] Bare Metal Modula-3 Para: "Jay K" CC: "m3devel" Fecha: s?bado, 5 de enero, 2013 03:24 That shouldn't be hard, there's a detailed guide here using GCC: http://www.state-machine.com/arm/Building_bare-metal_ARM_with_GNU.pdf Building an ARM cross compiler will be a bit more involved and although there don't seem to be any fundamental dependencies in the runtime I get the feeling separating the M3 minimalist portion from the OS dependent portion is going to be messy.? On Jan 4, 2013, at 6:40 PM, Jay K wrote: Get hello world running on your system first, written in C. Then?get back to us. :) Seriously. ? Ok, maybe not with stdio. At least this: ? int main() { ?malloc(1); ?return 0; } ? ? ?- Jay ? Subject: Re: [M3devel] Bare Metal Modula-3 From:?darko at darko.org Date: Fri, 4 Jan 2013 16:45:27 -0800 CC:?m3devel at elegosoft.com To:?jay.krell at cornell.edu That's useful to know. It makes implementing memory allocation very straight forward. All I'd need to implement would be some calls for setting aside pages of memory and setting their read/write status, which would be directly supported by the hardware. It also occurs to me I'd have to write some sort of loader, which shouldn't be difficult as long as I can link the m3 program into some sort of monolithic "raw" format that I can just copy into a fixed place in memory and start executing. On Jan 4, 2013, at 4:36 PM, Jay K wrote: Clarification?regarding mmap. ? ? mmap has two fairly?different purposes in Posix. ? ? ?1) to "map a file" into memory? ?2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size).?? ? ??#1 is the more obvious probably better known use.?The one I knew of. The one it sounds like.? ??#2 is what we use it for.?? ? ? If we ever autoconf-m3core, it'd probably be reasonable to do something like: ? ? #if HAS_MMAP return mmap(...); ? #elif HAS_CALLOC ? void** p = (void**)calloc(size + sizeof(void*)); if (!p) return p; p[0] = p; return p + 1; ? #else #error #endif ? ? #if HAS_MMAP munmap(...); ? #elif HAS_CALLOC ? if (p) ? free(((void**)p)[-1]); ? #endif ? ? alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed. Including assert(0) in places. Invent your own value for "OS_TYPE". ? ? Maybe ?#define OS_TYPE_FOO? ?#include ../POSIX/Foo.c? ? and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. ? ? Sharing code can be good or bad. ? ? We don't actually use "memory protection". Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible. This is nice. It might be required for "safety". It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead. More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. ? ? ? Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3. You make a much different system, you get to do the port. It is neither impossible nor a no-op. ? ? ?- Jay ? From:?darko at darko.org Date: Fri, 4 Jan 2013 12:09:26 -0800 To:?dabenavidesd at yahoo.es CC:?m3devel at elegosoft.com Subject: Re: [M3devel] Bare Metal Modula-3 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN.? Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament.? and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El?vie, 4/1/13, Darko??escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware.? The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Wed Jan 9 07:46:00 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 9 Jan 2013 06:46:00 +0000 Subject: [M3devel] thouhts on -Wall with C backend output In-Reply-To: <20121217074935.5DD971A2094@async.async.caltech.edu> References: , , <20121216184306.GA29473@topoi.pooq.com>, , <20121216185529.AD9681A2094@async.async.caltech.edu>, , <20121217074935.5DD971A2094@async.async.caltech.edu> Message-ID: I'm going with "gcc -Wno-return-type " for now. Alas. I put in "default:assert(!"case_jump hit default") for case_jumps, but of coursethat doesn't help. If/when I make the C backend even more sophisticated, I'll detectlabel:;} // end of non-void function and change it to:label:assert(!"control reaches end of non-void function");} // end of non-void function This level of sophistication is basically to run the last pass multiple times, suppressing some/most logic/code, esp. the prints on all but the last pass. The other passes, so far, have been useful in that they run over a subset of operations, and leavefewer for the last pass to deal with. Hm. I do have "op_index", so at end of function, I might be able to just look back one operation for the set_label. But that wouldn't detect:label: a = b;} // end of function maybe that never occurs. I also can't likely just put the assert at the end of every non-void function. 1) it bloats the code a bit 2) it would be usually unreachable. I'm not even sure gcc wouldn't complain here about reachability...except..I already omit unused labels, so I know this label is branched to... anyway..later... - Jay > To: jay.krell at cornell.edu > Date: Sun, 16 Dec 2012 23:49:35 -0800 > From: mika at async.caltech.edu > CC: m3devel at elegosoft.com > Subject: Re: [M3devel] thouhts on -Wall with C backend output > > Yeah it sounds like the frontend knows something that it's not telling > the backend about... if I am reading your emails right. > > Jay K writes: > >--_ad389312-f922-410e-bb8f-e7106388428f_ > >Content-Type: text/plain; charset="Windows-1252" > >Content-Transfer-Encoding: quoted-printable > > > > > >drat=2C these are worse: > > > >"../src/Macro.m3"=2C line 949: warning: unreachable ELSE in TYPECASE > > > > > >=3D=3D package /Users/jay/dev2/cm3/m3-ui/formsvbt =3D=3D > > > > +++ /cm3/bin/cm3 -build -DROOT=3D/Users/jay/dev2/cm3 +++ > >--- building in AMD64_DARWIN --- > > > >ignoring ../src/m3overrides > > > >new source -> compiling Macro.m3 > >cc1plus: warnings being treated as errors > >Macro.mc.c: In function =91char* Macro__EvalLength(char*=2C char*)=92: > >Macro.mc.c:5271: warning: control reaches end of non-void function > >Macro.mc.c: In function =91char* Macro__EvalPlus(char*=2C char*)=92: > >Macro.mc.c:9004: warning: control reaches end of non-void function > >Macro.mc.c: In function =91char* Macro__EvalMinus(char*=2C char*)=92: > >Macro.mc.c:9468: warning: control reaches end of non-void function > > > > > >If I put in the somewhat obvious: > > > > > > ELSE <* ASSERT FALSE *> > > > > > >then: > > > >new source -> compiling Macro.m3 > >"../src/Macro.m3"=2C line 949: warning: unreachable ELSE in TYPECASE > >1 warning encountered > >cc1plus: warnings being treated as errors > >Macro.mc.c: In function =91char* Macro__EvalLength(char*=2C char*)=92: > >Macro.mc.c:5271: warning: control reaches end of non-void function > >Macro.mc.c: In function =91char* Macro__EvalPlus(char*=2C char*)=92: > >Macro.mc.c:9004: warning: control reaches end of non-void function > > > > > > > >For stablegen=2C I am inclined to put in that ELSE <* ASSERT FALSE *>. > > > > > >I might might might be able to put in C assert(false) in these places. > > > > - Jay > > > > > >> To: hendrik at topoi.pooq.com > >> Date: Sun=2C 16 Dec 2012 10:55:29 -0800 > >> From: mika at async.caltech.edu > >> CC: m3devel at elegosoft.com > >> Subject: Re: [M3devel] thouhts on -Wall with C backend output > >>=20 > >> Can you have an option to add an assertion in the output for these cases? > >>=20 > >> Here either > >>=20 > >> 1. gcc has found a bug in the C code generator and/or front end=2C in tha= > >t > >> there's no default (abortion) case > >>=20 > >> or > >>=20 > >> 2. the front end has deduced there is no need for abortion because it can > >> see that the missing ELSE is never going to be exercised=2C based on t= > >he > >> already existing type information > >>=20 > >> What I'm proposing is two modes for the compiler: > >>=20 > >> -- ignore the errors > >>=20 > >> or > >>=20 > >> -- add proper assertions to the C code=2C e.g.=2C=20 > >>=20 > >> assert(false=2C "front-end deduced this cant happen by inspecting typ= > >e information") > >>=20 > >> which=2C when enabled=2C should make gcc shut up=2C and instead turn i= > >nto > >> runtime checks on the compiler > >>=20 > >> Mika > >>=20 > >> Hendrik Boom writes: > >> >On Sun=2C Dec 16=2C 2012 at 09:58:10AM +0000=2C Jay K wrote: > >> >>=20 > >> >> I've tried to generate "very good C". > >> >> I've fixed some of what gcc -Wall complains about. > >> >> For default gcc on my old MacBook -- old enough that it can still emul= > >ate PowerPC=2C gcc is 4.0.1. > >> >> (at least one of what I deal with=2C I think anything newer won't comp= > >lain..) > >> >>=20 > >> >>=20 > >> >>=20 > >> >> do-cm3-all with -Wall -Werror gets very far=2C to: > >> >>=20 > >> >> =3D=3D package /Users/jay/dev2/cm3/m3-db/stablegen =3D=3D > >> >>=20 > >> >> +++ /cm3/bin/cm3 -build -DROOT=3D/Users/jay/dev2/cm3 +++ > >> >> --- building in AMD64_DARWIN --- > >> >>=20 > >> >> ignoring ../src/m3overrides > >> >>=20 > >> >> w source -> compiling GenCode.m3 > >> >> cc1: warnings being treated as errors > >> >> GenCode.mc.c: In function =91GenCode__BuildMethods__Search=92: > >> >> GenCode.mc.c:3505: warning: control reaches end of non-void function > >> >> m3_backend =3D> 1 > >> >>=20 > >> >> PROCEDURE Search ( type : Type.Reference=3B > >> >> VAR count : INTEGER=3B > >> >> VAR top : CARDINAL=3B > >> >> umethods: AtomList.T ): > >> >> ImportList.MethodList RAISES {StablegenError.E} =3D > >> >> VAR methods: ImportList.MethodList=3B > >> >> BEGIN > >> >> IF (type =3D Type.root) OR (type =3D NIL) THEN (* base of > >> >> recursion *) > >> >> RETURN NEW(ImportList.MethodList=2C ABS(count)) > >> >> ELSE > >> >> TYPECASE type OF > >> >> Type.Object (ob) =3D>=20 > >> >> IF count <=3D 0 THEN > >> >> count:=3D count - NUMBER(ob.methods^) > >> >> END=3B > >> >> methods :=3D Search(ob.super=2C count=2C top=2C umethods)=3B > >> >> FOR i :=3D 0 TO LAST(ob.methods^) DO > >> >> IF umethods =3D NIL > >> >> OR AtomList.Member( > >> >> umethods=2C ob.methods[i].name) THEN > >> >> IF AtomList.Member(reserved=2C ob.methods[i].name) THEN > >> >> RAISE StablegenError.E(Atom.ToText(ob.methods[i].name) > >> >> &" is a reserved method name in stable objects. " > >> >> &"Must not be an update method.") > >> >> END=3B > >> >> methods[top].name :=3D ob.methods[i].name=3B > >> >> methods[top].sig :=3D ob.methods[i].sig=3B > >> >> INC(top) > >> >> END > >> >> END=3B > >> >> RETURN methods > >> >> | Type.Opaque (op) =3D> > >> >> RETURN Search(op.revealedSuperType=2C count=2C top=2C umetho= > >ds) > >> >> | Type.Reference =3D> <*ASSERT FALSE*> > >> >> END > >> >> END > >> >> END Search=3B > >> >>=20 > >> >> I think we can't expect gcc -Wall -Werror to pass. > >> >> I really wanted it to=2C and I tried=2C and I fixed stuff. > >> >> But I don't think it is viable. > >> >> Ok? > >> > > >> >Could it be that the TYPECASE doesn't have an ELSE clause=2C possibly > >> >translated to a switch withouy a default: label? This would give the > >> >C code an apparent path to the end of the function. M3 may know that > >> >the TYPECASE exhausts all the possibilities=2C but C will not. > >> > > >> >-- hendrik > > = > > > >--_ad389312-f922-410e-bb8f-e7106388428f_ > >Content-Type: text/html; charset="Windows-1252" > >Content-Transfer-Encoding: quoted-printable > > > > > > > > > >
> >drat=2C these are worse:

"../src/Macro.m3"=2C line 949: warning: unr= > >eachable ELSE in TYPECASE


=3D=3D package /Users/jay/dev2/cm3/m3-= > >ui/formsvbt =3D=3D

 =3B+++ /cm3/bin/cm3 =3B =3B =3B = > >-build -DROOT=3D/Users/jay/dev2/cm3 +++
--- building in AMD64_DARWIN ---= > >

ignoring ../src/m3overrides

new source ->=3B compiling Mac= > >ro.m3
cc1plus: warnings being treated as errors
Macro.mc.c: In functi= > >on =91char* Macro__EvalLength(char*=2C char*)=92:
Macro.mc.c:5271: warni= > >ng: control reaches end of non-void function
Macro.mc.c: In function =91= > >char* Macro__EvalPlus(char*=2C char*)=92:
Macro.mc.c:9004: warning: cont= > >rol reaches end of non-void function
Macro.mc.c: In function =91char* Ma= > >cro__EvalMinus(char*=2C char*)=92:
Macro.mc.c:9468: warning: control rea= > >ches end of non-void function


If I put in the somewhat obvious:<= > >br>

 =3B =3B =3B ELSE <=3B* ASSERT FALSE *>=3B
>r>
then:

new source ->=3B compiling Macro.m3
"../src/Macro.m= > >3"=2C line 949: warning: unreachable ELSE in TYPECASE
1 warning encounte= > >red
cc1plus: warnings being treated as errors
Macro.mc.c: In function= > > =91char* Macro__EvalLength(char*=2C char*)=92:
Macro.mc.c:5271: warning= > >: control reaches end of non-void function
Macro.mc.c: In function =91ch= > >ar* Macro__EvalPlus(char*=2C char*)=92:
Macro.mc.c:9004: warning: contro= > >l reaches end of non-void function



For stablegen=2C I am inc= > >lined to put in that ELSE <=3B* ASSERT FALSE *>=3B.


I might = > >might might be able to put in C assert(false) in these places.

 = > >=3B- Jay


>=3B To: h= > >endrik at topoi.pooq.com
>=3B Date: Sun=2C 16 Dec 2012 10:55:29 -0800
= > >>=3B From: mika at async.caltech.edu
>=3B CC: m3devel at elegosoft.com
= > >>=3B Subject: Re: [M3devel] thouhts on -Wall with C backend output
>= > >=3B
>=3B Can you have an option to add an assertion in the output for= > > these cases?
>=3B
>=3B Here either
>=3B
>=3B 1. gcc = > >has found a bug in the C code generator and/or front end=2C in that
>= > >=3B there's no default (abortion) case
>=3B
>=3B or
>=3B= > >
>=3B 2. the front end has deduced there is no need for abortion beca= > >use it can
>=3B see that the missing ELSE is never going to be exer= > >cised=2C based on the
>=3B already existing type information
>= > >=3B
>=3B What I'm proposing is two modes for the compiler:
>=3B = > >
>=3B -- ignore the errors
>=3B
>=3B or
>=3B
>= > >=3B -- add proper assertions to the C code=2C e.g.=2C
>=3B
>=3B= > > assert(false=2C "front-end deduced this cant happen by inspecting type= > > information")
>=3B
>=3B which=2C when enabled=2C should make= > > gcc shut up=2C and instead turn into
>=3B runtime checks on the co= > >mpiler
>=3B
>=3B Mika
>=3B
>=3B Hendrik Boom wr= > >ites:
>=3B >=3BOn Sun=2C Dec 16=2C 2012 at 09:58:10AM +0000=2C Jay K= > > wrote:
>=3B >=3B>=3B
>=3B >=3B>=3B I've tried to genera= > >te "very good C".
>=3B >=3B>=3B I've fixed some of what gcc -Wall = > >complains about.
>=3B >=3B>=3B For default gcc on my old MacBook -= > >- old enough that it can still emulate PowerPC=2C gcc is 4.0.1.
>=3B &= > >gt=3B>=3B (at least one of what I deal with=2C I think anything newer won= > >'t complain..)
>=3B >=3B>=3B
>=3B >=3B>=3B
>=3B &g= > >t=3B>=3B
>=3B >=3B>=3B do-cm3-all with -Wall -Werror gets very = > >far=2C to:
>=3B >=3B>=3B
>=3B >=3B>=3B =3D=3D package /U= > >sers/jay/dev2/cm3/m3-db/stablegen =3D=3D
>=3B >=3B>=3B
>=3B = > >>=3B>=3B +++ /cm3/bin/cm3 -build -DROOT=3D/Users/jay/dev2/cm3 +++ >r>>=3B >=3B>=3B --- building in AMD64_DARWIN ---
>=3B >=3B>= > >=3B
>=3B >=3B>=3B ignoring ../src/m3overrides
>=3B >=3B>= > >=3B
>=3B >=3B>=3B w source ->=3B compiling GenCode.m3
>=3B= > > >=3B>=3B cc1: warnings being treated as errors
>=3B >=3B>=3B = > >GenCode.mc.c: In function =91GenCode__BuildMethods__Search=92:
>=3B &g= > >t=3B>=3B GenCode.mc.c:3505: warning: control reaches end of non-void func= > >tion
>=3B >=3B>=3B m3_backend =3D>=3B 1
>=3B >=3B>=3B= > >
>=3B >=3B>=3B PROCEDURE Search ( type : Type.Reference= > >=3B
>=3B >=3B>=3B VAR count : INTEGER=3B
= > >>=3B >=3B>=3B VAR top : CARDINAL=3B
>=3B= > > >=3B>=3B umethods: AtomList.T ):
>=3B &= > >gt=3B>=3B ImportList.MethodList RAISES {StablegenError.E} =3D
>= > >=3B >=3B>=3B VAR methods: ImportList.MethodList=3B
>=3B >=3B= > >>=3B BEGIN
>=3B >=3B>=3B IF (type =3D Type.root) OR (t= > >ype =3D NIL) THEN (* base of
>=3B >=3B>=3B = > > recursion *)
>=3B >=3B>=3B RE= > >TURN NEW(ImportList.MethodList=2C ABS(count))
>=3B >=3B>=3B = > >ELSE
>=3B >=3B>=3B TYPECASE type OF
>=3B >=3B>=3B = > > Type.Object (ob) =3D>=3B
>=3B >=3B>=3B IF coun= > >t <=3B=3D 0 THEN
>=3B >=3B>=3B count:=3D count - NUM= > >BER(ob.methods^)
>=3B >=3B>=3B END=3B
>=3B >=3B&g= > >t=3B methods :=3D Search(ob.super=2C count=2C top=2C umethods)=3B= > >
>=3B >=3B>=3B FOR i :=3D 0 TO LAST(ob.methods^) DO
&= > >gt=3B >=3B>=3B IF umethods =3D NIL
>=3B >=3B>=3B = > > OR AtomList.Member(
>=3B >=3B>=3B = > > umethods=2C ob.methods[i].name) THEN
>=3B >=3B>=3B = > > IF AtomList.Member(reserved=2C ob.methods[i].name) THEN
>=3B >=3B&g= > >t=3B RAISE StablegenError.E(Atom.ToText(ob.methods[i].name)= > >
>=3B >=3B>=3B &=3B" is a reserved method name = > >in stable objects. "
>=3B >=3B>=3B &=3B"Must no= > >t be an update method.")
>=3B >=3B>=3B END=3B
>= > >=3B >=3B>=3B methods[top].name :=3D ob.methods[i].name=3B= > >
>=3B >=3B>=3B methods[top].sig :=3D ob.methods[i].s= > >ig=3B
>=3B >=3B>=3B INC(top)
>=3B >=3B>=3B = > > END
>=3B >=3B>=3B END=3B
>=3B >=3B>= > >=3B RETURN methods
>=3B >=3B>=3B | Type.Opaque (= > >op) =3D>=3B
>=3B >=3B>=3B RETURN Search(op.revealedSup= > >erType=2C count=2C top=2C umethods)
>=3B >=3B>=3B | Type.R= > >eference =3D>=3B <=3B*ASSERT FALSE*>=3B
>=3B >=3B>=3B = > > END
>=3B >=3B>=3B END
>=3B >=3B>=3B END Searc= > >h=3B
>=3B >=3B>=3B
>=3B >=3B>=3B I think we can't expect= > > gcc -Wall -Werror to pass.
>=3B >=3B>=3B I really wanted it to=2C= > > and I tried=2C and I fixed stuff.
>=3B >=3B>=3B But I don't think= > > it is viable.
>=3B >=3B>=3B Ok?
>=3B >=3B
>=3B >=3B= > >Could it be that the TYPECASE doesn't have an ELSE clause=2C possibly
&= > >gt=3B >=3Btranslated to a switch withouy a default: label? This would gi= > >ve the
>=3B >=3BC code an apparent path to the end of the function. = > > M3 may know that
>=3B >=3Bthe TYPECASE exhausts all the possibiliti= > >es=2C but C will not.
>=3B >=3B
>=3B >=3B-- hendrik
= > >
> >= > > > >--_ad389312-f922-410e-bb8f-e7106388428f_-- -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Wed Jan 9 07:53:49 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 9 Jan 2013 06:53:49 +0000 Subject: [M3devel] time to introduce C mode to builder? Message-ID: So..in our config files..I have this fairly reasonable autoconf-ish logic: if not equal(try_exec("@" & SYSTEM_CC & m & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: invalid option \\\`32'\" >/dev/null"), 0) SYSTEM_CC = SYSTEM_CC & m SYSTEM_CC_ASM = SYSTEM_CC_ASM & m end if not equal(try_exec("@" & SYSTEM_CC & arch & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: unrecognized command line option \\\\\"-arch\\\\\"\" >/dev/null"), 0) SYSTEM_CC = SYSTEM_CC & arch SYSTEM_CC_ASM = SYSTEM_CC_ASM & arch end It is detecting if gcc understands switches like -m32, -m64, -arch ppc, etc.By fgreping error messages.If gcc is localized, it might be wrong. This is fairly reasonable without a C backend, as the C compiler is used relatively few times.It is used as the linker, and if the directory has any C code.It is used a maximum of once per cm3 invocation. Now, currently I'm using m3cgcat, per file, and it reuses this code (good!)So instead of doing the autoconf-ish logic zero or one times per directory, I'm doing it n times per directory, for fairly large n. (i.e. per source file) I could, you know, hardcode the switches, or introduce a "setup" phase for users.. However, to "kill two birds with one stone", can I go ahead and introduce a "C" mode to the "builder"?You know, we have 4 modes: integrated backend generates assembly integrated backend generates object files external backend generates assembly external backend generates object files (We only use two of them.) I'd like to introduce: integrated backend generates C files (with no clear distinction currently between C and C++; the code tries to be valid for either, but eventually we'll probably want to generate C++ for exception handling). I implemented this months ago and showed the diffs here. This is one of the steps necessary before rolling out the C mode broadly (along with making sure it works with many existing targets, and adding new targets that use it, i.e. AMD64_NT). Thanks, - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Wed Jan 9 17:30:47 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Wed, 9 Jan 2013 16:30:47 +0000 (GMT) Subject: [M3devel] time to introduce C mode to builder? In-Reply-To: Message-ID: <1357749047.85558.YahooMailClassic@web133106.mail.ir2.yahoo.com> Hi all: Jay, besides writing another backend why not ask ex-DEC-SRC about their internal C- generating backend: http://computer-programming-forum.com/27-modula2/4637e2c4a0349465.htm Thanks in advance --- El mi?, 9/1/13, Jay K escribi?: De: Jay K Asunto: [M3devel] time to introduce C mode to builder? Para: "m3devel" Fecha: mi?rcoles, 9 de enero, 2013 01:53 So..in our config files..I have this fairly reasonable autoconf-ish logic: ? if not equal(try_exec("@" & SYSTEM_CC & m & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: invalid option \\\`32'\" >/dev/null"), 0)? ? SYSTEM_CC = SYSTEM_CC & m? ? SYSTEM_CC_ASM = SYSTEM_CC_ASM & m? end? if not equal(try_exec("@" & SYSTEM_CC & arch & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: unrecognized command line option \\\\\"-arch\\\\\"\" >/dev/null"), 0)? ? SYSTEM_CC = SYSTEM_CC & arch? ? SYSTEM_CC_ASM = SYSTEM_CC_ASM & arch? end It is detecting if gcc understands switches like -m32, -m64, -arch ppc, etc.By fgreping error messages.If gcc is localized, it might be wrong. This is fairly reasonable without a C backend, as the C compiler is used relatively few times.It is used as the linker, and if the directory has any C code.It is used a maximum of once per cm3 invocation. Now, currently I'm using m3cgcat, per file, and it reuses this code (good!)So instead of doing the autoconf-ish logic zero or one times per directory, I'm doing it n times per directory, for fairly large n. (i.e. per source file) I could, you know, hardcode the switches, or introduce a "setup" phase for users.. However, to "kill two birds with one stone", can I go ahead and introduce a "C" mode to the "builder"?You know, we have 4 modes:?integrated backend generates assembly??integrated backend generates object files ??external backend generates assembly??external?backend generates object files? (We only use two of them.) I'd like to introduce:?integrated backend generates C files (with no clear distinction currently between C and C++; the code tries to be valid for either, but eventually we'll probably want to generate C++ for exception handling). I implemented this months ago and showed the diffs here. This is one of the steps necessary before rolling out the C mode broadly (along with making sure it works with many existing targets, and adding new targets that use it, i.e. AMD64_NT). Thanks,?- Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From hendrik at topoi.pooq.com Thu Jan 10 02:23:50 2013 From: hendrik at topoi.pooq.com (Hendrik Boom) Date: Wed, 9 Jan 2013 20:23:50 -0500 Subject: [M3devel] time to introduce C mode to builder? In-Reply-To: References: Message-ID: <20130110012350.GA27496@topoi.pooq.com> On Wed, Jan 09, 2013 at 06:53:49AM +0000, Jay K wrote: > > It is detecting if gcc understands switches like -m32, -m64, -arch ppc, etc.By fgreping error messages.If gcc is localized, it might be wrong. You could try explicitly setting $ENV to C during the calls to SYSTEM_CC in order to standardise the messages. -- hendrik From hosking at cs.purdue.edu Wed Jan 9 22:25:27 2013 From: hosking at cs.purdue.edu (Antony Hosking) Date: Thu, 10 Jan 2013 08:25:27 +1100 Subject: [M3devel] time to introduce C mode to builder? In-Reply-To: References: Message-ID: Yes, sure. Antony Hosking | Associate Professor | Computer Science | Purdue University 305 N. University Street | West Lafayette | IN 47907 | USA Mobile +1 765 427 5484 On Jan 9, 2013, at 5:53 PM, Jay K wrote: > So..in our config files..I have this fairly reasonable autoconf-ish logic: > > > if not equal(try_exec("@" & SYSTEM_CC & m & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: invalid option \\\`32'\" >/dev/null"), 0) > SYSTEM_CC = SYSTEM_CC & m > SYSTEM_CC_ASM = SYSTEM_CC_ASM & m > end > if not equal(try_exec("@" & SYSTEM_CC & arch & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: unrecognized command line option \\\\\"-arch\\\\\"\" >/dev/null"), 0) > SYSTEM_CC = SYSTEM_CC & arch > SYSTEM_CC_ASM = SYSTEM_CC_ASM & arch > end > > > It is detecting if gcc understands switches like -m32, -m64, -arch ppc, etc. > By fgreping error messages. > If gcc is localized, it might be wrong. > > > This is fairly reasonable without a C backend, as the C compiler is used relatively few times. > It is used as the linker, and if the directory has any C code. > It is used a maximum of once per cm3 invocation. > > > Now, currently I'm using m3cgcat, per file, and it reuses this code (good!) > So instead of doing the autoconf-ish logic zero or one times per directory, I'm doing it n times per directory, for fairly large n. (i.e. per source file) > > > I could, you know, hardcode the switches, or introduce a "setup" phase for users. > . > > However, to "kill two birds with one stone", can I go ahead and introduce a "C" mode to the "builder"? > You know, we have 4 modes: > integrated backend generates assembly > integrated backend generates object files > external backend generates assembly > external backend generates object files > > > (We only use two of them.) > > > I'd like to introduce: > integrated backend generates C files (with no clear distinction currently between C and C++; the code tries to be valid for either, but eventually we'll probably want to generate C++ for exception handling). > > > I implemented this months ago and showed the diffs here. > > > This is one of the steps necessary before rolling out the C mode broadly (along with making sure it works with many existing targets, and adding new targets that use it, i.e. AMD64_NT). > > > Thanks, > - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Sun Jan 13 19:26:44 2013 From: jay.krell at cornell.edu (Jay) Date: Sun, 13 Jan 2013 10:26:44 -0800 Subject: [M3devel] Fwd: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 References: <50EF35B2.8050003@FreeBSD.org> Message-ID: <7CCADA27-2C42-4431-8D7E-11923D4F63C0@gmail.com> Declining use of CVS, CVSup, csup: Begin forwarded message: > From: Beat Gaetzi > Date: January 10, 2013, 1:42:10 PM PST > To: , > Subject: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 > > Hi, > > As announced in September the ports tree will no longer be exported to > CVS after February 28th 2013. All users who still use CVS, CVSup or csup > to update the ports tree are encouraged to switch to portsnap(8) or for > users which need more control over their ports collection to use > Subversion directly [1]. > > A migration guide from CVSup/csup to portsnap is also available in the > FreeBSD handbook [2]. > > More information regarding the end of ports CVS can be found in the > initial announcement [3]. > > Beat, on behalf of portmgr@ > > [1] > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html > [2] > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html#cvsup-migration > [3] > http://lists.freebsd.org/pipermail/freebsd-announce/2012-September/001435.html > _______________________________________________ > freebsd-announce at freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-announce > To unsubscribe, send any mail to "freebsd-announce-unsubscribe at freebsd.org" -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Mon Jan 14 04:31:15 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Mon, 14 Jan 2013 03:31:15 +0000 (GMT) Subject: [M3devel] Fwd: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 In-Reply-To: <7CCADA27-2C42-4431-8D7E-11923D4F63C0@gmail.com> Message-ID: <1358134275.67070.YahooMailClassic@web133102.mail.ir2.yahoo.com> Hi all: http://freebsd.1045724.n5.nabble.com/Cvsup-amp-cvsupd-on-Linux-td5739101.html It might been some problem in mailing list?, but I don't think they regret so, they weren't using it actively since 2008 switch over rsync. Anyway, we didn't solve the thread issue in which CVsupd stalled, and apparently didn't want us to solve it. What could we do? Thanks in advance --- El dom, 13/1/13, Jay escribi?: De: Jay Asunto: [M3devel] Fwd: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 Para: "m3devel" Fecha: domingo, 13 de enero, 2013 13:26 Declining use of CVS, CVSup, csup: Begin forwarded message: From: Beat Gaetzi Date: January 10, 2013, 1:42:10 PM PST To: , Subject: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 Hi, As announced in September the ports tree will no longer be exported to CVS after February 28th 2013. All users who still use CVS, CVSup or csup to update the ports tree are encouraged to switch to portsnap(8) or for users which need more control over their ports collection to use Subversion directly [1]. A migration guide from CVSup/csup to portsnap is also available in the FreeBSD handbook [2]. More information regarding the end of ports CVS can be found in the initial announcement [3]. Beat, on behalf of portmgr@ [1] http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html [2] http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html#cvsup-migration [3] http://lists.freebsd.org/pipermail/freebsd-announce/2012-September/001435.html _______________________________________________ freebsd-announce at freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-announce To unsubscribe, send any mail to "freebsd-announce-unsubscribe at freebsd.org" -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Mon Jan 14 23:08:13 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Mon, 14 Jan 2013 22:08:13 +0000 (GMT) Subject: [M3devel] About next release source, pre-built, pre-processor based ? Message-ID: <1358201293.55352.YahooMailClassic@web133103.mail.ir2.yahoo.com> Hi all: Does anybody knows what gonna be next release based on, or have any thoughts on its distribution form? This is because I want to talk about some language annotation mechanism idea in form of pragmas for memory accountability for possible small sized memory targets like embedded processors, any thoughts. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.anderson at elego.de Tue Jan 22 14:04:31 2013 From: michael.anderson at elego.de (Michael Anderson) Date: Tue, 22 Jan 2013 14:04:31 +0100 Subject: [M3devel] [ Message-ID: <50FE8E5F.1080606@elego.de> Hello Modula3 Users and Developers, As you may have noticed, our server birch.elego.de was down for most of the day yesterday due to hardware failure. As a full restore from backup was necessary, we decided to virtualize the system and move it to a more powerful server. As a result, the IP address has changed, and SSH users will receive a warning upon connecting, and will need to remove the corresponding entry for birch.elego.de in their ~/.ssh/known_hosts file. Please note that we are still in the process of restoring the cm3 package archive, so there may be broken links on the website until everything is uploaded. The cm3 cvs repository has been completely restored and is available for use. Please contact me directly at if you have any questions or experience problems with the new system. Michael Anderson -- Michael Anderson IT Services & Support elego Software Solutions GmbH Gustav-Meyer-Allee 25 Building 12.3 (BIG) room 227 13355 Berlin, Germany phone +49 30 23 45 86 96 michael.anderson at elegosoft.com fax +49 30 23 45 86 95 http://www.elegosoft.com Geschaeftsfuehrer: Olaf Wagner, Sitz Berlin Amtsgericht Berlin-Charlottenburg, HRB 77719, USt-IdNr: DE163214194 From jay.krell at cornell.edu Mon Jan 28 07:22:53 2013 From: jay.krell at cornell.edu (Jay K) Date: Mon, 28 Jan 2013 06:22:53 +0000 Subject: [M3devel] probing existance of C backend in config/quake Message-ID: I maintain (and they are checked in and used) "one" set of config files that are meant to work with a variety of old and new releases. The "upgrade" process, i.e. in Tinderbox/Hudon, does not necessarily do things this way -- they have old config files that go with old compilers, and only try to use the current version with current compilers. For these purposes however, I desire, like: M3Build.m3: Builtins = ARRAY OF Builtin { (*------------------------------------------------- feature/version probes --*) Builtin {"HasCBackend", HasCBackend, 0, TRUE }, ... (*------------------------------------------------- feature/version probes --*) PROCEDURE HasCBackend (m: QMachine.T; <*UNUSED*> n_args: INTEGER) RAISES {Quake.Error} = VAR t := Self (m); BEGIN PushBool (t, TRUE); END HasCBackend; so config file can use the old mode "3" gcc backend if there is no C backend. ok? Thanks, - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Mon Jan 28 07:44:29 2013 From: jay.krell at cornell.edu (Jay K) Date: Mon, 28 Jan 2013 06:44:29 +0000 Subject: [M3devel] generating target-independent C in backend? Message-ID: Currently the C output is target-specific. I want to generate one set of C output for all platforms. So you just download one portable "m3.tar.gz". Is there agreement on this goal? Others might help? And no generally object to my changes to make it so? Here are the obstacles to getting there as I understand: win32 vs. posix (or more generally, logic on the m3makefile's that change what source is compiled) jmpbuf size endian word size/layout I believe the "layout rules" (padding/alignment) are now fairly target independent, EXCEPT that endianness and word size vary. That is, interop with C has been compromised. jmpbuf size is probably the easiest to fix. In the near term, solve it like I already tried. change jmpbuf x to void*x = 0; x = x ? x : alloca(sizeof_jmpbuf); contants.c #include extern const size_t sizeof_jmpbuf = sizeof(jmpbuf) (plus possible Cygwin hack -- they accidentally blow up the size by a factor of 4) long term: generate C++ and no more setjmp/longjmp, or possibly C on OpenVMS, Tru64, and NT, possibly #ifdefed Endianness is partly solved by moving the "floating point cracking" code to C. But that doesn't suffice. There remain bitfields in the runtime, I don't think they can/should be removed, and their layout is endian-specific. Maybe we can just change layout to not be endian specific? I don't care to enable or keep working interop with C bitfields. win32 vs. posix (also pthreads vs. user threads) requires "something" in the "builder", interacting with the backend perhaps, or with bootstrapping Basically whenever there is an "if" in quake, you kind of need to go down both paths, but communicate the condition to the next level down. Like if we had FooPosix.m3 and FooWin32.m3 we either want both FooPosix.c and FooWin32.c generated and we'll only compile one of them, or Foo.m3 with both contents concatenated but with an #if/#else/#endif between them. But what if we had FooWin32.i3 and FooPosix.i3? We can't let FooPosix.i3 be fixible BarWin32.m3. Like, we want to compile everything to C, but not otherwise "infect" the compilation system with the conceptual output. Does that make sense? The layout problem is tricky. We need separate notions in the backend for UINT32, UINT64, and size_t; and INT32, INT64, and ptrdiff_t (INTEGER). We can't have the frontend resolve to a specific size, at least not without maintaining some notion of the abstraction that the backend sees. The existing typeids might suffice. As well, records/fields have to treated differently, or in an extra way. That is, we can pass computed sizes and offsets to the backend, and we'd also have to pass other information, and the backend could chose which to use. A reasonably easy approach is to pass a list of integers to add up and maybe multiple, and besides the obvious 1, 2, 4, 8, there'd also be stand-in values for "size_t", like maybe -1. This might be deducable from the declarations we have about arrays and records. It is also tempting to give up on the majority of this. If we solve the jmpbuf problem..including, heck, just blow up jmpbufs to 1K, or use C++ exception handling, then there are only a few targets remainaing: 32bit little endian posix 64bit little endian posix 32bit little big posix 64bit little big posix 32bit little endian NT 64bit little endian NT big endian NT doesn't really exist (Xbox 360?). We could distribute 6 source archives and let the user chose? Seems too lame to me. But that might be the short term solution. ? - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.veselovsky at gmail.com Mon Jan 28 18:30:40 2013 From: alexey.veselovsky at gmail.com (Alexey Veselovsky) Date: Mon, 28 Jan 2013 21:30:40 +0400 Subject: [M3devel] Information about record/object field name. Message-ID: Hello. It is possible to retrieve field names for given Record or Object type? I need it for json serializer. Also this information useful for creating field-order independent serializer. Thanks, Alexey. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mika at async.caltech.edu Mon Jan 28 19:40:24 2013 From: mika at async.caltech.edu (mika at async.caltech.edu) Date: Mon, 28 Jan 2013 10:40:24 -0800 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: Message-ID: <20130128184025.03FD21A207D@async.async.caltech.edu> I do this sort of thing with m3tk. I have posted links to a Scheme interpreter on this mailing list before. If you look at how it works you can see how it encodes records. (It uses the field names just as you suggest, in a dotted pair---very similar to JSON.) If you can't find it I can repeat the links for you. It's a CVS repository that has anonymous access. Mika Alexey Veselovsky writes: >--f46d04088f7bcbc96504d45ca2ca >Content-Type: text/plain; charset=ISO-8859-1 > >Hello. > >It is possible to retrieve field names for given Record or Object type? > >I need it for json serializer. > >Also this information useful for creating field-order independent >serializer. > >Thanks, Alexey. > >--f46d04088f7bcbc96504d45ca2ca >Content-Type: text/html; charset=ISO-8859-1 > >
Hello.

It is possible to retrieve field names for given Record or Object type?
tyle>
I need it for json serializer.

>Also this information useful for creating field-order independent serializer.

Thanks, Alexey. >
> >--f46d04088f7bcbc96504d45ca2ca-- From alexey.veselovsky at gmail.com Mon Jan 28 19:50:10 2013 From: alexey.veselovsky at gmail.com (Alexey Veselovsky) Date: Mon, 28 Jan 2013 22:50:10 +0400 Subject: [M3devel] Information about record/object field name. In-Reply-To: <20130128184025.03FD21A207D@async.async.caltech.edu> References: <20130128184025.03FD21A207D@async.async.caltech.edu> Message-ID: I can't find. Please give me link. Thanks, Alexey. On Mon, Jan 28, 2013 at 10:40 PM, wrote: > I do this sort of thing with m3tk. > > I have posted links to a Scheme interpreter on this mailing list before. > If you look at how it works you can see how it encodes records. (It uses > the field names just as you suggest, in a dotted pair---very similar > to JSON.) > > If you can't find it I can repeat the links for you. It's a CVS repository > that has anonymous access. > > Mika > > Alexey Veselovsky writes: > >--f46d04088f7bcbc96504d45ca2ca > >Content-Type: text/plain; charset=ISO-8859-1 > > > >Hello. > > > >It is possible to retrieve field names for given Record or Object type? > > > >I need it for json serializer. > > > >Also this information useful for creating field-order independent > >serializer. > > > >Thanks, Alexey. > > > >--f46d04088f7bcbc96504d45ca2ca > >Content-Type: text/html; charset=ISO-8859-1 > > > >
Hello.

It is possible to retrieve > field names for given Record or Object type?
>tyle>
I need it for json serializer.
style>
> >Also this information useful for creating field-order independent > serializer.

Thanks, Alexey. > >
> > > >--f46d04088f7bcbc96504d45ca2ca-- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.veselovsky at gmail.com Mon Jan 28 22:28:29 2013 From: alexey.veselovsky at gmail.com (Alexey Veselovsky) Date: Tue, 29 Jan 2013 00:28:29 +0300 Subject: [M3devel] Information about record/object field name. In-Reply-To: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> References: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> Message-ID: <1F41D973-19C2-4770-93FC-B26BA5894A74@gmail.com> Where I can read about m3web files? What is it? On 28.01.2013, at 23:16, Darko wrote: > Another way to do it is to parse the .M3WEB file. See the Load procedure in the attached module for clues (unfortunately it has some dependencies into my code but they're fairly obvious). It takes as a parameter the .M3WEB file from the build directory. > > > > > > On Jan 28, 2013, at 9:30 AM, Alexey Veselovsky wrote: > >> Hello. >> >> It is possible to retrieve field names for given Record or Object type? >> >> I need it for json serializer. >> >> Also this information useful for creating field-order independent serializer. >> >> Thanks, Alexey. > From darko at darko.org Mon Jan 28 21:39:24 2013 From: darko at darko.org (Darko) Date: Mon, 28 Jan 2013 12:39:24 -0800 Subject: [M3devel] Information about record/object field name. In-Reply-To: <1F41D973-19C2-4770-93FC-B26BA5894A74@gmail.com> References: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> <1F41D973-19C2-4770-93FC-B26BA5894A74@gmail.com> Message-ID: The files are generated by the compiler and are meant for an M3 tool which I forget the name of, I also forget where I got the details of the file from. I'll try to dig it up, or I may have guessed the format. Others on the list maybe have more information. On Jan 28, 2013, at 1:28 PM, Alexey Veselovsky wrote: > Where I can read about m3web files? What is it? > > On 28.01.2013, at 23:16, Darko wrote: > >> Another way to do it is to parse the .M3WEB file. See the Load procedure in the attached module for clues (unfortunately it has some dependencies into my code but they're fairly obvious). It takes as a parameter the .M3WEB file from the build directory. >> >> >> >> >> >> On Jan 28, 2013, at 9:30 AM, Alexey Veselovsky wrote: >> >>> Hello. >>> >>> It is possible to retrieve field names for given Record or Object type? >>> >>> I need it for json serializer. >>> >>> Also this information useful for creating field-order independent serializer. >>> >>> Thanks, Alexey. >> From darko at darko.org Mon Jan 28 21:16:32 2013 From: darko at darko.org (Darko) Date: Mon, 28 Jan 2013 12:16:32 -0800 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: Message-ID: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> Another way to do it is to parse the .M3WEB file. See the Load procedure in the attached module for clues (unfortunately it has some dependencies into my code but they're fairly obvious). It takes as a parameter the .M3WEB file from the build directory. -------------- next part -------------- A non-text attachment was scrubbed... Name: TypeInfo.i3 Type: application/octet-stream Size: 4266 bytes Desc: not available URL: -------------- next part -------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: TypeInfo.m3 Type: application/octet-stream Size: 17169 bytes Desc: not available URL: -------------- next part -------------- On Jan 28, 2013, at 9:30 AM, Alexey Veselovsky wrote: > Hello. > > It is possible to retrieve field names for given Record or Object type? > > I need it for json serializer. > > Also this information useful for creating field-order independent serializer. > > Thanks, Alexey. From mika at async.caltech.edu Tue Jan 29 10:40:57 2013 From: mika at async.caltech.edu (mika at async.caltech.edu) Date: Tue, 29 Jan 2013 01:40:57 -0800 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: <20130128184025.03FD21A207D@async.async.caltech.edu> Message-ID: <20130129094057.6E5631A208E@async.async.caltech.edu> cvs -d :pserver:anonymous at pluto.gcapltd.com:/home/gcap-public-cvs up -d . Alexey Veselovsky writes: >--f46d0435c24c28655c04d45dbf19 >Content-Type: text/plain; charset=ISO-8859-1 > >I can't find. Please give me link. > >Thanks, Alexey. > > >On Mon, Jan 28, 2013 at 10:40 PM, wrote: > >> I do this sort of thing with m3tk. >> >> I have posted links to a Scheme interpreter on this mailing list before. >> If you look at how it works you can see how it encodes records. (It uses >> the field names just as you suggest, in a dotted pair---very similar >> to JSON.) >> >> If you can't find it I can repeat the links for you. It's a CVS repository >> that has anonymous access. >> >> Mika >> >> Alexey Veselovsky writes: >> >--f46d04088f7bcbc96504d45ca2ca >> >Content-Type: text/plain; charset=ISO-8859-1 >> > >> >Hello. >> > >> >It is possible to retrieve field names for given Record or Object type? >> > >> >I need it for json serializer. >> > >> >Also this information useful for creating field-order independent >> >serializer. >> > >> >Thanks, Alexey. >> > >> >--f46d04088f7bcbc96504d45ca2ca >> >Content-Type: text/html; charset=ISO-8859-1 >> > >> >
Hello.

It is possible to retrieve >> field names for given Record or Object type?
> >tyle>
I need it for json serializer.
> style>
>> >Also this information useful for creating field-order independent >> serializer.

Thanks, Alexey. >> >
>> > >> >--f46d04088f7bcbc96504d45ca2ca-- >> > >--f46d0435c24c28655c04d45dbf19 >Content-Type: text/html; charset=ISO-8859-1 >Content-Transfer-Encoding: quoted-printable > >
I can't find. Please give me link.

= >Thanks, Alexey.


class=3D"gmail_quote">On Mon, Jan 28, 2013 at 10:40 PM, ><mika at async= >.caltech.edu> wrote:
>
x #ccc solid;padding-left:1ex">I do this sort of thing with m3tk.
>
>I have posted links to a Scheme interpreter on this mailing list before.> >If you look at how it works you can see how it encodes records. =A0(It uses= >
>the field names just as you suggest, in a dotted pair---very similar
>to JSON.)
>
>If you can't find it I can repeat the links for you. =A0It's a CVS = >repository
>that has anonymous access.
>
>=A0 =A0 =A0Mika
>
>Alexey Veselovsky writes:
>>--f46d04088f7bcbc96504d45ca2ca
>>Content-Type: text/plain; charset=3DISO-8859-1
>
>
>>Hello.
>>
>>It is possible to retrieve field names for given Record or Object type?= >
>>
>>I need it for json serializer.
>>
>>Also this information useful for creating field-order independent
>>serializer.
>>
>>Thanks, Alexey.
>>
>
>--f46d04088f7bcbc96504d45ca2ca
>>Content-Type: text/html; charset=3DISO-8859-1
>>
>><div dir=3D"ltr">Hello.<div><br></div>= >;<div style>It is possible to retrieve field names for given Record o= >r Object type?</div><div s
>>tyle><br></div><div style>I need it for json seria= >lizer.</div><div style><br></div><div style><= >br> >>Also this information useful for creating field-order independent seria= >lizer.</div><div style><br></div><div style>T= >hanks, Alexey.
>></div></div>
>>
>>--f46d04088f7bcbc96504d45ca2ca--
>

> >--f46d0435c24c28655c04d45dbf19-- From rcolebur at SCIRES.COM Tue Jan 29 22:42:42 2013 From: rcolebur at SCIRES.COM (Coleburn, Randy) Date: Tue, 29 Jan 2013 21:42:42 +0000 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> <1F41D973-19C2-4770-93FC-B26BA5894A74@gmail.com> Message-ID: <0BB8FA59C2932741A3A2941A8B9D8BFF03BDB3@ATLEX04-SRV.SCIRES.LOCAL> I think you may be referring to m3browser. Also, CM3IDE has the capability to generate and browse a web of your Modula-3 software source code. --Randy Coleburn -----Original Message----- From: Darko [mailto:darko at darko.org] Sent: Monday, January 28, 2013 3:39 PM To: Alexey Veselovsky Cc: m3devel at elegosoft.com Subject: EXT:Re: [M3devel] Information about record/object field name. The files are generated by the compiler and are meant for an M3 tool which I forget the name of, I also forget where I got the details of the file from. I'll try to dig it up, or I may have guessed the format. Others on the list maybe have more information. On Jan 28, 2013, at 1:28 PM, Alexey Veselovsky wrote: > Where I can read about m3web files? What is it? > > On 28.01.2013, at 23:16, Darko wrote: > >> Another way to do it is to parse the .M3WEB file. See the Load procedure in the attached module for clues (unfortunately it has some dependencies into my code but they're fairly obvious). It takes as a parameter the .M3WEB file from the build directory. >> >> >> >> >> >> On Jan 28, 2013, at 9:30 AM, Alexey Veselovsky wrote: >> >>> Hello. >>> >>> It is possible to retrieve field names for given Record or Object type? >>> >>> I need it for json serializer. >>> >>> Also this information useful for creating field-order independent serializer. >>> >>> Thanks, Alexey. >> From jay.krell at cornell.edu Wed Jan 30 08:40:02 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 30 Jan 2013 07:40:02 +0000 Subject: [M3devel] awful race condition in libm3/FilePosix.m3? Message-ID: FilePosix.m3: I'm not 100% sure, but looks really bad. I suspect it will close arbitrary files out from other threads. Notice there is absolutely no mutual exclusion. An arbitrary number of threads will run here, mostly succeeding, but not necessarily. VAR null_done := FALSE; null_stat: Ustat.struct_stat; null_fd: INTEGER; PROCEDURE IsDevNull(READONLY statbuf: Ustat.struct_stat): BOOLEAN RAISES {} = VAR result: INTEGER; BEGIN IF NOT null_done THEN null_fd := Unix.open(M3toC.FlatTtoS("/dev/null"), Unix.O_RDONLY, Unix.Mrwrwrw); IF null_fd < 0 THEN null_done := TRUE; RETURN FALSE ELSE result := Ustat.fstat(null_fd, ADR(null_stat)); EVAL Unix.close(null_fd); IF result # 0 THEN null_fd := -1 END END; null_done := TRUE; END; RETURN null_fd >= 0 AND statbuf.st_rdev = null_stat.st_rdev END IsDevNull; - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Wed Jan 30 09:24:50 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 30 Jan 2013 08:24:50 +0000 Subject: [M3devel] awful race condition in libm3/FilePosix.m3? In-Reply-To: References: Message-ID: I commited a fix. But two questions: 1) why not just stat, instead of open, fstat, close? 2) a lighter weight way to fix this than I did? In particular: a) VAR m := NEW(MUTEX); can we at least say VAR m: MUTEX instead? I tried. It crashed. b) some notion of a "once"? a lock that will only be successfully entered once, for one-time initialization, all other attempts to enter wait for the first enterer to leave, and the it is never entered again. pthreads has this. Win32 since Vista has it (I'd still provide something compatible to pre-Vista, but it can be done easily enough. They are faster and perhaps smaller than other kinds of locks. - Jay From: jay.krell at cornell.edu To: m3devel at elegosoft.com Date: Wed, 30 Jan 2013 07:40:02 +0000 Subject: [M3devel] awful race condition in libm3/FilePosix.m3? FilePosix.m3: I'm not 100% sure, but looks really bad. I suspect it will close arbitrary files out from other threads. Notice there is absolutely no mutual exclusion. An arbitrary number of threads will run here, mostly succeeding, but not necessarily. VAR null_done := FALSE; null_stat: Ustat.struct_stat; null_fd: INTEGER; PROCEDURE IsDevNull(READONLY statbuf: Ustat.struct_stat): BOOLEAN RAISES {} = VAR result: INTEGER; BEGIN IF NOT null_done THEN null_fd := Unix.open(M3toC.FlatTtoS("/dev/null"), Unix.O_RDONLY, Unix.Mrwrwrw); IF null_fd < 0 THEN null_done := TRUE; RETURN FALSE ELSE result := Ustat.fstat(null_fd, ADR(null_stat)); EVAL Unix.close(null_fd); IF result # 0 THEN null_fd := -1 END END; null_done := TRUE; END; RETURN null_fd >= 0 AND statbuf.st_rdev = null_stat.st_rdev END IsDevNull; - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Wed Jan 30 09:26:30 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 30 Jan 2013 08:26:30 +0000 Subject: [M3devel] less indirection in mutex? Message-ID: How about..on systems where sizeof(pthread_mutex) <= sizeof(void*), we remove a level of indirection? I realize it is tricky while preserving our now excellent level of portability. I would actually have C code with the if (sizeof....), no #ifs, no autoconf. - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Thu Jan 31 09:54:47 2013 From: jay.krell at cornell.edu (Jay K) Date: Thu, 31 Jan 2013 08:54:47 +0000 Subject: [M3devel] libm3 AMD64_NT loophole/size problem Message-ID: == package /Users/jay/dev2/cm3/m3-libs/libm3 == +++ /cm3/bin/cm3 -build -override -DROOT=/Users/jay/dev2/cm3 -boot -keep -DM3CC_TARGET=AMD64_NT +++ --- building in AMD64_NT --- ignoring override("libm3", "/Users/jay/dev2/cm3/m3-libs") "../src/os/WIN32/SocketWin32.m3", line 329: LOOPHOLE: expression's size differs from type's "../src/os/WIN32/SocketWin32.m3", line 383: LOOPHOLE: expression's size differs from type's "../src/os/WIN32/SocketWin32.m3", line 383: warning: LOOPHOLE: expression's alignment may differ from type's "../src/os/WIN32/SocketWin32.m3", line 389: LOOPHOLE: expression's size differs from type's 3 errors and 1 warning encountered FYI, if I end up rewriting this file or parts of it in C, this is one of the contributing reasons. It is kind of the same as the other Unix/C stuff where I rewrote in C, rather than maintain cloned headers. - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From rodney_bates at lcwb.coop Thu Jan 31 17:03:50 2013 From: rodney_bates at lcwb.coop (Rodney M. Bates) Date: Thu, 31 Jan 2013 10:03:50 -0600 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: Message-ID: <510A95E6.4000308@lcwb.coop> This question raises several others in my mind. Since you mention a serializer, do I correctly presume you want the field names of a record/object type that exists in the same program doing the reading? Are you familiar with the existing compiler-generated type information, in RTTypeMap.i3 and RTTipeMap.i3, and accessible at runtime using RT0.i3 and other things in m3-libs/m3core/src/runtime/common/*, and produced by the compiler in, e.g., m3-sys/m3front/src/misc/TipeDesc.i3? Unfortunately, neither of these kinds of runtime type information has field names, only a lists of field types in order. For a serializer, runtime type information would be a far more convenient source, since it would not require having either source files or separate derived files (.M3WEB). Adding the field names here would probably not be a big coding change, but a change in runtime data structure would no doubt be a big bootstrapping and upgrading operation, for all concerned. Field names are also available in the generated debug information. But even though this might be a more convenient location to get it from, decoding it this way would be a nightmare. It's a specialized derivative of stabs, with lots of Modula-3-specific stuff mangled and encoded inside the string fields of stabs records. gdb has gobs of code to read in general stabs and m3gdb has gobs more to further decode it, all in c. Moreover, there are quite a few differences in what is produced by various compilers, depending on the version of the M3 front end, the version of the gcc-derived code generator or the other code generators, and the target. The idea of field-order independent serializing at first seemed pointless to me. I think the intent must be to allow a serialized object to be deserialized into a different program as a different type, with different field orders. Is this the intent? what are the rules about how different a type can be and still be used in this way? Is it cross-language too? The existing Modula-3 serializer (m3-libs/libm3/src/pickle/ver2/Pickle2.i3 etc.) requires that there be type in the deserializing program that is an exact (structural) match to the type in the serializing program, according to the language's rules of type equality. Pickle enforces this by looking for equality of a 64-bit "signature" that is a hash on a type structure, with the assumption collisions will not occur. Perhaps you have read enough of the runtime, compiler, and serializer to know all this already. Tell us more about the json serializer. On 01/28/2013 11:30 AM, Alexey Veselovsky wrote: > Hello. > > It is possible to retrieve field names for given Record or Object type? > > I need it for json serializer. > > Also this information useful for creating field-order independent serializer. > > Thanks, Alexey. From alexey.veselovsky at gmail.com Thu Jan 31 16:14:23 2013 From: alexey.veselovsky at gmail.com (Alexey Veselovsky) Date: Thu, 31 Jan 2013 19:14:23 +0400 Subject: [M3devel] Can't acces to cvs repo. Message-ID: Subj. Login timeout: # cvs -d :pserver:anonymous at modula3.elegosoft.com:/usr/cvs login Logging in to :pserver:anonymous at modula3.elegosoft.com:2401/usr/cvs CVS password: cvs [login aborted]: connect to modula3.elegosoft.com(46.4.219.187):2401 failed: Connection timed out Thanks, Alexey. -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Fri Jan 4 10:16:47 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 01:16:47 -0800 Subject: [M3devel] Bare Metal Modula-3 Message-ID: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko From jay.krell at cornell.edu Fri Jan 4 18:08:09 2013 From: jay.krell at cornell.edu (Jay K) Date: Fri, 4 Jan 2013 17:08:09 +0000 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> References: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> Message-ID: What is the system? It is possible to not need memory allocation or threading or garbage collection. You could use just globals and/or locals. It is possibe to not need garbage collection. Use unsafe and new/dispose for dynamic allocation. The garbage collector for example, doesn't need garbage collection. It is possible to not need threads. It is obvious how. But be aware that "libraries", including the garbage collector, create threads. Anyway, "yes". There are currently three usermode thread implementations. 1) "get/set/make/swapcontext" 2) "sigaltstack" 3) "setjmp/timers" This looks currently unused, and maybe deleted. I guess they all user timers. To start, see: jbook2:src jay$ pwd /dev2/cm3/m3-libs/m3core/src jbook2:src jay$ find . | grep c$ | grep -i thread ./thread/POSIX/ThreadPosixC.c OR ./thread/PTHREAD/ThreadPThreadC.c Really, providing pthreads wouldn't be a bad idea. For memory allocation, we use at least calloc, free, maybe malloc, and mmap/munmap. You could probably replace mmap/munmap with calloc/malloc/free. If you really want to link all of m3core and libm3, you'll need more, open/close/read/write, fork or vfork/exec. The way to know is probably just to try it. Do you have a working C compiler/libraries/headers? Can you just try it? nm against cm3 is probably useful. Some of these might be injected by "startup" code. Some are wrappers for other code to use -- might not be used. Some are implementation details of the C library. nm /cm3/bin/cm3 | grep " U " U ___error U ___gxx_personality_v0 U ___sF U ___stderrp U __exit U __longjmp U __setjmp U _abort U _access U _calloc U _ceil U _chdir U _close U _closedir U _dup2 U _execve U _execvp U _exit U _fcntl U _feclearexcept U _fegetround U _feraiseexcept U _fesetround U _fetestexcept U _fflush U _floor U _fork U _fprintf U _free U _fstat U _fsync U _fwrite U _getcwd U _getdtablesize U _getegid U _getenv U _geteuid U _gethostname U _getpid U _gettimeofday U _gmtime U _kill U _ldexp U _link U _llroundl U _localtime U _lseek U _lstat U _malloc U _memcmp U _memmove U _memset U _mkdir U _mktime U _mmap U _modf U _nanosleep U _open U _opendir U _pipe U _poll U _pthread_atfork U _pthread_attr_destroy U _pthread_attr_getstacksize U _pthread_attr_init U _pthread_attr_setstacksize U _pthread_cond_broadcast U _pthread_cond_destroy U _pthread_cond_init U _pthread_cond_signal U _pthread_cond_timedwait U _pthread_cond_wait U _pthread_create U _pthread_detach U _pthread_equal U _pthread_getspecific U _pthread_key_create U _pthread_kill U _pthread_mach_thread_np U _pthread_mutex_destroy U _pthread_mutex_init U _pthread_mutex_lock U _pthread_mutex_unlock U _pthread_self U _pthread_setspecific U _read U _readdir U _readlink U _rename U _rmdir U _sched_yield U _sigaction U _sigsetjmp U _sleep U _stat U _strcmp U _strtod U _symlink U _thread_abort_safely U _thread_get_state U _thread_resume U _thread_suspend U _time U _tzset U _uname U _unlink U _utimes U _waitpid U _write - Jay > From: darko at darko.org > Date: Fri, 4 Jan 2013 01:16:47 -0800 > To: m3devel at elegosoft.com > Subject: [M3devel] Bare Metal Modula-3 > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > - Darko > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Fri Jan 4 19:46:45 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Fri, 4 Jan 2013 18:46:45 +0000 (GMT) Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> Message-ID: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com> Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament.? and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Fri Jan 4 21:50:04 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Fri, 4 Jan 2013 20:50:04 +0000 (GMT) Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> Message-ID: <1357332604.47416.YahooMailClassic@web133103.mail.ir2.yahoo.com> Hi all: You need realtime core services otherwise your system won't be efficient unless that's not what you want, it is to run Modula-3 applications, isn't it? If not, what's the point of your device? (e.g SPIN GC, etc) If you need a real-time core server in a networked implementation, you need a DRTOS. Thanks in advance PS: I don't see any response to Jay --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: Re: [M3devel] Bare Metal Modula-3 Para: "Daniel Alejandro Benavides D." CC: "m3devel developers" Fecha: viernes, 4 de enero, 2013 15:09 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament.? and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Fri Jan 4 21:09:26 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 12:09:26 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com> References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com> Message-ID: <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: > Hi all: > I think you just need runtime executive on top a machine would be enough. > For instance VAXELN. > Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). > Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. > I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: > http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor > > My hypothesis is that you can't bring up a realtime application in an embedded device like you want. > I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. > Thanks in advance > > > --- El vie, 4/1/13, Darko escribi?: > > De: Darko > Asunto: [M3devel] Bare Metal Modula-3 > Para: "m3devel developers" > Fecha: viernes, 4 de enero, 2013 04:16 > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > - Darko > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Sat Jan 5 01:36:16 2013 From: jay.krell at cornell.edu (Jay K) Date: Sat, 5 Jan 2013 00:36:16 +0000 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com>, <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> Message-ID: Clarification regarding mmap. mmap has two fairly different purposes in Posix. 1) to "map a file" into memory 2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size). #1 is the more obvious probably better known use. The one I knew of. The one it sounds like. #2 is what we use it for. If we ever autoconf-m3core, it'd probably be reasonable to do something like: #if HAS_MMAPreturn mmap(...); #elif HAS_CALLOC void** p = (void**)calloc(size + sizeof(void*));if (!p) return p;p[0] = p;return p + 1; #else#error#endif #if HAS_MMAPmunmap(...); #elif HAS_CALLOC if (p) free(((void**)p)[-1]); #endif alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed.Including assert(0) in places.Invent your own value for "OS_TYPE". Maybe #define OS_TYPE_FOO #include ../POSIX/Foo.c and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. Sharing code can be good or bad. We don't actually use "memory protection".Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible.This is nice. It might be required for "safety".It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead.More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3.You make a much different system, you get to do the port.It is neither impossible nor a no-op. - Jay From: darko at darko.org Date: Fri, 4 Jan 2013 12:09:26 -0800 To: dabenavidesd at yahoo.es CC: m3devel at elegosoft.com Subject: Re: [M3devel] Bare Metal Modula-3 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote:Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Sat Jan 5 03:40:49 2013 From: jay.krell at cornell.edu (Jay K) Date: Sat, 5 Jan 2013 02:40:49 +0000 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com>, <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> , Message-ID: Get hello world running on your system first, written in C. Then get back to us. :)Seriously. Ok, maybe not with stdio.At least this: int main(){ malloc(1); return 0;} - Jay Subject: Re: [M3devel] Bare Metal Modula-3 From: darko at darko.org Date: Fri, 4 Jan 2013 16:45:27 -0800 CC: m3devel at elegosoft.com To: jay.krell at cornell.edu That's useful to know. It makes implementing memory allocation very straight forward. All I'd need to implement would be some calls for setting aside pages of memory and setting their read/write status, which would be directly supported by the hardware. It also occurs to me I'd have to write some sort of loader, which shouldn't be difficult as long as I can link the m3 program into some sort of monolithic "raw" format that I can just copy into a fixed place in memory and start executing. On Jan 4, 2013, at 4:36 PM, Jay K wrote:Clarification regarding mmap. mmap has two fairly different purposes in Posix. 1) to "map a file" into memory 2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size). #1 is the more obvious probably better known use. The one I knew of. The one it sounds like. #2 is what we use it for. If we ever autoconf-m3core, it'd probably be reasonable to do something like: #if HAS_MMAP return mmap(...); #elif HAS_CALLOC void** p = (void**)calloc(size + sizeof(void*)); if (!p) return p; p[0] = p; return p + 1; #else #error #endif #if HAS_MMAP munmap(...); #elif HAS_CALLOC if (p) free(((void**)p)[-1]); #endif alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed. Including assert(0) in places. Invent your own value for "OS_TYPE". Maybe #define OS_TYPE_FOO #include ../POSIX/Foo.c and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. Sharing code can be good or bad. We don't actually use "memory protection". Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible. This is nice. It might be required for "safety". It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead. More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3. You make a much different system, you get to do the port. It is neither impossible nor a no-op. - Jay From: darko at darko.org Date: Fri, 4 Jan 2013 12:09:26 -0800 To: dabenavidesd at yahoo.es CC: m3devel at elegosoft.com Subject: Re: [M3devel] Bare Metal Modula-3 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote:Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Fri Jan 4 21:07:43 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 12:07:43 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: References: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> Message-ID: <796EA17B-0861-4D9E-8D5E-476F41357D25@darko.org> The threading, GC and TCP/IP are required by my software, so they have to be implemented, the question is what is the minimum required to implement them. No other OS services are required, and no OS would be installed. Some external libraries would be required, like a TCP/IP stack, but those are available without OS dependencies. The target system is the Samsung Exynos 4 Quad SoC. It has a 4 ARM Cortex-A9 cores running at 1.6GHz and 2GB integrated DRAM. Added to that would be a gigabit ethernet port. The whole system would have a maximum power draw of something like 5W. The manual can be found here for those interested: http://www.samsung.com/global/business/semiconductor/file/product/Exynos_4_Quad_User_Manaul_Public_REV100-0.pdf The idea is to build a low cost, low power computing node that can deployed in large numbers. It would only run one threaded application and all I/O would be through the network port, so the OS would do little else than create overhead. So far, aside from hardware initialization, I know I'd have to write a timer interrupt for user threads, some code to assign threads to cores, and an implementation of mmap/munmap, but I imagine not a full one since from what I understand only some of the functionality is used to catch access to various parts of memory. I know I'd have to remove the many parts of m3core, libm3 and other libraries that reference OS services. On Jan 4, 2013, at 9:08 AM, Jay K wrote: > What is the system? > > > > It is possible to not need memory allocation or threading or garbage collection. > You could use just globals and/or locals. > > > > It is possibe to not need garbage collection. > Use unsafe and new/dispose for dynamic allocation. > The garbage collector for example, doesn't need garbage collection. > > > > It is possible to not need threads. > It is obvious how. > But be aware that "libraries", including the garbage collector, create threads. > > > > Anyway, "yes". > There are currently three usermode thread implementations. > 1) "get/set/make/swapcontext" > 2) "sigaltstack" > 3) "setjmp/timers" > This looks currently unused, and maybe deleted. > > > > I guess they all user timers. > > > > To start, see: > > > jbook2:src jay$ pwd > /dev2/cm3/m3-libs/m3core/src > > > jbook2:src jay$ find . | grep c$ | grep -i thread > ./thread/POSIX/ThreadPosixC.c > OR > ./thread/PTHREAD/ThreadPThreadC.c > > > > Really, providing pthreads wouldn't be a bad idea. > > > > For memory allocation, we use at least calloc, free, maybe malloc, > and mmap/munmap. You could probably replace mmap/munmap with calloc/malloc/free. > > > > If you really want to link all of m3core and libm3, you'll > need more, open/close/read/write, fork or vfork/exec. > > > > The way to know is probably just to try it. > Do you have a working C compiler/libraries/headers? > Can you just try it? > > > nm against cm3 is probably useful. > Some of these might be injected by "startup" code. > Some are wrappers for other code to use -- might not be used. > Some are implementation details of the C library. > > > nm /cm3/bin/cm3 | grep " U " > > > U ___error > U ___gxx_personality_v0 > U ___sF > U ___stderrp > U __exit > U __longjmp > U __setjmp > U _abort > U _access > U _calloc > U _ceil > U _chdir > U _close > U _closedir > U _dup2 > U _execve > U _execvp > U _exit > U _fcntl > U _feclearexcept > U _fegetround > U _feraiseexcept > U _fesetround > U _fetestexcept > U _fflush > U _floor > U _fork > U _fprintf > U _free > U _fstat > U _fsync > U _fwrite > U _getcwd > U _getdtablesize > U _getegid > U _getenv > U _geteuid > U _gethostname > U _getpid > U _gettimeofday > U _gmtime > U _kill > U _ldexp > U _link > U _llroundl > U _localtime > U _lseek > U _lstat > U _malloc > U _memcmp > U _memmove > U _memset > U _mkdir > U _mktime > U _mmap > U _modf > U _nanosleep > U _open > U _opendir > U _pipe > U _poll > U _pthread_atfork > U _pthread_attr_destroy > U _pthread_attr_getstacksize > U _pthread_attr_init > U _pthread_attr_setstacksize > U _pthread_cond_broadcast > U _pthread_cond_destroy > U _pthread_cond_init > U _pthread_cond_signal > U _pthread_cond_timedwait > U _pthread_cond_wait > U _pthread_create > U _pthread_detach > U _pthread_equal > U _pthread_getspecific > U _pthread_key_create > U _pthread_kill > U _pthread_mach_thread_np > U _pthread_mutex_destroy > U _pthread_mutex_init > U _pthread_mutex_lock > U _pthread_mutex_unlock > U _pthread_self > U _pthread_setspecific > U _read > U _readdir > U _readlink > U _rename > U _rmdir > U _sched_yield > U _sigaction > U _sigsetjmp > U _sleep > U _stat > U _strcmp > U _strtod > U _symlink > U _thread_abort_safely > U _thread_get_state > U _thread_resume > U _thread_suspend > U _time > U _tzset > U _uname > U _unlink > U _utimes > U _waitpid > U _write > > > > - Jay > > > > > > From: darko at darko.org > > Date: Fri, 4 Jan 2013 01:16:47 -0800 > > To: m3devel at elegosoft.com > > Subject: [M3devel] Bare Metal Modula-3 > > > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > > > - Darko > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Sat Jan 5 02:26:03 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 17:26:03 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <1357332604.47416.YahooMailClassic@web133103.mail.ir2.yahoo.com> References: <1357332604.47416.YahooMailClassic@web133103.mail.ir2.yahoo.com> Message-ID: <02ED8FD1-2AF7-4F8D-919D-7B0B76F4FFDC@darko.org> My understanding of a RTOS is that is provides low-latency interrupt response and accurate timing. These are not my requirements. I'm using the ARM SoC because it provides a lot of processing power at low cost and low power, two important considerations when deploying large numbers of servers. On Jan 4, 2013, at 12:50 PM, Daniel Alejandro Benavides D. wrote: > Hi all: > You need realtime core services otherwise your system won't be efficient unless that's not what you want, it is to run Modula-3 applications, isn't it? If not, what's the point of your device? (e.g SPIN GC, etc) > If you need a real-time core server in a networked implementation, you need a DRTOS. > Thanks in advance > > PS: I don't see any response to Jay > > > --- El vie, 4/1/13, Darko escribi?: > > De: Darko > Asunto: Re: [M3devel] Bare Metal Modula-3 > Para: "Daniel Alejandro Benavides D." > CC: "m3devel developers" > Fecha: viernes, 4 de enero, 2013 15:09 > > It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. > > > On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: > >> Hi all: >> I think you just need runtime executive on top a machine would be enough. >> For instance VAXELN. >> Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). >> Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. >> I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: >> http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor >> >> My hypothesis is that you can't bring up a realtime application in an embedded device like you want. >> I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. >> Thanks in advance >> >> >> --- El vie, 4/1/13, Darko escribi?: >> >> De: Darko >> Asunto: [M3devel] Bare Metal Modula-3 >> Para: "m3devel developers" >> Fecha: viernes, 4 de enero, 2013 04:16 >> >> I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. >> >> The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. >> >> The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? >> >> - Darko >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Sat Jan 5 04:05:36 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Sat, 5 Jan 2013 03:05:36 +0000 (GMT) Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <02ED8FD1-2AF7-4F8D-919D-7B0B76F4FFDC@darko.org> Message-ID: <1357355136.54828.YahooMailClassic@web133104.mail.ir2.yahoo.com> Hi all: the core OS services performance in any OS is critical good chips doesn't make things easier, lots of processing power (not modeled for Modula-3 language semantics) not good. see s. 29, 30: core, rt, lib, sal: http://web.yl.is.s.u-tokyo.ac.jp/meeting/doc/hamanaka010620.ppt If your core is slow then it will damage the performance of your applications. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: Re: [M3devel] Bare Metal Modula-3 Para: "Daniel Alejandro Benavides D." CC: "m3devel developers" Fecha: viernes, 4 de enero, 2013 20:26 My understanding of a RTOS is that is provides low-latency interrupt response and accurate timing. These are not my requirements. I'm using the ARM SoC because it provides a lot of processing power at low cost and low power, two important considerations when deploying large numbers of servers. On Jan 4, 2013, at 12:50 PM, Daniel Alejandro Benavides D. wrote: Hi all: You need realtime core services otherwise your system won't be efficient unless that's not what you want, it is to run Modula-3 applications, isn't it? If not, what's the point of your device? (e.g SPIN GC, etc) If you need a real-time core server in a networked implementation, you need a DRTOS. Thanks in advance PS: I don't see any response to Jay --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: Re: [M3devel] Bare Metal Modula-3 Para: "Daniel Alejandro Benavides D." CC: "m3devel developers" Fecha: viernes, 4 de enero, 2013 15:09 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament.? and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Sat Jan 5 01:45:27 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 16:45:27 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com>, <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> Message-ID: That's useful to know. It makes implementing memory allocation very straight forward. All I'd need to implement would be some calls for setting aside pages of memory and setting their read/write status, which would be directly supported by the hardware. It also occurs to me I'd have to write some sort of loader, which shouldn't be difficult as long as I can link the m3 program into some sort of monolithic "raw" format that I can just copy into a fixed place in memory and start executing. On Jan 4, 2013, at 4:36 PM, Jay K wrote: > Clarification regarding mmap. > > > mmap has two fairly different purposes in Posix. > > > 1) to "map a file" into memory > 2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size). > > #1 is the more obvious probably better known use. The one I knew of. The one it sounds like. > #2 is what we use it for. > > > If we ever autoconf-m3core, it'd probably be reasonable to do something like: > > > #if HAS_MMAP > return mmap(...); > > #elif HAS_CALLOC > > void** p = (void**)calloc(size + sizeof(void*)); > if (!p) return p; > p[0] = p; > return p + 1; > > #else > #error > #endif > > > #if HAS_MMAP > munmap(...); > > #elif HAS_CALLOC > > if (p) > free(((void**)p)[-1]); > > #endif > > > alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed. > Including assert(0) in places. > Invent your own value for "OS_TYPE". > > > Maybe > #define OS_TYPE_FOO > #include ../POSIX/Foo.c > > and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. > > > Sharing code can be good or bad. > > > We don't actually use "memory protection". > Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible. > This is nice. It might be required for "safety". > It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead. > More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. > > > > Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3. > You make a much different system, you get to do the port. > It is neither impossible nor a no-op. > > > - Jay > > > > > > From: darko at darko.org > Date: Fri, 4 Jan 2013 12:09:26 -0800 > To: dabenavidesd at yahoo.es > CC: m3devel at elegosoft.com > Subject: Re: [M3devel] Bare Metal Modula-3 > > It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. > > > On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: > > Hi all: > I think you just need runtime executive on top a machine would be enough. > For instance VAXELN. > Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). > Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. > I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: > http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor > > My hypothesis is that you can't bring up a realtime application in an embedded device like you want. > I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. > Thanks in advance > > > --- El vie, 4/1/13, Darko escribi?: > > De: Darko > Asunto: [M3devel] Bare Metal Modula-3 > Para: "m3devel developers" > Fecha: viernes, 4 de enero, 2013 04:16 > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > - Darko > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Sat Jan 5 09:24:00 2013 From: darko at darko.org (Darko) Date: Sat, 5 Jan 2013 00:24:00 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com>, <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> , Message-ID: <543B31C6-F239-46E4-96A5-446EC1565589@darko.org> That shouldn't be hard, there's a detailed guide here using GCC: http://www.state-machine.com/arm/Building_bare-metal_ARM_with_GNU.pdf Building an ARM cross compiler will be a bit more involved and although there don't seem to be any fundamental dependencies in the runtime I get the feeling separating the M3 minimalist portion from the OS dependent portion is going to be messy. On Jan 4, 2013, at 6:40 PM, Jay K wrote: > Get hello world running on your system first, written in C. Then get back to us. :) > Seriously. > > Ok, maybe not with stdio. > At least this: > > int main() > { > malloc(1); > return 0; > } > > > - Jay > > Subject: Re: [M3devel] Bare Metal Modula-3 > From: darko at darko.org > Date: Fri, 4 Jan 2013 16:45:27 -0800 > CC: m3devel at elegosoft.com > To: jay.krell at cornell.edu > > That's useful to know. It makes implementing memory allocation very straight forward. All I'd need to implement would be some calls for setting aside pages of memory and setting their read/write status, which would be directly supported by the hardware. > > It also occurs to me I'd have to write some sort of loader, which shouldn't be difficult as long as I can link the m3 program into some sort of monolithic "raw" format that I can just copy into a fixed place in memory and start executing. > > > > On Jan 4, 2013, at 4:36 PM, Jay K wrote: > > Clarification regarding mmap. > > > mmap has two fairly different purposes in Posix. > > > 1) to "map a file" into memory > 2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size). > > #1 is the more obvious probably better known use. The one I knew of. The one it sounds like. > #2 is what we use it for. > > > If we ever autoconf-m3core, it'd probably be reasonable to do something like: > > > #if HAS_MMAP > return mmap(...); > > #elif HAS_CALLOC > > void** p = (void**)calloc(size + sizeof(void*)); > if (!p) return p; > p[0] = p; > return p + 1; > > #else > #error > #endif > > > #if HAS_MMAP > munmap(...); > > #elif HAS_CALLOC > > if (p) > free(((void**)p)[-1]); > > #endif > > > alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed. > Including assert(0) in places. > Invent your own value for "OS_TYPE". > > > Maybe > #define OS_TYPE_FOO > #include ../POSIX/Foo.c > > and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. > > > Sharing code can be good or bad. > > > We don't actually use "memory protection". > Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible. > This is nice. It might be required for "safety". > It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead. > More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. > > > > Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3. > You make a much different system, you get to do the port. > It is neither impossible nor a no-op. > > > - Jay > > > > > > From: darko at darko.org > Date: Fri, 4 Jan 2013 12:09:26 -0800 > To: dabenavidesd at yahoo.es > CC: m3devel at elegosoft.com > Subject: Re: [M3devel] Bare Metal Modula-3 > > It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. > > > On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: > > Hi all: > I think you just need runtime executive on top a machine would be enough. > For instance VAXELN. > Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). > Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. > I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: > http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor > > My hypothesis is that you can't bring up a realtime application in an embedded device like you want. > I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. > Thanks in advance > > > --- El vie, 4/1/13, Darko escribi?: > > De: Darko > Asunto: [M3devel] Bare Metal Modula-3 > Para: "m3devel developers" > Fecha: viernes, 4 de enero, 2013 04:16 > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > - Darko > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Sat Jan 5 19:15:20 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Sat, 5 Jan 2013 18:15:20 +0000 (GMT) Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <543B31C6-F239-46E4-96A5-446EC1565589@darko.org> Message-ID: <1357409720.1464.YahooMailClassic@web133102.mail.ir2.yahoo.com> Hi all: the core services as here explained must be maintained CPU and memory management regardless of any other tasks, I don't think even Gnu/Linux is capable of doing this today: http://www.poppyfields.net/acorn/news/acopress/97-02-10b.shtml Core services independent of platform are the top part to maintain available during updates over network, interesting service. ?I would use their RT rather than CM3, which is nice but not for embedded OS kernel, certainly. Never released guess why? Thanks in advance --- El s?b, 5/1/13, Darko escribi?: De: Darko Asunto: Re: [M3devel] Bare Metal Modula-3 Para: "Jay K" CC: "m3devel" Fecha: s?bado, 5 de enero, 2013 03:24 That shouldn't be hard, there's a detailed guide here using GCC: http://www.state-machine.com/arm/Building_bare-metal_ARM_with_GNU.pdf Building an ARM cross compiler will be a bit more involved and although there don't seem to be any fundamental dependencies in the runtime I get the feeling separating the M3 minimalist portion from the OS dependent portion is going to be messy.? On Jan 4, 2013, at 6:40 PM, Jay K wrote: Get hello world running on your system first, written in C. Then?get back to us. :) Seriously. ? Ok, maybe not with stdio. At least this: ? int main() { ?malloc(1); ?return 0; } ? ? ?- Jay ? Subject: Re: [M3devel] Bare Metal Modula-3 From:?darko at darko.org Date: Fri, 4 Jan 2013 16:45:27 -0800 CC:?m3devel at elegosoft.com To:?jay.krell at cornell.edu That's useful to know. It makes implementing memory allocation very straight forward. All I'd need to implement would be some calls for setting aside pages of memory and setting their read/write status, which would be directly supported by the hardware. It also occurs to me I'd have to write some sort of loader, which shouldn't be difficult as long as I can link the m3 program into some sort of monolithic "raw" format that I can just copy into a fixed place in memory and start executing. On Jan 4, 2013, at 4:36 PM, Jay K wrote: Clarification?regarding mmap. ? ? mmap has two fairly?different purposes in Posix. ? ? ?1) to "map a file" into memory? ?2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size).?? ? ??#1 is the more obvious probably better known use.?The one I knew of. The one it sounds like.? ??#2 is what we use it for.?? ? ? If we ever autoconf-m3core, it'd probably be reasonable to do something like: ? ? #if HAS_MMAP return mmap(...); ? #elif HAS_CALLOC ? void** p = (void**)calloc(size + sizeof(void*)); if (!p) return p; p[0] = p; return p + 1; ? #else #error #endif ? ? #if HAS_MMAP munmap(...); ? #elif HAS_CALLOC ? if (p) ? free(((void**)p)[-1]); ? #endif ? ? alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed. Including assert(0) in places. Invent your own value for "OS_TYPE". ? ? Maybe ?#define OS_TYPE_FOO? ?#include ../POSIX/Foo.c? ? and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. ? ? Sharing code can be good or bad. ? ? We don't actually use "memory protection". Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible. This is nice. It might be required for "safety". It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead. More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. ? ? ? Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3. You make a much different system, you get to do the port. It is neither impossible nor a no-op. ? ? ?- Jay ? From:?darko at darko.org Date: Fri, 4 Jan 2013 12:09:26 -0800 To:?dabenavidesd at yahoo.es CC:?m3devel at elegosoft.com Subject: Re: [M3devel] Bare Metal Modula-3 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN.? Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament.? and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El?vie, 4/1/13, Darko??escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware.? The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Wed Jan 9 07:46:00 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 9 Jan 2013 06:46:00 +0000 Subject: [M3devel] thouhts on -Wall with C backend output In-Reply-To: <20121217074935.5DD971A2094@async.async.caltech.edu> References: , , <20121216184306.GA29473@topoi.pooq.com>, , <20121216185529.AD9681A2094@async.async.caltech.edu>, , <20121217074935.5DD971A2094@async.async.caltech.edu> Message-ID: I'm going with "gcc -Wno-return-type " for now. Alas. I put in "default:assert(!"case_jump hit default") for case_jumps, but of coursethat doesn't help. If/when I make the C backend even more sophisticated, I'll detectlabel:;} // end of non-void function and change it to:label:assert(!"control reaches end of non-void function");} // end of non-void function This level of sophistication is basically to run the last pass multiple times, suppressing some/most logic/code, esp. the prints on all but the last pass. The other passes, so far, have been useful in that they run over a subset of operations, and leavefewer for the last pass to deal with. Hm. I do have "op_index", so at end of function, I might be able to just look back one operation for the set_label. But that wouldn't detect:label: a = b;} // end of function maybe that never occurs. I also can't likely just put the assert at the end of every non-void function. 1) it bloats the code a bit 2) it would be usually unreachable. I'm not even sure gcc wouldn't complain here about reachability...except..I already omit unused labels, so I know this label is branched to... anyway..later... - Jay > To: jay.krell at cornell.edu > Date: Sun, 16 Dec 2012 23:49:35 -0800 > From: mika at async.caltech.edu > CC: m3devel at elegosoft.com > Subject: Re: [M3devel] thouhts on -Wall with C backend output > > Yeah it sounds like the frontend knows something that it's not telling > the backend about... if I am reading your emails right. > > Jay K writes: > >--_ad389312-f922-410e-bb8f-e7106388428f_ > >Content-Type: text/plain; charset="Windows-1252" > >Content-Transfer-Encoding: quoted-printable > > > > > >drat=2C these are worse: > > > >"../src/Macro.m3"=2C line 949: warning: unreachable ELSE in TYPECASE > > > > > >=3D=3D package /Users/jay/dev2/cm3/m3-ui/formsvbt =3D=3D > > > > +++ /cm3/bin/cm3 -build -DROOT=3D/Users/jay/dev2/cm3 +++ > >--- building in AMD64_DARWIN --- > > > >ignoring ../src/m3overrides > > > >new source -> compiling Macro.m3 > >cc1plus: warnings being treated as errors > >Macro.mc.c: In function =91char* Macro__EvalLength(char*=2C char*)=92: > >Macro.mc.c:5271: warning: control reaches end of non-void function > >Macro.mc.c: In function =91char* Macro__EvalPlus(char*=2C char*)=92: > >Macro.mc.c:9004: warning: control reaches end of non-void function > >Macro.mc.c: In function =91char* Macro__EvalMinus(char*=2C char*)=92: > >Macro.mc.c:9468: warning: control reaches end of non-void function > > > > > >If I put in the somewhat obvious: > > > > > > ELSE <* ASSERT FALSE *> > > > > > >then: > > > >new source -> compiling Macro.m3 > >"../src/Macro.m3"=2C line 949: warning: unreachable ELSE in TYPECASE > >1 warning encountered > >cc1plus: warnings being treated as errors > >Macro.mc.c: In function =91char* Macro__EvalLength(char*=2C char*)=92: > >Macro.mc.c:5271: warning: control reaches end of non-void function > >Macro.mc.c: In function =91char* Macro__EvalPlus(char*=2C char*)=92: > >Macro.mc.c:9004: warning: control reaches end of non-void function > > > > > > > >For stablegen=2C I am inclined to put in that ELSE <* ASSERT FALSE *>. > > > > > >I might might might be able to put in C assert(false) in these places. > > > > - Jay > > > > > >> To: hendrik at topoi.pooq.com > >> Date: Sun=2C 16 Dec 2012 10:55:29 -0800 > >> From: mika at async.caltech.edu > >> CC: m3devel at elegosoft.com > >> Subject: Re: [M3devel] thouhts on -Wall with C backend output > >>=20 > >> Can you have an option to add an assertion in the output for these cases? > >>=20 > >> Here either > >>=20 > >> 1. gcc has found a bug in the C code generator and/or front end=2C in tha= > >t > >> there's no default (abortion) case > >>=20 > >> or > >>=20 > >> 2. the front end has deduced there is no need for abortion because it can > >> see that the missing ELSE is never going to be exercised=2C based on t= > >he > >> already existing type information > >>=20 > >> What I'm proposing is two modes for the compiler: > >>=20 > >> -- ignore the errors > >>=20 > >> or > >>=20 > >> -- add proper assertions to the C code=2C e.g.=2C=20 > >>=20 > >> assert(false=2C "front-end deduced this cant happen by inspecting typ= > >e information") > >>=20 > >> which=2C when enabled=2C should make gcc shut up=2C and instead turn i= > >nto > >> runtime checks on the compiler > >>=20 > >> Mika > >>=20 > >> Hendrik Boom writes: > >> >On Sun=2C Dec 16=2C 2012 at 09:58:10AM +0000=2C Jay K wrote: > >> >>=20 > >> >> I've tried to generate "very good C". > >> >> I've fixed some of what gcc -Wall complains about. > >> >> For default gcc on my old MacBook -- old enough that it can still emul= > >ate PowerPC=2C gcc is 4.0.1. > >> >> (at least one of what I deal with=2C I think anything newer won't comp= > >lain..) > >> >>=20 > >> >>=20 > >> >>=20 > >> >> do-cm3-all with -Wall -Werror gets very far=2C to: > >> >>=20 > >> >> =3D=3D package /Users/jay/dev2/cm3/m3-db/stablegen =3D=3D > >> >>=20 > >> >> +++ /cm3/bin/cm3 -build -DROOT=3D/Users/jay/dev2/cm3 +++ > >> >> --- building in AMD64_DARWIN --- > >> >>=20 > >> >> ignoring ../src/m3overrides > >> >>=20 > >> >> w source -> compiling GenCode.m3 > >> >> cc1: warnings being treated as errors > >> >> GenCode.mc.c: In function =91GenCode__BuildMethods__Search=92: > >> >> GenCode.mc.c:3505: warning: control reaches end of non-void function > >> >> m3_backend =3D> 1 > >> >>=20 > >> >> PROCEDURE Search ( type : Type.Reference=3B > >> >> VAR count : INTEGER=3B > >> >> VAR top : CARDINAL=3B > >> >> umethods: AtomList.T ): > >> >> ImportList.MethodList RAISES {StablegenError.E} =3D > >> >> VAR methods: ImportList.MethodList=3B > >> >> BEGIN > >> >> IF (type =3D Type.root) OR (type =3D NIL) THEN (* base of > >> >> recursion *) > >> >> RETURN NEW(ImportList.MethodList=2C ABS(count)) > >> >> ELSE > >> >> TYPECASE type OF > >> >> Type.Object (ob) =3D>=20 > >> >> IF count <=3D 0 THEN > >> >> count:=3D count - NUMBER(ob.methods^) > >> >> END=3B > >> >> methods :=3D Search(ob.super=2C count=2C top=2C umethods)=3B > >> >> FOR i :=3D 0 TO LAST(ob.methods^) DO > >> >> IF umethods =3D NIL > >> >> OR AtomList.Member( > >> >> umethods=2C ob.methods[i].name) THEN > >> >> IF AtomList.Member(reserved=2C ob.methods[i].name) THEN > >> >> RAISE StablegenError.E(Atom.ToText(ob.methods[i].name) > >> >> &" is a reserved method name in stable objects. " > >> >> &"Must not be an update method.") > >> >> END=3B > >> >> methods[top].name :=3D ob.methods[i].name=3B > >> >> methods[top].sig :=3D ob.methods[i].sig=3B > >> >> INC(top) > >> >> END > >> >> END=3B > >> >> RETURN methods > >> >> | Type.Opaque (op) =3D> > >> >> RETURN Search(op.revealedSuperType=2C count=2C top=2C umetho= > >ds) > >> >> | Type.Reference =3D> <*ASSERT FALSE*> > >> >> END > >> >> END > >> >> END Search=3B > >> >>=20 > >> >> I think we can't expect gcc -Wall -Werror to pass. > >> >> I really wanted it to=2C and I tried=2C and I fixed stuff. > >> >> But I don't think it is viable. > >> >> Ok? > >> > > >> >Could it be that the TYPECASE doesn't have an ELSE clause=2C possibly > >> >translated to a switch withouy a default: label? This would give the > >> >C code an apparent path to the end of the function. M3 may know that > >> >the TYPECASE exhausts all the possibilities=2C but C will not. > >> > > >> >-- hendrik > > = > > > >--_ad389312-f922-410e-bb8f-e7106388428f_ > >Content-Type: text/html; charset="Windows-1252" > >Content-Transfer-Encoding: quoted-printable > > > > > > > > > >
> >drat=2C these are worse:

"../src/Macro.m3"=2C line 949: warning: unr= > >eachable ELSE in TYPECASE


=3D=3D package /Users/jay/dev2/cm3/m3-= > >ui/formsvbt =3D=3D

 =3B+++ /cm3/bin/cm3 =3B =3B =3B = > >-build -DROOT=3D/Users/jay/dev2/cm3 +++
--- building in AMD64_DARWIN ---= > >

ignoring ../src/m3overrides

new source ->=3B compiling Mac= > >ro.m3
cc1plus: warnings being treated as errors
Macro.mc.c: In functi= > >on =91char* Macro__EvalLength(char*=2C char*)=92:
Macro.mc.c:5271: warni= > >ng: control reaches end of non-void function
Macro.mc.c: In function =91= > >char* Macro__EvalPlus(char*=2C char*)=92:
Macro.mc.c:9004: warning: cont= > >rol reaches end of non-void function
Macro.mc.c: In function =91char* Ma= > >cro__EvalMinus(char*=2C char*)=92:
Macro.mc.c:9468: warning: control rea= > >ches end of non-void function


If I put in the somewhat obvious:<= > >br>

 =3B =3B =3B ELSE <=3B* ASSERT FALSE *>=3B
>r>
then:

new source ->=3B compiling Macro.m3
"../src/Macro.m= > >3"=2C line 949: warning: unreachable ELSE in TYPECASE
1 warning encounte= > >red
cc1plus: warnings being treated as errors
Macro.mc.c: In function= > > =91char* Macro__EvalLength(char*=2C char*)=92:
Macro.mc.c:5271: warning= > >: control reaches end of non-void function
Macro.mc.c: In function =91ch= > >ar* Macro__EvalPlus(char*=2C char*)=92:
Macro.mc.c:9004: warning: contro= > >l reaches end of non-void function



For stablegen=2C I am inc= > >lined to put in that ELSE <=3B* ASSERT FALSE *>=3B.


I might = > >might might be able to put in C assert(false) in these places.

 = > >=3B- Jay


>=3B To: h= > >endrik at topoi.pooq.com
>=3B Date: Sun=2C 16 Dec 2012 10:55:29 -0800
= > >>=3B From: mika at async.caltech.edu
>=3B CC: m3devel at elegosoft.com
= > >>=3B Subject: Re: [M3devel] thouhts on -Wall with C backend output
>= > >=3B
>=3B Can you have an option to add an assertion in the output for= > > these cases?
>=3B
>=3B Here either
>=3B
>=3B 1. gcc = > >has found a bug in the C code generator and/or front end=2C in that
>= > >=3B there's no default (abortion) case
>=3B
>=3B or
>=3B= > >
>=3B 2. the front end has deduced there is no need for abortion beca= > >use it can
>=3B see that the missing ELSE is never going to be exer= > >cised=2C based on the
>=3B already existing type information
>= > >=3B
>=3B What I'm proposing is two modes for the compiler:
>=3B = > >
>=3B -- ignore the errors
>=3B
>=3B or
>=3B
>= > >=3B -- add proper assertions to the C code=2C e.g.=2C
>=3B
>=3B= > > assert(false=2C "front-end deduced this cant happen by inspecting type= > > information")
>=3B
>=3B which=2C when enabled=2C should make= > > gcc shut up=2C and instead turn into
>=3B runtime checks on the co= > >mpiler
>=3B
>=3B Mika
>=3B
>=3B Hendrik Boom wr= > >ites:
>=3B >=3BOn Sun=2C Dec 16=2C 2012 at 09:58:10AM +0000=2C Jay K= > > wrote:
>=3B >=3B>=3B
>=3B >=3B>=3B I've tried to genera= > >te "very good C".
>=3B >=3B>=3B I've fixed some of what gcc -Wall = > >complains about.
>=3B >=3B>=3B For default gcc on my old MacBook -= > >- old enough that it can still emulate PowerPC=2C gcc is 4.0.1.
>=3B &= > >gt=3B>=3B (at least one of what I deal with=2C I think anything newer won= > >'t complain..)
>=3B >=3B>=3B
>=3B >=3B>=3B
>=3B &g= > >t=3B>=3B
>=3B >=3B>=3B do-cm3-all with -Wall -Werror gets very = > >far=2C to:
>=3B >=3B>=3B
>=3B >=3B>=3B =3D=3D package /U= > >sers/jay/dev2/cm3/m3-db/stablegen =3D=3D
>=3B >=3B>=3B
>=3B = > >>=3B>=3B +++ /cm3/bin/cm3 -build -DROOT=3D/Users/jay/dev2/cm3 +++ >r>>=3B >=3B>=3B --- building in AMD64_DARWIN ---
>=3B >=3B>= > >=3B
>=3B >=3B>=3B ignoring ../src/m3overrides
>=3B >=3B>= > >=3B
>=3B >=3B>=3B w source ->=3B compiling GenCode.m3
>=3B= > > >=3B>=3B cc1: warnings being treated as errors
>=3B >=3B>=3B = > >GenCode.mc.c: In function =91GenCode__BuildMethods__Search=92:
>=3B &g= > >t=3B>=3B GenCode.mc.c:3505: warning: control reaches end of non-void func= > >tion
>=3B >=3B>=3B m3_backend =3D>=3B 1
>=3B >=3B>=3B= > >
>=3B >=3B>=3B PROCEDURE Search ( type : Type.Reference= > >=3B
>=3B >=3B>=3B VAR count : INTEGER=3B
= > >>=3B >=3B>=3B VAR top : CARDINAL=3B
>=3B= > > >=3B>=3B umethods: AtomList.T ):
>=3B &= > >gt=3B>=3B ImportList.MethodList RAISES {StablegenError.E} =3D
>= > >=3B >=3B>=3B VAR methods: ImportList.MethodList=3B
>=3B >=3B= > >>=3B BEGIN
>=3B >=3B>=3B IF (type =3D Type.root) OR (t= > >ype =3D NIL) THEN (* base of
>=3B >=3B>=3B = > > recursion *)
>=3B >=3B>=3B RE= > >TURN NEW(ImportList.MethodList=2C ABS(count))
>=3B >=3B>=3B = > >ELSE
>=3B >=3B>=3B TYPECASE type OF
>=3B >=3B>=3B = > > Type.Object (ob) =3D>=3B
>=3B >=3B>=3B IF coun= > >t <=3B=3D 0 THEN
>=3B >=3B>=3B count:=3D count - NUM= > >BER(ob.methods^)
>=3B >=3B>=3B END=3B
>=3B >=3B&g= > >t=3B methods :=3D Search(ob.super=2C count=2C top=2C umethods)=3B= > >
>=3B >=3B>=3B FOR i :=3D 0 TO LAST(ob.methods^) DO
&= > >gt=3B >=3B>=3B IF umethods =3D NIL
>=3B >=3B>=3B = > > OR AtomList.Member(
>=3B >=3B>=3B = > > umethods=2C ob.methods[i].name) THEN
>=3B >=3B>=3B = > > IF AtomList.Member(reserved=2C ob.methods[i].name) THEN
>=3B >=3B&g= > >t=3B RAISE StablegenError.E(Atom.ToText(ob.methods[i].name)= > >
>=3B >=3B>=3B &=3B" is a reserved method name = > >in stable objects. "
>=3B >=3B>=3B &=3B"Must no= > >t be an update method.")
>=3B >=3B>=3B END=3B
>= > >=3B >=3B>=3B methods[top].name :=3D ob.methods[i].name=3B= > >
>=3B >=3B>=3B methods[top].sig :=3D ob.methods[i].s= > >ig=3B
>=3B >=3B>=3B INC(top)
>=3B >=3B>=3B = > > END
>=3B >=3B>=3B END=3B
>=3B >=3B>= > >=3B RETURN methods
>=3B >=3B>=3B | Type.Opaque (= > >op) =3D>=3B
>=3B >=3B>=3B RETURN Search(op.revealedSup= > >erType=2C count=2C top=2C umethods)
>=3B >=3B>=3B | Type.R= > >eference =3D>=3B <=3B*ASSERT FALSE*>=3B
>=3B >=3B>=3B = > > END
>=3B >=3B>=3B END
>=3B >=3B>=3B END Searc= > >h=3B
>=3B >=3B>=3B
>=3B >=3B>=3B I think we can't expect= > > gcc -Wall -Werror to pass.
>=3B >=3B>=3B I really wanted it to=2C= > > and I tried=2C and I fixed stuff.
>=3B >=3B>=3B But I don't think= > > it is viable.
>=3B >=3B>=3B Ok?
>=3B >=3B
>=3B >=3B= > >Could it be that the TYPECASE doesn't have an ELSE clause=2C possibly
&= > >gt=3B >=3Btranslated to a switch withouy a default: label? This would gi= > >ve the
>=3B >=3BC code an apparent path to the end of the function. = > > M3 may know that
>=3B >=3Bthe TYPECASE exhausts all the possibiliti= > >es=2C but C will not.
>=3B >=3B
>=3B >=3B-- hendrik
= > >
> >= > > > >--_ad389312-f922-410e-bb8f-e7106388428f_-- -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Wed Jan 9 07:53:49 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 9 Jan 2013 06:53:49 +0000 Subject: [M3devel] time to introduce C mode to builder? Message-ID: So..in our config files..I have this fairly reasonable autoconf-ish logic: if not equal(try_exec("@" & SYSTEM_CC & m & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: invalid option \\\`32'\" >/dev/null"), 0) SYSTEM_CC = SYSTEM_CC & m SYSTEM_CC_ASM = SYSTEM_CC_ASM & m end if not equal(try_exec("@" & SYSTEM_CC & arch & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: unrecognized command line option \\\\\"-arch\\\\\"\" >/dev/null"), 0) SYSTEM_CC = SYSTEM_CC & arch SYSTEM_CC_ASM = SYSTEM_CC_ASM & arch end It is detecting if gcc understands switches like -m32, -m64, -arch ppc, etc.By fgreping error messages.If gcc is localized, it might be wrong. This is fairly reasonable without a C backend, as the C compiler is used relatively few times.It is used as the linker, and if the directory has any C code.It is used a maximum of once per cm3 invocation. Now, currently I'm using m3cgcat, per file, and it reuses this code (good!)So instead of doing the autoconf-ish logic zero or one times per directory, I'm doing it n times per directory, for fairly large n. (i.e. per source file) I could, you know, hardcode the switches, or introduce a "setup" phase for users.. However, to "kill two birds with one stone", can I go ahead and introduce a "C" mode to the "builder"?You know, we have 4 modes: integrated backend generates assembly integrated backend generates object files external backend generates assembly external backend generates object files (We only use two of them.) I'd like to introduce: integrated backend generates C files (with no clear distinction currently between C and C++; the code tries to be valid for either, but eventually we'll probably want to generate C++ for exception handling). I implemented this months ago and showed the diffs here. This is one of the steps necessary before rolling out the C mode broadly (along with making sure it works with many existing targets, and adding new targets that use it, i.e. AMD64_NT). Thanks, - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Wed Jan 9 17:30:47 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Wed, 9 Jan 2013 16:30:47 +0000 (GMT) Subject: [M3devel] time to introduce C mode to builder? In-Reply-To: Message-ID: <1357749047.85558.YahooMailClassic@web133106.mail.ir2.yahoo.com> Hi all: Jay, besides writing another backend why not ask ex-DEC-SRC about their internal C- generating backend: http://computer-programming-forum.com/27-modula2/4637e2c4a0349465.htm Thanks in advance --- El mi?, 9/1/13, Jay K escribi?: De: Jay K Asunto: [M3devel] time to introduce C mode to builder? Para: "m3devel" Fecha: mi?rcoles, 9 de enero, 2013 01:53 So..in our config files..I have this fairly reasonable autoconf-ish logic: ? if not equal(try_exec("@" & SYSTEM_CC & m & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: invalid option \\\`32'\" >/dev/null"), 0)? ? SYSTEM_CC = SYSTEM_CC & m? ? SYSTEM_CC_ASM = SYSTEM_CC_ASM & m? end? if not equal(try_exec("@" & SYSTEM_CC & arch & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: unrecognized command line option \\\\\"-arch\\\\\"\" >/dev/null"), 0)? ? SYSTEM_CC = SYSTEM_CC & arch? ? SYSTEM_CC_ASM = SYSTEM_CC_ASM & arch? end It is detecting if gcc understands switches like -m32, -m64, -arch ppc, etc.By fgreping error messages.If gcc is localized, it might be wrong. This is fairly reasonable without a C backend, as the C compiler is used relatively few times.It is used as the linker, and if the directory has any C code.It is used a maximum of once per cm3 invocation. Now, currently I'm using m3cgcat, per file, and it reuses this code (good!)So instead of doing the autoconf-ish logic zero or one times per directory, I'm doing it n times per directory, for fairly large n. (i.e. per source file) I could, you know, hardcode the switches, or introduce a "setup" phase for users.. However, to "kill two birds with one stone", can I go ahead and introduce a "C" mode to the "builder"?You know, we have 4 modes:?integrated backend generates assembly??integrated backend generates object files ??external backend generates assembly??external?backend generates object files? (We only use two of them.) I'd like to introduce:?integrated backend generates C files (with no clear distinction currently between C and C++; the code tries to be valid for either, but eventually we'll probably want to generate C++ for exception handling). I implemented this months ago and showed the diffs here. This is one of the steps necessary before rolling out the C mode broadly (along with making sure it works with many existing targets, and adding new targets that use it, i.e. AMD64_NT). Thanks,?- Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From hendrik at topoi.pooq.com Thu Jan 10 02:23:50 2013 From: hendrik at topoi.pooq.com (Hendrik Boom) Date: Wed, 9 Jan 2013 20:23:50 -0500 Subject: [M3devel] time to introduce C mode to builder? In-Reply-To: References: Message-ID: <20130110012350.GA27496@topoi.pooq.com> On Wed, Jan 09, 2013 at 06:53:49AM +0000, Jay K wrote: > > It is detecting if gcc understands switches like -m32, -m64, -arch ppc, etc.By fgreping error messages.If gcc is localized, it might be wrong. You could try explicitly setting $ENV to C during the calls to SYSTEM_CC in order to standardise the messages. -- hendrik From hosking at cs.purdue.edu Wed Jan 9 22:25:27 2013 From: hosking at cs.purdue.edu (Antony Hosking) Date: Thu, 10 Jan 2013 08:25:27 +1100 Subject: [M3devel] time to introduce C mode to builder? In-Reply-To: References: Message-ID: Yes, sure. Antony Hosking | Associate Professor | Computer Science | Purdue University 305 N. University Street | West Lafayette | IN 47907 | USA Mobile +1 765 427 5484 On Jan 9, 2013, at 5:53 PM, Jay K wrote: > So..in our config files..I have this fairly reasonable autoconf-ish logic: > > > if not equal(try_exec("@" & SYSTEM_CC & m & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: invalid option \\\`32'\" >/dev/null"), 0) > SYSTEM_CC = SYSTEM_CC & m > SYSTEM_CC_ASM = SYSTEM_CC_ASM & m > end > if not equal(try_exec("@" & SYSTEM_CC & arch & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: unrecognized command line option \\\\\"-arch\\\\\"\" >/dev/null"), 0) > SYSTEM_CC = SYSTEM_CC & arch > SYSTEM_CC_ASM = SYSTEM_CC_ASM & arch > end > > > It is detecting if gcc understands switches like -m32, -m64, -arch ppc, etc. > By fgreping error messages. > If gcc is localized, it might be wrong. > > > This is fairly reasonable without a C backend, as the C compiler is used relatively few times. > It is used as the linker, and if the directory has any C code. > It is used a maximum of once per cm3 invocation. > > > Now, currently I'm using m3cgcat, per file, and it reuses this code (good!) > So instead of doing the autoconf-ish logic zero or one times per directory, I'm doing it n times per directory, for fairly large n. (i.e. per source file) > > > I could, you know, hardcode the switches, or introduce a "setup" phase for users. > . > > However, to "kill two birds with one stone", can I go ahead and introduce a "C" mode to the "builder"? > You know, we have 4 modes: > integrated backend generates assembly > integrated backend generates object files > external backend generates assembly > external backend generates object files > > > (We only use two of them.) > > > I'd like to introduce: > integrated backend generates C files (with no clear distinction currently between C and C++; the code tries to be valid for either, but eventually we'll probably want to generate C++ for exception handling). > > > I implemented this months ago and showed the diffs here. > > > This is one of the steps necessary before rolling out the C mode broadly (along with making sure it works with many existing targets, and adding new targets that use it, i.e. AMD64_NT). > > > Thanks, > - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Sun Jan 13 19:26:44 2013 From: jay.krell at cornell.edu (Jay) Date: Sun, 13 Jan 2013 10:26:44 -0800 Subject: [M3devel] Fwd: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 References: <50EF35B2.8050003@FreeBSD.org> Message-ID: <7CCADA27-2C42-4431-8D7E-11923D4F63C0@gmail.com> Declining use of CVS, CVSup, csup: Begin forwarded message: > From: Beat Gaetzi > Date: January 10, 2013, 1:42:10 PM PST > To: , > Subject: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 > > Hi, > > As announced in September the ports tree will no longer be exported to > CVS after February 28th 2013. All users who still use CVS, CVSup or csup > to update the ports tree are encouraged to switch to portsnap(8) or for > users which need more control over their ports collection to use > Subversion directly [1]. > > A migration guide from CVSup/csup to portsnap is also available in the > FreeBSD handbook [2]. > > More information regarding the end of ports CVS can be found in the > initial announcement [3]. > > Beat, on behalf of portmgr@ > > [1] > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html > [2] > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html#cvsup-migration > [3] > http://lists.freebsd.org/pipermail/freebsd-announce/2012-September/001435.html > _______________________________________________ > freebsd-announce at freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-announce > To unsubscribe, send any mail to "freebsd-announce-unsubscribe at freebsd.org" -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Mon Jan 14 04:31:15 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Mon, 14 Jan 2013 03:31:15 +0000 (GMT) Subject: [M3devel] Fwd: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 In-Reply-To: <7CCADA27-2C42-4431-8D7E-11923D4F63C0@gmail.com> Message-ID: <1358134275.67070.YahooMailClassic@web133102.mail.ir2.yahoo.com> Hi all: http://freebsd.1045724.n5.nabble.com/Cvsup-amp-cvsupd-on-Linux-td5739101.html It might been some problem in mailing list?, but I don't think they regret so, they weren't using it actively since 2008 switch over rsync. Anyway, we didn't solve the thread issue in which CVsupd stalled, and apparently didn't want us to solve it. What could we do? Thanks in advance --- El dom, 13/1/13, Jay escribi?: De: Jay Asunto: [M3devel] Fwd: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 Para: "m3devel" Fecha: domingo, 13 de enero, 2013 13:26 Declining use of CVS, CVSup, csup: Begin forwarded message: From: Beat Gaetzi Date: January 10, 2013, 1:42:10 PM PST To: , Subject: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 Hi, As announced in September the ports tree will no longer be exported to CVS after February 28th 2013. All users who still use CVS, CVSup or csup to update the ports tree are encouraged to switch to portsnap(8) or for users which need more control over their ports collection to use Subversion directly [1]. A migration guide from CVSup/csup to portsnap is also available in the FreeBSD handbook [2]. More information regarding the end of ports CVS can be found in the initial announcement [3]. Beat, on behalf of portmgr@ [1] http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html [2] http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html#cvsup-migration [3] http://lists.freebsd.org/pipermail/freebsd-announce/2012-September/001435.html _______________________________________________ freebsd-announce at freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-announce To unsubscribe, send any mail to "freebsd-announce-unsubscribe at freebsd.org" -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Mon Jan 14 23:08:13 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Mon, 14 Jan 2013 22:08:13 +0000 (GMT) Subject: [M3devel] About next release source, pre-built, pre-processor based ? Message-ID: <1358201293.55352.YahooMailClassic@web133103.mail.ir2.yahoo.com> Hi all: Does anybody knows what gonna be next release based on, or have any thoughts on its distribution form? This is because I want to talk about some language annotation mechanism idea in form of pragmas for memory accountability for possible small sized memory targets like embedded processors, any thoughts. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.anderson at elego.de Tue Jan 22 14:04:31 2013 From: michael.anderson at elego.de (Michael Anderson) Date: Tue, 22 Jan 2013 14:04:31 +0100 Subject: [M3devel] [ Message-ID: <50FE8E5F.1080606@elego.de> Hello Modula3 Users and Developers, As you may have noticed, our server birch.elego.de was down for most of the day yesterday due to hardware failure. As a full restore from backup was necessary, we decided to virtualize the system and move it to a more powerful server. As a result, the IP address has changed, and SSH users will receive a warning upon connecting, and will need to remove the corresponding entry for birch.elego.de in their ~/.ssh/known_hosts file. Please note that we are still in the process of restoring the cm3 package archive, so there may be broken links on the website until everything is uploaded. The cm3 cvs repository has been completely restored and is available for use. Please contact me directly at if you have any questions or experience problems with the new system. Michael Anderson -- Michael Anderson IT Services & Support elego Software Solutions GmbH Gustav-Meyer-Allee 25 Building 12.3 (BIG) room 227 13355 Berlin, Germany phone +49 30 23 45 86 96 michael.anderson at elegosoft.com fax +49 30 23 45 86 95 http://www.elegosoft.com Geschaeftsfuehrer: Olaf Wagner, Sitz Berlin Amtsgericht Berlin-Charlottenburg, HRB 77719, USt-IdNr: DE163214194 From jay.krell at cornell.edu Mon Jan 28 07:22:53 2013 From: jay.krell at cornell.edu (Jay K) Date: Mon, 28 Jan 2013 06:22:53 +0000 Subject: [M3devel] probing existance of C backend in config/quake Message-ID: I maintain (and they are checked in and used) "one" set of config files that are meant to work with a variety of old and new releases. The "upgrade" process, i.e. in Tinderbox/Hudon, does not necessarily do things this way -- they have old config files that go with old compilers, and only try to use the current version with current compilers. For these purposes however, I desire, like: M3Build.m3: Builtins = ARRAY OF Builtin { (*------------------------------------------------- feature/version probes --*) Builtin {"HasCBackend", HasCBackend, 0, TRUE }, ... (*------------------------------------------------- feature/version probes --*) PROCEDURE HasCBackend (m: QMachine.T; <*UNUSED*> n_args: INTEGER) RAISES {Quake.Error} = VAR t := Self (m); BEGIN PushBool (t, TRUE); END HasCBackend; so config file can use the old mode "3" gcc backend if there is no C backend. ok? Thanks, - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Mon Jan 28 07:44:29 2013 From: jay.krell at cornell.edu (Jay K) Date: Mon, 28 Jan 2013 06:44:29 +0000 Subject: [M3devel] generating target-independent C in backend? Message-ID: Currently the C output is target-specific. I want to generate one set of C output for all platforms. So you just download one portable "m3.tar.gz". Is there agreement on this goal? Others might help? And no generally object to my changes to make it so? Here are the obstacles to getting there as I understand: win32 vs. posix (or more generally, logic on the m3makefile's that change what source is compiled) jmpbuf size endian word size/layout I believe the "layout rules" (padding/alignment) are now fairly target independent, EXCEPT that endianness and word size vary. That is, interop with C has been compromised. jmpbuf size is probably the easiest to fix. In the near term, solve it like I already tried. change jmpbuf x to void*x = 0; x = x ? x : alloca(sizeof_jmpbuf); contants.c #include extern const size_t sizeof_jmpbuf = sizeof(jmpbuf) (plus possible Cygwin hack -- they accidentally blow up the size by a factor of 4) long term: generate C++ and no more setjmp/longjmp, or possibly C on OpenVMS, Tru64, and NT, possibly #ifdefed Endianness is partly solved by moving the "floating point cracking" code to C. But that doesn't suffice. There remain bitfields in the runtime, I don't think they can/should be removed, and their layout is endian-specific. Maybe we can just change layout to not be endian specific? I don't care to enable or keep working interop with C bitfields. win32 vs. posix (also pthreads vs. user threads) requires "something" in the "builder", interacting with the backend perhaps, or with bootstrapping Basically whenever there is an "if" in quake, you kind of need to go down both paths, but communicate the condition to the next level down. Like if we had FooPosix.m3 and FooWin32.m3 we either want both FooPosix.c and FooWin32.c generated and we'll only compile one of them, or Foo.m3 with both contents concatenated but with an #if/#else/#endif between them. But what if we had FooWin32.i3 and FooPosix.i3? We can't let FooPosix.i3 be fixible BarWin32.m3. Like, we want to compile everything to C, but not otherwise "infect" the compilation system with the conceptual output. Does that make sense? The layout problem is tricky. We need separate notions in the backend for UINT32, UINT64, and size_t; and INT32, INT64, and ptrdiff_t (INTEGER). We can't have the frontend resolve to a specific size, at least not without maintaining some notion of the abstraction that the backend sees. The existing typeids might suffice. As well, records/fields have to treated differently, or in an extra way. That is, we can pass computed sizes and offsets to the backend, and we'd also have to pass other information, and the backend could chose which to use. A reasonably easy approach is to pass a list of integers to add up and maybe multiple, and besides the obvious 1, 2, 4, 8, there'd also be stand-in values for "size_t", like maybe -1. This might be deducable from the declarations we have about arrays and records. It is also tempting to give up on the majority of this. If we solve the jmpbuf problem..including, heck, just blow up jmpbufs to 1K, or use C++ exception handling, then there are only a few targets remainaing: 32bit little endian posix 64bit little endian posix 32bit little big posix 64bit little big posix 32bit little endian NT 64bit little endian NT big endian NT doesn't really exist (Xbox 360?). We could distribute 6 source archives and let the user chose? Seems too lame to me. But that might be the short term solution. ? - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.veselovsky at gmail.com Mon Jan 28 18:30:40 2013 From: alexey.veselovsky at gmail.com (Alexey Veselovsky) Date: Mon, 28 Jan 2013 21:30:40 +0400 Subject: [M3devel] Information about record/object field name. Message-ID: Hello. It is possible to retrieve field names for given Record or Object type? I need it for json serializer. Also this information useful for creating field-order independent serializer. Thanks, Alexey. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mika at async.caltech.edu Mon Jan 28 19:40:24 2013 From: mika at async.caltech.edu (mika at async.caltech.edu) Date: Mon, 28 Jan 2013 10:40:24 -0800 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: Message-ID: <20130128184025.03FD21A207D@async.async.caltech.edu> I do this sort of thing with m3tk. I have posted links to a Scheme interpreter on this mailing list before. If you look at how it works you can see how it encodes records. (It uses the field names just as you suggest, in a dotted pair---very similar to JSON.) If you can't find it I can repeat the links for you. It's a CVS repository that has anonymous access. Mika Alexey Veselovsky writes: >--f46d04088f7bcbc96504d45ca2ca >Content-Type: text/plain; charset=ISO-8859-1 > >Hello. > >It is possible to retrieve field names for given Record or Object type? > >I need it for json serializer. > >Also this information useful for creating field-order independent >serializer. > >Thanks, Alexey. > >--f46d04088f7bcbc96504d45ca2ca >Content-Type: text/html; charset=ISO-8859-1 > >
Hello.

It is possible to retrieve field names for given Record or Object type?
tyle>
I need it for json serializer.

>Also this information useful for creating field-order independent serializer.

Thanks, Alexey. >
> >--f46d04088f7bcbc96504d45ca2ca-- From alexey.veselovsky at gmail.com Mon Jan 28 19:50:10 2013 From: alexey.veselovsky at gmail.com (Alexey Veselovsky) Date: Mon, 28 Jan 2013 22:50:10 +0400 Subject: [M3devel] Information about record/object field name. In-Reply-To: <20130128184025.03FD21A207D@async.async.caltech.edu> References: <20130128184025.03FD21A207D@async.async.caltech.edu> Message-ID: I can't find. Please give me link. Thanks, Alexey. On Mon, Jan 28, 2013 at 10:40 PM, wrote: > I do this sort of thing with m3tk. > > I have posted links to a Scheme interpreter on this mailing list before. > If you look at how it works you can see how it encodes records. (It uses > the field names just as you suggest, in a dotted pair---very similar > to JSON.) > > If you can't find it I can repeat the links for you. It's a CVS repository > that has anonymous access. > > Mika > > Alexey Veselovsky writes: > >--f46d04088f7bcbc96504d45ca2ca > >Content-Type: text/plain; charset=ISO-8859-1 > > > >Hello. > > > >It is possible to retrieve field names for given Record or Object type? > > > >I need it for json serializer. > > > >Also this information useful for creating field-order independent > >serializer. > > > >Thanks, Alexey. > > > >--f46d04088f7bcbc96504d45ca2ca > >Content-Type: text/html; charset=ISO-8859-1 > > > >
Hello.

It is possible to retrieve > field names for given Record or Object type?
>tyle>
I need it for json serializer.
style>
> >Also this information useful for creating field-order independent > serializer.

Thanks, Alexey. > >
> > > >--f46d04088f7bcbc96504d45ca2ca-- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.veselovsky at gmail.com Mon Jan 28 22:28:29 2013 From: alexey.veselovsky at gmail.com (Alexey Veselovsky) Date: Tue, 29 Jan 2013 00:28:29 +0300 Subject: [M3devel] Information about record/object field name. In-Reply-To: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> References: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> Message-ID: <1F41D973-19C2-4770-93FC-B26BA5894A74@gmail.com> Where I can read about m3web files? What is it? On 28.01.2013, at 23:16, Darko wrote: > Another way to do it is to parse the .M3WEB file. See the Load procedure in the attached module for clues (unfortunately it has some dependencies into my code but they're fairly obvious). It takes as a parameter the .M3WEB file from the build directory. > > > > > > On Jan 28, 2013, at 9:30 AM, Alexey Veselovsky wrote: > >> Hello. >> >> It is possible to retrieve field names for given Record or Object type? >> >> I need it for json serializer. >> >> Also this information useful for creating field-order independent serializer. >> >> Thanks, Alexey. > From darko at darko.org Mon Jan 28 21:39:24 2013 From: darko at darko.org (Darko) Date: Mon, 28 Jan 2013 12:39:24 -0800 Subject: [M3devel] Information about record/object field name. In-Reply-To: <1F41D973-19C2-4770-93FC-B26BA5894A74@gmail.com> References: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> <1F41D973-19C2-4770-93FC-B26BA5894A74@gmail.com> Message-ID: The files are generated by the compiler and are meant for an M3 tool which I forget the name of, I also forget where I got the details of the file from. I'll try to dig it up, or I may have guessed the format. Others on the list maybe have more information. On Jan 28, 2013, at 1:28 PM, Alexey Veselovsky wrote: > Where I can read about m3web files? What is it? > > On 28.01.2013, at 23:16, Darko wrote: > >> Another way to do it is to parse the .M3WEB file. See the Load procedure in the attached module for clues (unfortunately it has some dependencies into my code but they're fairly obvious). It takes as a parameter the .M3WEB file from the build directory. >> >> >> >> >> >> On Jan 28, 2013, at 9:30 AM, Alexey Veselovsky wrote: >> >>> Hello. >>> >>> It is possible to retrieve field names for given Record or Object type? >>> >>> I need it for json serializer. >>> >>> Also this information useful for creating field-order independent serializer. >>> >>> Thanks, Alexey. >> From darko at darko.org Mon Jan 28 21:16:32 2013 From: darko at darko.org (Darko) Date: Mon, 28 Jan 2013 12:16:32 -0800 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: Message-ID: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> Another way to do it is to parse the .M3WEB file. See the Load procedure in the attached module for clues (unfortunately it has some dependencies into my code but they're fairly obvious). It takes as a parameter the .M3WEB file from the build directory. -------------- next part -------------- A non-text attachment was scrubbed... Name: TypeInfo.i3 Type: application/octet-stream Size: 4266 bytes Desc: not available URL: -------------- next part -------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: TypeInfo.m3 Type: application/octet-stream Size: 17169 bytes Desc: not available URL: -------------- next part -------------- On Jan 28, 2013, at 9:30 AM, Alexey Veselovsky wrote: > Hello. > > It is possible to retrieve field names for given Record or Object type? > > I need it for json serializer. > > Also this information useful for creating field-order independent serializer. > > Thanks, Alexey. From mika at async.caltech.edu Tue Jan 29 10:40:57 2013 From: mika at async.caltech.edu (mika at async.caltech.edu) Date: Tue, 29 Jan 2013 01:40:57 -0800 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: <20130128184025.03FD21A207D@async.async.caltech.edu> Message-ID: <20130129094057.6E5631A208E@async.async.caltech.edu> cvs -d :pserver:anonymous at pluto.gcapltd.com:/home/gcap-public-cvs up -d . Alexey Veselovsky writes: >--f46d0435c24c28655c04d45dbf19 >Content-Type: text/plain; charset=ISO-8859-1 > >I can't find. Please give me link. > >Thanks, Alexey. > > >On Mon, Jan 28, 2013 at 10:40 PM, wrote: > >> I do this sort of thing with m3tk. >> >> I have posted links to a Scheme interpreter on this mailing list before. >> If you look at how it works you can see how it encodes records. (It uses >> the field names just as you suggest, in a dotted pair---very similar >> to JSON.) >> >> If you can't find it I can repeat the links for you. It's a CVS repository >> that has anonymous access. >> >> Mika >> >> Alexey Veselovsky writes: >> >--f46d04088f7bcbc96504d45ca2ca >> >Content-Type: text/plain; charset=ISO-8859-1 >> > >> >Hello. >> > >> >It is possible to retrieve field names for given Record or Object type? >> > >> >I need it for json serializer. >> > >> >Also this information useful for creating field-order independent >> >serializer. >> > >> >Thanks, Alexey. >> > >> >--f46d04088f7bcbc96504d45ca2ca >> >Content-Type: text/html; charset=ISO-8859-1 >> > >> >
Hello.

It is possible to retrieve >> field names for given Record or Object type?
> >tyle>
I need it for json serializer.
> style>
>> >Also this information useful for creating field-order independent >> serializer.

Thanks, Alexey. >> >
>> > >> >--f46d04088f7bcbc96504d45ca2ca-- >> > >--f46d0435c24c28655c04d45dbf19 >Content-Type: text/html; charset=ISO-8859-1 >Content-Transfer-Encoding: quoted-printable > >
I can't find. Please give me link.

= >Thanks, Alexey.


class=3D"gmail_quote">On Mon, Jan 28, 2013 at 10:40 PM, ><mika at async= >.caltech.edu> wrote:
>
x #ccc solid;padding-left:1ex">I do this sort of thing with m3tk.
>
>I have posted links to a Scheme interpreter on this mailing list before.> >If you look at how it works you can see how it encodes records. =A0(It uses= >
>the field names just as you suggest, in a dotted pair---very similar
>to JSON.)
>
>If you can't find it I can repeat the links for you. =A0It's a CVS = >repository
>that has anonymous access.
>
>=A0 =A0 =A0Mika
>
>Alexey Veselovsky writes:
>>--f46d04088f7bcbc96504d45ca2ca
>>Content-Type: text/plain; charset=3DISO-8859-1
>
>
>>Hello.
>>
>>It is possible to retrieve field names for given Record or Object type?= >
>>
>>I need it for json serializer.
>>
>>Also this information useful for creating field-order independent
>>serializer.
>>
>>Thanks, Alexey.
>>
>
>--f46d04088f7bcbc96504d45ca2ca
>>Content-Type: text/html; charset=3DISO-8859-1
>>
>><div dir=3D"ltr">Hello.<div><br></div>= >;<div style>It is possible to retrieve field names for given Record o= >r Object type?</div><div s
>>tyle><br></div><div style>I need it for json seria= >lizer.</div><div style><br></div><div style><= >br> >>Also this information useful for creating field-order independent seria= >lizer.</div><div style><br></div><div style>T= >hanks, Alexey.
>></div></div>
>>
>>--f46d04088f7bcbc96504d45ca2ca--
>

> >--f46d0435c24c28655c04d45dbf19-- From rcolebur at SCIRES.COM Tue Jan 29 22:42:42 2013 From: rcolebur at SCIRES.COM (Coleburn, Randy) Date: Tue, 29 Jan 2013 21:42:42 +0000 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> <1F41D973-19C2-4770-93FC-B26BA5894A74@gmail.com> Message-ID: <0BB8FA59C2932741A3A2941A8B9D8BFF03BDB3@ATLEX04-SRV.SCIRES.LOCAL> I think you may be referring to m3browser. Also, CM3IDE has the capability to generate and browse a web of your Modula-3 software source code. --Randy Coleburn -----Original Message----- From: Darko [mailto:darko at darko.org] Sent: Monday, January 28, 2013 3:39 PM To: Alexey Veselovsky Cc: m3devel at elegosoft.com Subject: EXT:Re: [M3devel] Information about record/object field name. The files are generated by the compiler and are meant for an M3 tool which I forget the name of, I also forget where I got the details of the file from. I'll try to dig it up, or I may have guessed the format. Others on the list maybe have more information. On Jan 28, 2013, at 1:28 PM, Alexey Veselovsky wrote: > Where I can read about m3web files? What is it? > > On 28.01.2013, at 23:16, Darko wrote: > >> Another way to do it is to parse the .M3WEB file. See the Load procedure in the attached module for clues (unfortunately it has some dependencies into my code but they're fairly obvious). It takes as a parameter the .M3WEB file from the build directory. >> >> >> >> >> >> On Jan 28, 2013, at 9:30 AM, Alexey Veselovsky wrote: >> >>> Hello. >>> >>> It is possible to retrieve field names for given Record or Object type? >>> >>> I need it for json serializer. >>> >>> Also this information useful for creating field-order independent serializer. >>> >>> Thanks, Alexey. >> From jay.krell at cornell.edu Wed Jan 30 08:40:02 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 30 Jan 2013 07:40:02 +0000 Subject: [M3devel] awful race condition in libm3/FilePosix.m3? Message-ID: FilePosix.m3: I'm not 100% sure, but looks really bad. I suspect it will close arbitrary files out from other threads. Notice there is absolutely no mutual exclusion. An arbitrary number of threads will run here, mostly succeeding, but not necessarily. VAR null_done := FALSE; null_stat: Ustat.struct_stat; null_fd: INTEGER; PROCEDURE IsDevNull(READONLY statbuf: Ustat.struct_stat): BOOLEAN RAISES {} = VAR result: INTEGER; BEGIN IF NOT null_done THEN null_fd := Unix.open(M3toC.FlatTtoS("/dev/null"), Unix.O_RDONLY, Unix.Mrwrwrw); IF null_fd < 0 THEN null_done := TRUE; RETURN FALSE ELSE result := Ustat.fstat(null_fd, ADR(null_stat)); EVAL Unix.close(null_fd); IF result # 0 THEN null_fd := -1 END END; null_done := TRUE; END; RETURN null_fd >= 0 AND statbuf.st_rdev = null_stat.st_rdev END IsDevNull; - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Wed Jan 30 09:24:50 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 30 Jan 2013 08:24:50 +0000 Subject: [M3devel] awful race condition in libm3/FilePosix.m3? In-Reply-To: References: Message-ID: I commited a fix. But two questions: 1) why not just stat, instead of open, fstat, close? 2) a lighter weight way to fix this than I did? In particular: a) VAR m := NEW(MUTEX); can we at least say VAR m: MUTEX instead? I tried. It crashed. b) some notion of a "once"? a lock that will only be successfully entered once, for one-time initialization, all other attempts to enter wait for the first enterer to leave, and the it is never entered again. pthreads has this. Win32 since Vista has it (I'd still provide something compatible to pre-Vista, but it can be done easily enough. They are faster and perhaps smaller than other kinds of locks. - Jay From: jay.krell at cornell.edu To: m3devel at elegosoft.com Date: Wed, 30 Jan 2013 07:40:02 +0000 Subject: [M3devel] awful race condition in libm3/FilePosix.m3? FilePosix.m3: I'm not 100% sure, but looks really bad. I suspect it will close arbitrary files out from other threads. Notice there is absolutely no mutual exclusion. An arbitrary number of threads will run here, mostly succeeding, but not necessarily. VAR null_done := FALSE; null_stat: Ustat.struct_stat; null_fd: INTEGER; PROCEDURE IsDevNull(READONLY statbuf: Ustat.struct_stat): BOOLEAN RAISES {} = VAR result: INTEGER; BEGIN IF NOT null_done THEN null_fd := Unix.open(M3toC.FlatTtoS("/dev/null"), Unix.O_RDONLY, Unix.Mrwrwrw); IF null_fd < 0 THEN null_done := TRUE; RETURN FALSE ELSE result := Ustat.fstat(null_fd, ADR(null_stat)); EVAL Unix.close(null_fd); IF result # 0 THEN null_fd := -1 END END; null_done := TRUE; END; RETURN null_fd >= 0 AND statbuf.st_rdev = null_stat.st_rdev END IsDevNull; - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Wed Jan 30 09:26:30 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 30 Jan 2013 08:26:30 +0000 Subject: [M3devel] less indirection in mutex? Message-ID: How about..on systems where sizeof(pthread_mutex) <= sizeof(void*), we remove a level of indirection? I realize it is tricky while preserving our now excellent level of portability. I would actually have C code with the if (sizeof....), no #ifs, no autoconf. - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Thu Jan 31 09:54:47 2013 From: jay.krell at cornell.edu (Jay K) Date: Thu, 31 Jan 2013 08:54:47 +0000 Subject: [M3devel] libm3 AMD64_NT loophole/size problem Message-ID: == package /Users/jay/dev2/cm3/m3-libs/libm3 == +++ /cm3/bin/cm3 -build -override -DROOT=/Users/jay/dev2/cm3 -boot -keep -DM3CC_TARGET=AMD64_NT +++ --- building in AMD64_NT --- ignoring override("libm3", "/Users/jay/dev2/cm3/m3-libs") "../src/os/WIN32/SocketWin32.m3", line 329: LOOPHOLE: expression's size differs from type's "../src/os/WIN32/SocketWin32.m3", line 383: LOOPHOLE: expression's size differs from type's "../src/os/WIN32/SocketWin32.m3", line 383: warning: LOOPHOLE: expression's alignment may differ from type's "../src/os/WIN32/SocketWin32.m3", line 389: LOOPHOLE: expression's size differs from type's 3 errors and 1 warning encountered FYI, if I end up rewriting this file or parts of it in C, this is one of the contributing reasons. It is kind of the same as the other Unix/C stuff where I rewrote in C, rather than maintain cloned headers. - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From rodney_bates at lcwb.coop Thu Jan 31 17:03:50 2013 From: rodney_bates at lcwb.coop (Rodney M. Bates) Date: Thu, 31 Jan 2013 10:03:50 -0600 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: Message-ID: <510A95E6.4000308@lcwb.coop> This question raises several others in my mind. Since you mention a serializer, do I correctly presume you want the field names of a record/object type that exists in the same program doing the reading? Are you familiar with the existing compiler-generated type information, in RTTypeMap.i3 and RTTipeMap.i3, and accessible at runtime using RT0.i3 and other things in m3-libs/m3core/src/runtime/common/*, and produced by the compiler in, e.g., m3-sys/m3front/src/misc/TipeDesc.i3? Unfortunately, neither of these kinds of runtime type information has field names, only a lists of field types in order. For a serializer, runtime type information would be a far more convenient source, since it would not require having either source files or separate derived files (.M3WEB). Adding the field names here would probably not be a big coding change, but a change in runtime data structure would no doubt be a big bootstrapping and upgrading operation, for all concerned. Field names are also available in the generated debug information. But even though this might be a more convenient location to get it from, decoding it this way would be a nightmare. It's a specialized derivative of stabs, with lots of Modula-3-specific stuff mangled and encoded inside the string fields of stabs records. gdb has gobs of code to read in general stabs and m3gdb has gobs more to further decode it, all in c. Moreover, there are quite a few differences in what is produced by various compilers, depending on the version of the M3 front end, the version of the gcc-derived code generator or the other code generators, and the target. The idea of field-order independent serializing at first seemed pointless to me. I think the intent must be to allow a serialized object to be deserialized into a different program as a different type, with different field orders. Is this the intent? what are the rules about how different a type can be and still be used in this way? Is it cross-language too? The existing Modula-3 serializer (m3-libs/libm3/src/pickle/ver2/Pickle2.i3 etc.) requires that there be type in the deserializing program that is an exact (structural) match to the type in the serializing program, according to the language's rules of type equality. Pickle enforces this by looking for equality of a 64-bit "signature" that is a hash on a type structure, with the assumption collisions will not occur. Perhaps you have read enough of the runtime, compiler, and serializer to know all this already. Tell us more about the json serializer. On 01/28/2013 11:30 AM, Alexey Veselovsky wrote: > Hello. > > It is possible to retrieve field names for given Record or Object type? > > I need it for json serializer. > > Also this information useful for creating field-order independent serializer. > > Thanks, Alexey. From alexey.veselovsky at gmail.com Thu Jan 31 16:14:23 2013 From: alexey.veselovsky at gmail.com (Alexey Veselovsky) Date: Thu, 31 Jan 2013 19:14:23 +0400 Subject: [M3devel] Can't acces to cvs repo. Message-ID: Subj. Login timeout: # cvs -d :pserver:anonymous at modula3.elegosoft.com:/usr/cvs login Logging in to :pserver:anonymous at modula3.elegosoft.com:2401/usr/cvs CVS password: cvs [login aborted]: connect to modula3.elegosoft.com(46.4.219.187):2401 failed: Connection timed out Thanks, Alexey. -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Fri Jan 4 10:16:47 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 01:16:47 -0800 Subject: [M3devel] Bare Metal Modula-3 Message-ID: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko From jay.krell at cornell.edu Fri Jan 4 18:08:09 2013 From: jay.krell at cornell.edu (Jay K) Date: Fri, 4 Jan 2013 17:08:09 +0000 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> References: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> Message-ID: What is the system? It is possible to not need memory allocation or threading or garbage collection. You could use just globals and/or locals. It is possibe to not need garbage collection. Use unsafe and new/dispose for dynamic allocation. The garbage collector for example, doesn't need garbage collection. It is possible to not need threads. It is obvious how. But be aware that "libraries", including the garbage collector, create threads. Anyway, "yes". There are currently three usermode thread implementations. 1) "get/set/make/swapcontext" 2) "sigaltstack" 3) "setjmp/timers" This looks currently unused, and maybe deleted. I guess they all user timers. To start, see: jbook2:src jay$ pwd /dev2/cm3/m3-libs/m3core/src jbook2:src jay$ find . | grep c$ | grep -i thread ./thread/POSIX/ThreadPosixC.c OR ./thread/PTHREAD/ThreadPThreadC.c Really, providing pthreads wouldn't be a bad idea. For memory allocation, we use at least calloc, free, maybe malloc, and mmap/munmap. You could probably replace mmap/munmap with calloc/malloc/free. If you really want to link all of m3core and libm3, you'll need more, open/close/read/write, fork or vfork/exec. The way to know is probably just to try it. Do you have a working C compiler/libraries/headers? Can you just try it? nm against cm3 is probably useful. Some of these might be injected by "startup" code. Some are wrappers for other code to use -- might not be used. Some are implementation details of the C library. nm /cm3/bin/cm3 | grep " U " U ___error U ___gxx_personality_v0 U ___sF U ___stderrp U __exit U __longjmp U __setjmp U _abort U _access U _calloc U _ceil U _chdir U _close U _closedir U _dup2 U _execve U _execvp U _exit U _fcntl U _feclearexcept U _fegetround U _feraiseexcept U _fesetround U _fetestexcept U _fflush U _floor U _fork U _fprintf U _free U _fstat U _fsync U _fwrite U _getcwd U _getdtablesize U _getegid U _getenv U _geteuid U _gethostname U _getpid U _gettimeofday U _gmtime U _kill U _ldexp U _link U _llroundl U _localtime U _lseek U _lstat U _malloc U _memcmp U _memmove U _memset U _mkdir U _mktime U _mmap U _modf U _nanosleep U _open U _opendir U _pipe U _poll U _pthread_atfork U _pthread_attr_destroy U _pthread_attr_getstacksize U _pthread_attr_init U _pthread_attr_setstacksize U _pthread_cond_broadcast U _pthread_cond_destroy U _pthread_cond_init U _pthread_cond_signal U _pthread_cond_timedwait U _pthread_cond_wait U _pthread_create U _pthread_detach U _pthread_equal U _pthread_getspecific U _pthread_key_create U _pthread_kill U _pthread_mach_thread_np U _pthread_mutex_destroy U _pthread_mutex_init U _pthread_mutex_lock U _pthread_mutex_unlock U _pthread_self U _pthread_setspecific U _read U _readdir U _readlink U _rename U _rmdir U _sched_yield U _sigaction U _sigsetjmp U _sleep U _stat U _strcmp U _strtod U _symlink U _thread_abort_safely U _thread_get_state U _thread_resume U _thread_suspend U _time U _tzset U _uname U _unlink U _utimes U _waitpid U _write - Jay > From: darko at darko.org > Date: Fri, 4 Jan 2013 01:16:47 -0800 > To: m3devel at elegosoft.com > Subject: [M3devel] Bare Metal Modula-3 > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > - Darko > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Fri Jan 4 19:46:45 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Fri, 4 Jan 2013 18:46:45 +0000 (GMT) Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> Message-ID: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com> Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament.? and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Fri Jan 4 21:50:04 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Fri, 4 Jan 2013 20:50:04 +0000 (GMT) Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> Message-ID: <1357332604.47416.YahooMailClassic@web133103.mail.ir2.yahoo.com> Hi all: You need realtime core services otherwise your system won't be efficient unless that's not what you want, it is to run Modula-3 applications, isn't it? If not, what's the point of your device? (e.g SPIN GC, etc) If you need a real-time core server in a networked implementation, you need a DRTOS. Thanks in advance PS: I don't see any response to Jay --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: Re: [M3devel] Bare Metal Modula-3 Para: "Daniel Alejandro Benavides D." CC: "m3devel developers" Fecha: viernes, 4 de enero, 2013 15:09 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament.? and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Fri Jan 4 21:09:26 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 12:09:26 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com> References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com> Message-ID: <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: > Hi all: > I think you just need runtime executive on top a machine would be enough. > For instance VAXELN. > Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). > Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. > I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: > http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor > > My hypothesis is that you can't bring up a realtime application in an embedded device like you want. > I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. > Thanks in advance > > > --- El vie, 4/1/13, Darko escribi?: > > De: Darko > Asunto: [M3devel] Bare Metal Modula-3 > Para: "m3devel developers" > Fecha: viernes, 4 de enero, 2013 04:16 > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > - Darko > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Sat Jan 5 01:36:16 2013 From: jay.krell at cornell.edu (Jay K) Date: Sat, 5 Jan 2013 00:36:16 +0000 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com>, <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> Message-ID: Clarification regarding mmap. mmap has two fairly different purposes in Posix. 1) to "map a file" into memory 2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size). #1 is the more obvious probably better known use. The one I knew of. The one it sounds like. #2 is what we use it for. If we ever autoconf-m3core, it'd probably be reasonable to do something like: #if HAS_MMAPreturn mmap(...); #elif HAS_CALLOC void** p = (void**)calloc(size + sizeof(void*));if (!p) return p;p[0] = p;return p + 1; #else#error#endif #if HAS_MMAPmunmap(...); #elif HAS_CALLOC if (p) free(((void**)p)[-1]); #endif alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed.Including assert(0) in places.Invent your own value for "OS_TYPE". Maybe #define OS_TYPE_FOO #include ../POSIX/Foo.c and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. Sharing code can be good or bad. We don't actually use "memory protection".Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible.This is nice. It might be required for "safety".It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead.More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3.You make a much different system, you get to do the port.It is neither impossible nor a no-op. - Jay From: darko at darko.org Date: Fri, 4 Jan 2013 12:09:26 -0800 To: dabenavidesd at yahoo.es CC: m3devel at elegosoft.com Subject: Re: [M3devel] Bare Metal Modula-3 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote:Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Sat Jan 5 03:40:49 2013 From: jay.krell at cornell.edu (Jay K) Date: Sat, 5 Jan 2013 02:40:49 +0000 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com>, <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> , Message-ID: Get hello world running on your system first, written in C. Then get back to us. :)Seriously. Ok, maybe not with stdio.At least this: int main(){ malloc(1); return 0;} - Jay Subject: Re: [M3devel] Bare Metal Modula-3 From: darko at darko.org Date: Fri, 4 Jan 2013 16:45:27 -0800 CC: m3devel at elegosoft.com To: jay.krell at cornell.edu That's useful to know. It makes implementing memory allocation very straight forward. All I'd need to implement would be some calls for setting aside pages of memory and setting their read/write status, which would be directly supported by the hardware. It also occurs to me I'd have to write some sort of loader, which shouldn't be difficult as long as I can link the m3 program into some sort of monolithic "raw" format that I can just copy into a fixed place in memory and start executing. On Jan 4, 2013, at 4:36 PM, Jay K wrote:Clarification regarding mmap. mmap has two fairly different purposes in Posix. 1) to "map a file" into memory 2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size). #1 is the more obvious probably better known use. The one I knew of. The one it sounds like. #2 is what we use it for. If we ever autoconf-m3core, it'd probably be reasonable to do something like: #if HAS_MMAP return mmap(...); #elif HAS_CALLOC void** p = (void**)calloc(size + sizeof(void*)); if (!p) return p; p[0] = p; return p + 1; #else #error #endif #if HAS_MMAP munmap(...); #elif HAS_CALLOC if (p) free(((void**)p)[-1]); #endif alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed. Including assert(0) in places. Invent your own value for "OS_TYPE". Maybe #define OS_TYPE_FOO #include ../POSIX/Foo.c and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. Sharing code can be good or bad. We don't actually use "memory protection". Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible. This is nice. It might be required for "safety". It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead. More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3. You make a much different system, you get to do the port. It is neither impossible nor a no-op. - Jay From: darko at darko.org Date: Fri, 4 Jan 2013 12:09:26 -0800 To: dabenavidesd at yahoo.es CC: m3devel at elegosoft.com Subject: Re: [M3devel] Bare Metal Modula-3 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote:Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Fri Jan 4 21:07:43 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 12:07:43 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: References: <07370A0B-07D2-4EA6-9ED7-AC76665B8145@darko.org> Message-ID: <796EA17B-0861-4D9E-8D5E-476F41357D25@darko.org> The threading, GC and TCP/IP are required by my software, so they have to be implemented, the question is what is the minimum required to implement them. No other OS services are required, and no OS would be installed. Some external libraries would be required, like a TCP/IP stack, but those are available without OS dependencies. The target system is the Samsung Exynos 4 Quad SoC. It has a 4 ARM Cortex-A9 cores running at 1.6GHz and 2GB integrated DRAM. Added to that would be a gigabit ethernet port. The whole system would have a maximum power draw of something like 5W. The manual can be found here for those interested: http://www.samsung.com/global/business/semiconductor/file/product/Exynos_4_Quad_User_Manaul_Public_REV100-0.pdf The idea is to build a low cost, low power computing node that can deployed in large numbers. It would only run one threaded application and all I/O would be through the network port, so the OS would do little else than create overhead. So far, aside from hardware initialization, I know I'd have to write a timer interrupt for user threads, some code to assign threads to cores, and an implementation of mmap/munmap, but I imagine not a full one since from what I understand only some of the functionality is used to catch access to various parts of memory. I know I'd have to remove the many parts of m3core, libm3 and other libraries that reference OS services. On Jan 4, 2013, at 9:08 AM, Jay K wrote: > What is the system? > > > > It is possible to not need memory allocation or threading or garbage collection. > You could use just globals and/or locals. > > > > It is possibe to not need garbage collection. > Use unsafe and new/dispose for dynamic allocation. > The garbage collector for example, doesn't need garbage collection. > > > > It is possible to not need threads. > It is obvious how. > But be aware that "libraries", including the garbage collector, create threads. > > > > Anyway, "yes". > There are currently three usermode thread implementations. > 1) "get/set/make/swapcontext" > 2) "sigaltstack" > 3) "setjmp/timers" > This looks currently unused, and maybe deleted. > > > > I guess they all user timers. > > > > To start, see: > > > jbook2:src jay$ pwd > /dev2/cm3/m3-libs/m3core/src > > > jbook2:src jay$ find . | grep c$ | grep -i thread > ./thread/POSIX/ThreadPosixC.c > OR > ./thread/PTHREAD/ThreadPThreadC.c > > > > Really, providing pthreads wouldn't be a bad idea. > > > > For memory allocation, we use at least calloc, free, maybe malloc, > and mmap/munmap. You could probably replace mmap/munmap with calloc/malloc/free. > > > > If you really want to link all of m3core and libm3, you'll > need more, open/close/read/write, fork or vfork/exec. > > > > The way to know is probably just to try it. > Do you have a working C compiler/libraries/headers? > Can you just try it? > > > nm against cm3 is probably useful. > Some of these might be injected by "startup" code. > Some are wrappers for other code to use -- might not be used. > Some are implementation details of the C library. > > > nm /cm3/bin/cm3 | grep " U " > > > U ___error > U ___gxx_personality_v0 > U ___sF > U ___stderrp > U __exit > U __longjmp > U __setjmp > U _abort > U _access > U _calloc > U _ceil > U _chdir > U _close > U _closedir > U _dup2 > U _execve > U _execvp > U _exit > U _fcntl > U _feclearexcept > U _fegetround > U _feraiseexcept > U _fesetround > U _fetestexcept > U _fflush > U _floor > U _fork > U _fprintf > U _free > U _fstat > U _fsync > U _fwrite > U _getcwd > U _getdtablesize > U _getegid > U _getenv > U _geteuid > U _gethostname > U _getpid > U _gettimeofday > U _gmtime > U _kill > U _ldexp > U _link > U _llroundl > U _localtime > U _lseek > U _lstat > U _malloc > U _memcmp > U _memmove > U _memset > U _mkdir > U _mktime > U _mmap > U _modf > U _nanosleep > U _open > U _opendir > U _pipe > U _poll > U _pthread_atfork > U _pthread_attr_destroy > U _pthread_attr_getstacksize > U _pthread_attr_init > U _pthread_attr_setstacksize > U _pthread_cond_broadcast > U _pthread_cond_destroy > U _pthread_cond_init > U _pthread_cond_signal > U _pthread_cond_timedwait > U _pthread_cond_wait > U _pthread_create > U _pthread_detach > U _pthread_equal > U _pthread_getspecific > U _pthread_key_create > U _pthread_kill > U _pthread_mach_thread_np > U _pthread_mutex_destroy > U _pthread_mutex_init > U _pthread_mutex_lock > U _pthread_mutex_unlock > U _pthread_self > U _pthread_setspecific > U _read > U _readdir > U _readlink > U _rename > U _rmdir > U _sched_yield > U _sigaction > U _sigsetjmp > U _sleep > U _stat > U _strcmp > U _strtod > U _symlink > U _thread_abort_safely > U _thread_get_state > U _thread_resume > U _thread_suspend > U _time > U _tzset > U _uname > U _unlink > U _utimes > U _waitpid > U _write > > > > - Jay > > > > > > From: darko at darko.org > > Date: Fri, 4 Jan 2013 01:16:47 -0800 > > To: m3devel at elegosoft.com > > Subject: [M3devel] Bare Metal Modula-3 > > > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > > > - Darko > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Sat Jan 5 02:26:03 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 17:26:03 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <1357332604.47416.YahooMailClassic@web133103.mail.ir2.yahoo.com> References: <1357332604.47416.YahooMailClassic@web133103.mail.ir2.yahoo.com> Message-ID: <02ED8FD1-2AF7-4F8D-919D-7B0B76F4FFDC@darko.org> My understanding of a RTOS is that is provides low-latency interrupt response and accurate timing. These are not my requirements. I'm using the ARM SoC because it provides a lot of processing power at low cost and low power, two important considerations when deploying large numbers of servers. On Jan 4, 2013, at 12:50 PM, Daniel Alejandro Benavides D. wrote: > Hi all: > You need realtime core services otherwise your system won't be efficient unless that's not what you want, it is to run Modula-3 applications, isn't it? If not, what's the point of your device? (e.g SPIN GC, etc) > If you need a real-time core server in a networked implementation, you need a DRTOS. > Thanks in advance > > PS: I don't see any response to Jay > > > --- El vie, 4/1/13, Darko escribi?: > > De: Darko > Asunto: Re: [M3devel] Bare Metal Modula-3 > Para: "Daniel Alejandro Benavides D." > CC: "m3devel developers" > Fecha: viernes, 4 de enero, 2013 15:09 > > It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. > > > On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: > >> Hi all: >> I think you just need runtime executive on top a machine would be enough. >> For instance VAXELN. >> Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). >> Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. >> I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: >> http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor >> >> My hypothesis is that you can't bring up a realtime application in an embedded device like you want. >> I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. >> Thanks in advance >> >> >> --- El vie, 4/1/13, Darko escribi?: >> >> De: Darko >> Asunto: [M3devel] Bare Metal Modula-3 >> Para: "m3devel developers" >> Fecha: viernes, 4 de enero, 2013 04:16 >> >> I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. >> >> The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. >> >> The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? >> >> - Darko >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Sat Jan 5 04:05:36 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Sat, 5 Jan 2013 03:05:36 +0000 (GMT) Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <02ED8FD1-2AF7-4F8D-919D-7B0B76F4FFDC@darko.org> Message-ID: <1357355136.54828.YahooMailClassic@web133104.mail.ir2.yahoo.com> Hi all: the core OS services performance in any OS is critical good chips doesn't make things easier, lots of processing power (not modeled for Modula-3 language semantics) not good. see s. 29, 30: core, rt, lib, sal: http://web.yl.is.s.u-tokyo.ac.jp/meeting/doc/hamanaka010620.ppt If your core is slow then it will damage the performance of your applications. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: Re: [M3devel] Bare Metal Modula-3 Para: "Daniel Alejandro Benavides D." CC: "m3devel developers" Fecha: viernes, 4 de enero, 2013 20:26 My understanding of a RTOS is that is provides low-latency interrupt response and accurate timing. These are not my requirements. I'm using the ARM SoC because it provides a lot of processing power at low cost and low power, two important considerations when deploying large numbers of servers. On Jan 4, 2013, at 12:50 PM, Daniel Alejandro Benavides D. wrote: Hi all: You need realtime core services otherwise your system won't be efficient unless that's not what you want, it is to run Modula-3 applications, isn't it? If not, what's the point of your device? (e.g SPIN GC, etc) If you need a real-time core server in a networked implementation, you need a DRTOS. Thanks in advance PS: I don't see any response to Jay --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: Re: [M3devel] Bare Metal Modula-3 Para: "Daniel Alejandro Benavides D." CC: "m3devel developers" Fecha: viernes, 4 de enero, 2013 15:09 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN. Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament.? and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El vie, 4/1/13, Darko escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Sat Jan 5 01:45:27 2013 From: darko at darko.org (Darko) Date: Fri, 4 Jan 2013 16:45:27 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com>, <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> Message-ID: That's useful to know. It makes implementing memory allocation very straight forward. All I'd need to implement would be some calls for setting aside pages of memory and setting their read/write status, which would be directly supported by the hardware. It also occurs to me I'd have to write some sort of loader, which shouldn't be difficult as long as I can link the m3 program into some sort of monolithic "raw" format that I can just copy into a fixed place in memory and start executing. On Jan 4, 2013, at 4:36 PM, Jay K wrote: > Clarification regarding mmap. > > > mmap has two fairly different purposes in Posix. > > > 1) to "map a file" into memory > 2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size). > > #1 is the more obvious probably better known use. The one I knew of. The one it sounds like. > #2 is what we use it for. > > > If we ever autoconf-m3core, it'd probably be reasonable to do something like: > > > #if HAS_MMAP > return mmap(...); > > #elif HAS_CALLOC > > void** p = (void**)calloc(size + sizeof(void*)); > if (!p) return p; > p[0] = p; > return p + 1; > > #else > #error > #endif > > > #if HAS_MMAP > munmap(...); > > #elif HAS_CALLOC > > if (p) > free(((void**)p)[-1]); > > #endif > > > alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed. > Including assert(0) in places. > Invent your own value for "OS_TYPE". > > > Maybe > #define OS_TYPE_FOO > #include ../POSIX/Foo.c > > and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. > > > Sharing code can be good or bad. > > > We don't actually use "memory protection". > Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible. > This is nice. It might be required for "safety". > It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead. > More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. > > > > Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3. > You make a much different system, you get to do the port. > It is neither impossible nor a no-op. > > > - Jay > > > > > > From: darko at darko.org > Date: Fri, 4 Jan 2013 12:09:26 -0800 > To: dabenavidesd at yahoo.es > CC: m3devel at elegosoft.com > Subject: Re: [M3devel] Bare Metal Modula-3 > > It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. > > > On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: > > Hi all: > I think you just need runtime executive on top a machine would be enough. > For instance VAXELN. > Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). > Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. > I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: > http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor > > My hypothesis is that you can't bring up a realtime application in an embedded device like you want. > I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. > Thanks in advance > > > --- El vie, 4/1/13, Darko escribi?: > > De: Darko > Asunto: [M3devel] Bare Metal Modula-3 > Para: "m3devel developers" > Fecha: viernes, 4 de enero, 2013 04:16 > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > - Darko > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From darko at darko.org Sat Jan 5 09:24:00 2013 From: darko at darko.org (Darko) Date: Sat, 5 Jan 2013 00:24:00 -0800 Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: References: <1357325205.33013.YahooMailClassic@web133101.mail.ir2.yahoo.com>, <3883CC57-59A9-4AF7-AB66-63F67D36D5A9@darko.org> , Message-ID: <543B31C6-F239-46E4-96A5-446EC1565589@darko.org> That shouldn't be hard, there's a detailed guide here using GCC: http://www.state-machine.com/arm/Building_bare-metal_ARM_with_GNU.pdf Building an ARM cross compiler will be a bit more involved and although there don't seem to be any fundamental dependencies in the runtime I get the feeling separating the M3 minimalist portion from the OS dependent portion is going to be messy. On Jan 4, 2013, at 6:40 PM, Jay K wrote: > Get hello world running on your system first, written in C. Then get back to us. :) > Seriously. > > Ok, maybe not with stdio. > At least this: > > int main() > { > malloc(1); > return 0; > } > > > - Jay > > Subject: Re: [M3devel] Bare Metal Modula-3 > From: darko at darko.org > Date: Fri, 4 Jan 2013 16:45:27 -0800 > CC: m3devel at elegosoft.com > To: jay.krell at cornell.edu > > That's useful to know. It makes implementing memory allocation very straight forward. All I'd need to implement would be some calls for setting aside pages of memory and setting their read/write status, which would be directly supported by the hardware. > > It also occurs to me I'd have to write some sort of loader, which shouldn't be difficult as long as I can link the m3 program into some sort of monolithic "raw" format that I can just copy into a fixed place in memory and start executing. > > > > On Jan 4, 2013, at 4:36 PM, Jay K wrote: > > Clarification regarding mmap. > > > mmap has two fairly different purposes in Posix. > > > 1) to "map a file" into memory > 2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size). > > #1 is the more obvious probably better known use. The one I knew of. The one it sounds like. > #2 is what we use it for. > > > If we ever autoconf-m3core, it'd probably be reasonable to do something like: > > > #if HAS_MMAP > return mmap(...); > > #elif HAS_CALLOC > > void** p = (void**)calloc(size + sizeof(void*)); > if (!p) return p; > p[0] = p; > return p + 1; > > #else > #error > #endif > > > #if HAS_MMAP > munmap(...); > > #elif HAS_CALLOC > > if (p) > free(((void**)p)[-1]); > > #endif > > > alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed. > Including assert(0) in places. > Invent your own value for "OS_TYPE". > > > Maybe > #define OS_TYPE_FOO > #include ../POSIX/Foo.c > > and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. > > > Sharing code can be good or bad. > > > We don't actually use "memory protection". > Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible. > This is nice. It might be required for "safety". > It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead. > More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. > > > > Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3. > You make a much different system, you get to do the port. > It is neither impossible nor a no-op. > > > - Jay > > > > > > From: darko at darko.org > Date: Fri, 4 Jan 2013 12:09:26 -0800 > To: dabenavidesd at yahoo.es > CC: m3devel at elegosoft.com > Subject: Re: [M3devel] Bare Metal Modula-3 > > It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. > > > On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: > > Hi all: > I think you just need runtime executive on top a machine would be enough. > For instance VAXELN. > Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). > Memory managament. and threading are core services in VAXELN as part of system, just need bindings for each language. > I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: > http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor > > My hypothesis is that you can't bring up a realtime application in an embedded device like you want. > I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. > Thanks in advance > > > --- El vie, 4/1/13, Darko escribi?: > > De: Darko > Asunto: [M3devel] Bare Metal Modula-3 > Para: "m3devel developers" > Fecha: viernes, 4 de enero, 2013 04:16 > > I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware. > > The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. > > The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? > > - Darko > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Sat Jan 5 19:15:20 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Sat, 5 Jan 2013 18:15:20 +0000 (GMT) Subject: [M3devel] Bare Metal Modula-3 In-Reply-To: <543B31C6-F239-46E4-96A5-446EC1565589@darko.org> Message-ID: <1357409720.1464.YahooMailClassic@web133102.mail.ir2.yahoo.com> Hi all: the core services as here explained must be maintained CPU and memory management regardless of any other tasks, I don't think even Gnu/Linux is capable of doing this today: http://www.poppyfields.net/acorn/news/acopress/97-02-10b.shtml Core services independent of platform are the top part to maintain available during updates over network, interesting service. ?I would use their RT rather than CM3, which is nice but not for embedded OS kernel, certainly. Never released guess why? Thanks in advance --- El s?b, 5/1/13, Darko escribi?: De: Darko Asunto: Re: [M3devel] Bare Metal Modula-3 Para: "Jay K" CC: "m3devel" Fecha: s?bado, 5 de enero, 2013 03:24 That shouldn't be hard, there's a detailed guide here using GCC: http://www.state-machine.com/arm/Building_bare-metal_ARM_with_GNU.pdf Building an ARM cross compiler will be a bit more involved and although there don't seem to be any fundamental dependencies in the runtime I get the feeling separating the M3 minimalist portion from the OS dependent portion is going to be messy.? On Jan 4, 2013, at 6:40 PM, Jay K wrote: Get hello world running on your system first, written in C. Then?get back to us. :) Seriously. ? Ok, maybe not with stdio. At least this: ? int main() { ?malloc(1); ?return 0; } ? ? ?- Jay ? Subject: Re: [M3devel] Bare Metal Modula-3 From:?darko at darko.org Date: Fri, 4 Jan 2013 16:45:27 -0800 CC:?m3devel at elegosoft.com To:?jay.krell at cornell.edu That's useful to know. It makes implementing memory allocation very straight forward. All I'd need to implement would be some calls for setting aside pages of memory and setting their read/write status, which would be directly supported by the hardware. It also occurs to me I'd have to write some sort of loader, which shouldn't be difficult as long as I can link the m3 program into some sort of monolithic "raw" format that I can just copy into a fixed place in memory and start executing. On Jan 4, 2013, at 4:36 PM, Jay K wrote: Clarification?regarding mmap. ? ? mmap has two fairly?different purposes in Posix. ? ? ?1) to "map a file" into memory? ?2) to "allocate memory", probably with address and size page-aligned, probably for relatively large allocations (i.e. ones you don't mind rounding up to a page size).?? ? ??#1 is the more obvious probably better known use.?The one I knew of. The one it sounds like.? ??#2 is what we use it for.?? ? ? If we ever autoconf-m3core, it'd probably be reasonable to do something like: ? ? #if HAS_MMAP return mmap(...); ? #elif HAS_CALLOC ? void** p = (void**)calloc(size + sizeof(void*)); if (!p) return p; p[0] = p; return p + 1; ? #else #error #endif ? ? #if HAS_MMAP munmap(...); ? #elif HAS_CALLOC ? if (p) ? free(((void**)p)[-1]); ? #endif ? ? alternatively though, look for every directory named "POSIX" and make a copy of it, and modify as needed. Including assert(0) in places. Invent your own value for "OS_TYPE". ? ? Maybe ?#define OS_TYPE_FOO? ?#include ../POSIX/Foo.c? ? and #ifndef OS_TYPE_FOO in Foo.c, if it isn't too messy. ? ? Sharing code can be good or bad. ? ? We don't actually use "memory protection". Er, well..maybe we do...we might have code that allocates stacks, and makes a page at either end inaccessible. This is nice. It might be required for "safety". It might also be a good idea to have a flag in Target.i3 that says the target needs calls in prologues to check for stack overflow, and use that instead. More portable -- i.e. doesn't require hardware page protection -- but bigger/bloated/slower. ? ? ? Really you need to look at all the POSIX/PTHREAD/WIN32 directories, esp. in m3core and libm3. You make a much different system, you get to do the port. It is neither impossible nor a no-op. ? ? ?- Jay ? From:?darko at darko.org Date: Fri, 4 Jan 2013 12:09:26 -0800 To:?dabenavidesd at yahoo.es CC:?m3devel at elegosoft.com Subject: Re: [M3devel] Bare Metal Modula-3 It's not a realtime system, so that's not a problem. Have a look at my reply to Jay you'll see a fuller description of what I have in mind. On Jan 4, 2013, at 10:46 AM, Daniel Alejandro Benavides D. wrote: Hi all: I think you just need runtime executive on top a machine would be enough. For instance VAXELN.? Problem is you would need realtime core services at the language level (somehow SPIN services with no protection overhead caused by language). Memory managament.? and threading are core services in VAXELN as part of system, just need bindings for each language. I guess you need and advanced distributed realtime system. Such was VMS 5 for rtVAX9000: http://books.google.com.co/books?id=TzUXAQAAMAAJ&dq="%2C+in+conjunction+with+VMS.+VAXELN%2C+which+provides+optimal+performance+for"&q="+which+provides+optimal+performance+for"#search_anchor My hypothesis is that you can't bring up a realtime application in an embedded device like you want. I know of realtime OS in Modula-3, there must be several ones I guess, based on what I have researched but you can not trust whether they are embedded, that's the problem. Thanks in advance --- El?vie, 4/1/13, Darko??escribi?: De: Darko Asunto: [M3devel] Bare Metal Modula-3 Para: "m3devel developers" Fecha: viernes, 4 de enero, 2013 04:16 I'm interested in deploying M3 into a kind-of embedded environment where efficiency and performance are key and I want to avoid installing an OS beyond a simple supervisor that manages the hardware.? The services needed are threading, memory allocation and network access. I'm figuring the first two already exist in M3 and a network stack can be found. The question I have is can all of the OS specific runtime can be removed? Beyond maybe a timer and possibly some memory protection functionality, what does M3 need to run threading and garbage collection? - Darko -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Wed Jan 9 07:46:00 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 9 Jan 2013 06:46:00 +0000 Subject: [M3devel] thouhts on -Wall with C backend output In-Reply-To: <20121217074935.5DD971A2094@async.async.caltech.edu> References: , , <20121216184306.GA29473@topoi.pooq.com>, , <20121216185529.AD9681A2094@async.async.caltech.edu>, , <20121217074935.5DD971A2094@async.async.caltech.edu> Message-ID: I'm going with "gcc -Wno-return-type " for now. Alas. I put in "default:assert(!"case_jump hit default") for case_jumps, but of coursethat doesn't help. If/when I make the C backend even more sophisticated, I'll detectlabel:;} // end of non-void function and change it to:label:assert(!"control reaches end of non-void function");} // end of non-void function This level of sophistication is basically to run the last pass multiple times, suppressing some/most logic/code, esp. the prints on all but the last pass. The other passes, so far, have been useful in that they run over a subset of operations, and leavefewer for the last pass to deal with. Hm. I do have "op_index", so at end of function, I might be able to just look back one operation for the set_label. But that wouldn't detect:label: a = b;} // end of function maybe that never occurs. I also can't likely just put the assert at the end of every non-void function. 1) it bloats the code a bit 2) it would be usually unreachable. I'm not even sure gcc wouldn't complain here about reachability...except..I already omit unused labels, so I know this label is branched to... anyway..later... - Jay > To: jay.krell at cornell.edu > Date: Sun, 16 Dec 2012 23:49:35 -0800 > From: mika at async.caltech.edu > CC: m3devel at elegosoft.com > Subject: Re: [M3devel] thouhts on -Wall with C backend output > > Yeah it sounds like the frontend knows something that it's not telling > the backend about... if I am reading your emails right. > > Jay K writes: > >--_ad389312-f922-410e-bb8f-e7106388428f_ > >Content-Type: text/plain; charset="Windows-1252" > >Content-Transfer-Encoding: quoted-printable > > > > > >drat=2C these are worse: > > > >"../src/Macro.m3"=2C line 949: warning: unreachable ELSE in TYPECASE > > > > > >=3D=3D package /Users/jay/dev2/cm3/m3-ui/formsvbt =3D=3D > > > > +++ /cm3/bin/cm3 -build -DROOT=3D/Users/jay/dev2/cm3 +++ > >--- building in AMD64_DARWIN --- > > > >ignoring ../src/m3overrides > > > >new source -> compiling Macro.m3 > >cc1plus: warnings being treated as errors > >Macro.mc.c: In function =91char* Macro__EvalLength(char*=2C char*)=92: > >Macro.mc.c:5271: warning: control reaches end of non-void function > >Macro.mc.c: In function =91char* Macro__EvalPlus(char*=2C char*)=92: > >Macro.mc.c:9004: warning: control reaches end of non-void function > >Macro.mc.c: In function =91char* Macro__EvalMinus(char*=2C char*)=92: > >Macro.mc.c:9468: warning: control reaches end of non-void function > > > > > >If I put in the somewhat obvious: > > > > > > ELSE <* ASSERT FALSE *> > > > > > >then: > > > >new source -> compiling Macro.m3 > >"../src/Macro.m3"=2C line 949: warning: unreachable ELSE in TYPECASE > >1 warning encountered > >cc1plus: warnings being treated as errors > >Macro.mc.c: In function =91char* Macro__EvalLength(char*=2C char*)=92: > >Macro.mc.c:5271: warning: control reaches end of non-void function > >Macro.mc.c: In function =91char* Macro__EvalPlus(char*=2C char*)=92: > >Macro.mc.c:9004: warning: control reaches end of non-void function > > > > > > > >For stablegen=2C I am inclined to put in that ELSE <* ASSERT FALSE *>. > > > > > >I might might might be able to put in C assert(false) in these places. > > > > - Jay > > > > > >> To: hendrik at topoi.pooq.com > >> Date: Sun=2C 16 Dec 2012 10:55:29 -0800 > >> From: mika at async.caltech.edu > >> CC: m3devel at elegosoft.com > >> Subject: Re: [M3devel] thouhts on -Wall with C backend output > >>=20 > >> Can you have an option to add an assertion in the output for these cases? > >>=20 > >> Here either > >>=20 > >> 1. gcc has found a bug in the C code generator and/or front end=2C in tha= > >t > >> there's no default (abortion) case > >>=20 > >> or > >>=20 > >> 2. the front end has deduced there is no need for abortion because it can > >> see that the missing ELSE is never going to be exercised=2C based on t= > >he > >> already existing type information > >>=20 > >> What I'm proposing is two modes for the compiler: > >>=20 > >> -- ignore the errors > >>=20 > >> or > >>=20 > >> -- add proper assertions to the C code=2C e.g.=2C=20 > >>=20 > >> assert(false=2C "front-end deduced this cant happen by inspecting typ= > >e information") > >>=20 > >> which=2C when enabled=2C should make gcc shut up=2C and instead turn i= > >nto > >> runtime checks on the compiler > >>=20 > >> Mika > >>=20 > >> Hendrik Boom writes: > >> >On Sun=2C Dec 16=2C 2012 at 09:58:10AM +0000=2C Jay K wrote: > >> >>=20 > >> >> I've tried to generate "very good C". > >> >> I've fixed some of what gcc -Wall complains about. > >> >> For default gcc on my old MacBook -- old enough that it can still emul= > >ate PowerPC=2C gcc is 4.0.1. > >> >> (at least one of what I deal with=2C I think anything newer won't comp= > >lain..) > >> >>=20 > >> >>=20 > >> >>=20 > >> >> do-cm3-all with -Wall -Werror gets very far=2C to: > >> >>=20 > >> >> =3D=3D package /Users/jay/dev2/cm3/m3-db/stablegen =3D=3D > >> >>=20 > >> >> +++ /cm3/bin/cm3 -build -DROOT=3D/Users/jay/dev2/cm3 +++ > >> >> --- building in AMD64_DARWIN --- > >> >>=20 > >> >> ignoring ../src/m3overrides > >> >>=20 > >> >> w source -> compiling GenCode.m3 > >> >> cc1: warnings being treated as errors > >> >> GenCode.mc.c: In function =91GenCode__BuildMethods__Search=92: > >> >> GenCode.mc.c:3505: warning: control reaches end of non-void function > >> >> m3_backend =3D> 1 > >> >>=20 > >> >> PROCEDURE Search ( type : Type.Reference=3B > >> >> VAR count : INTEGER=3B > >> >> VAR top : CARDINAL=3B > >> >> umethods: AtomList.T ): > >> >> ImportList.MethodList RAISES {StablegenError.E} =3D > >> >> VAR methods: ImportList.MethodList=3B > >> >> BEGIN > >> >> IF (type =3D Type.root) OR (type =3D NIL) THEN (* base of > >> >> recursion *) > >> >> RETURN NEW(ImportList.MethodList=2C ABS(count)) > >> >> ELSE > >> >> TYPECASE type OF > >> >> Type.Object (ob) =3D>=20 > >> >> IF count <=3D 0 THEN > >> >> count:=3D count - NUMBER(ob.methods^) > >> >> END=3B > >> >> methods :=3D Search(ob.super=2C count=2C top=2C umethods)=3B > >> >> FOR i :=3D 0 TO LAST(ob.methods^) DO > >> >> IF umethods =3D NIL > >> >> OR AtomList.Member( > >> >> umethods=2C ob.methods[i].name) THEN > >> >> IF AtomList.Member(reserved=2C ob.methods[i].name) THEN > >> >> RAISE StablegenError.E(Atom.ToText(ob.methods[i].name) > >> >> &" is a reserved method name in stable objects. " > >> >> &"Must not be an update method.") > >> >> END=3B > >> >> methods[top].name :=3D ob.methods[i].name=3B > >> >> methods[top].sig :=3D ob.methods[i].sig=3B > >> >> INC(top) > >> >> END > >> >> END=3B > >> >> RETURN methods > >> >> | Type.Opaque (op) =3D> > >> >> RETURN Search(op.revealedSuperType=2C count=2C top=2C umetho= > >ds) > >> >> | Type.Reference =3D> <*ASSERT FALSE*> > >> >> END > >> >> END > >> >> END Search=3B > >> >>=20 > >> >> I think we can't expect gcc -Wall -Werror to pass. > >> >> I really wanted it to=2C and I tried=2C and I fixed stuff. > >> >> But I don't think it is viable. > >> >> Ok? > >> > > >> >Could it be that the TYPECASE doesn't have an ELSE clause=2C possibly > >> >translated to a switch withouy a default: label? This would give the > >> >C code an apparent path to the end of the function. M3 may know that > >> >the TYPECASE exhausts all the possibilities=2C but C will not. > >> > > >> >-- hendrik > > = > > > >--_ad389312-f922-410e-bb8f-e7106388428f_ > >Content-Type: text/html; charset="Windows-1252" > >Content-Transfer-Encoding: quoted-printable > > > > > > > > > >
> >drat=2C these are worse:

"../src/Macro.m3"=2C line 949: warning: unr= > >eachable ELSE in TYPECASE


=3D=3D package /Users/jay/dev2/cm3/m3-= > >ui/formsvbt =3D=3D

 =3B+++ /cm3/bin/cm3 =3B =3B =3B = > >-build -DROOT=3D/Users/jay/dev2/cm3 +++
--- building in AMD64_DARWIN ---= > >

ignoring ../src/m3overrides

new source ->=3B compiling Mac= > >ro.m3
cc1plus: warnings being treated as errors
Macro.mc.c: In functi= > >on =91char* Macro__EvalLength(char*=2C char*)=92:
Macro.mc.c:5271: warni= > >ng: control reaches end of non-void function
Macro.mc.c: In function =91= > >char* Macro__EvalPlus(char*=2C char*)=92:
Macro.mc.c:9004: warning: cont= > >rol reaches end of non-void function
Macro.mc.c: In function =91char* Ma= > >cro__EvalMinus(char*=2C char*)=92:
Macro.mc.c:9468: warning: control rea= > >ches end of non-void function


If I put in the somewhat obvious:<= > >br>

 =3B =3B =3B ELSE <=3B* ASSERT FALSE *>=3B
>r>
then:

new source ->=3B compiling Macro.m3
"../src/Macro.m= > >3"=2C line 949: warning: unreachable ELSE in TYPECASE
1 warning encounte= > >red
cc1plus: warnings being treated as errors
Macro.mc.c: In function= > > =91char* Macro__EvalLength(char*=2C char*)=92:
Macro.mc.c:5271: warning= > >: control reaches end of non-void function
Macro.mc.c: In function =91ch= > >ar* Macro__EvalPlus(char*=2C char*)=92:
Macro.mc.c:9004: warning: contro= > >l reaches end of non-void function



For stablegen=2C I am inc= > >lined to put in that ELSE <=3B* ASSERT FALSE *>=3B.


I might = > >might might be able to put in C assert(false) in these places.

 = > >=3B- Jay


>=3B To: h= > >endrik at topoi.pooq.com
>=3B Date: Sun=2C 16 Dec 2012 10:55:29 -0800
= > >>=3B From: mika at async.caltech.edu
>=3B CC: m3devel at elegosoft.com
= > >>=3B Subject: Re: [M3devel] thouhts on -Wall with C backend output
>= > >=3B
>=3B Can you have an option to add an assertion in the output for= > > these cases?
>=3B
>=3B Here either
>=3B
>=3B 1. gcc = > >has found a bug in the C code generator and/or front end=2C in that
>= > >=3B there's no default (abortion) case
>=3B
>=3B or
>=3B= > >
>=3B 2. the front end has deduced there is no need for abortion beca= > >use it can
>=3B see that the missing ELSE is never going to be exer= > >cised=2C based on the
>=3B already existing type information
>= > >=3B
>=3B What I'm proposing is two modes for the compiler:
>=3B = > >
>=3B -- ignore the errors
>=3B
>=3B or
>=3B
>= > >=3B -- add proper assertions to the C code=2C e.g.=2C
>=3B
>=3B= > > assert(false=2C "front-end deduced this cant happen by inspecting type= > > information")
>=3B
>=3B which=2C when enabled=2C should make= > > gcc shut up=2C and instead turn into
>=3B runtime checks on the co= > >mpiler
>=3B
>=3B Mika
>=3B
>=3B Hendrik Boom wr= > >ites:
>=3B >=3BOn Sun=2C Dec 16=2C 2012 at 09:58:10AM +0000=2C Jay K= > > wrote:
>=3B >=3B>=3B
>=3B >=3B>=3B I've tried to genera= > >te "very good C".
>=3B >=3B>=3B I've fixed some of what gcc -Wall = > >complains about.
>=3B >=3B>=3B For default gcc on my old MacBook -= > >- old enough that it can still emulate PowerPC=2C gcc is 4.0.1.
>=3B &= > >gt=3B>=3B (at least one of what I deal with=2C I think anything newer won= > >'t complain..)
>=3B >=3B>=3B
>=3B >=3B>=3B
>=3B &g= > >t=3B>=3B
>=3B >=3B>=3B do-cm3-all with -Wall -Werror gets very = > >far=2C to:
>=3B >=3B>=3B
>=3B >=3B>=3B =3D=3D package /U= > >sers/jay/dev2/cm3/m3-db/stablegen =3D=3D
>=3B >=3B>=3B
>=3B = > >>=3B>=3B +++ /cm3/bin/cm3 -build -DROOT=3D/Users/jay/dev2/cm3 +++ >r>>=3B >=3B>=3B --- building in AMD64_DARWIN ---
>=3B >=3B>= > >=3B
>=3B >=3B>=3B ignoring ../src/m3overrides
>=3B >=3B>= > >=3B
>=3B >=3B>=3B w source ->=3B compiling GenCode.m3
>=3B= > > >=3B>=3B cc1: warnings being treated as errors
>=3B >=3B>=3B = > >GenCode.mc.c: In function =91GenCode__BuildMethods__Search=92:
>=3B &g= > >t=3B>=3B GenCode.mc.c:3505: warning: control reaches end of non-void func= > >tion
>=3B >=3B>=3B m3_backend =3D>=3B 1
>=3B >=3B>=3B= > >
>=3B >=3B>=3B PROCEDURE Search ( type : Type.Reference= > >=3B
>=3B >=3B>=3B VAR count : INTEGER=3B
= > >>=3B >=3B>=3B VAR top : CARDINAL=3B
>=3B= > > >=3B>=3B umethods: AtomList.T ):
>=3B &= > >gt=3B>=3B ImportList.MethodList RAISES {StablegenError.E} =3D
>= > >=3B >=3B>=3B VAR methods: ImportList.MethodList=3B
>=3B >=3B= > >>=3B BEGIN
>=3B >=3B>=3B IF (type =3D Type.root) OR (t= > >ype =3D NIL) THEN (* base of
>=3B >=3B>=3B = > > recursion *)
>=3B >=3B>=3B RE= > >TURN NEW(ImportList.MethodList=2C ABS(count))
>=3B >=3B>=3B = > >ELSE
>=3B >=3B>=3B TYPECASE type OF
>=3B >=3B>=3B = > > Type.Object (ob) =3D>=3B
>=3B >=3B>=3B IF coun= > >t <=3B=3D 0 THEN
>=3B >=3B>=3B count:=3D count - NUM= > >BER(ob.methods^)
>=3B >=3B>=3B END=3B
>=3B >=3B&g= > >t=3B methods :=3D Search(ob.super=2C count=2C top=2C umethods)=3B= > >
>=3B >=3B>=3B FOR i :=3D 0 TO LAST(ob.methods^) DO
&= > >gt=3B >=3B>=3B IF umethods =3D NIL
>=3B >=3B>=3B = > > OR AtomList.Member(
>=3B >=3B>=3B = > > umethods=2C ob.methods[i].name) THEN
>=3B >=3B>=3B = > > IF AtomList.Member(reserved=2C ob.methods[i].name) THEN
>=3B >=3B&g= > >t=3B RAISE StablegenError.E(Atom.ToText(ob.methods[i].name)= > >
>=3B >=3B>=3B &=3B" is a reserved method name = > >in stable objects. "
>=3B >=3B>=3B &=3B"Must no= > >t be an update method.")
>=3B >=3B>=3B END=3B
>= > >=3B >=3B>=3B methods[top].name :=3D ob.methods[i].name=3B= > >
>=3B >=3B>=3B methods[top].sig :=3D ob.methods[i].s= > >ig=3B
>=3B >=3B>=3B INC(top)
>=3B >=3B>=3B = > > END
>=3B >=3B>=3B END=3B
>=3B >=3B>= > >=3B RETURN methods
>=3B >=3B>=3B | Type.Opaque (= > >op) =3D>=3B
>=3B >=3B>=3B RETURN Search(op.revealedSup= > >erType=2C count=2C top=2C umethods)
>=3B >=3B>=3B | Type.R= > >eference =3D>=3B <=3B*ASSERT FALSE*>=3B
>=3B >=3B>=3B = > > END
>=3B >=3B>=3B END
>=3B >=3B>=3B END Searc= > >h=3B
>=3B >=3B>=3B
>=3B >=3B>=3B I think we can't expect= > > gcc -Wall -Werror to pass.
>=3B >=3B>=3B I really wanted it to=2C= > > and I tried=2C and I fixed stuff.
>=3B >=3B>=3B But I don't think= > > it is viable.
>=3B >=3B>=3B Ok?
>=3B >=3B
>=3B >=3B= > >Could it be that the TYPECASE doesn't have an ELSE clause=2C possibly
&= > >gt=3B >=3Btranslated to a switch withouy a default: label? This would gi= > >ve the
>=3B >=3BC code an apparent path to the end of the function. = > > M3 may know that
>=3B >=3Bthe TYPECASE exhausts all the possibiliti= > >es=2C but C will not.
>=3B >=3B
>=3B >=3B-- hendrik
= > >
> >= > > > >--_ad389312-f922-410e-bb8f-e7106388428f_-- -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Wed Jan 9 07:53:49 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 9 Jan 2013 06:53:49 +0000 Subject: [M3devel] time to introduce C mode to builder? Message-ID: So..in our config files..I have this fairly reasonable autoconf-ish logic: if not equal(try_exec("@" & SYSTEM_CC & m & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: invalid option \\\`32'\" >/dev/null"), 0) SYSTEM_CC = SYSTEM_CC & m SYSTEM_CC_ASM = SYSTEM_CC_ASM & m end if not equal(try_exec("@" & SYSTEM_CC & arch & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: unrecognized command line option \\\\\"-arch\\\\\"\" >/dev/null"), 0) SYSTEM_CC = SYSTEM_CC & arch SYSTEM_CC_ASM = SYSTEM_CC_ASM & arch end It is detecting if gcc understands switches like -m32, -m64, -arch ppc, etc.By fgreping error messages.If gcc is localized, it might be wrong. This is fairly reasonable without a C backend, as the C compiler is used relatively few times.It is used as the linker, and if the directory has any C code.It is used a maximum of once per cm3 invocation. Now, currently I'm using m3cgcat, per file, and it reuses this code (good!)So instead of doing the autoconf-ish logic zero or one times per directory, I'm doing it n times per directory, for fairly large n. (i.e. per source file) I could, you know, hardcode the switches, or introduce a "setup" phase for users.. However, to "kill two birds with one stone", can I go ahead and introduce a "C" mode to the "builder"?You know, we have 4 modes: integrated backend generates assembly integrated backend generates object files external backend generates assembly external backend generates object files (We only use two of them.) I'd like to introduce: integrated backend generates C files (with no clear distinction currently between C and C++; the code tries to be valid for either, but eventually we'll probably want to generate C++ for exception handling). I implemented this months ago and showed the diffs here. This is one of the steps necessary before rolling out the C mode broadly (along with making sure it works with many existing targets, and adding new targets that use it, i.e. AMD64_NT). Thanks, - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Wed Jan 9 17:30:47 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Wed, 9 Jan 2013 16:30:47 +0000 (GMT) Subject: [M3devel] time to introduce C mode to builder? In-Reply-To: Message-ID: <1357749047.85558.YahooMailClassic@web133106.mail.ir2.yahoo.com> Hi all: Jay, besides writing another backend why not ask ex-DEC-SRC about their internal C- generating backend: http://computer-programming-forum.com/27-modula2/4637e2c4a0349465.htm Thanks in advance --- El mi?, 9/1/13, Jay K escribi?: De: Jay K Asunto: [M3devel] time to introduce C mode to builder? Para: "m3devel" Fecha: mi?rcoles, 9 de enero, 2013 01:53 So..in our config files..I have this fairly reasonable autoconf-ish logic: ? if not equal(try_exec("@" & SYSTEM_CC & m & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: invalid option \\\`32'\" >/dev/null"), 0)? ? SYSTEM_CC = SYSTEM_CC & m? ? SYSTEM_CC_ASM = SYSTEM_CC_ASM & m? end? if not equal(try_exec("@" & SYSTEM_CC & arch & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: unrecognized command line option \\\\\"-arch\\\\\"\" >/dev/null"), 0)? ? SYSTEM_CC = SYSTEM_CC & arch? ? SYSTEM_CC_ASM = SYSTEM_CC_ASM & arch? end It is detecting if gcc understands switches like -m32, -m64, -arch ppc, etc.By fgreping error messages.If gcc is localized, it might be wrong. This is fairly reasonable without a C backend, as the C compiler is used relatively few times.It is used as the linker, and if the directory has any C code.It is used a maximum of once per cm3 invocation. Now, currently I'm using m3cgcat, per file, and it reuses this code (good!)So instead of doing the autoconf-ish logic zero or one times per directory, I'm doing it n times per directory, for fairly large n. (i.e. per source file) I could, you know, hardcode the switches, or introduce a "setup" phase for users.. However, to "kill two birds with one stone", can I go ahead and introduce a "C" mode to the "builder"?You know, we have 4 modes:?integrated backend generates assembly??integrated backend generates object files ??external backend generates assembly??external?backend generates object files? (We only use two of them.) I'd like to introduce:?integrated backend generates C files (with no clear distinction currently between C and C++; the code tries to be valid for either, but eventually we'll probably want to generate C++ for exception handling). I implemented this months ago and showed the diffs here. This is one of the steps necessary before rolling out the C mode broadly (along with making sure it works with many existing targets, and adding new targets that use it, i.e. AMD64_NT). Thanks,?- Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From hendrik at topoi.pooq.com Thu Jan 10 02:23:50 2013 From: hendrik at topoi.pooq.com (Hendrik Boom) Date: Wed, 9 Jan 2013 20:23:50 -0500 Subject: [M3devel] time to introduce C mode to builder? In-Reply-To: References: Message-ID: <20130110012350.GA27496@topoi.pooq.com> On Wed, Jan 09, 2013 at 06:53:49AM +0000, Jay K wrote: > > It is detecting if gcc understands switches like -m32, -m64, -arch ppc, etc.By fgreping error messages.If gcc is localized, it might be wrong. You could try explicitly setting $ENV to C during the calls to SYSTEM_CC in order to standardise the messages. -- hendrik From hosking at cs.purdue.edu Wed Jan 9 22:25:27 2013 From: hosking at cs.purdue.edu (Antony Hosking) Date: Thu, 10 Jan 2013 08:25:27 +1100 Subject: [M3devel] time to introduce C mode to builder? In-Reply-To: References: Message-ID: Yes, sure. Antony Hosking | Associate Professor | Computer Science | Purdue University 305 N. University Street | West Lafayette | IN 47907 | USA Mobile +1 765 427 5484 On Jan 9, 2013, at 5:53 PM, Jay K wrote: > So..in our config files..I have this fairly reasonable autoconf-ish logic: > > > if not equal(try_exec("@" & SYSTEM_CC & m & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: invalid option \\\`32'\" >/dev/null"), 0) > SYSTEM_CC = SYSTEM_CC & m > SYSTEM_CC_ASM = SYSTEM_CC_ASM & m > end > if not equal(try_exec("@" & SYSTEM_CC & arch & " -c -x c /dev/null -o /dev/null 2>&1 | fgrep \"cc1: error: unrecognized command line option \\\\\"-arch\\\\\"\" >/dev/null"), 0) > SYSTEM_CC = SYSTEM_CC & arch > SYSTEM_CC_ASM = SYSTEM_CC_ASM & arch > end > > > It is detecting if gcc understands switches like -m32, -m64, -arch ppc, etc. > By fgreping error messages. > If gcc is localized, it might be wrong. > > > This is fairly reasonable without a C backend, as the C compiler is used relatively few times. > It is used as the linker, and if the directory has any C code. > It is used a maximum of once per cm3 invocation. > > > Now, currently I'm using m3cgcat, per file, and it reuses this code (good!) > So instead of doing the autoconf-ish logic zero or one times per directory, I'm doing it n times per directory, for fairly large n. (i.e. per source file) > > > I could, you know, hardcode the switches, or introduce a "setup" phase for users. > . > > However, to "kill two birds with one stone", can I go ahead and introduce a "C" mode to the "builder"? > You know, we have 4 modes: > integrated backend generates assembly > integrated backend generates object files > external backend generates assembly > external backend generates object files > > > (We only use two of them.) > > > I'd like to introduce: > integrated backend generates C files (with no clear distinction currently between C and C++; the code tries to be valid for either, but eventually we'll probably want to generate C++ for exception handling). > > > I implemented this months ago and showed the diffs here. > > > This is one of the steps necessary before rolling out the C mode broadly (along with making sure it works with many existing targets, and adding new targets that use it, i.e. AMD64_NT). > > > Thanks, > - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Sun Jan 13 19:26:44 2013 From: jay.krell at cornell.edu (Jay) Date: Sun, 13 Jan 2013 10:26:44 -0800 Subject: [M3devel] Fwd: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 References: <50EF35B2.8050003@FreeBSD.org> Message-ID: <7CCADA27-2C42-4431-8D7E-11923D4F63C0@gmail.com> Declining use of CVS, CVSup, csup: Begin forwarded message: > From: Beat Gaetzi > Date: January 10, 2013, 1:42:10 PM PST > To: , > Subject: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 > > Hi, > > As announced in September the ports tree will no longer be exported to > CVS after February 28th 2013. All users who still use CVS, CVSup or csup > to update the ports tree are encouraged to switch to portsnap(8) or for > users which need more control over their ports collection to use > Subversion directly [1]. > > A migration guide from CVSup/csup to portsnap is also available in the > FreeBSD handbook [2]. > > More information regarding the end of ports CVS can be found in the > initial announcement [3]. > > Beat, on behalf of portmgr@ > > [1] > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html > [2] > http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html#cvsup-migration > [3] > http://lists.freebsd.org/pipermail/freebsd-announce/2012-September/001435.html > _______________________________________________ > freebsd-announce at freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-announce > To unsubscribe, send any mail to "freebsd-announce-unsubscribe at freebsd.org" -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Mon Jan 14 04:31:15 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Mon, 14 Jan 2013 03:31:15 +0000 (GMT) Subject: [M3devel] Fwd: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 In-Reply-To: <7CCADA27-2C42-4431-8D7E-11923D4F63C0@gmail.com> Message-ID: <1358134275.67070.YahooMailClassic@web133102.mail.ir2.yahoo.com> Hi all: http://freebsd.1045724.n5.nabble.com/Cvsup-amp-cvsupd-on-Linux-td5739101.html It might been some problem in mailing list?, but I don't think they regret so, they weren't using it actively since 2008 switch over rsync. Anyway, we didn't solve the thread issue in which CVsupd stalled, and apparently didn't want us to solve it. What could we do? Thanks in advance --- El dom, 13/1/13, Jay escribi?: De: Jay Asunto: [M3devel] Fwd: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 Para: "m3devel" Fecha: domingo, 13 de enero, 2013 13:26 Declining use of CVS, CVSup, csup: Begin forwarded message: From: Beat Gaetzi Date: January 10, 2013, 1:42:10 PM PST To: , Subject: [FreeBSD-Announce] Reminder: Ports CVS EoL on February 28th 2013 Hi, As announced in September the ports tree will no longer be exported to CVS after February 28th 2013. All users who still use CVS, CVSup or csup to update the ports tree are encouraged to switch to portsnap(8) or for users which need more control over their ports collection to use Subversion directly [1]. A migration guide from CVSup/csup to portsnap is also available in the FreeBSD handbook [2]. More information regarding the end of ports CVS can be found in the initial announcement [3]. Beat, on behalf of portmgr@ [1] http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html [2] http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html#cvsup-migration [3] http://lists.freebsd.org/pipermail/freebsd-announce/2012-September/001435.html _______________________________________________ freebsd-announce at freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-announce To unsubscribe, send any mail to "freebsd-announce-unsubscribe at freebsd.org" -------------- next part -------------- An HTML attachment was scrubbed... URL: From dabenavidesd at yahoo.es Mon Jan 14 23:08:13 2013 From: dabenavidesd at yahoo.es (Daniel Alejandro Benavides D.) Date: Mon, 14 Jan 2013 22:08:13 +0000 (GMT) Subject: [M3devel] About next release source, pre-built, pre-processor based ? Message-ID: <1358201293.55352.YahooMailClassic@web133103.mail.ir2.yahoo.com> Hi all: Does anybody knows what gonna be next release based on, or have any thoughts on its distribution form? This is because I want to talk about some language annotation mechanism idea in form of pragmas for memory accountability for possible small sized memory targets like embedded processors, any thoughts. Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.anderson at elego.de Tue Jan 22 14:04:31 2013 From: michael.anderson at elego.de (Michael Anderson) Date: Tue, 22 Jan 2013 14:04:31 +0100 Subject: [M3devel] [ Message-ID: <50FE8E5F.1080606@elego.de> Hello Modula3 Users and Developers, As you may have noticed, our server birch.elego.de was down for most of the day yesterday due to hardware failure. As a full restore from backup was necessary, we decided to virtualize the system and move it to a more powerful server. As a result, the IP address has changed, and SSH users will receive a warning upon connecting, and will need to remove the corresponding entry for birch.elego.de in their ~/.ssh/known_hosts file. Please note that we are still in the process of restoring the cm3 package archive, so there may be broken links on the website until everything is uploaded. The cm3 cvs repository has been completely restored and is available for use. Please contact me directly at if you have any questions or experience problems with the new system. Michael Anderson -- Michael Anderson IT Services & Support elego Software Solutions GmbH Gustav-Meyer-Allee 25 Building 12.3 (BIG) room 227 13355 Berlin, Germany phone +49 30 23 45 86 96 michael.anderson at elegosoft.com fax +49 30 23 45 86 95 http://www.elegosoft.com Geschaeftsfuehrer: Olaf Wagner, Sitz Berlin Amtsgericht Berlin-Charlottenburg, HRB 77719, USt-IdNr: DE163214194 From jay.krell at cornell.edu Mon Jan 28 07:22:53 2013 From: jay.krell at cornell.edu (Jay K) Date: Mon, 28 Jan 2013 06:22:53 +0000 Subject: [M3devel] probing existance of C backend in config/quake Message-ID: I maintain (and they are checked in and used) "one" set of config files that are meant to work with a variety of old and new releases. The "upgrade" process, i.e. in Tinderbox/Hudon, does not necessarily do things this way -- they have old config files that go with old compilers, and only try to use the current version with current compilers. For these purposes however, I desire, like: M3Build.m3: Builtins = ARRAY OF Builtin { (*------------------------------------------------- feature/version probes --*) Builtin {"HasCBackend", HasCBackend, 0, TRUE }, ... (*------------------------------------------------- feature/version probes --*) PROCEDURE HasCBackend (m: QMachine.T; <*UNUSED*> n_args: INTEGER) RAISES {Quake.Error} = VAR t := Self (m); BEGIN PushBool (t, TRUE); END HasCBackend; so config file can use the old mode "3" gcc backend if there is no C backend. ok? Thanks, - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Mon Jan 28 07:44:29 2013 From: jay.krell at cornell.edu (Jay K) Date: Mon, 28 Jan 2013 06:44:29 +0000 Subject: [M3devel] generating target-independent C in backend? Message-ID: Currently the C output is target-specific. I want to generate one set of C output for all platforms. So you just download one portable "m3.tar.gz". Is there agreement on this goal? Others might help? And no generally object to my changes to make it so? Here are the obstacles to getting there as I understand: win32 vs. posix (or more generally, logic on the m3makefile's that change what source is compiled) jmpbuf size endian word size/layout I believe the "layout rules" (padding/alignment) are now fairly target independent, EXCEPT that endianness and word size vary. That is, interop with C has been compromised. jmpbuf size is probably the easiest to fix. In the near term, solve it like I already tried. change jmpbuf x to void*x = 0; x = x ? x : alloca(sizeof_jmpbuf); contants.c #include extern const size_t sizeof_jmpbuf = sizeof(jmpbuf) (plus possible Cygwin hack -- they accidentally blow up the size by a factor of 4) long term: generate C++ and no more setjmp/longjmp, or possibly C on OpenVMS, Tru64, and NT, possibly #ifdefed Endianness is partly solved by moving the "floating point cracking" code to C. But that doesn't suffice. There remain bitfields in the runtime, I don't think they can/should be removed, and their layout is endian-specific. Maybe we can just change layout to not be endian specific? I don't care to enable or keep working interop with C bitfields. win32 vs. posix (also pthreads vs. user threads) requires "something" in the "builder", interacting with the backend perhaps, or with bootstrapping Basically whenever there is an "if" in quake, you kind of need to go down both paths, but communicate the condition to the next level down. Like if we had FooPosix.m3 and FooWin32.m3 we either want both FooPosix.c and FooWin32.c generated and we'll only compile one of them, or Foo.m3 with both contents concatenated but with an #if/#else/#endif between them. But what if we had FooWin32.i3 and FooPosix.i3? We can't let FooPosix.i3 be fixible BarWin32.m3. Like, we want to compile everything to C, but not otherwise "infect" the compilation system with the conceptual output. Does that make sense? The layout problem is tricky. We need separate notions in the backend for UINT32, UINT64, and size_t; and INT32, INT64, and ptrdiff_t (INTEGER). We can't have the frontend resolve to a specific size, at least not without maintaining some notion of the abstraction that the backend sees. The existing typeids might suffice. As well, records/fields have to treated differently, or in an extra way. That is, we can pass computed sizes and offsets to the backend, and we'd also have to pass other information, and the backend could chose which to use. A reasonably easy approach is to pass a list of integers to add up and maybe multiple, and besides the obvious 1, 2, 4, 8, there'd also be stand-in values for "size_t", like maybe -1. This might be deducable from the declarations we have about arrays and records. It is also tempting to give up on the majority of this. If we solve the jmpbuf problem..including, heck, just blow up jmpbufs to 1K, or use C++ exception handling, then there are only a few targets remainaing: 32bit little endian posix 64bit little endian posix 32bit little big posix 64bit little big posix 32bit little endian NT 64bit little endian NT big endian NT doesn't really exist (Xbox 360?). We could distribute 6 source archives and let the user chose? Seems too lame to me. But that might be the short term solution. ? - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.veselovsky at gmail.com Mon Jan 28 18:30:40 2013 From: alexey.veselovsky at gmail.com (Alexey Veselovsky) Date: Mon, 28 Jan 2013 21:30:40 +0400 Subject: [M3devel] Information about record/object field name. Message-ID: Hello. It is possible to retrieve field names for given Record or Object type? I need it for json serializer. Also this information useful for creating field-order independent serializer. Thanks, Alexey. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mika at async.caltech.edu Mon Jan 28 19:40:24 2013 From: mika at async.caltech.edu (mika at async.caltech.edu) Date: Mon, 28 Jan 2013 10:40:24 -0800 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: Message-ID: <20130128184025.03FD21A207D@async.async.caltech.edu> I do this sort of thing with m3tk. I have posted links to a Scheme interpreter on this mailing list before. If you look at how it works you can see how it encodes records. (It uses the field names just as you suggest, in a dotted pair---very similar to JSON.) If you can't find it I can repeat the links for you. It's a CVS repository that has anonymous access. Mika Alexey Veselovsky writes: >--f46d04088f7bcbc96504d45ca2ca >Content-Type: text/plain; charset=ISO-8859-1 > >Hello. > >It is possible to retrieve field names for given Record or Object type? > >I need it for json serializer. > >Also this information useful for creating field-order independent >serializer. > >Thanks, Alexey. > >--f46d04088f7bcbc96504d45ca2ca >Content-Type: text/html; charset=ISO-8859-1 > >
Hello.

It is possible to retrieve field names for given Record or Object type?
tyle>
I need it for json serializer.

>Also this information useful for creating field-order independent serializer.

Thanks, Alexey. >
> >--f46d04088f7bcbc96504d45ca2ca-- From alexey.veselovsky at gmail.com Mon Jan 28 19:50:10 2013 From: alexey.veselovsky at gmail.com (Alexey Veselovsky) Date: Mon, 28 Jan 2013 22:50:10 +0400 Subject: [M3devel] Information about record/object field name. In-Reply-To: <20130128184025.03FD21A207D@async.async.caltech.edu> References: <20130128184025.03FD21A207D@async.async.caltech.edu> Message-ID: I can't find. Please give me link. Thanks, Alexey. On Mon, Jan 28, 2013 at 10:40 PM, wrote: > I do this sort of thing with m3tk. > > I have posted links to a Scheme interpreter on this mailing list before. > If you look at how it works you can see how it encodes records. (It uses > the field names just as you suggest, in a dotted pair---very similar > to JSON.) > > If you can't find it I can repeat the links for you. It's a CVS repository > that has anonymous access. > > Mika > > Alexey Veselovsky writes: > >--f46d04088f7bcbc96504d45ca2ca > >Content-Type: text/plain; charset=ISO-8859-1 > > > >Hello. > > > >It is possible to retrieve field names for given Record or Object type? > > > >I need it for json serializer. > > > >Also this information useful for creating field-order independent > >serializer. > > > >Thanks, Alexey. > > > >--f46d04088f7bcbc96504d45ca2ca > >Content-Type: text/html; charset=ISO-8859-1 > > > >
Hello.

It is possible to retrieve > field names for given Record or Object type?
>tyle>
I need it for json serializer.
style>
> >Also this information useful for creating field-order independent > serializer.

Thanks, Alexey. > >
> > > >--f46d04088f7bcbc96504d45ca2ca-- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.veselovsky at gmail.com Mon Jan 28 22:28:29 2013 From: alexey.veselovsky at gmail.com (Alexey Veselovsky) Date: Tue, 29 Jan 2013 00:28:29 +0300 Subject: [M3devel] Information about record/object field name. In-Reply-To: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> References: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> Message-ID: <1F41D973-19C2-4770-93FC-B26BA5894A74@gmail.com> Where I can read about m3web files? What is it? On 28.01.2013, at 23:16, Darko wrote: > Another way to do it is to parse the .M3WEB file. See the Load procedure in the attached module for clues (unfortunately it has some dependencies into my code but they're fairly obvious). It takes as a parameter the .M3WEB file from the build directory. > > > > > > On Jan 28, 2013, at 9:30 AM, Alexey Veselovsky wrote: > >> Hello. >> >> It is possible to retrieve field names for given Record or Object type? >> >> I need it for json serializer. >> >> Also this information useful for creating field-order independent serializer. >> >> Thanks, Alexey. > From darko at darko.org Mon Jan 28 21:39:24 2013 From: darko at darko.org (Darko) Date: Mon, 28 Jan 2013 12:39:24 -0800 Subject: [M3devel] Information about record/object field name. In-Reply-To: <1F41D973-19C2-4770-93FC-B26BA5894A74@gmail.com> References: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> <1F41D973-19C2-4770-93FC-B26BA5894A74@gmail.com> Message-ID: The files are generated by the compiler and are meant for an M3 tool which I forget the name of, I also forget where I got the details of the file from. I'll try to dig it up, or I may have guessed the format. Others on the list maybe have more information. On Jan 28, 2013, at 1:28 PM, Alexey Veselovsky wrote: > Where I can read about m3web files? What is it? > > On 28.01.2013, at 23:16, Darko wrote: > >> Another way to do it is to parse the .M3WEB file. See the Load procedure in the attached module for clues (unfortunately it has some dependencies into my code but they're fairly obvious). It takes as a parameter the .M3WEB file from the build directory. >> >> >> >> >> >> On Jan 28, 2013, at 9:30 AM, Alexey Veselovsky wrote: >> >>> Hello. >>> >>> It is possible to retrieve field names for given Record or Object type? >>> >>> I need it for json serializer. >>> >>> Also this information useful for creating field-order independent serializer. >>> >>> Thanks, Alexey. >> From darko at darko.org Mon Jan 28 21:16:32 2013 From: darko at darko.org (Darko) Date: Mon, 28 Jan 2013 12:16:32 -0800 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: Message-ID: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> Another way to do it is to parse the .M3WEB file. See the Load procedure in the attached module for clues (unfortunately it has some dependencies into my code but they're fairly obvious). It takes as a parameter the .M3WEB file from the build directory. -------------- next part -------------- A non-text attachment was scrubbed... Name: TypeInfo.i3 Type: application/octet-stream Size: 4266 bytes Desc: not available URL: -------------- next part -------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: TypeInfo.m3 Type: application/octet-stream Size: 17169 bytes Desc: not available URL: -------------- next part -------------- On Jan 28, 2013, at 9:30 AM, Alexey Veselovsky wrote: > Hello. > > It is possible to retrieve field names for given Record or Object type? > > I need it for json serializer. > > Also this information useful for creating field-order independent serializer. > > Thanks, Alexey. From mika at async.caltech.edu Tue Jan 29 10:40:57 2013 From: mika at async.caltech.edu (mika at async.caltech.edu) Date: Tue, 29 Jan 2013 01:40:57 -0800 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: <20130128184025.03FD21A207D@async.async.caltech.edu> Message-ID: <20130129094057.6E5631A208E@async.async.caltech.edu> cvs -d :pserver:anonymous at pluto.gcapltd.com:/home/gcap-public-cvs up -d . Alexey Veselovsky writes: >--f46d0435c24c28655c04d45dbf19 >Content-Type: text/plain; charset=ISO-8859-1 > >I can't find. Please give me link. > >Thanks, Alexey. > > >On Mon, Jan 28, 2013 at 10:40 PM, wrote: > >> I do this sort of thing with m3tk. >> >> I have posted links to a Scheme interpreter on this mailing list before. >> If you look at how it works you can see how it encodes records. (It uses >> the field names just as you suggest, in a dotted pair---very similar >> to JSON.) >> >> If you can't find it I can repeat the links for you. It's a CVS repository >> that has anonymous access. >> >> Mika >> >> Alexey Veselovsky writes: >> >--f46d04088f7bcbc96504d45ca2ca >> >Content-Type: text/plain; charset=ISO-8859-1 >> > >> >Hello. >> > >> >It is possible to retrieve field names for given Record or Object type? >> > >> >I need it for json serializer. >> > >> >Also this information useful for creating field-order independent >> >serializer. >> > >> >Thanks, Alexey. >> > >> >--f46d04088f7bcbc96504d45ca2ca >> >Content-Type: text/html; charset=ISO-8859-1 >> > >> >
Hello.

It is possible to retrieve >> field names for given Record or Object type?
> >tyle>
I need it for json serializer.
> style>
>> >Also this information useful for creating field-order independent >> serializer.

Thanks, Alexey. >> >
>> > >> >--f46d04088f7bcbc96504d45ca2ca-- >> > >--f46d0435c24c28655c04d45dbf19 >Content-Type: text/html; charset=ISO-8859-1 >Content-Transfer-Encoding: quoted-printable > >
I can't find. Please give me link.

= >Thanks, Alexey.


class=3D"gmail_quote">On Mon, Jan 28, 2013 at 10:40 PM, ><mika at async= >.caltech.edu> wrote:
>
x #ccc solid;padding-left:1ex">I do this sort of thing with m3tk.
>
>I have posted links to a Scheme interpreter on this mailing list before.> >If you look at how it works you can see how it encodes records. =A0(It uses= >
>the field names just as you suggest, in a dotted pair---very similar
>to JSON.)
>
>If you can't find it I can repeat the links for you. =A0It's a CVS = >repository
>that has anonymous access.
>
>=A0 =A0 =A0Mika
>
>Alexey Veselovsky writes:
>>--f46d04088f7bcbc96504d45ca2ca
>>Content-Type: text/plain; charset=3DISO-8859-1
>
>
>>Hello.
>>
>>It is possible to retrieve field names for given Record or Object type?= >
>>
>>I need it for json serializer.
>>
>>Also this information useful for creating field-order independent
>>serializer.
>>
>>Thanks, Alexey.
>>
>
>--f46d04088f7bcbc96504d45ca2ca
>>Content-Type: text/html; charset=3DISO-8859-1
>>
>><div dir=3D"ltr">Hello.<div><br></div>= >;<div style>It is possible to retrieve field names for given Record o= >r Object type?</div><div s
>>tyle><br></div><div style>I need it for json seria= >lizer.</div><div style><br></div><div style><= >br> >>Also this information useful for creating field-order independent seria= >lizer.</div><div style><br></div><div style>T= >hanks, Alexey.
>></div></div>
>>
>>--f46d04088f7bcbc96504d45ca2ca--
>

> >--f46d0435c24c28655c04d45dbf19-- From rcolebur at SCIRES.COM Tue Jan 29 22:42:42 2013 From: rcolebur at SCIRES.COM (Coleburn, Randy) Date: Tue, 29 Jan 2013 21:42:42 +0000 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: <804651A4-BBBA-4248-83DF-12375C0D8A24@darko.org> <1F41D973-19C2-4770-93FC-B26BA5894A74@gmail.com> Message-ID: <0BB8FA59C2932741A3A2941A8B9D8BFF03BDB3@ATLEX04-SRV.SCIRES.LOCAL> I think you may be referring to m3browser. Also, CM3IDE has the capability to generate and browse a web of your Modula-3 software source code. --Randy Coleburn -----Original Message----- From: Darko [mailto:darko at darko.org] Sent: Monday, January 28, 2013 3:39 PM To: Alexey Veselovsky Cc: m3devel at elegosoft.com Subject: EXT:Re: [M3devel] Information about record/object field name. The files are generated by the compiler and are meant for an M3 tool which I forget the name of, I also forget where I got the details of the file from. I'll try to dig it up, or I may have guessed the format. Others on the list maybe have more information. On Jan 28, 2013, at 1:28 PM, Alexey Veselovsky wrote: > Where I can read about m3web files? What is it? > > On 28.01.2013, at 23:16, Darko wrote: > >> Another way to do it is to parse the .M3WEB file. See the Load procedure in the attached module for clues (unfortunately it has some dependencies into my code but they're fairly obvious). It takes as a parameter the .M3WEB file from the build directory. >> >> >> >> >> >> On Jan 28, 2013, at 9:30 AM, Alexey Veselovsky wrote: >> >>> Hello. >>> >>> It is possible to retrieve field names for given Record or Object type? >>> >>> I need it for json serializer. >>> >>> Also this information useful for creating field-order independent serializer. >>> >>> Thanks, Alexey. >> From jay.krell at cornell.edu Wed Jan 30 08:40:02 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 30 Jan 2013 07:40:02 +0000 Subject: [M3devel] awful race condition in libm3/FilePosix.m3? Message-ID: FilePosix.m3: I'm not 100% sure, but looks really bad. I suspect it will close arbitrary files out from other threads. Notice there is absolutely no mutual exclusion. An arbitrary number of threads will run here, mostly succeeding, but not necessarily. VAR null_done := FALSE; null_stat: Ustat.struct_stat; null_fd: INTEGER; PROCEDURE IsDevNull(READONLY statbuf: Ustat.struct_stat): BOOLEAN RAISES {} = VAR result: INTEGER; BEGIN IF NOT null_done THEN null_fd := Unix.open(M3toC.FlatTtoS("/dev/null"), Unix.O_RDONLY, Unix.Mrwrwrw); IF null_fd < 0 THEN null_done := TRUE; RETURN FALSE ELSE result := Ustat.fstat(null_fd, ADR(null_stat)); EVAL Unix.close(null_fd); IF result # 0 THEN null_fd := -1 END END; null_done := TRUE; END; RETURN null_fd >= 0 AND statbuf.st_rdev = null_stat.st_rdev END IsDevNull; - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Wed Jan 30 09:24:50 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 30 Jan 2013 08:24:50 +0000 Subject: [M3devel] awful race condition in libm3/FilePosix.m3? In-Reply-To: References: Message-ID: I commited a fix. But two questions: 1) why not just stat, instead of open, fstat, close? 2) a lighter weight way to fix this than I did? In particular: a) VAR m := NEW(MUTEX); can we at least say VAR m: MUTEX instead? I tried. It crashed. b) some notion of a "once"? a lock that will only be successfully entered once, for one-time initialization, all other attempts to enter wait for the first enterer to leave, and the it is never entered again. pthreads has this. Win32 since Vista has it (I'd still provide something compatible to pre-Vista, but it can be done easily enough. They are faster and perhaps smaller than other kinds of locks. - Jay From: jay.krell at cornell.edu To: m3devel at elegosoft.com Date: Wed, 30 Jan 2013 07:40:02 +0000 Subject: [M3devel] awful race condition in libm3/FilePosix.m3? FilePosix.m3: I'm not 100% sure, but looks really bad. I suspect it will close arbitrary files out from other threads. Notice there is absolutely no mutual exclusion. An arbitrary number of threads will run here, mostly succeeding, but not necessarily. VAR null_done := FALSE; null_stat: Ustat.struct_stat; null_fd: INTEGER; PROCEDURE IsDevNull(READONLY statbuf: Ustat.struct_stat): BOOLEAN RAISES {} = VAR result: INTEGER; BEGIN IF NOT null_done THEN null_fd := Unix.open(M3toC.FlatTtoS("/dev/null"), Unix.O_RDONLY, Unix.Mrwrwrw); IF null_fd < 0 THEN null_done := TRUE; RETURN FALSE ELSE result := Ustat.fstat(null_fd, ADR(null_stat)); EVAL Unix.close(null_fd); IF result # 0 THEN null_fd := -1 END END; null_done := TRUE; END; RETURN null_fd >= 0 AND statbuf.st_rdev = null_stat.st_rdev END IsDevNull; - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Wed Jan 30 09:26:30 2013 From: jay.krell at cornell.edu (Jay K) Date: Wed, 30 Jan 2013 08:26:30 +0000 Subject: [M3devel] less indirection in mutex? Message-ID: How about..on systems where sizeof(pthread_mutex) <= sizeof(void*), we remove a level of indirection? I realize it is tricky while preserving our now excellent level of portability. I would actually have C code with the if (sizeof....), no #ifs, no autoconf. - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.krell at cornell.edu Thu Jan 31 09:54:47 2013 From: jay.krell at cornell.edu (Jay K) Date: Thu, 31 Jan 2013 08:54:47 +0000 Subject: [M3devel] libm3 AMD64_NT loophole/size problem Message-ID: == package /Users/jay/dev2/cm3/m3-libs/libm3 == +++ /cm3/bin/cm3 -build -override -DROOT=/Users/jay/dev2/cm3 -boot -keep -DM3CC_TARGET=AMD64_NT +++ --- building in AMD64_NT --- ignoring override("libm3", "/Users/jay/dev2/cm3/m3-libs") "../src/os/WIN32/SocketWin32.m3", line 329: LOOPHOLE: expression's size differs from type's "../src/os/WIN32/SocketWin32.m3", line 383: LOOPHOLE: expression's size differs from type's "../src/os/WIN32/SocketWin32.m3", line 383: warning: LOOPHOLE: expression's alignment may differ from type's "../src/os/WIN32/SocketWin32.m3", line 389: LOOPHOLE: expression's size differs from type's 3 errors and 1 warning encountered FYI, if I end up rewriting this file or parts of it in C, this is one of the contributing reasons. It is kind of the same as the other Unix/C stuff where I rewrote in C, rather than maintain cloned headers. - Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: From rodney_bates at lcwb.coop Thu Jan 31 17:03:50 2013 From: rodney_bates at lcwb.coop (Rodney M. Bates) Date: Thu, 31 Jan 2013 10:03:50 -0600 Subject: [M3devel] Information about record/object field name. In-Reply-To: References: Message-ID: <510A95E6.4000308@lcwb.coop> This question raises several others in my mind. Since you mention a serializer, do I correctly presume you want the field names of a record/object type that exists in the same program doing the reading? Are you familiar with the existing compiler-generated type information, in RTTypeMap.i3 and RTTipeMap.i3, and accessible at runtime using RT0.i3 and other things in m3-libs/m3core/src/runtime/common/*, and produced by the compiler in, e.g., m3-sys/m3front/src/misc/TipeDesc.i3? Unfortunately, neither of these kinds of runtime type information has field names, only a lists of field types in order. For a serializer, runtime type information would be a far more convenient source, since it would not require having either source files or separate derived files (.M3WEB). Adding the field names here would probably not be a big coding change, but a change in runtime data structure would no doubt be a big bootstrapping and upgrading operation, for all concerned. Field names are also available in the generated debug information. But even though this might be a more convenient location to get it from, decoding it this way would be a nightmare. It's a specialized derivative of stabs, with lots of Modula-3-specific stuff mangled and encoded inside the string fields of stabs records. gdb has gobs of code to read in general stabs and m3gdb has gobs more to further decode it, all in c. Moreover, there are quite a few differences in what is produced by various compilers, depending on the version of the M3 front end, the version of the gcc-derived code generator or the other code generators, and the target. The idea of field-order independent serializing at first seemed pointless to me. I think the intent must be to allow a serialized object to be deserialized into a different program as a different type, with different field orders. Is this the intent? what are the rules about how different a type can be and still be used in this way? Is it cross-language too? The existing Modula-3 serializer (m3-libs/libm3/src/pickle/ver2/Pickle2.i3 etc.) requires that there be type in the deserializing program that is an exact (structural) match to the type in the serializing program, according to the language's rules of type equality. Pickle enforces this by looking for equality of a 64-bit "signature" that is a hash on a type structure, with the assumption collisions will not occur. Perhaps you have read enough of the runtime, compiler, and serializer to know all this already. Tell us more about the json serializer. On 01/28/2013 11:30 AM, Alexey Veselovsky wrote: > Hello. > > It is possible to retrieve field names for given Record or Object type? > > I need it for json serializer. > > Also this information useful for creating field-order independent serializer. > > Thanks, Alexey. From alexey.veselovsky at gmail.com Thu Jan 31 16:14:23 2013 From: alexey.veselovsky at gmail.com (Alexey Veselovsky) Date: Thu, 31 Jan 2013 19:14:23 +0400 Subject: [M3devel] Can't acces to cvs repo. Message-ID: Subj. Login timeout: # cvs -d :pserver:anonymous at modula3.elegosoft.com:/usr/cvs login Logging in to :pserver:anonymous at modula3.elegosoft.com:2401/usr/cvs CVS password: cvs [login aborted]: connect to modula3.elegosoft.com(46.4.219.187):2401 failed: Connection timed out Thanks, Alexey. -------------- next part -------------- An HTML attachment was scrubbed... URL: