[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OOC Core Library



On Nov 29 Michael Acken wrote:

> Just before the this mailing list got started I was discussing with
> Frank the problems he has in getting OOC compiled on his Oberon-A
> compiler.  In order to do this he has to port some of the (Unix based)
> o2c libs.

The only serious problem was really Dos.mod, which caused a name clash. The
match between Unix and AmigaOS is quite close, and the conversions were
straightforward. It also showed a few problems with Oberon-A, which I've
fixed.

> Most of the stumbling blocks have been removed for now, but he suggested
> to start a discussion on a library for OOC "rather sooner than later".  I
> didn't want to begin thinking on libs at the current stage, but Frank is
> probably right.  So, here are my first thoughts on this topic...

I had in mind only the minimum set needed for the compiler, but more
complete library is certainly a long-term requirement. I think it is
possibly as important an issue as the compiler itself, as the experience of
'C' shows.

>   I suggest to take a look at existing libraries and take the best
> from all of them.  The original Oberon System can be safely ignored,

Agreed.

>   Other Oberon compilers:  These come in two flavors, namely as part
> of a whole system or as stand-alone compilers.  An example of the
> first is Oberon/F.  I like how O/F treats files: The type `Rider' is
> split into `Reader' and `Writer' and all procedures working on them
> are defined as type-bound procs.  This is far more flexible and
> powerful than the Oakwood Files modules.

I agree, this is an excellent implementation and I would like to adopt it.
One problem is they call it 'Files' too, adding to the namespace pollution.
Perhaps we should also settle on a naming convention for library modules.

> In order to implement a `make' I'll need facilities to get a file's
> time stamp (from Dos.Mod) and to compare time stamps (from Time.Mod).

I think a general-purpose DateTime class is needed, designed for more than
just time-stamping files.

> Here is my outline for a core library:
> - take most library modules from the M2 DIS
> - make an object-oriented Files module
> - provide modules In and Out
> - put together a module `Filenames' that works with Unix, AmigaOS,
>   RISC OS (and maybe MS-DOG)
> - don't forget to add procedures to access command line arguments and
>   to run a command

Don't forget non-CLI environments like AmigaOS's Workbench and the
Macintosh Finder. argv-style argument lists are not necessarily appropriate
in these environments.

Frank