[M3devel] Moving ahead with Modula3. Making my code safe.

Chris Highjinks at gmx.com
Tue Mar 23 21:02:32 CET 2010


Alright, I'm finally comfortable enough with Modula3 to start doing some serious work with it.

However, I'm now in the process of learning how to do things the Modula3 way. Or probably more correctly, writing things that are easily managed by other Modula3 developers.

What is the "proper" Modula3 way of taking an unsafe interface to an external library and making it "safe" for the purposes of my fellow Modula3 developers? I know how I would it with Ada and GNAT GPL; but even though the languages are similiar, the environments are quite a bit different.

The same thing goes for pretty much everything else. I really want to nail down my libraries and make them as bulletproof as possible.

I'd like to make everything as exception free as possible. This means very few uses of the "RAISES" keyword. If a properly defined function returns a predefined error, I dont consider that exceptional. I typically consider any undefined behavior to be exceptional.

Also, does Modula3 provide any facilities for Synchronous threads and/or State Machines/Automata, or do these all have to be coded manually? 

One last question, in regards to threads...how do I get access to Atomic ops? Typically I like to prefetch a dataset into the processors data cache and do most of my operations there. I can doubletime it on a multicore processor, assuming I dont have to use Mutexes and such.

Any tips, pointers, or articles you might recommend?

-- 
Chris <Highjinks at gmx.com>



More information about the M3devel mailing list