Results 1 - 10
of
20
A Lightweight Implementation of Generics and Dynamics
, 2002
"... The recent years have seen a number of proposals for extending statically typed languages by dynamics or generics. Most proposals --- if not all --- require significant extensions to the underlying language. In this paper we show that this need not be the case. We propose a particularly lightweight ..."
Abstract
-
Cited by 70 (6 self)
- Add to MetaCart
The recent years have seen a number of proposals for extending statically typed languages by dynamics or generics. Most proposals --- if not all --- require significant extensions to the underlying language. In this paper we show that this need not be the case. We propose a particularly lightweight extension that supports both dynamics and generics. Furthermore, the two features are smoothly integrated: dynamic values, for instance, can be passed to generic functions. Our proposal makes do with a standard Hindley-Milner type system augmented by existential types. Building upon these ideas we have implemented a small library that is readily usable both with Hugs and with the Glasgow Haskell compiler.
Typing dynamic typing
- ICFP ’02: Proceedings of the 7th ACM SIGPLAN International Conference on Functional Programming
, 2002
"... Even when programming in a statically typed language we every now and then encounter statically untypable values; such values result from interpreting values or from communicating with the outside world. To cope with this problem most languages include some form of dynamic types. It may be that the ..."
Abstract
-
Cited by 53 (1 self)
- Add to MetaCart
Even when programming in a statically typed language we every now and then encounter statically untypable values; such values result from interpreting values or from communicating with the outside world. To cope with this problem most languages include some form of dynamic types. It may be that the core language has been explicitly extended with such a type, or that one is allowed to live dangerously by using functions like unsafeCoerce. We show how, by a careful use of existentially and universally quantified types, one may achieve the same effect, without extending the language with new or unsafe features. The techniques explained are universally applicable, provided the core language is expressive enough; this is the case for the common implementations of Haskell. The techniques are used in the description of a type checking compiler that, starting from an expression term, constructs a typed function representing the semantics of that expression. In this function the overhead associated with the type checking is only once being paid for; in this sense we have thus achieved static type checking.
Towards a Strongly Typed Functional Operating System
- The 14th International Workshop on the Implementation of Functional Languages, IFL'02, Selected Papers, volume 2670 of LNCS
, 2002
"... In this paper, we present Famke. It is a library for Clean that enables the creation and management of independent distributed processes (written in Clean) on a network of computers. The main feature of Famke is that values of any type, i.e. data and code, can be communicated between independent ..."
Abstract
-
Cited by 10 (4 self)
- Add to MetaCart
In this paper, we present Famke. It is a library for Clean that enables the creation and management of independent distributed processes (written in Clean) on a network of computers. The main feature of Famke is that values of any type, i.e. data and code, can be communicated between independent processes in a type safe way. Famke uses Clean's dynamic types and its dynamic linker to extend running applications with new code (plug-ins) that, if its type matches the types used in the application, are guaranteed to fit. Clean no longer o#ers any support for concurrent evaluation, but fortunately, we can realize threads, signalling and exception handling by using first class continuations without the need for additional run-time support. We have made an interactive shell on top of Famke with which the user can manipulate processes interactively.
Lazy Dynamic Input/Output in the lazy functional language Clean
- The 14th International Workshop on the Implementation of Functional Languages, IFL’02, Selected Papers, volume 2670 of LNCS
, 2002
"... The new release of Clean oers a hybrid type system with both static and dynamic typing. Any common static Clean expression can in principle be converted into a dynamic expression (called a "dynamic "), and backwards. The type of the dynamic (an encoding of the original static type) can be checked at ..."
Abstract
-
Cited by 10 (9 self)
- Add to MetaCart
The new release of Clean oers a hybrid type system with both static and dynamic typing. Any common static Clean expression can in principle be converted into a dynamic expression (called a "dynamic "), and backwards. The type of the dynamic (an encoding of the original static type) can be checked at run-time via a special pattern match after which the dynamic expression can be evaluated as eciently as usual. Clean furthermore oers "dynamic I/O": any application can read in a dynamic that is stored by some other application. Such a dynamic can contain unevaluated functions (closures) that are unknown in the receiving application. The receiving application therefore has to be extended with these function de nitions. This is not trivial because Clean uses compiled code and is not an interpreted language that uses some byte code. A running Clean application therefore communicates with a dynamic linker that is able to add the missing binary code to the running application. So, dynamics can be used to realize plug-ins and mobile code in a type safe way without loss of eciency in the resulting code. In this paper we explain the implementation of dynamic I/O. Dynamics are written in such a way that internal sharing is preserved when a dynamic is read. Dynamics are read in very lazily in phases: rst its type is checked, and only if the evaluation is demanded, the dynamic expression is reconstructed and the new code is linked in. Dynamics can become quite complicated: they can contain sharing, they can be cyclic, they can even refer to other dynamics, and they may be distributed over a computer network. We have managed to completely hide the internal storage structure for the user by separating the storage of dynamics in system space and user space. For the user a dynamic o...
A functional shell that dynamically combines compiled code
- Watt University
, 2003
"... Abstract. We present a new shell that provides the full basic functionality of a strongly typed lazy functional language, including overloading. The shell can be used for manipulating files, applications, data and processes at the command line. The shell does type checking and only executes well-typ ..."
Abstract
-
Cited by 6 (5 self)
- Add to MetaCart
Abstract. We present a new shell that provides the full basic functionality of a strongly typed lazy functional language, including overloading. The shell can be used for manipulating files, applications, data and processes at the command line. The shell does type checking and only executes well-typed expressions. Files are typed, and applications are simply files with a function type. The shell executes a command line by combining existing code of functions on disk. We use the hybrid static/dynamic type system of Clean to do type checking/inference. Its dynamic linker is used to store and retrieve any expression (both data and code) with its type on disk. Our shell combines the advantages of interpreters (direct response) and compilers (statically typed, fast code). Applications (compiled functions) can be used, in a type safe way, in the shell, and functions defined in the shell can be used by any compiled application. 1
GEC: A Toolkit for Generic Rapid Prototyping of Type Safe Interactive Applications
- In 5th International Summer School on Advanced Functional Programming (AFP 2004), volume 3622 of LNCS
, 2005
"... Programming GUIs with conventional GUI APIs is notoriously tedious. In these notes we present the GEC toolkit in which the programmer can create user interfaces without any knowledge of lowlevel I/O handling. Instead, he works with Graphical Editor Components (GEC). A GEC is an interactive compo ..."
Abstract
-
Cited by 4 (4 self)
- Add to MetaCart
Programming GUIs with conventional GUI APIs is notoriously tedious. In these notes we present the GEC toolkit in which the programmer can create user interfaces without any knowledge of lowlevel I/O handling. Instead, he works with Graphical Editor Components (GEC). A GEC is an interactive component that is automatically derived from an arbitrary monomorphic data type, including higher order types.
Automatic Generation of Editors for Higher-Order Data Structures
- Second ASIAN Symposium on Programming Languages and Systems (APLAS 2004), volume 3302 of LNCS
, 2004
"... With generic functional programming techniques, we have eased GUI programming by constructing a programming toolkit with which one can create GUIs in an abstract and compositional way, using type-directed Graphical Editor Components (GECs). In this toolkit, the programmer specifies a GUI by mean ..."
Abstract
-
Cited by 4 (3 self)
- Add to MetaCart
With generic functional programming techniques, we have eased GUI programming by constructing a programming toolkit with which one can create GUIs in an abstract and compositional way, using type-directed Graphical Editor Components (GECs). In this toolkit, the programmer specifies a GUI by means of a data model instead of lowlevel GUI programming. In earlier versions of this toolkit, the data model must have a first-order type. In this paper we show that the programming toolkit can be extended in two ways, such that the data model can contain higher-order types. We added support for dynamic polymorphic higher-order editors using the functional shell Esther. By combining the earlier developed techniques of generic GECs, abstract editors, we also added statically typed higher-order editors. In principle this solution extends our GUI programming toolkit with the full expressive power of functional programming languages.
Subtyping with Strengthening Type Invariants
"... . Our research directive is the development of a programming environment which provides support for writing safety-critical applications. The possibility to integrate the specication and verication of (e.g. safety and progress) properties of the code into programming itself would decrease the ex ..."
Abstract
-
Cited by 3 (3 self)
- Add to MetaCart
. Our research directive is the development of a programming environment which provides support for writing safety-critical applications. The possibility to integrate the specication and verication of (e.g. safety and progress) properties of the code into programming itself would decrease the existing gap between design and implementation, thus it would ease the development of correct programs. Furthermore, integration with the run-time system would enable the dynamic extension of programs in a safe manner, which would be useful in the embedded systems and mobile computing domains. The current paper focuses on one aspect of the above mentioned research directive, the propagation of properties throughout the code. A large part of this task can be realized by an appropriate type system which can keep track of type invariants, oering a cheap (though partial) solution applicable beside a (usually very resource consuming) theorem prover. Hence, we extend the type system of ...
Towards a Mobile Haskell
, 2003
"... This paper proposes a set of communication primitives for Haskell, to be used in open distributed systems, i.e. systems where multiple executing programs can interact using a prede ned protocol. Functions are \ rst class citizens" in a functional language, hence it would be natural transfer th ..."
Abstract
-
Cited by 3 (2 self)
- Add to MetaCart
This paper proposes a set of communication primitives for Haskell, to be used in open distributed systems, i.e. systems where multiple executing programs can interact using a prede ned protocol. Functions are \ rst class citizens" in a functional language, hence it would be natural transfer them between programs in a distributed system. However, existing distributed Haskell extensions are limited to closed systems or restrict the set of expressions that can be communicated. The former eectively prohibits large-scale distribution, whereas the latter sacri ces key abstraction constructs. A functional language that allows the communication of functions in an open system can be seen as a mobile computation language, hence we call our extension mHaskell (Mobile Haskell). We demonstrate how the proposed communication primitives can be used to implement more powerful abstractions, such as remote evaluation, and that common patterns of communication can be encoded as higher order functions or mobile skeletons. The design has been validated by constructing a prototype in Glasgow Distributed Haskell, and a compiled implementation is under construction.

