490 research outputs found
Approaches to Interpreter Composition
In this paper, we compose six different Python and Prolog VMs into 4 pairwise
compositions: one using C interpreters; one running on the JVM; one using
meta-tracing interpreters; and one using a C interpreter and a meta-tracing
interpreter. We show that programs that cross the language barrier frequently
execute faster in a meta-tracing composition, and that meta-tracing imposes a
significantly lower overhead on composed programs relative to mono-language
programs.Comment: 33 pages, 1 figure, 9 table
Transforming specifications of observable behaviour into programs
A methodology for deriving programs from specifications of observable
behaviour is described. The class of processes to which this methodology
is applicable includes those whose state changes are fully definable by labelled
transition systems, for example communicating processes without
internal state changes. A logic program representation of such labelled
transition systems is proposed, interpreters based on path searching techniques
are defined, and the use of partial evaluation techniques to derive
the executable programs is described
Fine-grained Language Composition: A Case Study
Although run-time language composition is common, it normally takes the form
of a crude Foreign Function Interface (FFI). While useful, such compositions
tend to be coarse-grained and slow. In this paper we introduce a novel
fine-grained syntactic composition of PHP and Python which allows users to
embed each language inside the other, including referencing variables across
languages. This composition raises novel design and implementation challenges.
We show that good solutions can be found to the design challenges; and that the
resulting implementation imposes an acceptable performance overhead of, at
most, 2.6x.Comment: 27 pages, 4 tables, 5 figure
Making an Embedded DBMS JIT-friendly
While database management systems (DBMSs) are highly optimized, interactions
across the boundary between the programming language (PL) and the DBMS are
costly, even for in-process embedded DBMSs. In this paper, we show that
programs that interact with the popular embedded DBMS SQLite can be
significantly optimized - by a factor of 3.4 in our benchmarks - by inlining
across the PL / DBMS boundary. We achieved this speed-up by replacing parts of
SQLite's C interpreter with RPython code and composing the resulting
meta-tracing virtual machine (VM) - called SQPyte - with the PyPy VM. SQPyte
does not compromise stand-alone SQL performance and is 2.2% faster than SQLite
on the widely used TPC-H benchmark suite.Comment: 24 pages, 18 figure
Fundamental Constructs in Programming Languages
Specifying the semantics of a programming language formally can have many
benefits. However, it can also require a huge effort. The effort can be
significantly reduced by translating language syntax to so-called fundamental
constructs (funcons). A translation to funcons is easy to update when the
language evolves, and it exposes relationships between individual language
constructs.
The PLanCompS project has developed an initial collection of funcons
(primarily for translation of functional and imperative languages). The
behaviour of each funcon is defined, once and for all, using a modular variant
of structural operational semantics. The definitions are available online.
This paper introduces and motivates funcons. It illustrates translation of
language constructs to funcons, and how funcons are defined. It also relates
funcons to notation used in previous frameworks, including monadic semantics
and action semantics.Comment: 20 pages plus appendix, submitted to ISoLA 202
Using Prolog techniques to guide program composition
It is possible to build complex programs by repeated combination of pairs of simpler
programs. However, naive combination often produces programs that are far too inefficient.
We would like to have a system that would produce the optimal combination of two
programs, and also work with minimal supervision by the user. In this thesis we make a
significant step towards such an ideal, with the presentation of an interactive system based
on program transformation complemented with knowledge of the program development.
No single method is known that will combine all programs efficiently and so a variety of
different combination methods must be used. However, to get good results it is necessary
that the methods have access to knowledge about the program structure. To provide this
knowledge we have decided to require that the initial programs be constructed in a speĀ¬
cialised editor which embodies knowledge of certain standard Prolog practices (techniques)
to aid the program construction, but more importantly can record pertinent parts of the
program development into a structure called the program history. This program history
contains the initial control flow (skeleton) and the techniques that the user applied in the
construction of the program. Hence it carries knowledge about the program that would
otherwise be very difficult to extract from just the program itself.
The first contribution of this thesis is to recognise that knowledge contained in the program
history can be used in program transformation, reducing the need for user interaction. The
interactive composition system presented can automatically take major decisions, such as
the selection of which subgoal should be unfolded or the laws to be applied in order to
get a more efficient combined program. Furthermore, a component of our system called
the selection procedure can decide automatically which is the most suitable combination
method by analysing the characteristics of the initial pair of programs as given by their
program histories. Approaches that do not use the program history suffer from the problem
that it is not always practical to extract the required information about the structure of
the program.
Our second contribution is to provide a range of new methods which exploit the program
history in order to produce more efficient programs, and to deal with a wider range of
combination problems. The new methods not only combine programs with the same control
flow, but can also deal with some cases in which the control flows are different. All of these
methods are completely automatic with the exception of our "mutant" method in which
the combined clause needs to be approved by the user.
The third contribution is to present relevant properties in our composition system. These
properties fall into the following three groups: (i) properties which hold after applying each
combination method, (ii) properties about the type of program which is obtained after
the combination, (iii) properties of the join specification which defines the characteristics
of the combined program
- ā¦