Skip to content

What I had learned from this compiler (part 2)

congdm edited this page Aug 30, 2015 · 3 revisions

What I had learned from this compiler

Win64 and Oberon do not fit with each other

As Niklaus Wirth had talked about his first PASCAL compiler experience, the choice of platform is very important. Writing a PASCAL compiler by FORTRAN turned out to be an impossible task. In my case, it wasn't that severe, but nonetheless still disapointing.

The Win32 API is designed for Cee language and the Win64 ABI is designed for multipass compilers. The need for interoperability with the underlying system had greatly complicated both the Oberon compiler and language. I had to resort to many "clever" tricks in order to cope with the Win64 ABI. And for interfacing with Win32 API, I had to introduce typed-ADDRESS types and multiple INTEGER types into Oberon language, a step back to Modula-2 era. Garbage Collection was not developed yet.

The lesson:

We know that any chain is only as strong as its weakest link. This holds also for module hierarchies. Systems can be designed with utmost care and professionalism, yet they remain error-prone if built on a complex and unreliable platform.

Niklaus Wirth

More features, more troubles

Sometimes adding a simple feature into an existing system turned out to be an nightmarish task. In general, a system with n features will have n*n interactions between features. Therefore, adding 1 feature into 100 existing features is totally different from adding 1 feature into 10 existing features.

I think who using tools must at least understand how his tools are created, or better than that, directly experience the creating processes of his tools. It would make every tool simpler and more reliable than ever.

The lesson: Simplex sigillum veri!

You can’t perform that action at this time.