Hostname: page-component-6766d58669-vgfm9 Total loading time: 0 Render date: 2026-05-15T05:41:25.642Z Has data issue: false hasContentIssue false

Translation of tree-processing programs into stream-processing programs based on ordered linear type1

Published online by Cambridge University Press:  01 May 2008

KOICHI KODAMA
Affiliation:
Tokyo Institute of Technology
KOHEI SUENAGA
Affiliation:
University of Tokyo (e-mail: kohei@yl.is.s.u_tokyo.ac.jp)
NAOKI KOBAYASHI
Affiliation:
Tohoku University
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

There are two ways to write a program for manipulating tree-structured data such as XML documents: One is to write a tree-processing program focusing on the logical structure of the data and the other is to write a stream-processing program focusing on the physical structure. While tree-processing programs are easier to write than stream-processing programs, tree-processing programs are less efficient in memory usage since they use trees as intermediate data. Our aim is to establish a method for automatically translating a tree-processing program to a stream-processing one in order to take the best of both worlds. We first define a programming language for processing binary trees and a type system based on ordered linear type, and show that every well-typed program can be translated to an equivalent stream-processing program. We then extend the language and the type system to deal with XML documents. We have implemented an XML stream processor generator based on our algorithm, and obtained promising experimental results.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 2008
Submit a response

Discussions

No Discussions have been published for this article.