Stanford Pascal Compiler successfully ported to Windows, OS/2 and Linux

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Stanford Pascal Compiler successfully ported to Windows, OS/2 and Linux

Hercules390 - Vm mailing list
Hello H390-VM list,

as you might remember from previous post, I did some work recently
to improve the Stanford Pascal compiler, which is part of the
Hercules-VM distributions. You can find the recent state of my work
and some stories about this on my web site:

http://bernd-oppolzer.de/job9.htm

The last six weeks or so, I ported the compiler to Windows, Linux and OS/2;
by writing a P-Code interpreter program, which - on the non-mainframe
platforms -
interpretes the P-Code generated by the Compiler. On the mainframe, 370
machine
code is generated from the P-Code by a post-processor (second phase of
the compiler).

There were some issues in the compiler regarding portability, which had
to be solved
first, for example: branch tables which were based on the EBCDIC code page;
a solution which does not rely on a certain code page had to be found.
Now, the
P-Code is REALLY portable; P-Code generated on Windows, for example, can
be used
on the mainframe and vice versa.

The compiler now compiles itself on Windows etc.; it produces the same
results
as the compiler which was ported (as P-Code file) from the IBM mainframe.
The compiler on Windows (interpreted P-Code) is faster than the Hercules
version
(emulated 370 instructions), which is a very encouraging result.

There are still some parts of the language missing on Windows etc., for
example
binary files (files, which are not files of char), and modules (that is,
linking of seperately compiled program units). This will be added in the
next weeks and months.

This is the end of a long story; in the beginning of 2012, I tried to
get some support
from the Free Pascal project to add the IBM mainframe as an additional
target,
but there was not much interest. So I took the other way and ported the
Stanford
compiler to Win, Linux and OS/2; my goal was to have a "free" Pascal
compiler which
runs on all those platforms INCLUDING IBM mainframe, implementing the
same language,
so that Pascal programs are portable between those platforms.

I will now be able to implement some of the programs that I write for my
own use
and for my customers in Pascal instead of C, because they can be
deployed to virtually
every platform needed.

If you want to know more about this project, feel free to contact me
offline.

Kind regards,
merry Christmas and a happy new year

Bernd


Reply | Threaded
Open this post in threaded view
|

Re: Stanford Pascal Compiler successfully ported to Windows, OS/2 and Linux

Hercules390 - Vm mailing list
On 23/12/16 22:30, Bernd Oppolzer [hidden email] [H390-VM] wrote:
>
> Hello H390-VM list,
>
> as you might remember from previous post, I did some work recently
> to improve the Stanford Pascal compiler, which is part of the
> Hercules-VM distributions. You can find the recent state of my work
> and some stories about this on my web site:
>
> http://bernd-oppolzer.de/job9.htm

> This is the end of a long story; in the beginning of 2012, I tried to
> get some support
> from the Free Pascal project to add the IBM mainframe as an additional
> target,
> but there was not much interest.

I suggest that that's a simplification. I've tried to keep an archive of
relevant discussion at http://wiki.lazarus.freepascal.org/ZSeries and my
recollection is that an IBM mainframe target has been discussed on
several occasions but has invariably got bogged down in an argument over
what operating system to target and whether to assume current or
historical systems. I've always tried to make a case for targeting VM
since it is comparatively familiar for the core developers who have unix
backgrounds, and at least initially targeting fairly late 390s in common
with GCC. I'd have thought that VM/380 would have been ideal.

The situation was not helped by Paul R. who couldn't get his head around
how the portable FPC code generation worked and had little interest in
having it explained, instead demanding things like cross-references
between functions and the points at which they're called... something
which quite simply can't be provided in an object-oriented environment
where methods are overloaded and calling decisions are deferred until
runtime.

I for one would be keen in at the very least seeing the sources you're
using kept compatible with FPC, as a potential bridge between platforms.
I recall that you were having problems with (at least) character array
representation, and I suggest that you raise that in the fpc-devel
mailing list.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
Reply | Threaded
Open this post in threaded view
|

Re: Stanford Pascal Compiler successfully ported to Windows, OS/2 and Linux

Hercules390 - Vm mailing list
I'm sure you hashed this all out, but by targeting MVS (OS.360, zOS, etc.) it would also run on VM using OS emulation, whereas the reverse is not true.
Reply | Threaded
Open this post in threaded view
|

Re: Stanford Pascal Compiler successfully ported to Windows, OS/2 and Linux

Hercules390 - Vm mailing list
The original Stanford Pascal compiler was IMO available on OS/360 first;
the runtime, which is one single module (the Pascal monitor), uses OS macros
to do the systems related stuff (GETMAIN etc). I tried to keep this intact.

There is one short "bootstrap" module now called XRUNPARM ASSEMBLE
which reads the CMS command line and builds an OS style parameter string
and calls PASMONN (which in turn calls the Pascal main line).

So IMO the compiler and the generated objects should run on OS/360 or
MVS or z/OS (31 bit would be interesting), but I was not able to test it
until now. I could not ask my customers for machine time on their z/OS
machines, and I had no time to set up an OS based machine on Hercules.

There was one thing I added that was explicitly CMS only: a function CMSX
which allowed to issue CMS commands from the running Pascal program;
I needed this to do CMS FILEDEFs from the SNAPSHOT routine. This is some
sort of dynamic allocation - and this would need some rework, when I would
port the SNAPSHOT routine to MVS or z/OS some day.

See details regarding SNAPSHOT (symbolic dump) and CMSX on my web site.

Kind regards

Bernd



Am 24.12.2016 um 16:19 schrieb [hidden email] [H390-VM]:
>
> I'm sure you hashed this all out, but by targeting MVS (OS.360, zOS,
> etc.) it would also run on VM using OS emulation, whereas the reverse
> is not true.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Stanford Pascal Compiler successfully ported to Windows, OS/2 and Linux

Hercules390 - Vm mailing list
In reply to this post by Hercules390 - Vm mailing list
On 24/12/16 15:30, [hidden email] [H390-VM] wrote:
>
> I'm sure you hashed this all out, but by targeting MVS (OS.360, zOS,
> etc.) it would also run on VM using OS emulation, whereas the reverse is
> not true.

I'd hate to be the one that had to support a bunch of extremely
competent unix and Windows programmers as they got to grips with MVS :-)

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
Reply | Threaded
Open this post in threaded view
|

Re: Stanford Pascal Compiler successfully ported to Windows, OS/2 and Linux

Hercules390 - Vm mailing list
In reply to this post by Hercules390 - Vm mailing list
If targeted to MVS it could also run under MUSIC and probably MTS.

On Saturday, December 24, 2016, [hidden email] [H390-VM] <
[hidden email]> wrote:

>
>
> I'm sure you hashed this all out, but by targeting MVS (OS.360, zOS, etc.)
> it would also run on VM using OS emulation, whereas the reverse is not true.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Stanford Pascal Compiler successfully ported to Windows, OS/2 and Linux

Hercules390 - Vm mailing list
In reply to this post by Hercules390 - Vm mailing list
---In [hidden email], <markmll.h390-vm@...> wrote :

>> I'm sure you hashed this all out, but by targeting MVS (OS.360, zOS,
>> etc.) it would also run on VM using OS emulation, whereas the reverse is
>> not true.

> I'd hate to be the one that had to support a bunch of extremely
> competent unix and Windows programmers as they got to grips with MVS :-)

Why? Here's what a Unix programmer had
to say about using MVS:


https://groups.yahoo.com/neo/groups/turnkey-mvs/conversations/messages/9601

Infact, porting this simple MD5 package had been almost easy as for any
other POSIX platform, most of the problems coming from ASCII/EBCDIC
conversion and file transfers.


BFN. Paul.
Reply | Threaded
Open this post in threaded view
|

Re: Stanford Pascal Compiler successfully ported to Windows, OS/2 and Linux

Hercules390 - Vm mailing list
In reply to this post by Hercules390 - Vm mailing list
Hi Michael,

my version of Stanford Pascal came from MUSIC/SP.

The heritage is:

1979 - Stanford (probably OS/360 or a follow-up system;
the documents I have include job control etc. to run the Pascal system)
see: http://bernd-oppolzer.de/Stanford1979.pdf
1982 - McGill University (MUSIC/SP)
2011 - I discovered it (the 1982 version, improved 2007 by Dave Edwards)
on SIM390 running MUSIC/SP and ported it to Hercules running VM/370 Rel. 6
2016 - Compiler and runtime improvevents and port to Linux - Windows - OS2

Kind regards

Bernd



Am 24.12.2016 um 17:05 schrieb Michael Short [hidden email]
[H390-VM]:
>
> If targeted to MVS it could also run under MUSIC and probably MTS.
>
>