srplab Common Language Extension(CLE)
 

   There are many programing languages. In addition to traditional language C/C++, script languages such as JAVA,PHP,PYTHON,LUA,C#  are also introduced. Applications may be developped with proper and efficient language. For example, websites are usually programed with PHP, GUI applications are developped with JAVA or C#, low-layer applications use C/C++, etc. Although it is convenient, but it also introduces some problems: How to call each other, how the modules developped with one language are used in other languages easily,or how to re-use existing development results.

    For example, to develop a library module with C/C++, general method is to write kinds of extensions, such as Python extension, Lua extension, PHP extension, JAVA extension, and so on. In order to write these extensions, not only to  study interfaces of different languages, but also to perform real programming, in which many problems may be encountered leads to longer period and unstable of the products. In addition, this effort is only an accumulation of experience. The result almost can not be re-used in a new C/C++ module. The procedure will be repeat again.  Therefore, a common  extension development environment  or middleware is expected.

    There many languages to choice, which will introduce the problem of how to perform mixed calls between languages.There are some solutions. For JAVA calls PYTHON may be use JPYTHON, PHP  calls JAVA may uses PHP_JAVA extension, etc. But developpers have to study, understand  and use each of them.

    CLE is a common extension paltform. Modules developped on CLE can be called by any other languages supported. In addition, CLE also present a general pattern for mixed calls. CLE is cross-platform, which supports  win32 and  linux X86. Developing extension using interface presented by CLE, and calling these extensions also use the same interfaces. For programmer only study once to use CLE in different languages.

   CLE supports distributed object technique, which take objects as medium to impletemt the mixed call between languages. Object is presented as a structed memory and a list of function pointers. Through mapping the structed memory and function pointers to different languages, the above idea is realized. CLE is only a share library, which does not impose any restrictions on special script language, and can also be used to develop kinds of distributed applications.

Atricles of common language extension
Multi-Languagee Programming : Object As Medium Software developers may encounter the problem to develop applications with multiple languages, maybe for efficiency, simplicity, marketing time, or for reusing libraries developed with other programming languages. There are many methods can be used...downloadDownload
Multi-Language Programming : How To Manage Objects For multi language programming of c/c++, python, java, csharp, etc, the blog introduces a common and simplified method, which uses common object environment to manage interface object of different languages. The document discusses on how to manage these objects further...downloadDownload
Multi-Language Programming : Entity Object Inheritance And Function Overloading For multi-language programming based on common object environment, object is defined by different languages. Therefore traditional object-oriented programming method is no longer suitable for this case. Developers can not create instance of a class defined in other language...downloadDownload
Multi-Language Programming : Accessing Objects Defined In Other Language Common object environment provides run-time support. Based on support of the environment, applications can access interface objects defined in other language. There are two methods, we introduce them one by one in detail...downloadDownload
Multi-Language Programming : More Complicated Function Call Between Languages Components or libraries provide some functions. Other modules may access these functions through their interface. In some cases, the interface functions may be simple. The caller constructs input arguments, calls the function, and gets the return value. These type interfaces are easy to define and no more restrictions...downloadDownload
Multi-Language Programming : Common Object's Event Object may generate or handle events. This feature should continue to be supported in common object environment. Event is not an entity. It is a set of information. If the event information is described by special language, then it can not be triggered or handled by other languages. Therefore, environment should present a common model to describe events and provide a dispatcher to schedule these events. ...downloadDownload
Multi-Language Programming : Simplifying web service programming Let's go deeper into common object environment. The environment manages interface objects of multiple different languages and provides interface to these languages to define object's attributes, functions and events. It holds all information and parameters about the objects....downloadDownload
Multi-Language Programming : Distributed Object If common object enivronment is deployed on different computers, it will become a distributed object environment. For the environment holds all....downloadDownload
   
 
Examples of common language extension
java extensions
java call c++:  Traditional method for java calling c++ usually uses jni interface. This is little more difficult because programmer have to deal with calling conversion, structed memory conversion, string format conversion, record callback java handle, etc. Using cle developed by srplab, the procedure is simplified. Here is a simple example. full version
java call lua:  For java calls lua, Here presents a new method, which ues cle developed by srplab.A function “Add” is defined in lua which returns the sum of two input integers, the function also call java method “Show” to print the result.full version
java call python:  For java calls python, Here presents a new method, which ues cle developed by srplab.A function "Add" is defined in lua which returns the sum of two input integers. The function also calls java method "Show" to print the result.full version
java call c#:  Traditional method for java calling c++ usually uses jni interface and CLI. This is little more difficult because programmer have to deal with calling conversion, structed memory conversion, string format conversion, record callback java handle, etc.full version
lua extensions
lua call c++:  Here presents a new method for lua calling c++. A function "Add" is defined in c++ which returns the sum of two input integers. The function also calls lua method "Show" to print the result. full version
lua call java:  For lua calls java, here presents a new method, which ues cle developed by srplab.A function "Add" is defined in lua which returns the sum of two input integers, the function also call lua method "Show" to print the result.full version
lua call python:  For lua calls python, here presents a new method, which ues cle developed by srplab.A function "Add" is defined in lua which returns the sum of two input integers, the function also call lua method "Show" to print the result.full version
lua call c#:  For lua calls c#, here presents a new method, which ues cle developed by srplab..A function "Add" is defined in lua which returns the sum of two input integers, the function also call lua method "Show" to print the result.full version
python extensions
python call c++:  Here presents a new method for python calling c++. A function "Add" is defined in c++ which returns the sum of two input integers. The function also calls python method "Show" to print the result. full version
python call java:  For python calls java, here presents a new method, which ues cle developed by srplab.A function "Add" is defined in lua which returns the sum of two input integers. The function also calls python method "Show" to print the result.full version
python call lua:  For python calls lua, here presents a new method, which ues cle developed by srplab.A function "Add" is defined in lua which returns the sum of two input integers. The function also calls python method "Show" to print the result.full version
python call c#:  For python calls c#, here presents a new method, which ues cle developed by srplab..A function "Add" is defined in lua which returns the sum of two input integers. The function also calls python method "Show" to print the result.full version
c# extensions
c# call c++:  Here presents a new method for c# calling c++. A function "Add" is defined in c++ which returns the sum of two input integers, the function also call c# method "Show" to print the result. full version
c# call java:  For c# calls java, here presents a new method, which ues cle developed by srplab.A function "Add" is defined in lua which returns the sum of two input integers, the function also calls c# method "Show" to print the result.full version
c# call lua:  For c# calls lua, here presents a new method, which ues cle developed by srplab.A function "Add" is defined in lua which returns the sum of two input integers, the function also call c# method "Show" to print the result.full version
c# call python:  For c# calls python, Here presents a new method, which ues cle developed by srplab.A function "Add" is defined in lua which returns the sum of two input integers, the function also call c# method "Show" to print the result.full version
php extensions
php call c++:  Here presents a new method for php calling c++. A function "Add" is defined in c++ which returns the sum of two input integers. The function also calls php method "Show" to print the result. full version
php call java:  For php calls java, here presents a new method, which ues cle developed by srplab.A function "Add" is defined in lua which returns the sum of two input integers. The function also calls php method "Show" to print the result.full version
php call lua:  For php calls lua, here presents a new method, which ues cle developed by srplab.A function "Add" is defined in lua which returns the sum of two input integers. The function also calls php method "Show" to print the result.full version
php call python:  For php calls python, here presents a new method, which ues cle developed by srplab.A function "Add" is defined in lua which returns the sum of two input integers, the function also call php method "Show" to print the result.full version
php call c#:  For php calls c#, here presents a new method, which ues cle developed by srplab..A function "Add" is defined in lua which returns the sum of two input integers. The function also calls php method "Show" to print the result.full version

Copywright (C) 2005 www.SRPLab.com(Star-River Platform Lab.) All Rights Reserved Email:support@srplab.com