Applications, implementation and performance evaluation of bit stream programming in erlang

  • Authors:
  • Per Gustafsson;Konstantinos Sagonas

  • Affiliations:
  • Uppsala University and Ericsson AB, Sweden;National Technical University of Athens, Greece

  • Venue:
  • PADL'07 Proceedings of the 9th international conference on Practical Aspects of Declarative Languages
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

Writing code that manipulates bit streams is a painful and error-prone programming task, often performed via bit twiddling techniques such as explicit bit shifts and bit masks in programmer-allocated buffers. Still, this kind of programming is necessary in many application areas ranging from decoding streaming media files to implementing network protocols. In this paper we employ high-level constructs from declarative programming, such as pattern matching at the bit level and bit stream comprehensions, and show how a variety of bit stream programming applications can be written in a succinct, less error-prone, and totally memory-safe manner. We also describe how these constructs can be implemented efficiently. The resulting performance is superior to that of other (purely) functional languages and competitive to that of low-level languages such as C.