Multi-Stage Programs are Generalized Arrows

The lambda calculus, subject to typing restrictions, provides a syntax for the internal language of cartesian closed categories. This paper establishes a parallel result: staging annotations, subject to named level restrictions, provide a syntax for the internal language of Freyd categories, which a...

Full description

Saved in:
Bibliographic Details
Published inarXiv.org
Main Author Megacz, Adam
Format Paper
LanguageEnglish
Published Ithaca Cornell University Library, arXiv.org 30.09.2010
Subjects
Online AccessGet full text
ISSN2331-8422

Cover

Abstract The lambda calculus, subject to typing restrictions, provides a syntax for the internal language of cartesian closed categories. This paper establishes a parallel result: staging annotations, subject to named level restrictions, provide a syntax for the internal language of Freyd categories, which are known to be in bijective correspondence with Arrows. The connection is made by interpreting multi-stage type systems as indexed functors from polynomial categories to their reindexings. This result applies only to multi-stage languages which are (1) homogeneous, (2) allow cross-stage persistence and (3) place no restrictions on the use of structural rules in typing derivations. Removing these restrictions and repeating the construction yields generalized arrows, of which Arrows are a particular case. A translation from well-typed multi-stage programs to single-stage GArrow terms is provided. The translation is defined by induction on the structure of the proof that the multi-stage program is well-typed, relying on information encoded in the proof's use of structural rules. Metalanguage designers can now factor out the syntactic machinery of metaprogramming by providing a single translation from staging syntax into expressions of generalized arrow type. Object language providers need only implement the functions of the generalized arrow type class in point-free style. Object language users may write metaprograms over these object languages in a point-ful style, using the same binding, scoping, abstraction, and application mechanisms in both the object language and metalanguage. This paper's principal contributions are the GArrow definition of Figures 2 and 3, the translation in Figure 5 and the category-theoretic semantics of Definition 16. An accompanying Coq proof formalizes the type system, translation procedure, and key theorems.
AbstractList The lambda calculus, subject to typing restrictions, provides a syntax for the internal language of cartesian closed categories. This paper establishes a parallel result: staging annotations, subject to named level restrictions, provide a syntax for the internal language of Freyd categories, which are known to be in bijective correspondence with Arrows. The connection is made by interpreting multi-stage type systems as indexed functors from polynomial categories to their reindexings. This result applies only to multi-stage languages which are (1) homogeneous, (2) allow cross-stage persistence and (3) place no restrictions on the use of structural rules in typing derivations. Removing these restrictions and repeating the construction yields generalized arrows, of which Arrows are a particular case. A translation from well-typed multi-stage programs to single-stage GArrow terms is provided. The translation is defined by induction on the structure of the proof that the multi-stage program is well-typed, relying on information encoded in the proof's use of structural rules. Metalanguage designers can now factor out the syntactic machinery of metaprogramming by providing a single translation from staging syntax into expressions of generalized arrow type. Object language providers need only implement the functions of the generalized arrow type class in point-free style. Object language users may write metaprograms over these object languages in a point-ful style, using the same binding, scoping, abstraction, and application mechanisms in both the object language and metalanguage. This paper's principal contributions are the GArrow definition of Figures 2 and 3, the translation in Figure 5 and the category-theoretic semantics of Definition 16. An accompanying Coq proof formalizes the type system, translation procedure, and key theorems.
Author Megacz, Adam
Author_xml – sequence: 1
  givenname: Adam
  surname: Megacz
  fullname: Megacz, Adam
BookMark eNrjYmDJy89LZWLgNDI2NtS1MDEy4mDgLS7OMjAwMDIzNzI1NeZk0PYtzSnJ1A0uSUxPVQgoyk8vSswtVkgsSlVwT81LLUrMyaxKTVFwLCrKLy_mYWBNS8wpTuWF0twMym6uIc4eugVF-YWlqcUl8Vn5pUV5QKl4IwMLQ0MTSzNzE2PiVAEAYGcy2Q
ContentType Paper
Copyright 2010. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.
Copyright_xml – notice: 2010. This work is published under http://arxiv.org/licenses/nonexclusive-distrib/1.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.
DBID 8FE
8FG
ABJCF
ABUWG
AFKRA
AZQEC
BENPR
BGLVJ
CCPQU
DWQXO
HCIFZ
L6V
M7S
PHGZM
PHGZT
PIMPY
PKEHL
PQEST
PQGLB
PQQKQ
PQUKI
PRINS
PTHSS
DatabaseName ProQuest SciTech Collection
ProQuest Technology Collection
Materials Science & Engineering Collection
ProQuest Central (Alumni Edition)
ProQuest Central
ProQuest Central Essentials
ProQuest
Technology Collection
ProQuest One Community College
ProQuest Central Korea
SciTech Premium Collection
ProQuest Engineering Collection
Engineering Database
ProQuest Central Premium
ProQuest One Academic
Publicly Available Content Database
ProQuest One Academic Middle East (New)
ProQuest One Academic Eastern Edition (DO NOT USE)
ProQuest One Applied & Life Sciences
ProQuest One Academic
ProQuest One Academic UKI Edition
ProQuest Central China
Engineering Collection
DatabaseTitle Publicly Available Content Database
Engineering Database
Technology Collection
ProQuest One Academic Middle East (New)
ProQuest Central Essentials
ProQuest One Academic Eastern Edition
ProQuest Central (Alumni Edition)
SciTech Premium Collection
ProQuest One Community College
ProQuest Technology Collection
ProQuest SciTech Collection
ProQuest Central China
ProQuest Central
ProQuest One Applied & Life Sciences
ProQuest Engineering Collection
ProQuest One Academic UKI Edition
ProQuest Central Korea
Materials Science & Engineering Collection
ProQuest Central (New)
ProQuest One Academic
ProQuest One Academic (New)
Engineering Collection
DatabaseTitleList Publicly Available Content Database
Database_xml – sequence: 1
  dbid: 8FG
  name: ProQuest Technology Collection
  url: https://search.proquest.com/technologycollection1
  sourceTypes: Aggregation Database
DeliveryMethod fulltext_linktorsrc
Discipline Physics
EISSN 2331-8422
Genre Working Paper/Pre-Print
GroupedDBID 8FE
8FG
ABJCF
ABUWG
AFKRA
ALMA_UNASSIGNED_HOLDINGS
AZQEC
BENPR
BGLVJ
CCPQU
DWQXO
FRJ
HCIFZ
L6V
M7S
M~E
PHGZM
PHGZT
PIMPY
PKEHL
PQEST
PQGLB
PQQKQ
PQUKI
PRINS
PTHSS
ID FETCH-proquest_journals_20811496743
IEDL.DBID 8FG
IngestDate Mon Jun 30 09:26:53 EDT 2025
IsOpenAccess true
IsPeerReviewed false
IsScholarly false
Language English
LinkModel DirectLink
MergedId FETCHMERGED-proquest_journals_20811496743
Notes content type line 50
SourceType-Working Papers-1
ObjectType-Working Paper/Pre-Print-1
OpenAccessLink https://www.proquest.com/docview/2081149674?pq-origsite=%requestingapplication%
PQID 2081149674
PQPubID 2050157
ParticipantIDs proquest_journals_2081149674
PublicationCentury 2000
PublicationDate 20100930
PublicationDateYYYYMMDD 2010-09-30
PublicationDate_xml – month: 09
  year: 2010
  text: 20100930
  day: 30
PublicationDecade 2010
PublicationPlace Ithaca
PublicationPlace_xml – name: Ithaca
PublicationTitle arXiv.org
PublicationYear 2010
Publisher Cornell University Library, arXiv.org
Publisher_xml – name: Cornell University Library, arXiv.org
SSID ssj0002672553
Score 2.7352006
SecondaryResourceType preprint
Snippet The lambda calculus, subject to typing restrictions, provides a syntax for the internal language of cartesian closed categories. This paper establishes a...
SourceID proquest
SourceType Aggregation Database
SubjectTerms Annotations
Categories
Coding
Constrictions
Language
Languages
Mathematical analysis
Polynomials
Semantics
Syntax
Title Multi-Stage Programs are Generalized Arrows
URI https://www.proquest.com/docview/2081149674
hasFullText 1
inHoldings 1
isFullTextHit
isPrint
link http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwfV1LSwMxEB60i-DNJz5qCehNArqb155EZdcitCyi0FvJJqN40bpbLx787U7SrR6EHkMgCWGYbx7fzACcWW-ExwvkWPuMi1RLnktdc2EkPss6NVaHeufRWA2fxP1ETrqAW9vRKpc6MSpq_-5CjJycdEOme660uJp98DA1KmRXuxEa65AQUOdBqk159xtjSZUmizn7p2YjdpRbkFR2hs02rOHbDmxEyqVrd-E81r5ysvZekFULmlTLbIOsawX9-oWeXYceie0enJbF4-2QL2-YdjLQTv9enO1Dj5x5PABmjaqVTX126Sx5YiJ3BCHSWeXI1FCoDqG_6qSj1dvHsLnIbgc-Qx968-YTTwg05_Ug_swAkptiXD3QavRd_ADtkXZ2
linkProvider ProQuest
linkToHtml http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV1LS8NAEB5qi-jNJz6qLqgnWdFkd5McivhoSW0bglToLWyyU_GS1qQi-hv80e6miR6EouddhmUWZuabmW8G4EQqlym8QIqxsimzHE497sSUuRzHPLZc6Ri-8yAQ_iO7H_FRDT4rLoxpq6xsYmGo1SQxOXIN0l0dunvCYVfTF2q2RpnqarVCQ5arFVSrGDFWEjt6-P6mIVze6t7p_z61rE57eOvTSn5Uflce_Qi39a0laDCbeRrKNW7aQfjwnbOxhKMjcPuX2S58UWcNGqGcYrYONUw3YLlo4UzyTTgruLRUR49PSMJ521VOZIakHC39_IGKXJuZi_kWHP_hkdtQTycp7gCRroiFtJR9mUiN7JiXaJfEEykSHboIFLvQXCRpb_HxEaz4w0E_6neD3j6szivnpleiCfVZ9ooH2iHP4sNSTwTO_6foLzJfn2I
openUrl ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.atitle=Multi-Stage+Programs+are+Generalized+Arrows&rft.jtitle=arXiv.org&rft.au=Megacz%2C+Adam&rft.date=2010-09-30&rft.pub=Cornell+University+Library%2C+arXiv.org&rft.eissn=2331-8422