5 research outputs found
Facilitating modular property-preserving extensions of programming languages
We will explore an approach to modular programming language descriptions and extensions in a denotational style.
Based on a language core, language features are added stepwise on the core. Language features can be described
separated from each other in a self-contained, orthogonal way. We present an extension semantics framework consisting
of mechanisms to adapt semantics of a basic language to new structural requirements in an extended language
preserving the behaviour of programs of the basic language. Common templates of extension are provided. These
can be collected in extension libraries accessible to and extendible by language designers. Mechanisms to extend
these libraries are provided. A notation for describing language features embedding these semantics extensions is
presented
A Rational Deconstruction of Landin's SECD Machine with the J Operator
Landin's SECD machine was the first abstract machine for applicative
expressions, i.e., functional programs. Landin's J operator was the first
control operator for functional languages, and was specified by an extension of
the SECD machine. We present a family of evaluation functions corresponding to
this extension of the SECD machine, using a series of elementary
transformations (transformation into continu-ation-passing style (CPS) and
defunctionalization, chiefly) and their left inverses (transformation into
direct style and refunctionalization). To this end, we modernize the SECD
machine into a bisimilar one that operates in lockstep with the original one
but that (1) does not use a data stack and (2) uses the caller-save rather than
the callee-save convention for environments. We also identify that the dump
component of the SECD machine is managed in a callee-save way. The caller-save
counterpart of the modernized SECD machine precisely corresponds to Thielecke's
double-barrelled continuations and to Felleisen's encoding of J in terms of
call/cc. We then variously characterize the J operator in terms of CPS and in
terms of delimited-control operators in the CPS hierarchy. As a byproduct, we
also present several reduction semantics for applicative expressions with the J
operator, based on Curien's original calculus of explicit substitutions. These
reduction semantics mechanically correspond to the modernized versions of the
SECD machine and to the best of our knowledge, they provide the first syntactic
theories of applicative expressions with the J operator
On the Transformation between Direct and Continuation Semantics
. Proving the congruence between a direct semantics and a continuation semantics is often surprisingly complicated considering that direct-style -terms can be transformed into continuation style automatically. However, transforming the representation of a direct-style semantics into continuation style usually does not yield the expected representation of a continuation-style semantics (i.e., one written by hand). The goal of our work is to automate the transformation between textual representations of direct semantics and of continuation semantics. Essentially, we identify properties of a direct-style representation (e.g., totality), and we generalize the transformation into continuation style accordingly. As a result, we can produce the expected representation of a continuation semantics, automatically. It is important to understand the transformation between representations of direct and of continuation semantics because it is these representations that get processed in any kind of ..