PL/I to C conversion 
Author Message
 PL/I to C conversion

Waldek is talking about strings of any length, which you simulated by using
pointers and your own code. As soon as you code a char (*) [var[z]], you
have the 32767 char limit (length limit also applies to graphic and wchar].

The good news is that the lab are implementing new memory BIFs (memindex,
memverify, memsearch, memverifyr, memsearchr) that will ease our life when
coding buffer management. The first 2 parameters are address and length, so
the routines are all "safe".


Quote:

> > For simple strings manipulations PL/I is definitely safer. But my
> > impression was that for say dynamicaly allocated stings PL/I and C
> > offer pretty similar support -- the language gives pointers (handles)
> > and the rest is up to the programmer (is PL/I checking validity of
> > memory access via pointers?).

> Shouldn't be.  If a string with (*) length is allocated the compiler
> should build a descriptor containing the allocated length to be used for
> checking.  I say "should" because Robin indicated that some versions of
> Enterprise PL/I may be sloppy about this.



Sun, 05 Jun 2005 14:53:57 GMT  
 PL/I to C conversion

Quote:

> Waldek is talking about strings of any length, which you simulated by using
> pointers and your own code. As soon as you code a char (*) [var[z]], you
> have the 32767 char limit (length limit also applies to graphic and wchar].

This is a "let the coder beware" situation: use at your own risk. (yes,
I do it too...)
No language can protect you against yourself.


Sun, 05 Jun 2005 19:27:47 GMT  
 PL/I to C conversion

Quote:


> : Date: 14 Dec 2002 19:30:31 GMT

> : ><snip>
> : >: PL/I would be a better choice for this viv-a-vis C,
> : >: as the latter does not have the functionality of PL/I.
> : >: In particular, it does not have the robustness of
> : >: a PL/I executable.
> :                                       ^^^^^^^^^^
> : >I am puzzled -- what you really mean?

> : C programs can corrupt (destroy) themselves (unprotected string moves,
> : which rely on the zero terminating byte, for example).
> : Format strings are also a problem.

> Yes, the problems with strings are well-known. But they are more
> problem of (very widespread) programmer practice -- now the standard
> library have "safe" variants for all basic operations, and anyone can make
> own library which is doing even more checking.

> For simple strings manipulations PL/I is definitely safer. But my
> impression was that for say dynamicaly allocated stings PL/I and C
> offer pretty similar support -- the language gives pointers (handles)
> and the rest is up to the programmer (is PL/I checking validity of
> memory access via pointers?).

PL/I does not need to use pointers for string handling,
which is a major advantage over C.

Quote:
> But coming back to the subject of this thread: I would assume that
> PL/I code converted to C and compiled by the C compiler is robust if
> the original program and the converter is robust. In other words, IMHO
> converting PL/I to C is a valid method to make a PL/I compiler. Of course
> the convertor must do what the compiler is doing: introduce checks
> where needed and have necessary support library (like opertions
> on counted strings...).

There are an awful lot of "if"s there.

- Show quoted text -

Quote:
> --
>                               Waldek Hebisch




Sun, 05 Jun 2005 22:59:50 GMT  
 PL/I to C conversion
Mr. Vowels,
 I assume that since you have written atleast one book on
PL/I you probably have a vested interest in swaying people from a PL/I
migration.  As a I mentioned in a previous post, a PL/I to C
conversion is not for everyone and is very dependent on the
circumstances of a site.  However, for you to just unilaterally say
there is no valid reason to do it is unprofessional and closed-minded.
In the cases where a client has chosen to convert, they have
already tended to look at a straight PL/I to PL/I migration first!
In these cases, the client found that the conversion to
another language made the most business sense (these decisions were
made by technical as well as managerial folks).  

To give you just one example, when a particular client had to migrate
to a different hardware platform, the only real choice they had for a
suitable PL/I environment required them to pay a runtime license.  
(Additionally, the move to this new PL/I environment was not
considered in any way as a walk in the park!)  Since they were
selling a commercial product, they had to incorporate the license price
into the price of their product.  This is turn put them at an immediate
pricing disadvantage with their competitors.  So yes, they probably could
have migrated to another PL/I environment but as a result could have gone
out of business because of their new pricing structure.  In the real world,
sometimes business decisions have to outweigh the academic debating.

However, I think I am straying from the point of my original post.
Previously, it had been argued whether or not the conversion was
possible.  Then it was mentioned that there were products out there
but they would require some type of coding to glue all the pieces
together.  The only point I was trying to make was that an automated
conversion is possible, it exists, and it works.

Charles Churchill
www.datatek-net.com



Wed, 08 Jun 2005 03:40:29 GMT  
 PL/I to C conversion
in comp.lang.pl1 i read:

Quote:
> I assume that since you have written atleast one book on
>PL/I you probably have a vested interest in swaying people from a PL/I
>migration.  

and since you provide a migration service you have a vested interest in the
other direction.

how boring, of both of you.

--
bringing you boring signatures for 17 years



Wed, 08 Jun 2005 10:49:35 GMT  
 PL/I to C conversion


Quote:


> > A while ago I was kicking around the idea of a web-tutorial "PL/I for C
> > Programmers", building on Eberhard's stuff.  The idea would be to assume
> > a programmer knows C fairly well and write it in a "how do I do x (some
> > C thing) in PL/I".  I plan to do more work on it, but I have lots of
> > other projects, plus a real job.  If anyone's interested I hereby offer
> > the idea.

> Wow, you really do want to be a troublemaker!  You could even destroy
> the "Emperor has no clothes" mystique that has been perpetuated over the
> years that C is a superior language. Unless congress passes a special
> whistle-blowers act to protect honest programmers you could be in for a
> lot of misery.  :-)     (When can I start?)

I wish that my skills were up to that standard of being able to write such a
tutorial;  since I can't, let me at least encourage you, Mr. Flass and
anybody else capable of doing such to do so at your earliest possible
convenience, and please include at least enough C++ so as to allow me to
understand what I've been missing in attempting to learn Charles Petzold's
"Programming in Windows" and being able to do it in PL/I.  [Those prefix and
postfix operations + pointers is what's bringing me grief...]


Tue, 18 Oct 2005 13:42:39 GMT  
 
 [ 22 post ]  Go to page: [1] [2]

 Relevant Pages 
 

 
Powered by phpBB® Forum Software