• Nicky Ask Lund
4. term, Computer Science, Master (Master Programme)
As ReScript introduces a strongly typed language that targets JavaScript, as an alternative to gradually typed languages, such as TypeScript. While ReScript is built upon OCaml, it provides its own build system and integration with JavaScript, as such not much analysis has been introduced to ReScript. They do provide an experimental analysis tool to analyze areas, such as dead-code and termination.
As data-flow analysis has been used for decades in compiler optimization, as they provide information about the data-flow in programs. As many languages use locations, the data-flow analysis must consider aliasing to ensure safety.
In this paper, we present a type system for data-flow analysis for a subset of the ReScript language, more specific for a $\lambda$-calculus with mutability and pattern matching. We present the syntax and semantics of the language, where we extends the semantics with a semantic data-flow analysis. The type system is a local analysis that collects information about what variables are used and alias information. We show that how the binding models relate for the semantics and type system and shows that the type system gives a sound approximation of dependencies and alias information.
Publication date16 Jun 2023
Number of pages56
ID: 535093584