{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,8,18]],"date-time":"2026-08-18T14:17:27Z","timestamp":1787062647355,"version":"build-2736575974"},"reference-count":35,"publisher":"Cambridge University Press (CUP)","license":[{"start":{"date-parts":[[2025,3,12]],"date-time":"2025-03-12T00:00:00Z","timestamp":1741737600000},"content-version":"unspecified","delay-in-days":70,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":["cambridge.org"],"crossmark-restriction":true},"short-container-title":["J. Funct. Prog."],"published-print":{"date-parts":[[2025]]},"abstract":"<jats:title>Abstract<\/jats:title>\n                  <jats:p>\n                    The tensor notation used in several areas of mathematics is a useful one, but it is not widely available to the functional programming community. In a practical sense, the (embedded) domain-specific languages (\n                    <jats:sc>dsl<\/jats:sc>\n                    s) that are currently in use for tensor algebra are either 1. array-oriented languages that do not enforce or take advantage of tensor properties and algebraic structure or 2. follow the categorical structure of tensors but require the programmer to manipulate tensors in an unwieldy point-free notation. A deeper issue is that for tensor calculus, the dominant pedagogical paradigm assumes an audience which is either comfortable with notational liberties which programmers cannot afford, or focus on the applied mathematics of tensors, largely leaving their linguistic aspects (behaviour of variable binding, syntax and semantics, etc.) for the reader to figure out by themselves. This state of affairs is hardly surprising, because, as we highlight, several properties of standard tensor notation are somewhat exotic from the perspective of lambda calculi. We bridge the gap by defining a\n                    <jats:sc>dsl<\/jats:sc>\n                    , embedded in Haskell, whose syntax closely captures the index notation for tensors in wide use in the literature. The semantics of this\n                    <jats:sc>edsl<\/jats:sc>\n                    is defined in terms of the algebraic structures which define tensors in their full generality. This way, we believe that our\n                    <jats:sc>edsl<\/jats:sc>\n                    can be used both as a tool for scientific computing, but also as a vehicle to express and present the theory and applications of tensors.\n                  <\/jats:p>","DOI":"10.1017\/s0956796825000048","type":"journal-article","created":{"date-parts":[[2025,3,12]],"date-time":"2025-03-12T05:14:26Z","timestamp":1741756466000},"update-policy":"https:\/\/doi.org\/10.1017\/policypage","source":"Crossref","is-referenced-by-count":1,"title":["Domain-specific tensor languages"],"prefix":"10.1017","volume":"35","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-8469-5617","authenticated-orcid":false,"given":"JEAN-PHILIPPE","family":"BERNARDY","sequence":"first","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-3078-1437","authenticated-orcid":false,"given":"PATRIK","family":"JANSSON","sequence":"additional","affiliation":[],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"56","published-online":{"date-parts":[[2025,3,12]]},"reference":[{"key":"S0956796825000048_ref6","unstructured":"Blinn, J. (2002) Using tensor diagrams to represent and solve geometric problems. In Lecture Notes for a Tutorial Given at Siggraph 2002."},{"key":"S0956796825000048_ref29","unstructured":"Porat, B. (2014) A gentle introduction to tensors. Available from https:\/\/www.ese.wustl.edu\/nehorai\/Porat_A_Gentle_Introduction_to_Tensors_2014.pdfwww.ese.wustl.edu\/nehorai\/."},{"key":"S0956796825000048_ref27","unstructured":"Peeters, K. (2006) A field-theory motivated approach to symbolic computer algebra. arXiv preprint cs\/0608005."},{"key":"S0956796825000048_ref30","unstructured":"Rowland, T. & Weisstein, E. W. (2023) \u201ctensor.\u201d from mathworld\u2013a wolfram web resource. Available at: https:\/\/mathworld.wolfram.com\/Tensor.html."},{"key":"S0956796825000048_ref35","volume-title":"Modern Classical Physics: Optics, Fluids, Plasmas, Elasticity, Relativity, and Statistical Physics","author":"Thorne","year":"2015"},{"key":"S0956796825000048_ref9","doi-asserted-by":"publisher","DOI":"10.1145\/2254064.2254079"},{"key":"S0956796825000048_ref15","doi-asserted-by":"publisher","DOI":"10.1017\/CBO9781139031035"},{"key":"S0956796825000048_ref23","doi-asserted-by":"publisher","DOI":"10.1145\/3133901"},{"key":"S0956796825000048_ref25","volume-title":"Tensors, Differential Forms, and Variational Principles","author":"Lovelock","year":"1989"},{"key":"S0956796825000048_ref31","unstructured":"Scholz, S.-B. (1994) Single assignment c-functional programming using imperative style. In Proceedings of IFL."},{"key":"S0956796825000048_ref8","doi-asserted-by":"publisher","DOI":"10.1145\/1926354.1926358"},{"key":"S0956796825000048_ref17","doi-asserted-by":"publisher","DOI":"10.1007\/978-1-4614-7867-6"},{"key":"S0956796825000048_ref14","doi-asserted-by":"publisher","DOI":"10.1016\/0743-7315(90)90035-N"},{"key":"S0956796825000048_ref10","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-15975-4_29"},{"key":"S0956796825000048_ref16","volume-title":"MATLAB: An Introduction with Applications","author":"Gilat","year":"2004"},{"key":"S0956796825000048_ref3","volume-title":"Computer Science Logic","author":"Benton","year":"1995"},{"key":"S0956796825000048_ref13","doi-asserted-by":"publisher","DOI":"10.1145\/3236765"},{"key":"S0956796825000048_ref22","unstructured":"Kissinger, A. (2012) Pictures of Processes: Automated Graph Rewriting for Monoidal Categories and Applications to Quantum Computing. PhD Thesis. University of Oxford."},{"key":"S0956796825000048_ref24","doi-asserted-by":"crossref","unstructured":"Lippmeier, B. , Keller, G. , Chakravarty, M. M. T. , Leshchinskiy, R. & Peyton Jones, S. L. (2010) Regular, shape-polymorphic, parallel arrays in Haskell. In ICFP, pp. 261\u2013272.","DOI":"10.1145\/1863543.1863582"},{"key":"S0956796825000048_ref26","volume-title":"Functional and Logic Programming, 10th International Symposium, FLOPS","author":"Orchard","year":"2010"},{"key":"S0956796825000048_ref34","volume-title":"Functional Differential Geometry","author":"Sussman","year":"2013"},{"key":"S0956796825000048_ref19","doi-asserted-by":"publisher","DOI":"10.1145\/1460833.1460872"},{"key":"S0956796825000048_ref33","doi-asserted-by":"crossref","unstructured":"Selinger, P. (2011) A survey of graphical languages for monoidal categories. In New Structures for Physics, pp. 289\u2013355.","DOI":"10.1007\/978-3-642-12821-9_4"},{"key":"S0956796825000048_ref28","unstructured":"Penrose, R. (1971) Applications of negative dimensional tensors. In Combinatorial Mathematics and its Applications, vol. 1, pp. 221\u2013244."},{"key":"S0956796825000048_ref1","unstructured":"Abadi, M. , Barham, P. , Chen, J. , Chen, Z. , Davis, A. , Dean, J. , Devin, M. , Ghemawat, S. , Irving, G. , Isard, M. , Kudlur, M. , Levenberg, J. , Monga, R. , Moore, S. , Murray, D. G. , Steiner, B. , Tucker, P. , Vasudevan, V. , Warden, P. , Wicke, M. , Yu, Y. & Zheng, X. (2016) Tensorflow: A system for large-scale machine learning. In OSDI, pp. 265\u2013283."},{"key":"S0956796825000048_ref4","doi-asserted-by":"publisher","DOI":"10.1145\/3471874.3472980"},{"key":"S0956796825000048_ref18","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-31113-0_16"},{"key":"S0956796825000048_ref32","doi-asserted-by":"publisher","DOI":"10.1145\/2500365.2500602"},{"key":"S0956796825000048_ref7","volume-title":"Introduction to Vectors and Tensors. Volume 1: Linear and Multilinear Algebra","author":"Bowen","year":"1976"},{"key":"S0956796825000048_ref11","unstructured":"Dullemond, K. & Peeters, K. (2010) Introduction to tensor calculus. Lecture notes available online."},{"key":"S0956796825000048_ref12","doi-asserted-by":"publisher","DOI":"10.1145\/3110271"},{"key":"S0956796825000048_ref20","doi-asserted-by":"publisher","DOI":"10.1007\/978-0-8176-4715-5"},{"key":"S0956796825000048_ref5","volume-title":"Gauge Theory and Variational Principles","author":"Bleecker","year":"2005"},{"key":"S0956796825000048_ref21","doi-asserted-by":"publisher","DOI":"10.1016\/0001-8708(91)90003-P"},{"key":"S0956796825000048_ref2","volume-title":"Category Theory for Computing Science","author":"Barr","year":"1999"}],"container-title":["Journal of Functional Programming"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.cambridge.org\/core\/services\/aop-cambridge-core\/content\/view\/S0956796825000048","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,5,26]],"date-time":"2026-05-26T22:37:05Z","timestamp":1779835025000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.cambridge.org\/core\/product\/identifier\/S0956796825000048\/type\/journal_article"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025]]},"references-count":35,"alternative-id":["S0956796825000048"],"URL":"https:\/\/doi.org\/10.1017\/s0956796825000048","relation":{},"ISSN":["0956-7968","1469-7653"],"issn-type":[{"value":"0956-7968","type":"print"},{"value":"1469-7653","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025]]},"assertion":[{"value":"\u00a9 The Author(s), 2025. Published by Cambridge University Press","name":"copyright","label":"Copyright","group":{"name":"copyright_and_licensing","label":"Copyright and Licensing"}},{"value":"This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https:\/\/creativecommons.org\/licenses\/by\/4.0\/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.","name":"license","label":"License","group":{"name":"copyright_and_licensing","label":"Copyright and Licensing"}},{"value":"This content has been made available to all.","name":"free","label":"Free to read"}],"article-number":"e9"}}