Дэйв Браун во вчерашнем письме в рассылке по Ofront+ предложил поддержать системы типов старого Оберона, Компонентного Паскаля и Оберона-07. Можно было бы пойти ещё дальше. Вот у нас есть компилятор OPCL, в котором входной язык (Oberon, Oberon-2 или подмножество Active Oberon) задаётся при компиляции ключиком. Мы можем сделать ровно то же — и получим универсальный транслятор, который будет транслировать в Си все Оберон-языки, ну, быть может, кроме Активного Оберона, и то не потому, что тут все его ненавидят, а просто потому что тамошнее сообщество не нуждается в таком инструменте, т.к. в основном они делают замкнутые системы без опоры на существующие технологии, так что они просто не будут этим пользоваться.
Итак. Наш гипотетический транслятор будет поддерживать:
Вот на такие мысли навело меня письмо Дэйва.
That's great - I too want a compiler that works across very diverse
platforms.
Oberon-07 attracts me because I want to see what can be done within
its limitations. And if great things /can/ be achieved without much
trouble then it is a win, particularly for self-contained small ARM
systems.
Vishap needs to support the old 16 bit INTEGER Oberons implicitly by
virtue of including the ulm, ooc, ooc2, s3 and v4 libraries.
I like what I see of component Pascal very much. However as a whole it
feels a little step beyond Wirthian simplicity. And unfortunately it
builds in its own text, font and gui handling, which is what I want to
experiment with building my own very simple version of. It's tied to
Windows too, and I'm looking for very broad cross-compatibility.
I thoroughly agree with Julian Miglio's sentiments about C like languages.
C was developed a little after Pascal yet failed to learn from it. Over
time C has eventually achieved the flexibility of the original Pascal on
the CDC 6000, but only reached through layers of pitfalls and workarounds.
And the syntax of pointers is horrific.
I think Julian is giving Pascal haters too much credit. I found almost
nobody at MS who had a kind word for Pascal. The initial feel you
would get would be as if you had mentioned a taboo religion. When pushed
to explain, they would hand wave about perceived restrictions that they
felt always got in the way of doing what they wanted and which were not
in C.
I strongly suspect that a big hurdle is simply that the assignment
operator isn't the one they are used to, and switching to := feels to
them like they are admitting to being unable to get their consitionals
right. (Never mind that the very same people will then see no issue with
recommending that tests like 'if (x==1)' always be written as 'if (1==x)'
so the C compiler is guaranteed to detect if they type 'if (1=x)'.
But that's humans for you
![Улыбается :-)](./images/smilies/icon_e_smile.gif)
. We mostly do what comes easiest, and only
then make up apparently good reasons and use those to persuade others to
do the same as us.
To the future!
Cheers -- Dave.