The University of Southampton
University of Southampton Institutional Repository

Preemptive type checking

Preemptive type checking
Preemptive type checking
Dynamically typed languages languages are very well suited for rapid prototyping, agile programming methodologies and rapidly evolving software. However, programmers can still benefit from the ability to detect type errors in their code early, in particular if this does not impose restrictions on their programming style.
In this paper we describe a new type checking system that identifies potential type errors in such languages through a flow-sensitive static analysis. It computes for every expression the variable’s present (from the values that it has last been assigned) and future (with which it is used in the further program execution) types, respectively. Using this information, the mechanism inserts type checks at strategic points in the original program. We prove that these checks are inserted as early as possible and preempt type errors earlier than existing type systems. We further show that these checks do not change the semantics of programs that do not raise type errors.
Preemptive type checking can be added to existing languages without the need to modify the existing runtime environment. Instead, it can be invoked at a very late stage, after the compilation to bytecode and initialisation of the program. We demonstrate an implementation of this for the Python language, and its effectiveness on a number of standard benchmarks.
2352-2208
151-181
Grech, Neville
b8afe72a-04a8-48cf-8193-cf1d9b5edfa5
Fischer, Bernd
0c9575e6-d099-47f1-b3a2-2dbc93c53d18
Rathke, Julian
dba0b571-545c-4c31-9aec-5f70c231774b
Grech, Neville
b8afe72a-04a8-48cf-8193-cf1d9b5edfa5
Fischer, Bernd
0c9575e6-d099-47f1-b3a2-2dbc93c53d18
Rathke, Julian
dba0b571-545c-4c31-9aec-5f70c231774b

Grech, Neville, Fischer, Bernd and Rathke, Julian (2018) Preemptive type checking. Journal of Logical and Algebraic Methods in Programming, 101, 151-181. (doi:10.1016/j.jlamp.2018.08.003).

Record type: Article

Abstract

Dynamically typed languages languages are very well suited for rapid prototyping, agile programming methodologies and rapidly evolving software. However, programmers can still benefit from the ability to detect type errors in their code early, in particular if this does not impose restrictions on their programming style.
In this paper we describe a new type checking system that identifies potential type errors in such languages through a flow-sensitive static analysis. It computes for every expression the variable’s present (from the values that it has last been assigned) and future (with which it is used in the further program execution) types, respectively. Using this information, the mechanism inserts type checks at strategic points in the original program. We prove that these checks are inserted as early as possible and preempt type errors earlier than existing type systems. We further show that these checks do not change the semantics of programs that do not raise type errors.
Preemptive type checking can be added to existing languages without the need to modify the existing runtime environment. Instead, it can be invoked at a very late stage, after the compilation to bytecode and initialisation of the program. We demonstrate an implementation of this for the Python language, and its effectiveness on a number of standard benchmarks.

Text Preemptive-type-checki_2018_Journal-of-Logical-and-Algebraic-Methods-in-Prog - Version of Record
Restricted to Repository staff only
Request a copy

More information

Accepted/In Press date: 14 August 2018
e-pub ahead of print date: 26 September 2018
Published date: December 2018

Identifiers

Local EPrints ID: 421793
URI: https://eprints.soton.ac.uk/id/eprint/421793
ISSN: 2352-2208
PURE UUID: 56c0cba8-df91-41a3-8e31-3e1ea184874f

Catalogue record

Date deposited: 27 Jun 2018 16:31
Last modified: 16 Nov 2018 17:30

Export record

Altmetrics

Download statistics

Downloads from ePrints over the past year. Other digital versions may also be available to download e.g. from the publisher's website.

View more statistics

Atom RSS 1.0 RSS 2.0

Contact ePrints Soton: eprints@soton.ac.uk

ePrints Soton supports OAI 2.0 with a base URL of https://eprints.soton.ac.uk/cgi/oai2

This repository has been built using EPrints software, developed at the University of Southampton, but available to everyone to use.

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we will assume that you are happy to receive cookies on the University of Southampton website.

×