gm2
[Top][All Lists]
Advanced

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

Re: Portable bitwise operations library (was Re: Portability Considerati


From: Benjamin Kowarsch
Subject: Re: Portable bitwise operations library (was Re: Portability Considerations)
Date: Sat, 23 Mar 2024 07:59:36 +0900



On Sat, 23 Mar 2024 at 05:13, Alice Osako wrote:

I don't really know where to go from here; I imagine I should download
some other compilers and see what I can do for those, though I am a not
certain how much I can really do for any of them.

You don't need to test with other compilers, leave that to whoever wants to use the library with another compiler.

But you probably want to test on GM2 in both PIM and ISO modes.

Your test module uses the ISO I/O library,

FROM STextIO IMPORT WriteString, WriteLn;
FROM SWholeIO IMPORT WriteCard;

so, that code won't work on PIM.

In my projects, I use my own portable I/O library, which uses a low-level adaptation layer to plug into any of:

(1) the POSIX I/O subsystem (on Unix systems)
(2) the rudimentary I/O described in PIM
(3) the ISO I/O library

https://github.com/m2sf/m2bsk/tree/master/src/lib/IO

Since it would be cumbersome and difficult to maintain to supply the test module in separate versions (for PIM and ISO), you probably want to do something similar and write a simple shim library. You will then need two separate versions of the shims, one for PIM and one for ISO.

Wherever I need separate versions for dialects, I use the following file naming convention:

<library>.pim.mod
<library>.iso.mod

I then use a configuration script that copies all the required specific files into a build directory while removing the version specific part in the file name.

Last but not least, you may want to add a short paragraph into your project's README that states that the library has been tested on GM2 in PIM and ISO modes and not elsewhere, and then invite submission of additional tests and patches there.

regards
benjamin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]