L. Hamel, Timothy Colaneri, Ariel Finkle, Oliver McLaughlin
{"title":"TOWARDS PROGRAMMING WITH FIRST-CLASS PATTERNS","authors":"L. Hamel, Timothy Colaneri, Ariel Finkle, Oliver McLaughlin","doi":"10.33965/icwi_ac2021_202109r032","DOIUrl":null,"url":null,"abstract":"Pattern matching is a powerful programming paradigm which first appeared in functional programming languages to make data structure analysis and decomposition more declarative. Promoting patterns to first-class status does not increase the computational power of a programming language, but it does increase its expressiveness allowing for brand new ways of solving problems. First-class patterns were studied in the context of the lambda calculus. Today, almost all modern programming languages incorporate some form of pattern matching. However, with only a few exceptions, all programming languages we are aware of that support pattern matching stop short of treating patterns as first-class citizens. Consequently, many interesting use cases of pattern matching lie beyond the reach of those languages. We have implemented first-class patterns in Asteroid, a dynamically typed, multi-paradigm programming language, in order to assess and experiment with first-class patterns. Here we report some of our initial findings. The idea of first-class patterns is not new but we feel that the insights provided here are novel and highlight the impact that first-class patterns can have on programming languages and the discipline of programming itself .","PeriodicalId":178063,"journal":{"name":"Proceedings of the International Conferences on WWW/Internet 2021 and Applied Computing 2021","volume":"60 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-10-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the International Conferences on WWW/Internet 2021 and Applied Computing 2021","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.33965/icwi_ac2021_202109r032","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
Pattern matching is a powerful programming paradigm which first appeared in functional programming languages to make data structure analysis and decomposition more declarative. Promoting patterns to first-class status does not increase the computational power of a programming language, but it does increase its expressiveness allowing for brand new ways of solving problems. First-class patterns were studied in the context of the lambda calculus. Today, almost all modern programming languages incorporate some form of pattern matching. However, with only a few exceptions, all programming languages we are aware of that support pattern matching stop short of treating patterns as first-class citizens. Consequently, many interesting use cases of pattern matching lie beyond the reach of those languages. We have implemented first-class patterns in Asteroid, a dynamically typed, multi-paradigm programming language, in order to assess and experiment with first-class patterns. Here we report some of our initial findings. The idea of first-class patterns is not new but we feel that the insights provided here are novel and highlight the impact that first-class patterns can have on programming languages and the discipline of programming itself .