Results 1 -
5 of
5
The implementation technology of the Mercury debugger
- In Proceedings of the Tenth Workshop on Logic Programming Environments
, 1999
"... Every programming language needs a debugger. Mercury now has three debuggers: a simple procedural debugger similar to the tracing systems of Prolog implementations, a prototype declarative debugger, and a debugger based on the idea of automatic trace analysis. In this paper, we present the shared in ..."
Abstract
-
Cited by 15 (4 self)
- Add to MetaCart
Every programming language needs a debugger. Mercury now has three debuggers: a simple procedural debugger similar to the tracing systems of Prolog implementations, a prototype declarative debugger, and a debugger based on the idea of automatic trace analysis. In this paper, we present the shared infrastructure that underlies the three debuggers, and describe the implementation of the procedural debugger. We give our reasons for each of our main design decisions, and show how several of these decisions are rooted in our experience with the debugging of large programs working with large data structures.
A Unifying Approach to Goal-Directed Evaluation
- New Generation Computing
, 2001
"... Goal-directed evaluation, as embodied in Icon and Snobol, is built on the notions of backtracking and of generating successive results, and therefore it has always been something of a challenge to specify and implement. In this article, we address this challenge using computational monads and partia ..."
Abstract
-
Cited by 10 (3 self)
- Add to MetaCart
Goal-directed evaluation, as embodied in Icon and Snobol, is built on the notions of backtracking and of generating successive results, and therefore it has always been something of a challenge to specify and implement. In this article, we address this challenge using computational monads and partial evaluation. We consider a subset of Icon and we specify it with a monadic semantics and a list monad. We then consider a spectrum of monads that also fit the bill, and we relate them to each other. For example, we derive a continuation monad as a Church encoding of the list monad. The resulting semantics coincides with Gudeman's continuation semantics of Icon. We then compile Icon programs by specializing their interpreter (i.e., by using the first Futamura projection), using type-directed partial evaluation. Through various back ends, including a run-time code generator, we generate ML code, C code, and OCaml byte code. Binding-time analysis and partial evaluation of the continuation-based interpreter automatically give rise to C programs that coincide with the result of Proebsting's optimized compiler.
Compiling Mercury to high-level C code
- Proceedings of the 2002 International Conference on Compiler Construction
, 2001
"... Many logic programming implementations compile to C, but they compile to very low-level C, and thus discard many of the advantages of compiling to a high-level language. We describe an alternative approach to compiling logic programs to C, based on continuation passing, that we have used in a new ba ..."
Abstract
-
Cited by 7 (4 self)
- Add to MetaCart
Many logic programming implementations compile to C, but they compile to very low-level C, and thus discard many of the advantages of compiling to a high-level language. We describe an alternative approach to compiling logic programs to C, based on continuation passing, that we have used in a new back-end for the Mercury compiler. The new approach compiles to much higher-level C code, which means the compiler back-end and run-time system can be considerably simpler.
Simple Translation of Goal-Directed Evaluation
- In Proceedings of the 1997 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI
, 1997
"... This paper presents a simple, powerful and flexible technique for reasoning about and translating the goal-directed evaluation of programming language constructs that either succeed (and generate sequences of values) or fail. The technique generalizes the Byrd Box, a well-known device for describing ..."
Abstract
-
Cited by 5 (1 self)
- Add to MetaCart
This paper presents a simple, powerful and flexible technique for reasoning about and translating the goal-directed evaluation of programming language constructs that either succeed (and generate sequences of values) or fail. The technique generalizes the Byrd Box, a well-known device for describing Prolog backtracking. 1 Motivation In the current world of programming language development, an enormous amount of effort is going into developing new ways of expressing and manipulating data values (e.g., type theory, object-oriented theory, etc.) and very little effort is going towards incorporating richer control-flow constructs into modern languages. As evidence, note that CLU-style iterators have been well-understood for around 20 years [LSAS77] and yet they appear in no mainstream language. 1 Generators (iterators) and goal-directed expression evaluation are extremely powerful control-flow mechanisms for succinctly expressing operations that operate over a sequence of values. The Pr...
A New Implementation of the Icon Language
- Software—Practice and Experience
, 1999
"... Jcon is a new, full-featured, Java-based implementation of the Icon programming language. The compiler, written in Icon, generates an intermediate representation that is optimized and then used to produce classfiles of Java bytecode. A four-chunk control-flow model handles goal-directed evaluation a ..."
Abstract
- Add to MetaCart
Jcon is a new, full-featured, Java-based implementation of the Icon programming language. The compiler, written in Icon, generates an intermediate representation that is optimized and then used to produce classfiles of Java bytecode. A four-chunk control-flow model handles goal-directed evaluation and produces constructs not expressible as Java code. The runtime system, written in Java, finds object-oriented programming a great advantage in implementing a dynamically typed language, with method calls replacing many conditional tests. An all-encompassing descriptor class supports values, references, and suspended operations. The procedure call interface is simple and incurs overhead for generator support only when actually needed. Performance is somewhat disappointing, and some limitations are annoying, but in general Java provides a good implementation platform. Keywords: Icon, Java, compilation, generators, object-oriented programming, virtual machine This is a preprint of an article ...

