Refinement Kinds Type-Safe Programming with Practical Type-Level Computation

被引:3
|
作者
Caires, Luis [1 ]
Toninho, Bernardo [1 ]
机构
[1] Univ Nova Lisboa, NOVA LINCS, FCT NOVA, Dept Informat, Lisbon, Portugal
来源
关键词
Refinement Kinds; Typed Meta-Programming; Type-level Computation; Type Theory;
D O I
10.1145/3360557
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
This work introduces the novel concept of kind refinement, which we develop in the context of an explicitly polymorphic ML-like language with type-level computation. Just as type refinements embed rich specifications by means of comprehension principles expressed by predicates over values in the type domain, kind refinements provide rich kind specifications by means of predicates over types in the kind domain. By leveraging our powerful refinement kind discipline, types in our language are not just used to statically classify program expressions and values, but also conveniently manipulated as tree-like data structures, with their kinds refined by logical constraints on such structures. Remarkably, the resulting typing and kinding disciplines allow for powerful forms of type reflection, ad-hoc polymorphism and type-directed meta-programming, which are often found in modern software development, but not typically expressible in a type-safe manner in general purpose languages. We validate our approach both formally and pragmatically by establishing the standard meta-theoretical results of type safety and via a prototype implementation of a kind checker, type checker and interpreter for our language.
引用
收藏
页数:30
相关论文
共 50 条
  • [1] Type-safe update programming
    Erwig, Martin
    Ren, Deling
    [J]. 2003, Springer Verlag (2618):
  • [2] Type-safe update programming
    Erwig, M
    Ren, D
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, 2003, 2618 : 269 - 283
  • [3] Generative Type Abstraction and Type-level Computation
    Weirich, Stephanie
    Vytiniotis, Dimitrios
    Jones, Simon Peyton
    Zdancewic, Steve
    [J]. ACM SIGPLAN NOTICES, 2011, 46 (01) : 227 - 239
  • [4] Generative Type Abstraction and Type-level Computation
    Weirich, Stephanie
    Vytiniotis, Dimitrios
    Jones, Simon Peyton
    Zdancewic, Steve
    [J]. POPL 11: PROCEEDINGS OF THE 38TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2011, : 227 - 239
  • [5] Type-safe Quantum Programming in Idris
    Dandy, Liliane-Joy
    Jeandel, Emmanuel
    Zamdzhiev, Vladimir
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, ESOP 2023, 2023, 13990 : 507 - 534
  • [6] Type-Level Programming with Match Types
    Blanvillain, Olivier
    Brachthaeuser, Jonathan Immanuel
    Kjaer, Maxime
    Odersky, Martin
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2022, 6 (POPL):
  • [7] Type-After-Type: Practical and Complete Type-Safe Memory Reuse
    van der Kouwe, Erik
    Kroes, Taddeus
    Ouwehand, Chris
    Bos, Herbert
    Giuffrida, Cristiano
    [J]. 34TH ANNUAL COMPUTER SECURITY APPLICATIONS CONFERENCE (ACSAC 2018), 2018, : 17 - 27
  • [8] Type-safe run-time polytypic programming
    Weirich, Stephanie
    [J]. JOURNAL OF FUNCTIONAL PROGRAMMING, 2006, 16 : 681 - 710
  • [9] Type-safe distributed programming with ML5
    Murphy, Tom
    Crary, Karl
    Harper, Robert
    [J]. TRUSTWORTHY GLOBAL COMPUTING, 2008, 4912 : 108 - +
  • [10] Graded Monads and Type-Level Programming for Dependence Analysis
    Keating, Finnbar
    Gale, Michael B.
    [J]. HASKELL '21: PROCEEDINGS OF THE 14TH ACM SIGPLAN INTERNATIONAL SYMPOSIUM ON HASKELL, 2021, : 27 - 40