{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,11,16]],"date-time":"2026-11-16T05:57:35Z","timestamp":1794808655644,"version":"4.9.1"},"publisher-location":"Cham","reference-count":33,"publisher":"Springer Nature Switzerland","isbn-type":[{"value":"9783031911200","type":"print"},{"value":"9783031911217","type":"electronic"}],"license":[{"start":{"date-parts":[[2025,1,1]],"date-time":"2025-01-01T00:00:00Z","timestamp":1735689600000},"content-version":"tdm","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0"},{"start":{"date-parts":[[2025,5,1]],"date-time":"2025-05-01T00:00:00Z","timestamp":1746057600000},"content-version":"vor","delay-in-days":120,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0"}],"content-domain":{"domain":["link.springer.com"],"crossmark-restriction":false},"short-container-title":[],"published-print":{"date-parts":[[2025]]},"abstract":"<jats:title>Abstract<\/jats:title>\n                  <jats:p>\n                    Named and optional arguments are prevalent features in many mainstream programming languages, enhancing code readability\u00a0and flexibility. Despite widespread use, their formalization has not been extensively studied. This\u00a0paper bridges this gap by presenting a type-safe foundation for\u00a0named and optional arguments using intersection and union types. We\u00a0begin by identifying a critical type-safety issue in popular static\u00a0type checkers for Python and Ruby, particularly in handling first-class\u00a0named arguments in the presence of subtyping. Our solution involves rewriting call sites to ensure type safety, which we formalize through a translation into a core calculus called\n                    <jats:inline-formula>\n                      <jats:alternatives>\n                        <jats:tex-math>$$\\lambda _\\textsf{iu}$$<\/jats:tex-math>\n                        <mml:math xmlns:mml=\"http:\/\/www.w3.org\/1998\/Math\/MathML\">\n                          <mml:msub>\n                            <mml:mi>\u03bb<\/mml:mi>\n                            <mml:mi>iu<\/mml:mi>\n                          <\/mml:msub>\n                        <\/mml:math>\n                      <\/jats:alternatives>\n                    <\/jats:inline-formula>\n                    .\u00a0The type safety of the translation is proven using the Coq proof assistant. The practical implementation of\u00a0our approach in the CP language validates our theoretical contributions. Furthermore, we informally discuss how our approach could be adapted to encode named and optional arguments in other existing languages.\n                  <\/jats:p>","DOI":"10.1007\/978-3-031-91121-7_14","type":"book-chapter","created":{"date-parts":[[2025,5,2]],"date-time":"2025-05-02T07:22:04Z","timestamp":1746170524000},"page":"347-373","update-policy":"https:\/\/doi.org\/10.1007\/springer_crossmark_policy","source":"Crossref","is-referenced-by-count":0,"title":["Named Arguments as Intersections, Optional Arguments as Unions"],"prefix":"10.1007","author":[{"given":"Yaozhu","family":"Sun","sequence":"first","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Bruno C. d. S.","family":"Oliveira","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"297","published-online":{"date-parts":[[2025,5,1]]},"reference":[{"key":"14_CR1","doi-asserted-by":"publisher","unstructured":"A\u00eft-Kaci, H., Garrigue, J.: Label-selective $$\\lambda $$-calculus: syntax and confluence. Theor. Comput. Sci. 151(2) (1995). https:\/\/doi.org\/10.1016\/0304-3975(95)00072-5","DOI":"10.1016\/0304-3975(95)00072-5"},{"key":"14_CR2","doi-asserted-by":"publisher","unstructured":"Barbanera, F., Dezani-Ciancaglini, M., de\u2019Liguoro, U.: Intersection and union types: syntax and semantics. Inf. Comput. 119(2) (1995). https:\/\/doi.org\/10.1006\/inco.1995.1086","DOI":"10.1006\/inco.1995.1086"},{"key":"14_CR3","doi-asserted-by":"publisher","unstructured":"Castagna, G.: Programming with union, intersection, and negation types. In: The French School of Programming, chap.\u00a012 (2023). https:\/\/doi.org\/10.1007\/978-3-031-34518-0_12","DOI":"10.1007\/978-3-031-34518-0_12"},{"key":"14_CR4","doi-asserted-by":"publisher","unstructured":"Chargu\u00e9raud, A.: The locally nameless representation. J. Autom. Reason. 49(3) (2012). https:\/\/doi.org\/10.1007\/s10817-011-9225-2","DOI":"10.1007\/s10817-011-9225-2"},{"key":"14_CR5","unstructured":"Church, A.: The Calculi of Lambda-Conversion. No.\u00a06 in Annals of Mathematics Studies, Princeton University Press (1941), https:\/\/press.princeton.edu\/books\/paperback\/9780691083940\/the-calculi-of-lambda-conversion"},{"key":"14_CR6","doi-asserted-by":"publisher","unstructured":"Dunfield, J.: Elaborating intersection and union types. J. Funct. Program. 24(2-3) (2014). https:\/\/doi.org\/10.1017\/S0956796813000270","DOI":"10.1017\/S0956796813000270"},{"key":"14_CR7","unstructured":"Flatt, M., Barzilay, E.: Keyword and optional arguments in PLT Scheme. In: Scheme (2009), https:\/\/users.cs.utah.edu\/plt\/publications\/scheme09-fb.pdf"},{"key":"14_CR8","doi-asserted-by":"publisher","unstructured":"Frisch, A., Castagna, G., Benzaken, V.: Semantic subtyping: Dealing set-theoretically with function, union, intersection, and negation types. J. ACM 55(4) (2008). https:\/\/doi.org\/10.1145\/1391289.1391293","DOI":"10.1145\/1391289.1391293"},{"key":"14_CR9","unstructured":"Furuse, J.P., Garrigue, J.: A label-selective lambda-calculus with optional arguments and its compilation method. Tech. rep., Kyoto University (1995), https:\/\/www.math.nagoya-u.ac.jp\/~garrigue\/papers\/rims-1041.pdf"},{"key":"14_CR10","unstructured":"Garrigue, J.: Objective Label trilogy, http:\/\/wwwfun.kurims.kyoto-u.ac.jp\/soft\/olabl\/"},{"key":"14_CR11","unstructured":"Garrigue, J.: Labeled and optional arguments for Objective Caml. In: JSSST SIG-PPL (2001), https:\/\/www.math.nagoya-u.ac.jp\/~garrigue\/papers\/ppl2001.pdf"},{"key":"14_CR12","doi-asserted-by":"publisher","unstructured":"Garrigue, J., A\u00eft-Kaci, H.: The typed polymorphic label-selective lambda-calculus. In: POPL (1994). https:\/\/doi.org\/10.1145\/174675.174434","DOI":"10.1145\/174675.174434"},{"key":"14_CR13","unstructured":"Lehtosalo, J., et\u00a0al.: Mypy: Optional static typing for Python, https:\/\/www.mypy-lang.org"},{"key":"14_CR14","doi-asserted-by":"publisher","unstructured":"Luo, Z., Soloviev, S., Xue, T.: Coercive subtyping: Theory and implementation. Inf. Comput. 223 (2013). https:\/\/doi.org\/10.1016\/j.ic.2012.10.020","DOI":"10.1016\/j.ic.2012.10.020"},{"key":"14_CR15","doi-asserted-by":"publisher","unstructured":"Madhavapeddy, A., Minsky, Y.: Real World OCaml: Functional Programming for the Masses. Cambridge University Press (2022). https:\/\/doi.org\/10.1017\/9781009129220","DOI":"10.1017\/9781009129220"},{"key":"14_CR16","unstructured":"Matsumoto, S., et\u00a0al.: Steep: Gradual typing for Ruby, https:\/\/github.com\/soutaro\/steep"},{"key":"14_CR17","unstructured":"Microsoft: TypeScript: JavaScript with syntax for types, https:\/\/www.typescriptlang.org"},{"key":"14_CR18","doi-asserted-by":"publisher","unstructured":"Nieto, A., Zhao, Y., Lhot\u00e1k, O., Chang, A., Pu, J.: Scala with explicit nulls. In: ECOOP (2020). https:\/\/doi.org\/10.4230\/LIPIcs.ECOOP.2020.25","DOI":"10.4230\/LIPIcs.ECOOP.2020.25"},{"key":"14_CR19","doi-asserted-by":"publisher","unstructured":"Ohori, A.: A polymorphic record calculus and its compilation. ACM Trans. Program. Lang. Syst. 17(6) (1995). https:\/\/doi.org\/10.1145\/218570.218572","DOI":"10.1145\/218570.218572"},{"key":"14_CR20","unstructured":"Osinski, E.: A polymorphic type system and compilation scheme for record concatenation. Ph.D. thesis, New York University (2006), https:\/\/cs.nyu.edu\/media\/publications\/osinski_edward.pdf"},{"key":"14_CR21","unstructured":"Parsons, M., et\u00a0al.: Persistent: Type-safe, multi-backend data serialization, https:\/\/hackage.haskell.org\/package\/persistent"},{"key":"14_CR22","unstructured":"Pierce, B.C., et\u00a0al.: Programming language foundations. In: Software Foundations. https:\/\/softwarefoundations.cis.upenn.edu\/plf-current\/"},{"key":"14_CR23","unstructured":"Rehman, B.: A blend of intersection types and union types. Ph.D. thesis, The University of Hong Kong (2023), https:\/\/hub.hku.hk\/handle\/10722\/335090"},{"key":"14_CR24","doi-asserted-by":"publisher","unstructured":"Reynolds, J.C.: Design of the programming language Forsythe. In: Algol-like Languages, vol.\u00a01, chap.\u00a08 (1997). https:\/\/doi.org\/10.1007\/978-1-4612-4118-8_9","DOI":"10.1007\/978-1-4612-4118-8_9"},{"key":"14_CR25","unstructured":"Roblox: Luau: A fast, small, safe, gradually typed embeddable scripting language derived from Lua, https:\/\/luau.org"},{"key":"14_CR26","doi-asserted-by":"publisher","unstructured":"Rytz, L., Odersky, M.: Named and default arguments for polymorphic object-oriented languages: A discussion on the design implemented in the Scala language. In: SAC (2010). https:\/\/doi.org\/10.1145\/1774088.1774529","DOI":"10.1145\/1774088.1774529"},{"key":"14_CR27","unstructured":"Snoyman, M., et\u00a0al.: Warp: A fast, light-weight web server for WAI applications, https:\/\/hackage.haskell.org\/package\/warp"},{"key":"14_CR28","unstructured":"Stripe: Sorbet: A static type checker for Ruby, https:\/\/sorbet.org"},{"key":"14_CR29","doi-asserted-by":"publisher","unstructured":"Sun, Y., Dhandhania, U., Oliveira, B.C.d.S.: Compositional embeddings of domain-specific languages. In: OOPSLA (2022). https:\/\/doi.org\/10.1145\/3563294","DOI":"10.1145\/3563294"},{"key":"14_CR30","doi-asserted-by":"publisher","unstructured":"Sun, Y., Oliveira, B.C.d.S.: Named arguments as intersections, optional arguments as unions (artifact). Zenodo (2025). https:\/\/doi.org\/10.5281\/zenodo.14697184","DOI":"10.5281\/zenodo.14697184"},{"key":"14_CR31","unstructured":"Tobin-Hochstadt, S., St-Amour, V., Dobson, E., Takikawa, A.: The Typed Racket Guide, https:\/\/docs.racket-lang.org\/ts-guide\/"},{"key":"14_CR32","doi-asserted-by":"publisher","unstructured":"van Wijngaarden, A., Mailloux, B.J., Peck, J.E.L., Koster, C.H.A., Sintzoff, M., Lindsey, C.H., Meertens, L.G.L.T., Fisker, R.G.: Revised report on the algorithmic language ALGOL 68. Acta Informatica 5(1\u20133) (1975). https:\/\/doi.org\/10.1007\/BF00265077","DOI":"10.1007\/BF00265077"},{"key":"14_CR33","doi-asserted-by":"publisher","unstructured":"Zhang, W., Sun, Y., Oliveira, B.C.d.S.: Compositional programming. ACM Trans. Program. Lang. Syst. 43(3) (2021). https:\/\/doi.org\/10.1145\/3460228","DOI":"10.1145\/3460228"}],"container-title":["Lecture Notes in Computer Science","Programming Languages and Systems"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/link.springer.com\/content\/pdf\/10.1007\/978-3-031-91121-7_14","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,5,6]],"date-time":"2025-05-06T04:43:35Z","timestamp":1746506615000},"score":1,"resource":{"primary":{"URL":"https:\/\/link.springer.com\/10.1007\/978-3-031-91121-7_14"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025]]},"ISBN":["9783031911200","9783031911217"],"references-count":33,"URL":"https:\/\/doi.org\/10.1007\/978-3-031-91121-7_14","relation":{"is-part-of":[{"id-type":"doi","id":"https:\/\/doi.org\/10.1007\/978-3-031-91121-7","asserted-by":"object"}]},"ISSN":["0302-9743","1611-3349"],"issn-type":[{"value":"0302-9743","type":"print"},{"value":"1611-3349","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025]]},"assertion":[{"value":"1 May 2025","order":1,"name":"first_online","label":"First Online","group":{"name":"ChapterHistory","label":"Chapter History"}},{"value":"ESOP","order":1,"name":"conference_acronym","label":"Conference Acronym","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"European Symposium on Programming","order":2,"name":"conference_name","label":"Conference Name","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"Hamilton, ON","order":3,"name":"conference_city","label":"Conference City","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"Canada","order":4,"name":"conference_country","label":"Conference Country","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"2025","order":5,"name":"conference_year","label":"Conference Year","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"3 May 2025","order":7,"name":"conference_start_date","label":"Conference Start Date","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"8 May 2025","order":8,"name":"conference_end_date","label":"Conference End Date","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"34","order":9,"name":"conference_number","label":"Conference Number","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"esop2025","order":10,"name":"conference_id","label":"Conference ID","group":{"name":"ConferenceInfo","label":"Conference Information"}},{"value":"https:\/\/etaps.org\/2025\/conferences\/esop\/","order":11,"name":"conference_url","label":"Conference URL","group":{"name":"ConferenceInfo","label":"Conference Information"}}]}}