CompatibL Translator (beta)

Overview

CompatibL Translator sets a more ambitious goal than CompatibL Generator, which comes at the cost of additional restrictions on the types of code it can create.

When used for cross-platform development, CompatibL Generator creates complete files that are based exclusively on the object and data model (such as header and interface files, serialization, project files, etc.), and stubs for the used-edited code which may be interfaced to other languages using generated wrappers.

CompatibL Translator takes this process one step further to provide automatic translation of user-edited code between programming languages, when certain restrictions on code syntax are followed. The Translator generates native code in each of the target languages, with complete equivalence of implementation from one language to another.

How it works

CompatibL Translator begins from parsing the code written in source language (for example C#) into cross-platform FreeStyle definitions. The definitions capture both the object model (class interface) and the document model of the user-edited implementation.

The format used by FreeStyle to capture the user-edited implementation code is derived from Microsoft CodeDom, with added emphasis on full code expansion instead of relying on unparsed code snippets. FreeStyle also adds support for language features that are not present in the .NET family of languages.

If the parser is not able to recognize a specific code feature, it gives a detailed error message with the exact location of the unrecognized code snippet. At this point the user has two options to correct this problem:

  • Modify the source code so it is recognized by the parser
  • Provide literal code segments in each of the target languages to be inserted by the Translator into the generated code.

After the source code is parsed into FreeStyle, the code is generated by the Translator in each of the target languages, for example C++ and Java. If desired, the code can also be optionally regenerated in the source language to improve its formatting.

Cross-Platform Programming

CompatibL Translator makes it possible to achieve identical native implementation for different programming languages and platforms, without the added effort and risk of errors for manual porting.

The software can also handle those cases where one of the target languages lacks native support for a specific feature. In such cases CompatibL Translator generates additional code in the target language to replicate the desired native capabilities of the source language.

Class Libraries

CompatibL provides cross-platform versions of the class libraries to be used with translated source code. They include implementations of the most popular features of the Microsoft .NET Framework and industry standard math libraries.

Advantages

By using CompatibL Translator as a development tool, you will achieve:

  • Identical implementation of class libraries in C#, C++, and Java using native code in each programming language, not a wrapper
  • Performance and security features of native code in C# and Java
  • Optimization and portability in C++
  • Running C# or Java code inside your client application and identical C++ code on your Unix server.

Coverage

Currently the Translator supports C# as the source language with C++ and Java as target languages. Other combinations of source and target languages are in development.

 

Copyright © 2006 CompatibL