Pascal to C widget

Gordon Moffett gam at proper.UUCP
Mon Jan 16 06:31:29 AEST 1984


> From: yoavh at nsc.UUCP (yoavh)

> Does anyone have any experience with the Whitesmith's Pascal to C compiler?
I used this tool some time ago (before I knew C well) and was unimpressed.

> 	- does it have any weird limitations on the dialect of Pascal it
> 	  translates?

Only first eight chars of identifiers are significant.
No conformant array parameters.
No checking of:  subranges, tag values in variant records, `goto'
	limitations, `for' variables.  Optional range checking of
	case statements and subscripts.
'extern' in other Pascal's is 'external' in WS.
No 'otherwise' in case statement.
Sets can be quite large (up to 32K or so elements! -- compile-time
	specification).
MAXINT = 32766 [sic!]

> 	- does it translate into "standard" C (I've heard that Whitesmith's
> 	  C is a little strange)?

NO!  Here was my problem:  I tried teaching myself C using K&R and
Whitesmith's C compiler (for which the translator was intended) and was
frustrated by the inconsistency in library routines (no `printf' for
example...).  Their system library is weird:
	FILE open(name, mode, rsize)
		TEXT *name;
		COUNT mode;
		BYTES rsize;
And these guys love to make `cute' typedefs/defines for various types
(as above).  The syntax of C itself is probably uncorrupted.

> 	- is the resulting C code of reasonable quality?
If you mean, "Did the translator make a reasonable translation without
excess redundancy or obscure constructions" I would say yes.

>	- is the resulting C code readable (preserving symbol names, etc)?
I don't recall for certain.  Due to eight-char restriction I believe
names were retained.

>	- are Whitesmith's reasonable folks to deal with (I've heard rumors
>	  to the contrary...)?
I sent them a very critical letter rejecting their Pascal/C compiler
and asking why P J Plauger (president) didn't know better.  I got no
response, but after a phone call they confirmed that a refund was
forthcomming.  (I left the company I was with shortly thereafter so
I don't know if all went well).	
--
Gordon A. Moffett
	decvax!decwrl!amd70!proper!gam
	hplabs!intelca!proper!gam



More information about the Comp.lang.c mailing list