Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2012-02

Re: EBCDIC (was On a port of Free Pascal to the IBM 370)

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

steve smithers
Show quoted text 10 lines
wrote on Thu, 2 Feb 2012 16:28:29 +0000 (GMT) I had nearly 40 years of mainframe development (OS/360 through MVS and VM/SP) and it is not a comfortable environment for developing code. My productivity went up about 200% when I got a PC as a host terminal. I coded using my favourite PC editor then uploaded the source to the mainframe using MYTE or similar then ran it through the appropriate compiler. For pascal programs I wrote portable code, compiling and debugging with Virtual Pascal, then uploaded and ran it through the VSPascal compiler.

Same here, but things got better.  But to some extent, that's looking back through rose-tinted spectacles.  We managed with the resources we had at the time.  However, I am not suggesting we go back to overnight compilations on punched card.

Show quoted text 6 lines
If I was still developing pascal code for 370 etc I would like to write and test it on the PC - Free Pascal would be great - then change a parameter for FP to generate 370 assembler source to upload and compile. It wouldn't matter whether that output was ascii or ebcdic as it could be converted on the upload, but I would probably prefer ascii so that I could check and possibly tweak it before upload.

"Write once, compile anywhere" isn't that the motto?  I'm not trying to suggest anything to break this model, but when I compile my code on the mainframe, I would expect stuff like if ch in['A'..'Z'] to be EBCDIC based.

Show quoted text 6 lines
Mark Morgan Lloyd < wrote on Thu, 02 Feb 2012 17:27:51 +0000 I'd only expect the version control system to contain textfiles. Or are you saying that some IBM operating systems support files which contain both text and data (I'm aware of the Mac's OS and obviously OS/2 doing this, both of which FPC supports).

I wasn't really talking about source files.  I was talking about I/O in general.  Translating a text file on the fly is possible, assuming you can identify it as such.  But what about a structured file that contains mixed binary and string info.  Integers need to converted from little to big endian, strings from ASCII to EBCDIC, floating point from PC to mainframe formats, files may contain internal pointers to other info, again it needs to be converted.  Doing all this automagically in the RTL isn't an exercise in coding it's clairvoyance.  And yes, MVS supports mixed binary and string data in a file, doesn't every operating system?  A file is just data, stuff, the operating system has no business telling me what I can put in my files!

Just trust me then. PC doctrine has it that anybody can write a compiler, but we're aware of the fact that other architectures might do things differently.

Anyone can write whatever they want on the mainframe too.  All the tools required are provided.  What you do with it has nothing to do with architecture, it's to do with security.  If you were a user on a Linux system, one amongst 50 others, one without root access, you would find yourself constrained about what you and your compiler could do.  At least I hope you would.  It's the same on OS.  If you are running hercules and MVS, just for yourself on your desktop, you can do what you want.  If you work for NatWest, you would find you wouldn't have the same freedoms.

Show quoted text 6 lines
No, but having an accessible operating system for testing is, and it would end up being extremely inconvenient if that operating system didn't support standard networking so that- at the very least- test code code could be got onto it and copies of error messages got off. I don't think the other developers would be happy if told they had to use (something equivalent to) Kermit :-)

Hercules provides terminal access to a TCP/IP client, both in 3270 terminal mode and for file transfer.  As far as I know Kermit is not available

Reply by email

Mark Morgan Lloyd
to steve smithers
steve smithers wrote
> wrote on Thu, 2 Feb 2012 16:28:29 +0000 (GMT)

..

"Write once, compile anywhere" isn't that the motto? I'm not trying to suggest anything to break this model, but when I compile my code on the mainframe, I would expect stuff like if ch in['A'..'Z'] to be EBCDIC based.

That's reasonable, but is of course an RTL issue- or if it's not an RTL issue today I suspect it will be at the end of this port :-) However as Tomas points out the compiler will also have internal lists of reserved words and (pseudo-) procedures, and it might be that at present they assume ASCII collation order.

Show quoted text 16 lines
> Mark Morgan Lloyd < wrote on Thu, 02 Feb 2012 17:27:51 +0000 > > I'd only expect the version control system to contain textfiles. Or are > you saying that some IBM operating systems support files which contain > both text and data (I'm aware of the Mac's OS and obviously OS/2 doing > this, both of which FPC supports). I wasn't really talking about source files. I was talking about I/O in general. Translating a text file on the fly is possible, assuming you can identify it as such. But what about a structured file that contains mixed binary and string info. Integers need to converted from little to big endian, strings from ASCII to EBCDIC, floating point from PC to mainframe formats, files may contain internal pointers to other info, again it needs to be converted. Doing all this automagically in the RTL isn't an exercise in coding it's clairvoyance. And yes, MVS supports mixed binary and string data in a file, doesn't every operating system?

Yes, but some operating systems also support there being multiple forks (or some comparable term) of a file, so that (for example) an executable file contains both binary code and *separate* resource/message data, both of which can be read sequentially starting from zero. Think two columns in a database, both blobs.

Show quoted text 9 lines
> Just trust me then. PC doctrine has it that anybody can write a > compiler, but we're aware of the fact that other architectures might do > things differently. Anyone can write whatever they want on the mainframe too. All the tools required are provided. What you do with it has nothing to do with architecture, it's to do with security. If you were a user on a Linux system, one amongst 50 others, one without root access, you would find yourself constrained about what you and your compiler could do. At least I hope you would.

Yes and no. An unprivileged user on Linux can compile a kernel, or can even build a compiler which is then used to build a kernel, and the end product would be bootable or executable. The only thing he can't do is tell the system-wide boot manager to load the kernel at the next startup, or put the compiler where it is executed as the system default.

Some operating systems require a special blessing or signing stage in those cases. If IBM OS and its brethren don't, then it makes life a bit easier.

Show quoted text 9 lines
> No, but having an accessible operating system for testing is, and it > would end up being extremely inconvenient if that operating system > didn't support standard networking so that- at the very least- test code > code could be got onto it and copies of error messages got off. I don't > think the other developers would be happy if told they had to use > (something equivalent to) Kermit :-) Hercules provides terminal access to a TCP/IP client, both in 3270 terminal mode and for file transfer. As far as I know Kermit is not available

Hercules certainly does. MUSIC/SP (which was what was originally suggested as a target operating system) only provided TCP/IP if run on VM, or on Sim/390 which is Windows-only.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email