摘要
From a perspective of theoretical study, there are some faults in the models of the existing object-oriented programming languages. For example, C# does not support metaclasses, the primitive types of Java and C# are not objects, etc. So, this paper designs a programming language, Shrek, which integrates many language features and constructions in a compact and consistent model. The Shrek language is a class-based purely object-oriented language. It has a dynamical strong type system, and adopts a single-inheritance mechanism with Mixin as its complement. It has a consistent class instantiation and inheritance structure, and the ability of intercessive structural computational reflection, which enables it to support safe metaclass programming. It also supports multi-thread programming and automatic garbage collection, and enforces its expressive power by adopting a native method mechanism. The prototype system of the Shrek language is implemented and anticipated design goals are achieved.
以理论研究的视角,现有面向对象程序设计语言的理论模型存在不足,如C++不支持元类,Java和C#的基本类型不是对象等.为此,设计了一种程序设计语言Shrek,将多种语言特性和语言设施统一在一个简洁、一致的模型下实现.Shrek语言是基于类的完全面向对象语言,拥有动态强类型系统,采用了与Mixin相结合的单继承机制.该语言具有协调一致的类对象结构,具备结构化计算反射能力,能够进行安全的元类程序设计.另外,它还支持多线程程序设计和自动垃圾回收,并通过本地方法机制极大地增强了自身的表达能力.该语言的原型系统已经实现,达到了预期的设计目标.
基金
The National Science Fund for Distinguished Young Scholars (No.60425206)
the National Natural Science Foundation of China (No.60633010)
the Natural Science Foundation of Jiangsu Province(No.BK2006094)