Chris:
Crelier's OP2 Oberon-2 compiler totals about 10,000 lines. Wirth's latest RISC Oberon compiler is about 30% of the size (at less than 3000 lines). Apart from the support of the Oberon-2 extensions to the language, one of the initial advantages of the OP2 design over Wirth's original Oberon compiler was the separation of the target-dependent and portable parts of the compiler.
I read NW book on compiler construction, but it did not help me in understanding either one. Seriously, I vaguely remember that OP2 introduced the intermediate code representation that helped optimize the emitted opcodes. Please correct me if I am wrong. I am not trying to insist we need this. I hope that experts can comment. Oberon-2 "extensions" is another matter. I believe these are not extensions but important features. I have extensive experience with Oberon-2 and Component Pascal. I also wrote a graphics system with System-3 Gadgets, which I later converted to Component Pascal. (This graphics is still being used in one of the most advanced physics experiments of our times.) Based on this experience I believe that Oberon-2 helps with writing better, more reliable code. It is a pity that Oberon-2 is not available under the FPGA Oberon System. Perhaps it was more convenient to do so, but I think it was a mistake. Wojtek
On Mon, 13 Oct 2014 21:48:36 -0400, skulski@pas.rochester.edu wrote:
I read NW book on compiler construction, but it did not help me in understanding either one. Seriously, I vaguely remember that OP2 introduced the intermediate code representation that helped optimize the emitted opcodes. Please correct me if I am wrong. I am not trying to insist we need this. I hope that experts can comment.
Yes you are right. The OP2 generates an intermediate representation in a tree and afterwards the independent code generator traverses the tree. Documentation is in: ftp://ftp.ethoberon.ethz.ch/Oberon/OberonV4/Docu/OP2.Paper.ps.gz ftp://ftp.inf.ethz.ch/pub/publications/tech-reports/1xx/125.pdf Also ETH Dissertation 10650 from Crelier has a chapter about OP2. The complexity is considerable higher than in an immediate one pass code generating compiler.
Oberon-2 "extensions" is another matter. I believe these are not extensions but important features. I have extensive experience with Oberon-2 and Component Pascal. I also wrote a graphics system with System-3 Gadgets, which I later converted to Component Pascal. (This graphics is still being used in one of the most advanced physics experiments of our times.) Based on this experience I believe that Oberon-2 helps with writing better, more reliable code. It is a pity that Oberon-2 is not available under the FPGA Oberon System. Perhaps it was more convenient to do so, but I think it was a mistake.
In my opinion it is not too difficult to add the Oberon-2 extensions to the simple one pass compiler. Managing the OP2 and writing a new backend is more difficult if you have to learn OP2 from scratch. Greetings Christian
On 10/14/14 03:48, skulski@pas.rochester.edu wrote:
experiments of our times.) Based on this experience I believe that Oberon-2 helps with writing better, more reliable code. It is a pity that Oberon-2 is not available under the FPGA Oberon System. Perhaps it was more convenient to do so, but I think it was a mistake.
Approximately 20 years ago, I heard a guest lecture of Prof. Wirth at the University of Linz, in which he shortly talked about Oberon-2. If I remember correctly, he did like the reintroduction of the FOR statement. He also liked the possibility to export variables and record components for read-only access (with the "-" sign instead of "*"), although he would have made this the default. He did not like type-bound procedures, saying that they were some kind of constant record components and that procedure variables should be used instead. Therefore, I think Oberon on the FPGA is the way it is not because of convenience but because that's how Wirth wanted it to be. Richard
participants (3)
-
chris -
Richard Hable -
skulski@pas.rochester.edu