Implementing Statically Typed Object-Oriented Programming Languages

被引:7
|
作者
Ducournau, Roland [1 ]
机构
[1] Univ Montpellier 2, F-34095 Montpellier 5, France
关键词
Languages; Measurement; Performance; Binary tree dispatch; casting; coloring; downcast; dynamic loading; genericity; late binding; linking; message sending; method dispatch; multiple inheritance; pointer adjustment; single inheritance; static typing; type analysis; separate compilation; virtual function tables; C plus; C#; Eiffel; !text type='Java']Java[!/text; PRM; Theta; MULTIPLE INHERITANCE; DISPATCH; LAYOUT; SPACE; OPTIMIZATION; ALGORITHMS; EXTENSION; INFERENCE; TESTS; SELF;
D O I
10.1145/1922649.1922655
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Object-oriented programming represents an original implementation issue due to its philosophy of making the program behavior depend on the dynamic type of objects. This is expressed by the late binding mechanism, aka message sending. The underlying principle is that the address of the actually called procedure is not statically determined at compile-time, but depends on the dynamic type of a distinguished parameter known as the receiver. A similar issue arises with attributes, because their position in the object layout may also depend on the object's dynamic type. Furthermore, subtyping introduces another original feature (i.e., runtime subtype checks). All three mechanisms need specific implementations and data structures. In static typing, late binding is generally implemented with so-called virtual function tables. These tables reduce method calls to pointers to functions via a small fixed number of extra indirections. It follows that object-oriented programming yields some overhead, as compared to the usual procedural languages. The different techniques and their resulting overhead depend on several parameters. First, inheritance and subtyping may be single or multiple, and even a mixing is possible, as in JAVA and. NET which present single inheritance for classes and multiple subtyping for interfaces. Multiple inheritance is a well-known complication. Second, the production of executable programs may involve various schemes, from global compilation, which implies the closed-world assumption (CWA), as the whole program is known at compile time, to separate compilation and dynamic loading, where each program unit is compiled and loaded independently of any usage, hence under the open-world assumption (OWA). Global compilation is well-known to facilitate optimization. This article reviews the various implementation techniques available in static typing and in the three cases of single inheritance, multiple inheritance, and multiple subtyping. This language-independent survey focuses on separate compilation and dynamic loading, as they represent the most commonly used and the most demanding framework. However, many works have been undertaken in the global compilation framework, mostly for dynamically typed languages, but also applied to the EIFFEL language. Hence, we also examine global techniques and how they can improve implementation efficiency. Finally, mixed frameworks that combine open and closed world assumptions are considered. For instance, just-in-time (JIT) compilers work under provisional CWA, at the expense of possible recompilations. In contrast, we present an experimental compiler-linker, where separate compilation implies the OWA, whereas the whole program is finally linked under the CWA.
引用
收藏
页数:48
相关论文
共 50 条
  • [41] An extensible metrics extraction environment for object-oriented programming languages
    Harmer, TJ
    Wilkie, FG
    [J]. SCAM 2002: SECOND IEEE INTERNATIONAL WORKSHOP ON SOURCE CODE ANALYSIS MANIPULATION, PROCEEDINGS, 2002, : 26 - 35
  • [42] Application of Robot Programming to the Teaching of Object-Oriented Computer Languages
    Corral, J. M. Rodriguez
    Morgado-Estevez, A.
    Cabrera, D. Molina
    Perez-Pena, F.
    Rodriguez, C. A. Amaya
    Balcells, A. Civit
    [J]. INTERNATIONAL JOURNAL OF ENGINEERING EDUCATION, 2016, 32 (04) : 1823 - 1832
  • [43] ENCAPSULATION, REUSABILITY AND EXTENSIBILITY IN OBJECT-ORIENTED PROGRAMMING-LANGUAGES
    MICALLEF, J
    [J]. JOURNAL OF OBJECT-ORIENTED PROGRAMMING, 1988, 1 (01): : 12 - &
  • [44] ISSUES IN THE DESIGN OF OBJECT-ORIENTED DATABASE PROGRAMMING-LANGUAGES
    BLOOM, T
    ZDONIK, SB
    [J]. SIGPLAN NOTICES, 1987, 22 (12): : 441 - 451
  • [45] USING VERSIONED OBJECT-ORIENTED DATA IN PROGRAMMING-LANGUAGES
    RYKOWSKI, J
    WIECZERZYCKI, W
    [J]. MICROPROCESSING AND MICROPROGRAMMING, 1994, 40 (10-12): : 901 - 904
  • [46] OBJECT-ORIENTED PROGRAMMING WITHOUT AN OBJECT-ORIENTED LANGUAGE
    BOOCH, G
    SEIDEWITZ, E
    START, M
    FIRESMITH, D
    [J]. SIGPLAN NOTICES, 1986, 21 (11): : 508 - 508
  • [47] BENEFITS OF OBJECT-ORIENTED PROGRAMMING IN IMPLEMENTING VISUAL DATABASE INTERFACE
    WU, CT
    [J]. JOURNAL OF OBJECT-ORIENTED PROGRAMMING, 1990, 2 (06): : 8 - &
  • [48] OBJECT-ORIENTED PROGRAMMING
    ANDERSON, B
    [J]. MICROPROCESSORS AND MICROSYSTEMS, 1988, 12 (08) : 433 - 442
  • [49] OBJECT-ORIENTED PROGRAMMING
    BAINES, R
    [J]. ELECTRONICS & WIRELESS WORLD, 1989, 95 (1638): : 370 - 374
  • [50] OBJECT-ORIENTED PROGRAMMING
    TELLO, ER
    [J]. DR DOBBS JOURNAL, 1987, 12 (03): : 126 - &