lunduniversity.lu.se

Computer Science

Faculty of Engineering, LTH

Denna sida på svenska This page in English

Compiler projects fall 2023

EDAN70: Project in Computer Science

Metavis: Visual debugger for MetaDL
Emil Blennow
Abstract:
This paper introduces a tool for visualizing static bug reports generated by MetaDL. By utilizing a terminal UI the analysis results from MetaDL become easier to understand, debug and make use of. Taking inspiration from other terminal based UI the tool aims to be easy to learn and quickly usable.
(paper) (code)

JVM Bytecode Backend for SimpliC
Lukas Tröjer and Suleyman Zahi
Abstract:
In this paper we introduce a Java Virtual Machine (JVM) backend for SimpliC, a small language similar to C. A program written in SimpliC can thus be compiled to Java bytecode and run on the JVM. This allows for the use of many features that are often desirable, like platform independence and runtime optimizations. We then evaluate the performance of our generated bytecode using various benchmarks. Our results show that, compared to the bytecode generated by javac, our generated bytecode has virtually identical steady-state performance and only slightly worse start-up performance. Furthermore, the performance only becomes better with newer versions of Java. Our generated bytecode has not been able to be on par with optimized x86 assembly compiled from C, but can easily beat unoptimized x86 assembly on longer-running tasks.
(paper)

Finding and Resolving Common Code Style Errors in Java
Mark Lundager and Andreas Bergqvist
Abstract:
Verbose code with highly specialized if-statements containing return-statements for the different cases of the conditions is harder to maintain when compared to a single return-statement containing the condition. It is commonly referred to as a code style error. In this report we present a tool which can be used as an extension in your IDE, and performs on-demand analysis of your code to discover, and repairs to your style violations. All while using the same variables, constants and general structure of your original code. There is no change in functionality of the written code. It is also able to preserve the comments you may have in your original code. With this tool we hope to help people who are prone to these style errors to kick that habit.
(paper) (code)

Robot Comment Fixed Detector
Patrik Fjellstedt and Joakim Svensson
Abstract:
Today there exists a lot of tools to analyze existing code to generate useful feedback for the programmer. When these tools are used with code review tools, such as Gerrit, this feedback is also known as robot comments. Generating feedback upon code review is a useful workflow to prevent bugs and improve code quality before accepting changes into a project’s main branch. A problem that arises with the use of such tools though is the amount of generated comments and their accuracy for them to be useful. This points to a need for a pre-processing step where some comments could be filtered out before presenting them to the user. We focused our attention on one such tool, ErrorProne, which is a static analysis tool for Java that helps to identify errors during compilation. Using this tool we tried to detect whether a robot comment was fixed between its head version and the revised version.
(paper)

Garbage collection: Reference-Sweep
Hannes Brinklert and Christoffer Fjällborg Rinaldo
Abstract:
The stack and the heap are two different parts of the memory which a programming language usually requests memory from. Both of them are used for reading and writing data, but they are used for different purposes. The goal of this paper is to describe the work of extending a compiler built at a university course that only supports stack allocation, to support arrays with heap allocation. A further goal is to implement a garbage collection algorithm Reference-Sweep, which is a combination of mark-and-sweep and reference counting, and evaluate its performance. It was a successful implementation of heap-allocated arrays with manual memory allocation and the garbage collection algorithm Reference-Sweep. The evaluation shows that when garbage collection is enabled in the SimpliC compiler it is slower than the same program with manual memory allocation. SimpliC with garbage collection’s performance was worse than a similar Go program and as expected the same was true when compared against a similar program written in C. The paper creates a framework for future implementation of other garbage collection algorithms and the implemented Reference-Sweep algorithm can be evaluated against other garbage collection algorithms.
(paper)

JastAdd Bridge: Interfacing reference attribute grammars with editor tooling
Johannes Hardt and Dag Hemberg
Abstract:
Nowadays, programmers expect rich editor support when writing code, such as type hints, code completions, and warnings. While this is present in mainstream languages and editors, lacking such tooling can be a pain point when developing your own language. Our paper proposes an extension for the VS Code editor, JastAdd Bridge, that acts as a translation layer between languages developed with the JastAdd framework and the language server protocol (LSP). We find that it facilitates rapid integration with editor tooling while preserving flexibility in the way language authors choose to interact with the programming environment.
(paper) (code)