Browse in : |
All
> Topics
> Programming
All > Journals > CVu > 162 Any of these categories - All of these categories |
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles . The templates will get the extension .xt there.
Title: C++/CLI, Ecma TC39/TG5,and SC22/WG21
Author: Site Administrator
Date: 01 April 2004 22:53:48 +01:00 or Thu, 01 April 2004 22:53:48 +01:00
Summary:
There have been many languages for writing applications, but relatively few foundation platforms which support applications that are written in various different languages. We've had assembler (proprietary), then C (an ISO standard), and now we have the Common Language Infrastructure (CLI). The CLI standard is ISO/IEC 23271; the same content is also available online at http://www.ecma-international.org/publications/standards/Ecma-335.htm.
Body:
For years, C++ has been the most popular language for applications and middleware, but it has usually been hosted on a C base library. Very seldom is a C++ base library made available for use by other diverse languages. For example, libraries that make extensive use of templates (like the standard C++ library does) are difficult or impossible to be used by languages other than C++.
The important features of CLI as a base library have historical roots in a variety of previous technologies:
-
Robust (strongly typesafe, like Ada)
-
Inheritance (single, like Smalltalk)
-
Garbage collected (like Smalltalk)
-
Hardware-oriented datatypes (like C)
-
Twos-complement (8-16-32-64, like all modern PCs and workstations)
-
Exception-handling (like Ada and C++)
-
Object (single root of all inheritance, like Smalltalk)
-
Universal Intermediate Language, or "IL" (with JIT compiler, like ANDF)
-
Shared libraries available to all languages (like C)
CLI provides a base which can support applications written in ECMAScript (Javascript, Jscript), COBOL, Perl, Java, C#, etc., as well as C++.
CLI types are allocated into the CLI heap, using accurate garbagecollection ("GC"). In C++ these are the "managed types". Microsoft's first extensions of C++ for CLI were called "managed C++". Programmers complained about the awkward "bolt-on" feel and asked for a smoother integration. The new integrated design is known as C++/CLI. Microsoft offered the C++/CLI spec to Ecma International for standardization within the Ecma process. Ecma Technical Committee 39 (TC39) is the group which has already standardized ECMAScript, C#, and CLI, and is currently standardizing Eiffel. Within TC39, Task Group 5 (TG5) is standardizing C++/CLI; the author is convener of TG5.
Here are a few comparisons between development within Ecma versus the national-body process within ISO/IEC JTC 1. The members of Ecma are companies; they include Apple, HP, Intel, IBM, and Microsoft. Ecma is supported by one fairly large annual fee per member company, and its standards are then given away for free via internet or CD-ROM. (Nonprofit organisations such as universities and government laboratories can join Ecma for free.) The members of ISO, IEC, JTC 1, and SC22 are national standards bodies. National-body development is typically supported by a mixture of fees for documents and fees for individual participation. Development within Ecma is usually quicker than development within JTC 1. The original CLI and C# standards were developed in about one year, using monthly face-to-face meetings with a teleconference midway between each face-to-face. The schedule of TG5 is somewhat less accelerated; our meetings are spaced about six weeks apart, with occasional teleconferences.
TG5 met first in College Station (Texas), then in Kona (Hawaii); we will meet early March in Melbourne (Australia). Participant companies include Microsoft, IBM, Plum Hall, EDG, and Dinkumware. Invited experts have included Bjarne Stroustrup, Gabriel Dos Reis, and Jon Jagger. TG5 has established liaison with SC22/WG21, whereby members of WG21 national-body C++ panels can participate in a TG5 reflector, receive TG5 documents, and attend TG5 meetings. Since WG21 is actively engaged in the next revision of the ISO C++ standard ("C++0x"), TG5 wants to avoid pre-empting or conflicting with that ongoing revision; the liaison process provides feedback to TG5 in this regard.
C++/CLI tries to avoid breaking or changing the behaviour of alreadyexisting C++ code. We have used creative methods for giving the C++/CLI programmer a first-class ease-of-use while minimizing (perhaps eliminating) clashes with existing user-space identifiers. As of February 2004, the C++/CLI draft still clashes with one identifier, namely the keyword gcnew. In C# any name can be prefixed with "@" to indicate "I'm not a reserved word, I'm an identifier", such as @gcnew. This allows the use of CLI fields, enums, etc., written in various other languages which don't use the same keywords. Whether C++/CLI will use the " @" like C#, or a different syntax, is still being decided.
C++ has always been a multi-paradigm language, and C++/CLI will add even more choices. C++/CLI can be used as a producer language to create CLI base libraries and middleware which can be used by the full range of CLI consumer languages. In this paradigm, we aim to equal the expressiveness and efficiency of C#. But C++/CLI can also be used as a consumer language for CLI applications, using the full power of native C++ and linking with any APIs that are currently available to native C++. Even in the latter case, the C++/CLI software can still publish CLI APIs to any other CLI language. (But the native C++ parts are likely to be unverifiable, and therefore unsuitable for use in security-conscious applications.)
In this latter paradigm, the unmanaged and managed C++ can seamlessly call each other without cumbersome "glue harnesses" like JNI. The intent is to integrate native C++ with C++ which runs on a vendorneutral "virtual machine" (i.e. a Virtual Execution System or VES, as it's called in the CLI standard). One challenging aspect of this integration arises on platforms where one or more of the native C++ types are different in size and/or representation from the standardized CLI types; this is a front-burner issue in TG5 today.
Some of the issues considered by TG5 are enhancements that are conceptually simple but make a noticeable difference in ease-of-use. For example, TG5 has requested WG21 to consider changes that would allow two consecutive "close-angle-braces" at the end of template parameter lists such as list<vector<int>>, because the C# committee has chosen to implement the new "generics" parameter lists with this ease-of-use enhancement.
Plum Hall is currently developing a test suite for C++/CLI, similar in scope and technique to our existing suites for C, C++, Java, and C#. TG5's current target is completion of the C++/CLI standard by September 2004, about one year from the initial creation of TG5. This is not an imposed requirement, and can be changed by decision of TG5, but reflects our current estimate.
Your TG5 convener welcomes your comments; please contact <tplum@plumhall.com>.
[Dedicated to the memory of David Kelly, long-time resident of Oxford, who was still alive when WG21 last met in Oxford.]
Notes:
More fields may be available via dynamicdata ..