Mynx Code Synthesis Compiling to a High-level Language not Platform
The Mynx compiler uses a high-level language as the means of implementation, Mynx source code is compiled, analyzed, processed, and compiled into a high-level programming language, in this case the "Big Three" of Java, C#, and C++. This avoids platform specificity, and having to map the high level language structures into the platform/operating system. The original Eiffel was compiled in to the C programming language--as Bertrand Meyer put it (to paraphrase), using the C language as a form of high-level assembly language.
But compiler construction, programming language design are all computer science, I like the term "informatics" or informatik from German--but science when applied is engineering, and in engineering there is the concept of a trade-off--computer science or programming language engineering is no exception.
Using the HLL-code approach to implement Mynx is simpler in approach (and when effort is simplified and complexity reduced, so much the better...), as a Mynx class or program is translated or mapped to the HLL.
Simplify, and portability by using the approach of, compile to HLL, but in any trade-off there is something paid or lost.
In each case a 1:1 mapping is unattainable, and the synthesized code can become more complex as a result. The trade-off is code complexity for using a host high-level language.
One obvious but very important requirement is that the synthesized code in the host language for a Mynx unit must compile without any problem on the host language compiler, but the trade-off is also meeting the semantic expectations for Mynx.
Niklaus Wirth in a paper (Niklaus Wirth, On the Design of Programming Languages. In Information Processing 74, pages 386-393) about programming language design, states that a user expects the compiler to enforce every language rule; but in this case the Mynx rules but also the host language--without the host language semantics overriding the Mynx rules. Thus, Wirth's statement is very apt, but the implementation of the compiler using a host language and using a host language compiler requires both the host source code synthesized and the host language compiler are transparent to the user. Otherwise, the host language semantics and nuances will bubble up into the Mynx source code written, and then its is a Mynx-host programming language hybrid--not pure Mynx.
Another not so obvious consideration is that in code synthesis in one host language, another host language might entail different semantics. For example, synthesizing Java code as the host language is similar but different from C++, and similar but different from C#. The Big Three programming languages are semantically at the same level, using classes, instances, having statics, but not quite the same. C++ does not have reflection, the interface construct, or reflection, whereas C# and Java do--and this is not meant as a critique or criticism of C++. The host languages will entail different semantics, and possibly the boiler-plate code that is synthesized.
In summary, compiling Mynx and then synthesizing high-level host language has a trade-off in additional code complexity--the code is not Mynx:Host at 1-to-1 or bijective mapping. The semantic considerations of the host language, and the necessary code to implement the housekeeping functionality are a trade-off for using a HLL host language.
Trade-offs in Software Engineering
But compiler construction, programming language design are all computer science, I like the term "informatics" or informatik from German--but science when applied is engineering, and in engineering there is the concept of a trade-off--computer science or programming language engineering is no exception.
Using the HLL-code approach to implement Mynx is simpler in approach (and when effort is simplified and complexity reduced, so much the better...), as a Mynx class or program is translated or mapped to the HLL.
The Trade-off
Simplify, and portability by using the approach of, compile to HLL, but in any trade-off there is something paid or lost.
- semantics - code synthesis to avoid host language idiosyncrasies and semantic inconsistencies, but have semantic inconsistencies among host language and other languages.
- boiler-plate code - code to use the implemented host language unit as part of the "overhead" to manage and manipulate the code--such as for reflection, instantiation, serialization.
In each case a 1:1 mapping is unattainable, and the synthesized code can become more complex as a result. The trade-off is code complexity for using a host high-level language.
Host Language
One obvious but very important requirement is that the synthesized code in the host language for a Mynx unit must compile without any problem on the host language compiler, but the trade-off is also meeting the semantic expectations for Mynx.
Niklaus Wirth in a paper (Niklaus Wirth, On the Design of Programming Languages. In Information Processing 74, pages 386-393) about programming language design, states that a user expects the compiler to enforce every language rule; but in this case the Mynx rules but also the host language--without the host language semantics overriding the Mynx rules. Thus, Wirth's statement is very apt, but the implementation of the compiler using a host language and using a host language compiler requires both the host source code synthesized and the host language compiler are transparent to the user. Otherwise, the host language semantics and nuances will bubble up into the Mynx source code written, and then its is a Mynx-host programming language hybrid--not pure Mynx.
Another not so obvious consideration is that in code synthesis in one host language, another host language might entail different semantics. For example, synthesizing Java code as the host language is similar but different from C++, and similar but different from C#. The Big Three programming languages are semantically at the same level, using classes, instances, having statics, but not quite the same. C++ does not have reflection, the interface construct, or reflection, whereas C# and Java do--and this is not meant as a critique or criticism of C++. The host languages will entail different semantics, and possibly the boiler-plate code that is synthesized.
Synopsis--The Most with Mynx and Host, Language
In summary, compiling Mynx and then synthesizing high-level host language has a trade-off in additional code complexity--the code is not Mynx:Host at 1-to-1 or bijective mapping. The semantic considerations of the host language, and the necessary code to implement the housekeeping functionality are a trade-off for using a HLL host language.
Labels: code generation, code synthesis, mynx, Mynx compiler, programming language design

