{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2024,9,13]],"date-time":"2024-09-13T07:49:24Z","timestamp":1726213764152},"reference-count":44,"publisher":"Walter de Gruyter GmbH","issue":"1","license":[{"start":{"date-parts":[[2019,2,1]],"date-time":"2019-02-01T00:00:00Z","timestamp":1548979200000},"content-version":"unspecified","delay-in-days":0,"URL":"http:\/\/creativecommons.org\/licenses\/by\/4.0"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":[],"published-print":{"date-parts":[[2019,2,1]]},"abstract":"<jats:title>Abstract<\/jats:title><jats:p>Domain-specific languages (DSLs) permeate current programming practices. An important kind of DSLs includes those developed and integrated within a host language, which we call embedded or internal DSLs. Unfortunately, embedded DSLs usually fall short on domain-specific error diagnosis, that is, they do not give control to DSL authors over how errors are reported to the programmer. As a consequence, implementation details of the DSL leak through in error messages, and programmers need to understand the internals of the DSL implementation to fix their code in a productive way. This paper addresses the challenge of building a compiler with integrated support for domain-specific error diagnosis. We assume that the type system is described using a constraint-based approach, and constraint solving is specified using rewrite rules. Domain information can then be injected at constraint gathering time via type rules, during constraint solving via specialized rules and axioms, and finally at blaming and reparation time via transformations. Furthermore, we define error contexts as a way to control the order in which solving and blaming proceeds. We engineer domain-specific error diagnosis in such a way that the compiler can also reuse the techniques for improving general error diagnosis.<\/jats:p>","DOI":"10.1515\/comp-2019-0002","type":"journal-article","created":{"date-parts":[[2019,2,15]],"date-time":"2019-02-15T09:03:43Z","timestamp":1550221423000},"page":"33-51","source":"Crossref","is-referenced-by-count":4,"title":["A compiler architecture for domain-specific type error diagnosis"],"prefix":"10.1515","volume":"9","author":[{"given":"Alejandro","family":"Serrano","sequence":"first","affiliation":[{"name":"Utrecht University, Utrecht . The Netherlands"}]},{"given":"Jurriaan","family":"Hage","sequence":"additional","affiliation":[{"name":"Utrecht University, Utrecht . The Netherlands"}]}],"member":"374","published-online":{"date-parts":[[2019,2,14]]},"reference":[{"key":"2022042707443486326_j_comp-2019-0002_ref_001_w2aab3b7b1b1b6b1ab1ab1Aa","unstructured":"[1] Voelter M., DSL Engineering - Designing, Implementing and Using Domain-Specific Languages, 2013"},{"key":"2022042707443486326_j_comp-2019-0002_ref_002_w2aab3b7b1b1b6b1ab1ab2Aa","doi-asserted-by":"crossref","unstructured":"[2] Hudak P., Building domain-specific embedded languages, ACM Computing Surveys (CSUR) - Special issue: position statements on strategic directions in computing research, 1996, 28(4es), Article No. 19610.1145\/242224.242477","DOI":"10.1145\/242224.242477"},{"key":"2022042707443486326_j_comp-2019-0002_ref_003_w2aab3b7b1b1b6b1ab1ab3Aa","unstructured":"[3] Marlow S., Haskell 2010 Language Report, 2010, https:\/\/www. haskell.org\/onlinereport\/haskell2010\/"},{"key":"2022042707443486326_j_comp-2019-0002_ref_004_w2aab3b7b1b1b6b1ab1ab4Aa","unstructured":"[4] Hage J., Domain specific type error diagnosis (DOMSTED), Technical Report UU-CS-2014-019, Department of Information and Computing Sciences, Utrecht University, 2014"},{"key":"2022042707443486326_j_comp-2019-0002_ref_005_w2aab3b7b1b1b6b1ab1ab5Aa","doi-asserted-by":"crossref","unstructured":"[5] Damas L., Milner R., Principal type-schemes for functional programs, In: Proceedings of the 9th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL \u201982), ACM, 1982, 207-21210.1145\/582153.582176","DOI":"10.1145\/582153.582176"},{"key":"2022042707443486326_j_comp-2019-0002_ref_006_w2aab3b7b1b1b6b1ab1ab6Aa","doi-asserted-by":"crossref","unstructured":"[6] Lee O., Yi K., Proofs about a folklore let-polymorphic type inference algorithm, ACM Transactions on Programming Languages and Systems (TOPLAS), 1998, 20(4), 707-72310.1145\/291891.291892","DOI":"10.1145\/291891.291892"},{"key":"2022042707443486326_j_comp-2019-0002_ref_007_w2aab3b7b1b1b6b1ab1ab7Aa","doi-asserted-by":"crossref","unstructured":"[7] Vytiniotis D., Peyton Jones S., Schrijvers T., Sulzmann M., OutsideIn(X): Modular type inference with local Assumptions, Journal of Functional Programming, 2011, 21(4-5), 333-41210.1017\/S0956796811000098","DOI":"10.1017\/S0956796811000098"},{"key":"2022042707443486326_j_comp-2019-0002_ref_008_w2aab3b7b1b1b6b1ab1ab8Aa","unstructured":"[8] Swift Team, Type checker design and implementation, 2016"},{"key":"2022042707443486326_j_comp-2019-0002_ref_009_w2aab3b7b1b1b6b1ab1ab9Aa","unstructured":"[9] Elm Team, Source code for Elm type checker, file Type\/Solve.hs, 2018"},{"key":"2022042707443486326_j_comp-2019-0002_ref_010_w2aab3b7b1b1b6b1ab1ac10Aa","unstructured":"[10] Sulzmann M., Wazny J., Stuckey P. J., A Framework for Extended"},{"key":"2022042707443486326_j_comp-2019-0002_ref_011_w2aab3b7b1b1b6b1ab1ac11Aa","unstructured":"Algebraic Data Types, In: Hagiya M., Wadler P. (Eds.), Functional and Logic Programming, FLOPS 2006, Lecture Notes in Computer Science, vol 3945, Springer, Berlin, Heidelberg 2006, 47-64"},{"key":"2022042707443486326_j_comp-2019-0002_ref_012_w2aab3b7b1b1b6b1ab1ac12Aa","doi-asserted-by":"crossref","unstructured":"[11] Pottier F., R\u00e9my D., The essence of ML type inference, In: Pierce B. C. (Ed.), Advanced Topics in Types and Programming Languages, MIT Press, 2005, 10, 389-489","DOI":"10.7551\/mitpress\/1104.003.0016"},{"key":"2022042707443486326_j_comp-2019-0002_ref_013_w2aab3b7b1b1b6b1ab1ac13Aa","unstructured":"[12] McAdam B. J., On the unification of substitutions in type inference, In: Hammond K., Davie T., Clack C. (Eds.), Implementation of Functional Languages, Lecture Notes in Computer Science, 1999, 1595, 137-15210.1007\/3-540-48515-5_9"},{"key":"2022042707443486326_j_comp-2019-0002_ref_014_w2aab3b7b1b1b6b1ab1ac14Aa","doi-asserted-by":"crossref","unstructured":"[13] Heeren B., Hage J., Swierstra S. D., Scripting the type inference process, In: Proceedings of the Eighth ACM SIGPLAN International Conference on Functional Programming (ICFP \u201903), ACM, 2003, 3-1310.1145\/944705.944707","DOI":"10.1145\/944705.944707"},{"key":"2022042707443486326_j_comp-2019-0002_ref_015_w2aab3b7b1b1b6b1ab1ac15Aa","unstructured":"[14] Heeren B. J., Top Quality Type Error Messages. Ph.D. thesis, Universiteit Utrecht, The Netherlands, September 2005"},{"key":"2022042707443486326_j_comp-2019-0002_ref_016_w2aab3b7b1b1b6b1ab1ac16Aa","doi-asserted-by":"crossref","unstructured":"[15] Sulzmann M., Duck G. J., Peyton Jones S., Stuckey P. J., Understanding Functional Dependencies via Constraint Handling Rules, Journal of Functional Programming, 2007, 17(1), 83-12910.1017\/S0956796806006137","DOI":"10.1017\/S0956796806006137"},{"key":"2022042707443486326_j_comp-2019-0002_ref_017_w2aab3b7b1b1b6b1ab1ac17Aa","doi-asserted-by":"crossref","unstructured":"[16] Heeren B., Leijen D., van IJzendoorn A., Helium, for learning Haskell, In: Proceedings of the 2003 ACM SIGPLAN workshop on Haskell (Haskell \u201903), ACM, 2003, 62-7110.1145\/871895.871902","DOI":"10.1145\/871895.871902"},{"key":"2022042707443486326_j_comp-2019-0002_ref_018_w2aab3b7b1b1b6b1ab1ac18Aa","unstructured":"[17] Hage J., Heeren B., Heuristics for type error discovery and recovery, In: Horv\u00e1th Z., Zs\u00f3k V., Butterfield A. (Eds.), Implementation and Application of Functional Languages, IFL 2006, Lecture Notes in Computer Science, Springer, Berlin, Heidelberg, 2006, 4449, 199-21610.1007\/978-3-540-74130-5_12"},{"key":"2022042707443486326_j_comp-2019-0002_ref_019_w2aab3b7b1b1b6b1ab1ac19Aa","doi-asserted-by":"crossref","unstructured":"[18] Stuckey P. J., Sulzmann M., Wazny J., Type processing by constraint reasoning, In: Kobayashi N. (Ed.), Programming Languages and Systems, Lecture Notes in Computer Science, 2006, 4279, 1-2510.1007\/11924661_1","DOI":"10.1007\/11924661_1"},{"key":"2022042707443486326_j_comp-2019-0002_ref_020_w2aab3b7b1b1b6b1ab1ac20Aa","doi-asserted-by":"crossref","unstructured":"[19] Zhang D., Myers A. C., Toward general diagnosis of static errors, In: Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL \u201914), ACM, New York, NY, USA, 2014, 569-58110.1145\/2535838.2535870","DOI":"10.1145\/2535838.2535870"},{"key":"2022042707443486326_j_comp-2019-0002_ref_021_w2aab3b7b1b1b6b1ab1ac21Aa","doi-asserted-by":"crossref","unstructured":"[20] Pavlinovic Z., King T., Wies T., Practical SMT-based type error localization, In: Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming (ICFP 2015), ACM, 2015, 412-42310.1145\/2784731.2784765","DOI":"10.1145\/2784731.2784765"},{"key":"2022042707443486326_j_comp-2019-0002_ref_022_w2aab3b7b1b1b6b1ab1ac22Aa","doi-asserted-by":"crossref","unstructured":"[21] Loncaric C., Chandra S., Schlesinger C., Sridharan M., A practical framework for type inference error Explanation, In: Proceedings of the 2016 ACM SIGPLAN International Conference on Object- Oriented Programming, Systems, Languages, and Applications (OOPSLA 2016), 2016, 781-79910.1145\/2983990.2983994","DOI":"10.1145\/2983990.2983994"},{"key":"2022042707443486326_j_comp-2019-0002_ref_023_w2aab3b7b1b1b6b1ab1ac23Aa","unstructured":"[22] McAdam B., How to repair type errors automatically, In: Trends in Functional Programming, Intellect Books, Exeter, UK, 2002, 87-98"},{"key":"2022042707443486326_j_comp-2019-0002_ref_024_w2aab3b7b1b1b6b1ab1ac24Aa","unstructured":"[23] Diatchki I., Custom type errors, 2015, Available at https:\/\/ghc. haskell.org\/trac\/ghc\/wiki\/Proposal\/CustomTypeErrors"},{"key":"2022042707443486326_j_comp-2019-0002_ref_025_w2aab3b7b1b1b6b1ab1ac25Aa","unstructured":"[24] Scala Team, Docs for scala.annotation.implicitNotFound, 2015, Retrieved from https:\/\/www.scala-lang.org\/api\/2.12.7\/scala\/ annotation\/implicitNotFound.html"},{"key":"2022042707443486326_j_comp-2019-0002_ref_026_w2aab3b7b1b1b6b1ab1ac26Aa","doi-asserted-by":"crossref","unstructured":"[25] Stuckey P. J., Sulzmann M., A theory of overloading, In: Proceedings of the seventh ACM SIGPLAN international conference on Functional programming (ICFP \u201902), ACM, 2002, 167-17810.1145\/581478.581495","DOI":"10.1145\/581478.581495"},{"key":"2022042707443486326_j_comp-2019-0002_ref_027_w2aab3b7b1b1b6b1ab1ac27Aa","doi-asserted-by":"crossref","unstructured":"[26] Gundry A., A typechecker plugin for units of measure: domain-specific constraint solving in GHC Haskell, In: Proceedings of the 2015 ACM SIGPLAN Symposium on Haskell (Haskell 2015), ACM, 2015, 11-2210.1145\/2804302.2804305","DOI":"10.1145\/2804302.2804305"},{"key":"2022042707443486326_j_comp-2019-0002_ref_028_w2aab3b7b1b1b6b1ab1ac28Aa","unstructured":"[27] Wazny J., Type inference and type error diagnosis for Hindley\/Milner with extensions, Ph.D. thesis, University of Melbourne, Australia, 2006"},{"key":"2022042707443486326_j_comp-2019-0002_ref_029_w2aab3b7b1b1b6b1ab1ac29Aa","unstructured":"[28] Serrano A., Hage J., Context-dependent type error diagnosis for functional languages, Technical Report UU-CS-2016-011, Department of Information and Computing Sciences, Utrecht University, 2016"},{"key":"2022042707443486326_j_comp-2019-0002_ref_030_w2aab3b7b1b1b6b1ab1ac30Aa","unstructured":"[29] Serrano A., Hage J., Type error diagnosis for embedded DSLs by two-stage specialized type rules, In: Proceedings of the 25th European Symposium on Programming Languages and Systems (ESOP 2016), Springer-Verlag New York, 2016, 9632, 672-69810.1007\/978-3-662-49498-1_26"},{"key":"2022042707443486326_j_comp-2019-0002_ref_031_w2aab3b7b1b1b6b1ab1ac31Aa","unstructured":"[30] Serrano A., Hage J., From attribute grammars to constraint handling rules, Technical Report UU-CS- 2016-010, Department of Information and Computing Sciences, Utrecht University, 2016"},{"key":"2022042707443486326_j_comp-2019-0002_ref_032_w2aab3b7b1b1b6b1ab1ac32Aa","doi-asserted-by":"crossref","unstructured":"[31] Lorenzen F., Erdweg S., Sound type-dependent syntactic language extension, In: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2016), ACM, 2016, 204-21610.1145\/2837614.2837644","DOI":"10.1145\/2837614.2837644"},{"key":"2022042707443486326_j_comp-2019-0002_ref_033_w2aab3b7b1b1b6b1ab1ac33Aa","doi-asserted-by":"crossref","unstructured":"[32] Serrano A., Hage J., Lightweight Soundness for Towers of Language Extensions, In: Proceedings of the 2017 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation (PEPM 2017), ACM, 2017, 23-3410.1145\/3018882.3018884","DOI":"10.1145\/3018882.3018884"},{"key":"2022042707443486326_j_comp-2019-0002_ref_034_w2aab3b7b1b1b6b1ab1ac34Aa","unstructured":"[33] De Koninck L., Schrijvers T., Demoen B., A flexible search framework for CHR, In: Schrijvers T., Fr\u00fchwirth T. (Eds.), Constraint Handling Rules, Lecture Notes in Computer Science, Springer, Berlin, Heidelberg, 2008, 5388, 16-4710.1007\/978-3-540-92243-8_2"},{"key":"2022042707443486326_j_comp-2019-0002_ref_035_w2aab3b7b1b1b6b1ab1ac35Aa","doi-asserted-by":"crossref","unstructured":"[34] Pfenning F., Elliott C., Higher-order abstract syntax, In: Proceedings of the ACM SIGPLAN 1988 conference on Programming language design and implementation (PLDI \u201988), ACM, 1988, 199-20810.1145\/53990.54010","DOI":"10.1145\/53990.54010"},{"key":"2022042707443486326_j_comp-2019-0002_ref_036_w2aab3b7b1b1b6b1ab1ac36Aa","doi-asserted-by":"crossref","unstructured":"[35] Peyton Jones S., Vytiniotis D., Weirich S., Shields M., Practical type inference for arbitrary-rank types, Journal of Functional Programming, 2007, 17(1), 1-8210.1017\/S0956796806006034","DOI":"10.1017\/S0956796806006034"},{"key":"2022042707443486326_j_comp-2019-0002_ref_037_w2aab3b7b1b1b6b1ab1ac37Aa","doi-asserted-by":"crossref","unstructured":"[36] Serrano A., Hage J., Vytiniotis D., Peyton Jones S., Guarded impredicative polymorphism, In: Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2018), ACM, 2018, 783-79610.1145\/3192366.3192389","DOI":"10.1145\/3192366.3192389"},{"key":"2022042707443486326_j_comp-2019-0002_ref_038_w2aab3b7b1b1b6b1ab1ac38Aa","doi-asserted-by":"crossref","unstructured":"[37] Chakravarty M. M. T., Keller G., Peyton Jones S., Associated type synonyms, In: Proceedings of the tenth ACM SIGPLAN international conference on Functional programming (ICFP \u201905), ACM, 2005, 241-25310.1145\/1086365.1086397","DOI":"10.1145\/1086365.1086397"},{"key":"2022042707443486326_j_comp-2019-0002_ref_039_w2aab3b7b1b1b6b1ab1ac39Aa","doi-asserted-by":"crossref","unstructured":"[38] Hage J., Heeren B., Strategies for Solving Constraints in Type and Effect Systems, Electronic Notes in Theoretical Computer Science, 2009, 236, 163-18310.1016\/j.entcs.2009.03.021","DOI":"10.1016\/j.entcs.2009.03.021"},{"key":"2022042707443486326_j_comp-2019-0002_ref_040_w2aab3b7b1b1b6b1ab1ac40Aa","unstructured":"[39] Heeren B., Hage J., Type class directives, In: Hermenegildo M. V., Cabeza D. (Eds.), Practical Aspects of Declarative Languages, PADL 2005, Lecture Notes in Computer Science, Springer, Berlin, Heidelberg, 2005, 3350, 253-26710.1007\/978-3-540-30557-6_19"},{"key":"2022042707443486326_j_comp-2019-0002_ref_041_w2aab3b7b1b1b6b1ab1ac41Aa","doi-asserted-by":"crossref","unstructured":"[40] Morris J. G., Jones M. P., Instance chains: type class programming without overlapping instances, In: Proceeding of the 15th ACM SIGPLAN international conference on Functional programming (ICFP 2010), ACM, 2010, 45, 375-38610.1145\/1932681.1863596","DOI":"10.1145\/1932681.1863596"},{"key":"2022042707443486326_j_comp-2019-0002_ref_042_w2aab3b7b1b1b6b1ab1ac42Aa","doi-asserted-by":"crossref","unstructured":"[41] Kiselyov O., L\u00e4mmel R., Schupke K., Strongly typed heterogeneous collections, In: Proceedings of the 2004 ACM SIGPLAN workshop on Haskell (Haskell \u201904), ACM, 2004, 96-10710.1145\/1017472.1017488","DOI":"10.1145\/1017472.1017488"},{"key":"2022042707443486326_j_comp-2019-0002_ref_043_w2aab3b7b1b1b6b1ab1ac43Aa","unstructured":"[42] Christiansen D. R., Reflect on Your Mistakes! Lightweight Domain- Specific Error Messages, Presented at TFP 2014, 2014, http:\/\/ davidchristiansen.dk\/drafts\/error-reflection-submission.pdf"},{"key":"2022042707443486326_j_comp-2019-0002_ref_044_w2aab3b7b1b1b6b1ab1ac44Aa","unstructured":"[43] Plociniczak H., Miller H., Odersky M., Improving Human-Compiler Interaction Through Customizable Type Feedback, 2014, https: \/\/infoscience.epfl.ch\/record\/197948\/files\/splash2014.pdf"}],"container-title":["Open Computer Science"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.degruyter.com\/view\/journals\/comp\/9\/1\/article-p33.xml","content-type":"text\/html","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/www.degruyter.com\/document\/doi\/10.1515\/comp-2019-0002\/xml","content-type":"application\/xml","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/www.degruyter.com\/document\/doi\/10.1515\/comp-2019-0002\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2024,7,14]],"date-time":"2024-07-14T20:25:45Z","timestamp":1720988745000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.degruyter.com\/document\/doi\/10.1515\/comp-2019-0002\/html"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2019,2,1]]},"references-count":44,"journal-issue":{"issue":"1","published-online":{"date-parts":[[2019,9,26]]},"published-print":{"date-parts":[[2019,1,1]]}},"alternative-id":["10.1515\/comp-2019-0002"],"URL":"https:\/\/doi.org\/10.1515\/comp-2019-0002","relation":{},"ISSN":["2299-1093"],"issn-type":[{"value":"2299-1093","type":"electronic"}],"subject":[],"published":{"date-parts":[[2019,2,1]]}}}