Robust scripting via patterns

  • Authors:
  • Bard Bloom;Martin J. Hirzel

  • Affiliations:
  • IBM, Hawthorne, NY, USA;IBM, Hawthorne, NY, USA

  • Venue:
  • Proceedings of the 8th symposium on Dynamic languages
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Dynamic typing in scripting languages is a two-edged sword. On the one hand, it can be more flexible and more concise than static typing. On the other hand, it can lead to less robust code. We argue that patterns can give scripts much of the robustness of static typing, without losing the flexibility and concision of dynamic typing. To make this case, we describe a rich pattern system in the dynamic language Thorn. Thorn patterns interact with its control constructs and scoping rules to support concise and robust test-and-extract idioms. Thorn patterns encompass an extensive set of features from ML-style patterns to regular expressions and beyond. And Thorn patterns can be first-class and support pattern-punning (mirror constructor syntax). Overall, this paper describes a powerful pattern system that makes scripting more robust.