Towards fully controlled overloading across module boundaries (original) (raw)

Module Programming using Overloading and Late Binding

1999

One of the criticisms moved to the SML module system is that it does not allow code reusing and, more generally, and incremental style of programming. In this work we propose to extend this module system by adding overloading and late binding, and we show how by this extension it is possible to program modules in an incremental style, similar to the one of object-oriented languages.

An Approach to Overloading with Polymorphism

1991

When referring to this work, full bibliographic details including the author, title, awarding institution and date of the thesis must be given Enlighten: Theses https://theses.gla.ac.uk/

Parameterized Modules for Classes and Extensible Functions

Lecture Notes in Computer Science, 2006

We present F(Eml), a language that combines classes, extensible functions, symmetric multiple dispatching, and a practical system for parameterized modules. Parameterized modules permit subclasses and function extensions to be defined and typechecked once, and then reused to extend multiple argument modules. F(Eml)'s predecessor, Eml, supported classes and extensible functions with multiple dispatch, but its support for parameterized modules was weak. F(Eml)'s key novel features are alias declarations, generalized type relations in module signatures, and a nontrivial definition of signature subsumption.

An Empirical Study of Function Overloading in C++

Source Code Analysis and Manipulation, …, 2008

The usefulness and usability of programming tools (for example, languages, libraries, and frameworks) may greatly impact programmer productivity and software quality. Ideally, these tools should be designed to be both useful and usable. But in reality, there always exist some tools or features whose essential characteristics can be fully understood only after they have been extensively used. The study described in this paper is focused on discovering how C++'s function overloading is used in production code using an instrumented g++ compiler. Our principal finding for the system studied is that the most 'advanced' subset of function overloading tends to be defined in only a few utility modules, which are probably developed and maintained by a small number of programmers, the majority of application modules use only the 'easy' subset of function overloading when overloading names, and most overloaded names are used locally within rather than across module interfaces. We recommend these as guidelines to software designers. some of the complexity to external libraries and APIs. However, we believe that learning such a minimal language can still be a challenge for the average programmers.

A calculus of open modules: call-by-need strategy and confluence

Mathematical Structures in Computer Science, 2007

We present a simple module calculus where selection and execution of a component is possible on open modules, that is, modules which still have to import some definitions from the outside. Hence, it provides a kernel model for a computational paradigm in which standard execution (that is, execution of a single computation described by a fragment of code) can be interleaved with operations at the meta-level which can manipulate in various ways the context in which this computation takes place. Formally, this is achieved by introducing as basic terms configurations, which are, roughly speaking, pairs consisting of an (open, mutually recursive) collection of named components and a term representing a program running in the context of these components. Configurations can be manipulated by classical module/fragment operators, hence reduction steps can be either execution steps of the program or steps which perform module operators (called reconfiguration steps). Since configurations combine the features of lambda abstractions (first-class functions), records, environments with mutually recursive definitions, and modules, the calculus extends and integrates both traditional module calculi and recursive lambda calculi. We state confluence of the calculus, and propose different ways to prevent errors due to lack of some needed component, either by a purely static type system or by a combination of static and run-time checks. Moreover, we define a call-by-need strategy which performs module simplification only when needed and only once, leading to a generalization, including module features, of call-by-need lambda calculi. We prove soundness and completeness of this strategy using an approach based on information content which also allows to preserve confluence even in case local substitution rules are added to the calculus. providing foundations for manipulation and combination of software components. These calculi allow to express a large variety of existing mechanisms by a small set of operators, hence can be used as a paradigmatic example for studying modular languages, in the same spirit the lambda calculus is used for functional programming. For instance, in CMS modules are constructed from basic modules, which have the shape [ι; o; ρ] where ι, o and ρ model input, output and local components, respectively, by only three primitive operators: sum (merging two modules), freeze (binding an input to an output component) and reduct (independently renaming input and output components). operators allow to express, e.g., parameterized modules similar to ML functors, extension with overriding as in object-oriented programming, and mixin modules.

A Namespace Approach for Modularity in BDI Programming Languages

In this paper we propose a model for designing Belief-Desire-Intention (BDI) agents under the principles of modularity. We aim to encapsulate agent functionalities expressed as BDI abstractions into independent, reusable and easier to maintain units of code, which agents can dynamically load. The general idea of our approach is to exploit the notion of namespace to organize components such as beliefs, plans and goals. This approach allowed us to address the name-collision problem, providing interface and information hiding features for modules. Although the proposal is suitable for agent-oriented programming languages in general, we present concrete examples in Jason.

Magda: A new language for modularity

We introduce Magda, a modularity-oriented programming language. The language features lightweight mixins as units of code reuse, modular initialization protocols, and a hygienic approach to identifiers. In particular, Magda's modularity guarantees that the client code of a library written in Magda will never break as a consequence of any addition of members to the library's mixins.

Module-sensitive program specialisation

ACM SIGPLAN Notices, 1997

We present an approach for specialising large programs, such as programs consisting of several modules, or libraries. This approach is based on the idea of using a compiler generator (cogen) for creating generating extensions. Generating extensions are specialisers specialised with respect to some input program. When run on some input data the generating extension produces a specialised version of the input program. Here we use the cogen to tailor modules for specialisation. This happens once and for all, independently of all other modules. The resulting module can then be used as a building block for generating extensions for complete programs, in much the same way as the original modules can be put together into complete programs. The result of running the final generating extension is a collection of residual modules, with a module structure derived from the original program.

Module, Modular Programming, and Module-based Encapsulation : Critiques and Solutions

ICTS, 2009

Modular programming is common phrase written in textbooks, journals, and proceedings. Yet the thorough investigations toward web, books on standards, and textbooks show that there are many incoherent interpretations and definitions of module and modular programming. This state of confusion created unnecessary complexity in the programming languages, and led to the thick books consuming thousand of pages and lot of papers. In the midst of global warming, we need to reduce the number of pages in the textbooks and manuals. Our thesis about module, modular programming, and module-based encapsulation is a solid theory, easy to verify and understand. As byproduct of this research, we create Nusa, a programming-language that best mimic the definition of module, program, and module-based encapsulation. We compare the representative programming-languages with Nusa. Nusa manual is thin, easy to understand. It can contribute to green computing in this special way.

A Model for Inter-module Analysis and Optimizing Compilation

Lecture Notes in Computer Science, 2001

Recent research into the implementation of logic programming languages has demonstrated that global program analysis can be used to speed up execution by an order of magnitude. However, currently such global program analysis requires the program to be analysed as a whole: sepárate compilation of modules is not supported. We describe and empirically evalúate a simple model for extending global program analysis to support sepárate compilation of modules. Importantly, our model supports context-sensitive program analysis and multi-variant specialization of procedures in the modules. tracking global state, dynamic scheduling and higher-order function calis, may require considerable additional machinery to handle.