Frameworks and Static-Semantic Analysis Martin Fagereng Johansen, Birger Møller-Pedersen Department of Informatics University of Oslo Post box 1080 Blindern 0316 Oslo, Norway martifag@ifi.uio.no Abstract A domain may be represented either by a Domain Specific Language (DSL) or by a framework. While programs made in a DSL may be subject to static-semantic analysis and thereby ensured to be in accordance with the constraints of the domain, programs made on the basis of a corresponding framework cannot be analyzed with the same simplicity. Constraints of a domain are identified during domain analysis, and they are independent of whether a DSL or a framework is constructed. The reason that static-semantic analysis is harder for frameworks is that frameworks are implemented in general purpose implementation languages. The paper illustrates why Java is unsuited to support some static-semantic analysis for frameworks in Java, and it identifies which features a framework implementation language should have in order to support static-semantic analysis: An individual static constraint has an associated canonical form; therefore the implementation language must be able to implement this canonical form accurately, while the framework remains easy to use, in order to support static-semantic analysis. 1 Introduction Domain specific languages (DSLs) and frameworks are different in that DSLs commonly support static-semantic analysis, while frameworks commonly do not. This paper investigates why this is the case. Static semantic analysis is clearly of interest to both developers and users of a framework. Many frameworks have a large user base. For these users to be able to run a check on what they have written, potentially saves them time, and from the risk of encountering some faults at run-time. Static semantic analysis is not normally supported by frameworks today, even though static-semantic analysis can tell if certain properties of a program is wrong or dubious and give constructive feedback at compile-time. If it is important with static-semantic analysis for a general solution, an application that is used as a basis for other programs, then it is important to know if the technology This paper was presented at the NIK-2009 conference; see http://www.nik.no/.