[Oberon] SYSTEM Modules
Chris Burrows
chris at cfbsoftware.com
Sun Nov 11 01:28:18 CET 2018
> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> Diego Sardina
> Sent: Sunday, 11 November 2018 1:42 AM
> To: oberon at lists.inf.ethz.ch
> Subject: Re: [Oberon] SYSTEM Modules
>
> >
> > Consequently I m thinking of implementing an extension to the
> Astrobe Oberon-07 compilers. This will allow low-level modules to be
> specified by prefixing the keyword MODULE with the keyword SYSTEM
> (similarly to the DEFINITION and IMPLEMENTATION module prefixes in
> Modula-2). Such system modules would allow / require any SYSTEM
> objects to be referenced unqualified.
>
> It's more similar to what Modula-3 adopted for this. Modules that are
> going to use unsafe procedures/functions must place UNSAFE before the
> keyword MODULE or INTERFACE.
>
Thanks for the pointer. I'll have a closer look at what they did.
The UNSAFE concept opens up a whole different set of opportunities / can of worms (depending on whether you are a glass half full / half empty sort of person).
An UNSAFE module could allow:
1. Relaxed type-checking
2. Relaxed array bounds-checking
3. Variable parameter lists
etc.
All of which can be very useful for low-level / high-performance realtime code.
The downside of any of these extended 'features' is that are frequently misused. e.g. I have seen cases where somebody has declared every procedure as FORWARD so they don't have to worry about the order of declaration!
Some reasonable restrictions could be established to minimise this risk without impacting their usefulness. E.g. UNSAFE modules cannot import other modules; procedures in UNSAFE modules can only be leaf procedures etc.
Regards,
Chris Burrows
CFB Software
http://www.astrobe.com
More information about the Oberon
mailing list