Provisional Title

  • Visualising Ownership and Borrowing in Rust Programming.

Problem Definition

The problem revolves around the intricacies of learning Rust, a programming language used widely due to its memory safety features, achieved without relying on a garbage collector. Rust’s unique resource ownership and borrowing system, while powerful, can be a significant challenge for both novice and experienced programmers. Understanding this system is crucial for writing robust and efficient code in Rust.

The primary issue is the complexity of Rust’s ownership and borrowing system, which often needs mental tracking of events and state changes. This can negatively impact the learning process and slow down the development.

To address this problem, I aim to introduce a visualisation tool. The tool will be designed to visually depict ownership and borrowing events within Rust code. By integrating these visualisations, I aim to make the static events and their impact more obvious and tangible for learners. Therefore, the objective is to enhance the learning experience for developers, by providing them with a resource that accelerates their understanding of this powerful programming language.


Aims and Objectives

The aim of the project is to enhance the learning experience for individuals seeking to understand the Rust programming language by addressing the complexities of its ownership and borrowing system. This will be achieved through the introduction of a visualisation tool designed to make ownership and borrowing events in Rust code more comprehensible and accessible.

The objectives are:

  1. Conduct Comprehensive Background Research:
    • Review existing literature, educational materials and resources related to Rust programming.
    • Analyse common challenges faced by learners in understanding Rust’s ownership and borrowing system.
    • Examine existing visualisation tools and techniques used in programming education to identify best practices and state-of-art technology.
  2. Project Planning and Deliverables:
    • Define the project scope, timeline and deliverables, including milestones and deadlines.
    • Identify potential risks and develop a mitigation plan to address unforeseen challenges that may arise during the project.
  3. Design the Visualisation Tool:
    • Determine the appropriate visualisation techniques and representations to illustrate ownership and borrowing events effectively.
    • Create a user-friendly interface that allows learners to interact with the tool easily.
  4. Develop and Test the Visualisation Tool:
    • Implement the designed tool, ensuring it accurately visualises Rust’s ownership and borrowing system.
    • Refine tool based on user feedback and iterate as necessary.
  5. Evaluate Learning Outcomes:
    • Evaluate the impact of the visualisation tool on learners’ understanding of Rust’s ownership and borrowing.
    • Compare the learning outcomes of those who used the tool with a control group that did not have access to the tool.
  6. Documentation:
    • Document the design, development and testing process, creating comprehensive user guides and documentation for the tool.

Background Sources

Problem Justification:

Proposed Solution:

  • RustViz: RustViz is a central source, as it directly pertains to the proposed solution. The paper provides detailed insights into how visualisation can aid in understanding Rust’s ownership system.
  • A Beginner’s Guide to Parsing in Rust: This source highlights the importance of parsing in Rust. The success of my project depends on understanding and effectively representing Rust code structures, which parsing is fundamental to.
  • Tree-sitter - Creating Parsers: Tree-sitter is a library for code parsing, it will be important to understand how it can be leveraged into my tool.
  • CUPV - A Visualisation Tool for Generated Parsers: This source provides insights into a similar tool, demonstrating the efficacy of visualisation tools in the context of parsers.

Relevant Approaches and Techniques:

Requirements:

  • Rust - Lexing and Parsing: Understanding the lexing and parsing processes in Rust is essential. This source can help to define the requirements related to that aspect.
  • Types of Parsers in Compiler Design: Different types of parsers are used in compiler design, and understanding these can help define the parser component of the tool.
  • What are the Borrowing Rules in Rust?: Understanding Rust’s borrowing rules is critical for the tool’s accuracy. This source can help to derive requirements related to highlighting ownership and borrowing events accurately.

Approach

Justification of Approach

Considering a project timeline of October to January (estimates):

  • Deliverables:

    1. Project Scope and Plan Document (by the end of October):
      • Detailed project plan outlining the objectives, tasks and timeline (spreadsheet for example).
      • Initial risk assessment and mitigation plan.
      • An initial hello world prototype as a proof of concept, demonstrating the borrowing mechanism in Rust.
    2. Background Research (by the end of November):
      • Comprehensive review of existing literature, educational materials, and resources related to Rust programming.
      • Analysis of common challenges faced by learners in understanding Rust’s ownership and borrowing system.
      • Identify best practices in visualisation tools and techniques in programming education.
    3. Design Specification (by mid-December):
      • Design document specifying the scope and features.
      • Selection of appropriate visualisation techniques and representations.
    4. Tool Prototype (by the end of December):
      • Development of an initial prototype of the visualisation tool based on the design specifications.
    5. Usability Testing and User Feedback (by mid-January):
      • Testing of the tool (unit tests etc).
      • Document and analyse user feedback for improvement.
    6. Final Tool (by the end of January):
      • Refinement of the tool based on feedback.
      • Development of the final version ready for public release.
    7. Documentation and Knowledge Dissemination (end of January):
      • User guides and documentation for the tool.
      • Preparation for submission of research findings.
  • Milestones:

    1. Project Initiation:
      • Define objectives and scope.
      • Identify potential risks and mitigation strategies.
    2. Background Research:
      • Complete thorough background research report.
    3. Design Specification:
      • helloworld application.
      • Complete design specification.
    4. Prototype Development:
      • Develop a working prototype of the tool.
    5. Testing and Feedback:
      • Conduct testing and gather feedback.
      • Analyse both for refinements.
    6. Final Tool Development:
      • Refine tool based on feedback and finish development.
    7. Documentation and Knowledge Dissemination:
      • Create user guides and documentation.
      • Prepare and submit findings.
  • Risk Mitigation:

    1. Scope Creep (uncontrolled expansion):
      • Clearly define the project score and objectives from the get-go.
      • Assess and approve any scope changes to better manage it.
    2. Technical Challenges:
      • Maintain ongoing communication with my supervisor to address technical challenges effectively.
      • Consider involving experts to resolve complex technical issues.
    3. Time Constraint:
      • Have a clear schedule and effective project planning to ensure a timely completion.

Evaluation

  • Aim: To enhance the learning experience of Rust programming, particularly in understanding Rust’s ownership and borrowing system.

  • Evaluation: Success here will be determined by assessing whether the visualisation tool has indeed improved the learning experience for students. This evaluation will involve conducting usability testing and comparing the performance of learners who used the tool against a group that did not. It will involve various aspects, including:

    1. Usability Testing: Testing with the target audience, which includes novice and experienced Rust developers.
    2. Unit Testing of Parser: Rigorous unit testing of the parser component of the tool to ensure it accurately parsers Rust code. This testing will involve running various test cases, including valid and invalid Rust code snippets, to verify the parser’s correctness.
    3. Functional Testing: Evaluate the functionality of the tool by testing its ability to accurately depict ownership and borrowing events within Rust code.
    4. Comparative Analysis: Compare the performance of two groups:
      • Group A (Tool Users): Participants using the tool during their learning process.
      • Group B (Control Group): Participants who did not have access to the tool and learned Rust through traditional methods.
    5. Quantitative Metrics: Collect data on interactions with the tool, including number of sessions, frequency and duration of tool usage, and specific tool features utilised.
    6. Qualitative Feedback: Feedback from users through surveys and interviews.