Skip to main content

Showing 1–11 of 11 results for author: Castagna, G

Searching in archive cs. Search in all archives.
.
  1. arXiv:2404.00338  [pdf, other

    cs.PL

    Polymorphic Records for Dynamic Languages

    Authors: Giuseppe Castagna, Loïc Peyrot

    Abstract: We define and study "row polymorphism" for a type system with set-theoretic types, specifically union, intersection, and negation types. We consider record types that embed row variables and define a subty** relation by interpreting types into sets of record values and by defining subty** as the containment of interpretations. We define a functional calculus equipped with operations for field… ▽ More

    Submitted 30 March, 2024; originally announced April 2024.

    ACM Class: F.3.3; D.1.1

  2. Polymorphic Type Inference for Dynamic Languages

    Authors: Giuseppe Castagna, Mickaël Laurent, Kim Nguyen

    Abstract: We present a type system that combines, in a controlled way, first-order polymorphism with intersectiontypes, union types, and subty**, and prove its safety. We then define a type reconstruction algorithm that issound and terminating. This yields a system in which unannotated functions are given polymorphic types(thanks to Hindley-Milner) that can express the overloaded behavior of the functions… ▽ More

    Submitted 17 November, 2023; originally announced November 2023.

    Journal ref: Proceedings of the ACM on Programming Languages, In press, 8 (POPL), pp.40

  3. The Design Principles of the Elixir Type System

    Authors: Giuseppe Castagna, Guillaume Duboc, José Valim

    Abstract: Elixir is a dynamically-typed functional language running on the Erlang Virtual Machine, designed for building scalable and maintainable applications. Its characteristics have earned it a surging adoption by hundreds of industrial actors and tens of thousands of developers. Static ty** seems nowadays to be the most important request coming from the Elixir community. We present a gradual type sys… ▽ More

    Submitted 29 December, 2023; v1 submitted 10 June, 2023; originally announced June 2023.

    Journal ref: The Art, Science, and Engineering of Programming, 2024, Vol. 8, Issue 2, Article 4

  4. arXiv:2111.03354  [pdf, other

    cs.PL

    Programming with union, intersection, and negation types

    Authors: Giuseppe Castagna

    Abstract: In this essay, I present the advantages and, I dare say, the beauty of programming in a language with set-theoretic types, that is, types that include union, intersection, and negation type connectives. I show by several examples how set-theoretic types are necessary to type some common programming patterns, but also how they play a key role in ty** several language constructs-from branching and… ▽ More

    Submitted 27 March, 2024; v1 submitted 5 November, 2021; originally announced November 2021.

  5. Revisiting Occurrence Ty**

    Authors: Giuseppe Castagna, Victor Lanvin, Mickaël Laurent, Kim Nguyen

    Abstract: We revisit occurrence ty**, a technique to refine the type of variables occurring in type-cases and, thus, capturesome programming patterns used in untyped languages. Although occurrence ty** was tied from its inceptionto set-theoretic types-union types, in particular-it never fully exploited the capabilities of these types. Here weshow how, by using set-theoretic types, it is possible to deve… ▽ More

    Submitted 12 February, 2022; v1 submitted 12 July, 2019; originally announced July 2019.

  6. Semantic subty** for non-strict languages

    Authors: Tommaso Petrucciani, Giuseppe Castagna, Davide Ancona, Elena Zucca

    Abstract: Semantic subty** is an approach to define subty** relations for type systems featuring union and intersection type connectives. It has been studied only for strict languages, and it is unsound for non-strict semantics. In this work, we study how to adapt this approach to non-strict languages: in particular, we define a type system using semantic subty** for a functional language with a call-… ▽ More

    Submitted 16 October, 2018; v1 submitted 12 October, 2018; originally announced October 2018.

    Comments: Extended version of a submission to the post-proceedings of TYPES'18

  7. Covariance and Controvariance: a fresh look at an old issue (a primer in advanced type systems for learning functional programmers)

    Authors: Giuseppe Castagna

    Abstract: Twenty years ago, in an article titled "Covariance and contravariance: conflict without a cause", I argued that covariant and contravariant specialization of method parameters in object-oriented programming had different purposes and deduced that, not only they could, but actually they should both coexist in the same language. In this work I reexamine the result of that article in the light of r… ▽ More

    Submitted 21 February, 2022; v1 submitted 5 September, 2018; originally announced September 2018.

    Comments: This is a corrected version of the paper arXiv:1809.01427v7 published originally on Feb. 13, 2020

    Journal ref: Logical Methods in Computer Science, Volume 16, Issue 1 (February 22, 2022) lmcs:4809

  8. Set-Theoretic Types for Polymorphic Variants

    Authors: Giuseppe Castagna, Tommaso Petrucciani, Kim Nguyen

    Abstract: Polymorphic variants are a useful feature of the OCaml language whose current definition and implementation rely on kinding constraints to simulate a subty** relation via unification. This yields an awkward formalization and results in a type system whose behaviour is in some cases unintuitive and/or unduly restrictive. In this work, we present an alternative formalization of poly-morphic varian… ▽ More

    Submitted 5 July, 2016; v1 submitted 3 June, 2016; originally announced June 2016.

    Comments: ACM SIGPLAN International Conference on Functional Programming, Sep 2016, Nara, Japan. ICFP 16, 21st ACM SIGPLAN International Conference on Functional Programming, 2016

  9. Static and dynamic semantics of NoSQL languages

    Authors: Véronique Benzaken, Giuseppe Castagna, Kim Nguy\~ên, Jérôme Siméon

    Abstract: We present a calculus for processing semistructured data that spans differences of application area among several novel query languages, broadly categorized as "NoSQL". This calculus lets users define their own operators, capturing a wider range of data processing capabilities, whilst providing a ty** precision so far typical only of primitive hard-coded operators. The type inference algorithm i… ▽ More

    Submitted 7 March, 2013; originally announced March 2013.

    Journal ref: POPL, Rome : Italy (2013)

  10. On Global Types and Multi-Party Session

    Authors: Giuseppe Castagna, Mariangiola Dezani-Ciancaglini, Luca Padovani

    Abstract: Global types are formal specifications that describe communication protocols in terms of their global interactions. We present a new, streamlined language of global types equipped with a trace-based semantics and whose features and restrictions are semantically justified. The multi-party sessions obtained projecting our global types enjoy a liveness property in addition to the traditional progres… ▽ More

    Submitted 13 March, 2012; v1 submitted 4 March, 2012; originally announced March 2012.

    ACM Class: F.1.2, F.3.3, H.3.5, H.5.3

    Journal ref: Logical Methods in Computer Science, Volume 8, Issue 1 (March 15, 2012) lmcs:773

  11. arXiv:1104.2079  [pdf, ps, other

    cs.DB

    Optimizing XML querying using type-based document projection

    Authors: Véronique Benzaken, Giuseppe Castagna, Dario Colazzo, Kim Nguyen

    Abstract: XML data projection (or pruning) is a natural optimization for main memory query engines: given a query Q over a document D, the subtrees of D that are not necessary to evaluate Q are pruned, thus producing a smaller document D'; the query Q is then executed on D', hence avoiding to allocate and process nodes that will never be reached by Q. In this article, we propose a new approach, based on typ… ▽ More

    Submitted 11 April, 2011; originally announced April 2011.

    Comments: 65 pages A4 format

    ACM Class: H.2.5; F.3.2