18 research outputs found
Strategic Language Workbench Improvements
Computers execute software to do the tasks we expect from them. This software is written by human beings, we call this programming. The most common way to program is by writing text in a programming language. A programming language is very structured so we can be precise, but ultimately these languages are still for humans to read and write. In order to execute the written program, we need to translate it to a list of tiny instruction steps that the hardware of the computer can execute. This translation is also automated with software. The most common forms this software takes is (1) interpreters that execute a program live as they read it, or (2) compilers that translate the entire program for later execution.Interpreters and compilers are tools of the domain of Programming Languages (PL). Apart from interpreters and compilers, there is more support software available around programming languages. This includes smart text editors, program analysis, running-program observers, etc. The requirements for PL tools are high: they should not get in the way when used to create software. In particular, they should support useful features, be fast enough in interaction, and not make mistakes.Given these requirements, it is not a simple task to make PL tools. In an effort to make it easier to create PL tools, Language Workbenches (LWBs) were created: a suite of tools specifically for creating PL tools.In this dissertation, you can find several improvements I made to a particular language workbench. I have—in multiple ways—sped up the language development cycle in this workbench: in terms of improved development, feedback, and execution speed.Throughout my research, I have worked on and in the Spoofax language workbench, a research language workbench used for programming language research at TU Delft. Spoofax splits up the specification of programming languages into different domains, and captures each of those domains in a meta-language. For example, to describe the structure of the text of a programming language, Spoofax uses a formalism based on context-free grammars, extended with different useful features, which is called the Syntax Definition Formalism 3 or SDF3 for short. Similarly, there are meta-languages for the description of names, references and types; for what it means to execute a program; for defining assumptions and behaviour by example for testing purposes; and for transforming programs, which is a catch-all, but still a fairly high-level language. This language for transforming programs, called Stratego, is particularly relevant to this dissertation.Contributions. Firstly, we introduce a new meta-language specialised in control- and data-flow analysis: FlowSpec. FlowSpec improves the development speed of programming languages in Spoofax, and the feedback in Spoofax and in the PL tools generated by Spoofax.Secondly, we improve the compilation speed of Stratego on successive compilations with an incremental compiler. This compiler improves the speed at which you receive feedback inside Spoofax on changes to a Stratego program, and the speed at which you can see the results of tests and other short program executions after a change.Thirdly, we add a gradual type system to Stratego to improve the feedback that can be given without executing Stratego programs. A gradual type system does not require a user of Stratego to add types to their program, but if they choose to, the gradual type system will be able to reason about the parts of the program that are typed, and give certain errors at compilation time instead of run time.Finally, we develop a pattern matching optimisation that work for Stratego’s pattern matching. This improves the execution speed of Stratego programs. Since all PL tools created in Spoofax include at least some of those Stratego programs, this also speeds up the execution of the Spoofax meta-languages themselves.Prof.dr. E. Visser (Delft University of Technology) was the original promotor and supervisor of this research until his untimely passing on April 5th, 2022.Programming Language
The Static Semantics of the Green-Marl Graph Analysis Language: Formal Specification, Declarative Implementation and Integration with a Compiler Back-end
Green-Marl is a domain specific language for efficient graph analysis. In this thesis, we define the formal static semantics of the language and provide an implementation in the Spoofax language workbench. The type system of Green-Marl includes limited forms of name-dependent types, overloading, parametric polymorphism, and inference. We give a formal specification that covers all aspects of this type system. We also describe our implementation of the type system in the Spoofax language workbench, where we focus on the capabilities of Spoofax's meta-languages to describe the type system. Green-Marl provides several parallel language constructs, as well as constructs to mitigate data races that can occur in parallel regions. We give a formal description of a symbolic, tree-based dependence analysis that can check the invariants of the mitigation strategies and find potential data races. We employ a rewrite system for the implementation of this analysis in the Spoofax language workbench. Finally, we discuss the integration of these analyses with successive program transformation steps. Each transformation step is informed by the static analysis. However, transformation steps invalidate parts of the analysis results, which inhibits the successive steps. A naive approach to re-analyse the program after every transformation step does not scale. Therefore, we incrementally update analysis results after each transformation step.Software Engineering Research GroupSoftware TechnologyElectrical Engineering, Mathematics and Computer Scienc
Gradually typing strategies
The Stratego language supports program transformation by means of term rewriting with programmable rewriting strategies. Stratego's traversal primitives support concise definition of generic tree traversals. Stratego is a dynamically typed language because its features cannot be captured fully by a static type system. While dynamic typing makes for a flexible programming model, it also leads to unintended type errors, code that is harder to maintain, and missed opportunities for optimization. In this paper, we introduce a gradual type system for Stratego that combines the flexibility of dynamically typed generic programming, where needed, with the safety of statically declared and enforced types, where possible. To make sure that statically typed code cannot go wrong, all access to statically typed code from dynamically typed code is protected by dynamic type checks (casts). The type system is backwards compatible such that types can be introduced incrementally to existing Stratego programs. We formally define a type system for Core Gradual Stratego, discuss its implementation in a new type checker for Stratego, and present an evaluation of its impact on Stratego programs.Programming Language
Spoorbruggen bij Culemborg: Vermoeiingsonderzoek aan twee geklonken stuiken uit een diagonaal vervaardigd uit welijzer
Civil Engineering and GeosciencesStructural Engineerin
Spoorbruggen bij Culemborg: Vermoeiingsonderzoek aan knooppunten vervaardigd uit welijzer
Civil Engineering and GeosciencesStructural Engineerin
Optimising First-Class Pattern Matching
Pattern matching is a high-level notation for programs to analyse the shape of data, and can be optimised to efficient low-level instructions. The Stratego language uses first-class pattern matching, a powerful form of pattern matching that traditional optimisation techniques do not apply to directly.In this paper, we investigate how to optimise programs that use first-class pattern matching. Concretely, we show how to map first-class pattern matching to a form close to traditional pattern matching, on which standard optimisations can be applied.Through benchmarks, we demonstrate the positive effect of these optimisations on the run-time performance of Stratego programs. We conclude that the expressive power of first-class pattern matching does not hamper the optimisation potential of a language that features it.Programming Language
FlowSpec: A declarative specification language for intra-procedural flow-Sensitive data-flow analysis
Data-flow analysis is the static analysis of programs to estimate their approximate run-time behavior or approximate intermediate run-time values. It is an integral part of modern language specifications and compilers. In the specification of static semantics of programming languages, the concept of data-flow allows the description of well-formedness such as definite assignment of a local variable before its first use. In the implementation of compiler back-ends, data-flow analyses inform optimizations. Data-flow analysis has an established theoretical foundation. What lags behind is implementations of data-flow analysis in compilers, which are usually ad-hoc. This makes such implementations difficult to extend and maintain. In previous work researchers have proposed higher-level formalisms suitable for whole-program analysis in a separate tool, incremental analysis within editors, or bound to a specific intermediate representation. In this paper, we present FlowSpec, an executable formalism for specification of data-flow analysis. FlowSpec is a domain-specific language that enables direct and concise specification of data-flow analysis for programming languages, designed to express flow-sensitive, intra-procedural analyses. We define the formal semantics of FlowSpec in terms of monotone frameworks. We describe the design of FlowSpec using examples of standard analyses. We also include a description of our implementation of FlowSpec. In a case study we evaluate FlowSpec with the static analyses for Green-Marl, a domain-specific programming language for graph analytics.Programming Language
Examining student profiles for dealing with wickedness
When addressing problems with wicked tendencies in higher professional education, students experience complexity, uncertainty, and value divergence. Furthermore, they are confronted with disciplinary, organisational, and sector boundaries. Prior research has revealed variability in students’ experiences and boundary-crossing behaviour when dealing with problems with wicked tendencies. In this study we explore these differences by identifying student profiles based on the attributes that comprise the competence for dealing with problems with wicked tendencies, and by identifying their relations with students’ boundary-crossing behaviour and relevant work experience. Person-centred cluster analysis in a sample of first-year students (N = 264) from a bachelor’s programme in social work identified four student profiles, based on students’ self-assessed degree of creativity, critical thinking, initiative, proactivity, risk tolerance, and work efficacy. Meaningful relations with students’ prior work experiences and their boundary-crossing behaviour were found. These profiles could serve to better understand students’ boundary-crossing behaviour when confronted with problems with wicked tendencies, and help teachers foster the development of all students.Science Education and Communicatio
WebLab project
WebLab is an online academic tool used to improve education by providing a framework for teachers to supply a higher quantity and quality of assignments to students. Currently this system is being used in a variety of courses including the Concepts of Programming Languages course taught to bachelor students at the Delft University of Technology. As a tool is used more and more functionality must be added in order to meet the ever increasing demands. The goal of this project is just that, expand on the current system to provide support for a new set of features. Specifically two new courses want to start using WebLab. MySQL support is added to support the database part of the Web & Database Technology course so students can execute queries and test their code against the correct queries without seeing those queries. Java support is added to provide extra practice material for the Object-oriented Programming in Java course; students who are new to programming have a chance to practice with the material at their own pace without having to install a myriad of software packages. Aside from these main features other features including group support and random assignment collections are also included in this project. Finally, as with any other software engineering project we include our requirements analysis, system analysis, project process, and take an in depth look at the testing of such a diverse and complex system.Software Engineering Research GroupSoftware Computer TechnologyElectrical Engineering, Mathematics and Computer Scienc