27 research outputs found

    Multimethods and separate static typechecking in a language with C++-like object model

    Full text link
    The goal of this paper is the description and analysis of multimethod implementation in a new object-oriented, class-based programming language called OOLANG. The implementation of the multimethod typecheck and selection, deeply analyzed in the paper, is performed in two phases in order to allow static typechecking and separate compilation of modules. The first phase is performed at compile time, while the second is executed at link time and does not require the modules' source code. OOLANG has syntax similar to C++; the main differences are the absence of pointers and the realization of polymorphism through subsumption. It adopts the C++ object model and supports multiple inheritance as well as virtual base classes. For this reason, it has been necessary to define techniques for realigning argument and return value addresses when performing multimethod invocations.Comment: 15 pages, 18 figure

    Module Embedding

    Get PDF
    This paper proposes a code reuse mechanism called module embedding that enables the building of new modules from existing ones through inheritance, overriding of procedures, and overriding of types; the paper also describes an implementation scheme for this mechanism. Module embedding is beneficial when modules and classes are used in combination and need to be extended together, or when modules are more appropriate medium than classes

    Translating programming languages for intermediate codes

    Get PDF
    Many of the important data structures used in a compiler are intermediate representations of the program being compiled. Often these representations take the form of trees, with several node types, each of which has different attributes. Tree representations can be described with grammars, just like programming languages. For each grammar rule, there is one constructor that belongs to the class for its left-hand-side symbol. I simply extend the abstract class with a concrete class for each grammar rule. Each grammar rule has right hand side components that must be represented in the data structures.compiler, lexical analysis, abstract syntax, intermediate representation, abstract machine language

    Introduction to the Literature on Semantics

    Get PDF
    An introduction to the literature on semantics. Included are pointers to the literature on axiomatic semantics, denotational semantics, operational semantics, and type theory

    Multiple Dispatch in Practice

    No full text
    Multiple dispatch uses the run time types of more than one argument to a method call to determine which method body to run. While several languages over the last 20 years have provided multiple dispatch, most object-oriented languages still support only single dispatch - forcing programmers to implement multiple dispatch manually when required. This thesis presents an empirical study of the use of multiple dispatch in practice, considering six languages that support multiple dispatch. We hope that this study will help programmers understand the uses and abuses of multiple dispatch; virtual machine implementors optimise multiple dispatch; and language designers to evaluate the choice of providing multiple dispatch in new programming languages
    corecore