Typing Functional Stack-Based Languages

نویسنده

  • Christopher Diggins
چکیده

Stack-based languages (e.g. Forth (Moore 1974), Postscript (Inc. 1999)) have been around for nearly four decades. They are particularly popular today for use as intermediate languages (e.g. CIL (ECMA 2002), JVML (Lindholm and Yellin 1999), (Morrisett et al. 1998)). This is for several reasons: they have good run-time performance characteristics, they resemble the machine level instructions on many computers, they are easy to implement, and they have compact representations. In these stack-based languages instructions are not first-class values. The Joy programming language (von Thun 2001) and the Factor programming language (Pestov 2003) are examples of functional stack-based languages: they allow instructions to be treated as data and placed on the stack. These languages however are lacking a static type system. This paper aims to bridge the gap between statically typed imperative stack-based languages and untyped functional stack-based languages by defining a type-system for a point-free functional stack-based language.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Typing Tools for Typeless Stack Languages

Many low-level runtime engines and virtual machines are stack based instructions take parameters from the stack and leave their results on the stack. Stack language is a common name for several languages used to program stack based (virtual) machines like CLR, JVM, Forth, Postscript, etc. We chose the Forth language as an example to represent the class of stack languages, partially because this...

متن کامل

Stack-Based Typed Assembly Language

In previous work, we presented a Typed Assembly Language (TAL). TAL is sufficiently expressive to serve as a target language for compilers of high-level languages such as ML. This work assumed such a compiler would perform a continuation-passing style transform and eliminate the control stack by heap-allocating activation records. However, most compilers are based on stack allocation. This pape...

متن کامل

Amortised Memory Analysis Using the Depth of Data Structures

The heap space analysis presented by Hofmann and Jost in their 2003POPL paper [2] finds linear space bounds for many functional programs.It uses an amortized analysis: assigning hypothetical amounts of free space(called potential) to data structures in proportion to their sizes using typeannotations. Constraints on these annotations in the type system ensurethat the tota...

متن کامل

Compiling Curried Functional Languages to .NET

Recent trends in programming language implementation are moving more and more towards “managed” runtime environments. These offer many benefits, including static and dynamic type checking, security, profiling, bounds checking and garbage collection. The Common Language Infrastructure (CLI) is Microsoft’s attempt to define a managed runtime environment. However, since it was designed with more m...

متن کامل

A Type System for Bounded Space and Functional In-Place Update

We show how linear typing can be used to obtain functional programs which modify heap-allocated data structures in place. We present this both as a “design pattern” for writing C-code in a functional style and as a compilation process from linearly typed first-order functional programs into malloc()-free C code. The main technical result is the correctness of this compilation. The crucial innov...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007