Hi,
On 7/30/10, Frank Heckenbach ih8mj@fjf.gnu.de wrote:
Rugxulo wrote:
Frank, I would be curious what you think of Ada or Modula-2, esp. since both of those have (official or unofficial) GCC support. And there are already (weak) converters from Pascal to Ada, Oberon, Modula-2, etc. (But no GNU Oberon, only OO2C.)
Since you ask me specifically: I've never programmed in any of those languages myself (outside of University), and I haven't followed their development in recent years.
Well, I only ask you because you brought all this up! ;-) Note that I don't know any of those languages myself, but they are mostly Wirth-ian like Pascal.
Since most of these languages are not widely used, I wouldn't consider them attractive targets for a converter.
Maybe not individually, but taken as a whole, all the Wirth-ian languages and their users can add up. And it seems many users use (or have used) more than one (except me, so far).
Ada may be an exception, but it's still less widely used than C++, and at least I know C++ much better than Ada -- though if there's a number of Ada programmers here (whom I don't know yet :-) it might make it interesting to consider as a target.
Well, Ada has been folded into the GCC tree since 3.2 or so. Even DJGPP supports it. No, it's not got huge support, but people do indeed use it. Honestly, I'm surprised (but glad) GCC still supports it. Perhaps they have lots of DoD volunteers, I dunno. ;-) Originally the DoD paid a lot to have it written, so I guess that didn't hurt either.
Note that GNU Modula-2 (EDIT: I've never tried) partially requires C++ (I think) to build due to exceptions. They are allegedly very mature now but development does focus on Linux (surprise surprise) with some lesser testing on Cygwin and Mac OS X.
I'm not sure what to think, I have mixed feelings. I'm glad for them, but I wonder why all these efforts have to take place separately and not cooperate more. Wirth's children should stick together. ;-)
Weak converters are IMHO of not much use, since turning them into full converters is probably as difficult, if not more so, than writing one from scratch. (Furthermore, I suspect they each support only one Pascal dialect, in contrast to GPC.)
Correct, and e.g. P2Ada didn't work for my simple program. I'm not saying a rewrite is bad (or even feasible), just saying that some effort had already been done. Maybe there's some reusable code or good ideas at least, I dunno. But this seems more of something for you (expert) to decide than me (noob). ;-)
As an example, the GPC frontend was originally derived from the C frontend (note, I'm not talking about the backend issues here, but the actual frontend responsible for handling Pascal). Initially, this provided some success quickly, as many Pascal features map more or less roughly to C features (e.g. arrays to arrays, [variant] records to structs/unions, for/while/repeat loops to for/while/do loops, Integer to int, mod to %, procedures/functions to functions etc.). But the devil is in the details, and that's a damn big devil here
I'm not knocking your decision, it worked quite well! GPC is a nice product, nicer than most software. I don't personally believe software is throwaway, so I do think it should be reused or preserved (if possible). However, I do understand hindsight. Even RMS complains that choosing Mach for Hurd was meant to save them time but probably hurt in the long run. Yes, ironically, sometimes it is easier to rewrite from scratch. But you need experience, and that usually only comes from modifying a pre-existing project.