File Download
There are no files associated with this item.
Links for fulltext
(May Require Subscription)
- Publisher Website: 10.1016/j.scico.2020.102449
- Scopus: eid_2-s2.0-85082606755
- WOS: WOS:000528192000004
- Find via
Supplementary
- Citations:
- Appears in Collections:
Article: Castor: Programming with extensible generative visitors
Title | Castor: Programming with extensible generative visitors |
---|---|
Authors | |
Keywords | Modularity Visitor pattern Pattern matching Metaprogramming OOP |
Issue Date | 2020 |
Publisher | Elsevier BV. The Journal's web site is located at http://www.elsevier.com/locate/scico |
Citation | Science of Computer Programming, 2020, v. 193, p. article no. 102449 How to Cite? |
Abstract | Much recent work on type-safe extensibility for Object-Oriented languages has focused on design patterns that require modest type system features. Examples of such design patterns include Object Algebras, Extensible Visitors, Finally Tagless interpreters, or Polymorphic Embeddings. Those techniques, which often use a functional style, can solve basic forms of the Expression Problem. However, they have important limitations.
This paper presents Castor: a Scala framework for programming with extensible, generative visitors. Castor has several advantages over previous approaches. Firstly, Castor comes with support for (type-safe) pattern matching to complement its visitors with a concise notation to express operations. Secondly, Castor supports type-safe interpreters (à la Finally Tagless), but with additional support for pattern matching and a generally recursive style. Thirdly, Castor enables many operations to be defined using an imperative style, which is significantly more performant than a functional style (especially in the JVM platform). Finally, functional techniques usually only support tree structures well, but graph structures are poorly supported. Castor supports type-safe extensible programming on graph structures. The key to Castor's usability is the use of annotations to automatically generate large amounts of boilerplate code to simplify programming with extensible visitors. To illustrate the applicability of Castor we present several applications and two case studies. The first case study compares the ability of Castor for modularizing the interpreters from the “Types and Programming Languages” book with previous modularization work. The second case study on UML activity diagrams illustrates the imperative aspects of Castor, as well as its support for hierarchical datatypes and graphs. |
Persistent Identifier | http://hdl.handle.net/10722/301342 |
ISSN | 2023 Impact Factor: 1.5 2023 SCImago Journal Rankings: 0.511 |
ISI Accession Number ID |
DC Field | Value | Language |
---|---|---|
dc.contributor.author | ZHANG, W | - |
dc.contributor.author | Dos Santos Oliveira, BCDS | - |
dc.date.accessioned | 2021-07-27T08:09:40Z | - |
dc.date.available | 2021-07-27T08:09:40Z | - |
dc.date.issued | 2020 | - |
dc.identifier.citation | Science of Computer Programming, 2020, v. 193, p. article no. 102449 | - |
dc.identifier.issn | 0167-6423 | - |
dc.identifier.uri | http://hdl.handle.net/10722/301342 | - |
dc.description.abstract | Much recent work on type-safe extensibility for Object-Oriented languages has focused on design patterns that require modest type system features. Examples of such design patterns include Object Algebras, Extensible Visitors, Finally Tagless interpreters, or Polymorphic Embeddings. Those techniques, which often use a functional style, can solve basic forms of the Expression Problem. However, they have important limitations. This paper presents Castor: a Scala framework for programming with extensible, generative visitors. Castor has several advantages over previous approaches. Firstly, Castor comes with support for (type-safe) pattern matching to complement its visitors with a concise notation to express operations. Secondly, Castor supports type-safe interpreters (à la Finally Tagless), but with additional support for pattern matching and a generally recursive style. Thirdly, Castor enables many operations to be defined using an imperative style, which is significantly more performant than a functional style (especially in the JVM platform). Finally, functional techniques usually only support tree structures well, but graph structures are poorly supported. Castor supports type-safe extensible programming on graph structures. The key to Castor's usability is the use of annotations to automatically generate large amounts of boilerplate code to simplify programming with extensible visitors. To illustrate the applicability of Castor we present several applications and two case studies. The first case study compares the ability of Castor for modularizing the interpreters from the “Types and Programming Languages” book with previous modularization work. The second case study on UML activity diagrams illustrates the imperative aspects of Castor, as well as its support for hierarchical datatypes and graphs. | - |
dc.language | eng | - |
dc.publisher | Elsevier BV. The Journal's web site is located at http://www.elsevier.com/locate/scico | - |
dc.relation.ispartof | Science of Computer Programming | - |
dc.subject | Modularity | - |
dc.subject | Visitor pattern | - |
dc.subject | Pattern matching | - |
dc.subject | Metaprogramming | - |
dc.subject | OOP | - |
dc.title | Castor: Programming with extensible generative visitors | - |
dc.type | Article | - |
dc.identifier.email | Dos Santos Oliveira, BCDS: bruno@cs.hku.hk | - |
dc.identifier.authority | Dos Santos Oliveira, BCDS=rp01786 | - |
dc.description.nature | link_to_subscribed_fulltext | - |
dc.identifier.doi | 10.1016/j.scico.2020.102449 | - |
dc.identifier.scopus | eid_2-s2.0-85082606755 | - |
dc.identifier.hkuros | 323735 | - |
dc.identifier.volume | 193 | - |
dc.identifier.spage | article no. 102449 | - |
dc.identifier.epage | article no. 102449 | - |
dc.identifier.isi | WOS:000528192000004 | - |
dc.publisher.place | Netherlands | - |