MoTion: A new declarative object matching approach in Pharo - CRISTAL-RMOD
Article Dans Une Revue Journal of Computer Languages Année : 2024

MoTion: A new declarative object matching approach in Pharo

Résumé

Pattern matching is an expressive way of matching data and extracting pieces of information from it. The recent inclusion of pattern matching in the Java and Python languages highlights that such a facility is more and more adopted by developers for everyday development. Other main stream programming languages also offer pattern matching capabilities as part of the language (Rust, Scala, Haskell, and OCaml), with different degrees of expressivity in what can be matched. In the meantime, in graphs, pattern matching takes a slightly different turn; it enhances the expressivity of the patterns that can be defined. Smalltalk currently offers little pattern matching capability to find specific objects inside a large graph of objects using a declarative pattern. In Pharo, the closest library to classical pattern matching that exists is the RBParseTreeSearcher, which allows to express specialized patterns over a Pharo Abstract Syntax Tree to find some inner node. The question arises of what features a flexible pattern matching language should have. In this paper, we review the features found in different existing pattern matching languages, both in General Purpose Languages (like Java) and in declarative graph pattern matching languages. We then describe MoTion, a new pattern matching engine for Pharo smalltalk, combining all these features. We discuss some aspects of MoTion's implementation and illustrate its use with real case examples.

Fichier principal
Vignette du fichier
main.pdf (341.22 Ko) Télécharger le fichier
Origine Fichiers produits par l'(les) auteur(s)

Dates et versions

hal-04724509 , version 1 (07-10-2024)

Licence

Identifiants

Citer

Aless Hosry, Vincent Aranega, Nicolas Anquetil. MoTion: A new declarative object matching approach in Pharo. Journal of Computer Languages, 2024, 81, pp.101290. ⟨10.1016/j.cola.2024.101290⟩. ⟨hal-04724509⟩
0 Consultations
0 Téléchargements

Altmetric

Partager

More