| By Thomas Zang | Article Rating: |
|
| January 5, 2009 09:30 AM EST | Reads: |
3,193 |
But there is still some barrier in .NET language interoperability, because each .NET language uses CTS to support its own unique set of language features. There is no guarantee that the calling code written in one language can be fully accessed by the caller language. For example, if one language provides support for unsigned integers, you can design a field with type UInt16; but from a .NET language that has no concept of unsigned integers, that field won't be useful.
To ensure that the component developed in one .NET language can be fully accessible to any other .NET languages, the .NET Framework provides a Common Language Specification (CLS) that describes a set of features commonly needed by any .NET language. In other words, it defines the minimum language requirements that must be supported by any .NET language.
Therefore, to make PowerScript a .NET language, we must ensure that it is CLS-compliant.
In CLS terminology, there are three different roles: framework, consumer, and extender.
- A CLS-compliant .NET library is called a framework. The framework will have a guarantee of interoperability across different .NET languages; therefore, it will have a wider customer base than libraries that are not CLS-compliant.
- A language that enables users to use the CLS Framework is called a CLS consumer, but the consumer can't extend the CLS Framework.
- A language that lets users use and extend CLS Framework is called a CLS extender, which is a superset of a CLS consumer (everything that applies to a CLS consumer also applies to CLS extenders).
The detail information can be referred to as the Common Language Infrastructure (CLI) Partition I.
In PB12, the PB .NET assembly/Web Service will be targeted as the CLS Framework. PB's classic IDE will be targeted as the CLS consumer. The new WPF workshop IDE will be targeted as the CLS-compliant extender that lets users consume and extend the .NET CLS Framework and produce PB's own CLS Framework (PB .NET assembly/Web Service) for consumption by other .NET languages.
Figure 1 shows the relationship among CTS, CLS, and various .NET languages. As you can see, all .NET languages fully support CLS features and partially support their own set of CTS features. They have some common features, but they all have their own unique features as well.
In terms of the language interoperability in PB12 PowerScript will be CLS-compliant, which means that PowerScript will be able to consume and extend any CLS-compliant resources produced by other .NET languages and produce PB .NET assemblies/Web Services as CLS-compliant component.
The non-CLS-compliant .NET resources will be considered to be consumed or extended case-by-case. For example if the resource only involves unsigned integer types that are not CLS-compliant types, PB will be able to support it.
On the other hand, since PowerScript has its own unique set of language features, many of them are not CLS-compliant, therefore, the overall functionality of PowerScript will go beyond CLS rules, and PB .NET target applications (Windows Forms, Web Forms, or WPF) don't have to be CLS-compliant, users can use any language feature to develop their .NET applications.
As we all know, System.Object type is the root type of all .NET types. In PB12, the type system of PowerScript will be enhanced. All PB primitive types will be equivalent to their corresponding .NET primitive types, and the functionality of the .NET Sytem.Enum type and the .NET System.Array type will be merged with that of the PB enum type and PB array type, respectively. The PB PowerObject type will also inherit from .NET System.Object type. Finally System. Object type will be the root type of all PB types as well.
In .NET, an interface defines a contract. A class that implements an interface must adhere to its contract. In PB12, users will be able to define their own interfaces, which can include methods, properties, events, and indexers. The new syntax is as follows:
global type ISub1 interface [from IBase1, IBase2]
//Functions
function string MyFunction(integer i)
subroutine MySub(string s)
//Properties
integer Myproperty1 [get, set]
integer Myproperty2 [set]
string Myproperty3[get]
//Events
event type integer MyEvent ( )
//Indexers
string this[integer i, integer j] [get, set]
end type
The PB object types Custom Class, Standard Class, Custom Visual, Standard Visual, Window, and Menu will be able to implement both user-defined PB interfaces and imported .NET interfaces.
Currently in PB, an unbounded array must be single-dimensional, which means the array-bound information of a multi-dimensional array must be specified at compile time. This limitation prevents users from declaring a multi-dimensional array without specifying the array-bound information and assigning another array to it at runtime, which is a pretty common scenario in .NET programming. For example, a Web Service may return a multi-dimensional array, whose size is unknown at compile time.
In PB12, a single-dimensional array will be enhanced so it can be dynamically created. For example, int arr[] which is an unbounded single-dimensional integer array.
At runtime, users can create a single-dimensional array as follow:
arr = create int[2 to 5]
which creates a single -dimensional integer array, with indexes of the one dimension being 2 to 5.
Published January 5, 2009 Reads 3,193
Copyright © 2009 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Thomas Zang
Thomas Zang is a staff software engineer at Sybase. He works in the Singapore kernel team of the PB department and is in charge of the PowerScript language enhancement project in PB12.0.
- Yahoo! to Keynote 4th Cloud Expo: Accelerating Innovation with Cloud Computing
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- Yahoo! SVP Shelton Shugar to Discuss Innovation at Cloud Computing Expo
- Ulitzer Provides a Powerful Social Journalism Platform
- Live Demo of Yahoo! Query Language at Cloud Computing Expo
- Bernanke Should Go Back to Teaching
- How to Extract Your Contacts from LinkedIn and Facebook
- Yahoo! Announces Open-Source Cloud Server
- Google Responds to the Bing Challenge
- Google Open Sources its JavaScript Tools
- Adobe Cans Another 9% of its Workforce
- Unix Co-Creator Writes New Open Source Programming Language for Google
- Yahoo! Named “Platinum Sponsor” of Cloud Computing Expo
- Yahoo! to Keynote 4th Cloud Expo: Accelerating Innovation with Cloud Computing
- Confessions of a Ulitzer Addict
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- Twitter, Linked In, Ning and Ulitzer: Easy Personal Branding Strategy
- Ulitzer Live! New Media Conference & Expo
- Ulitzer vs. Ning
- Yahoo! SVP Shelton Shugar to Discuss Innovation at Cloud Computing Expo
- Google Wave Hits Wider Beta
- Ulitzer Provides a Powerful Social Journalism Platform
- Social Media on Ulitzer - Strategy Nets New AUM for RIA
- Live Demo of Yahoo! Query Language at Cloud Computing Expo
- Where Are RIA Technologies Headed in 2008?
- The Top 250 Players in the Cloud Computing Ecosystem
- Google Version 2.0: Googzilla - The Calculating Predator
- Google Space Launches at Heathrow Airport
- SEO/SEM Tips & Tricks: How and When Should You Submit Your Website to Google?
- Google Snaps Up the Father of the Orion Search Engine
- AOL To Enhance Video Search Engine by Adding RSS Feeds
- Ulitzer vs Knol - Google Wants Its Own Wikipedia
- AJAXWorld Knocks Spots Off LinuxWorld
- The World's Youngest "Google Entrepreneur" Is One Month Old
- Microsoft's Chase After Google Reverberates
- Google Jabbers On with GoogleTalk


































