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: Eric Streit
Subject: Re: Portable bitwise operations library (was Re: Portability Considerations)
Date: Sat, 23 Mar 2024 07:55:39 +0100
User-agent: Thunderbird Daily

hi,

and what about a simple config file or project file where you could define the paths of DEFs and MODs files; it would be easy to have a project file for PIM or ISO or M2R10.

JPI Modula2 (Topspeed) worked like this and it was super easy to work with.

And in that case, you can also manage and use sub-directories like you want:

Example of the redirection file in JPI M2: (version 1, but version 2 and 3 use the same mechanism)

=====================================
*.def = c:\M2\JPI-1\def;c:\M2\JPI-1\SPC;
*.obj = c:\M2\JPI-1\obj;
*.mod = c:\M2\JPI-1\mod;c:\M2\JPI-1\SPC;
*.map = c:\M2\JPI-1\map;
*.exe = c:\M2\JPI-1\exe;
*.a   = c:\M2\JPI-1\asm;
*.siz = c:\M2\JPI-1\siz;
*.dal = c:\M2\JPI-1\dal;
*.dbd = c:\M2\JPI-1\dbd;
*.prf = c:\M2\JPI-1\prf;
vid.* = c:\M2\JPI-1;
m2asm.* = c:\M2\JPI-1;
*.mem = c:\M2\jpi-1\mem;
======================================

I wrote several of them for the different cases.

Best regards

Eric

On 22/03/2024 23:59, Benjamin Kowarsch wrote:


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 <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]