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:
- 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.
- 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.
- 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.
- 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.
- 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.
- Documentation:
- Document the design, development and testing process, creating comprehensive user guides and documentation for the tool.
Background Sources
Problem Justification:
- Rust’s language ergonomics initiative: A blog post from the official Rust website which highlights the significance of language ergonomics. It expands on how Rust’s ownership system, while powerful, can present a challenge for programmers, justifying the need for improvements in its usability and learnability.
- Rust - References and Borrowing: The official documentation for understanding the core problem. It provides insights into Rust’s ownership and borrowing, emphasising its importance and complexities.
- Stack Overflow Annual Developer Survey: This source can provide statistical evidence of the challenges programmers face while learning Rust.
- The Usability of Ownership: Paper by W. Crichton that discusses the usability of Rust’s ownership system. It’s relevant to understanding the challenges associated with Rust’s ownership model.
- Understanding and Evolving the Rust Programming Language:
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:
- Syn - Parser for Rust source code: Syn is a library for parsing Rust code. Understanding how it works can be beneficial to learn how to parse Rust code for visualisation.
- Crafting Interpreters: This resource can provide insights into parsing techniques and how they can be applied to the development of the visualisation tool.
- An alias-based formulation of the borrow checker: Online source that discusses an alias-based formulation of the borrow checker in Rust.
- Borrowing - Rust By Example: Online resource from the official Rust documentation that explains borrowing in Rust.
- Identifying Gaps in the Secure Programming Knowledge and Skills of Students: A paper that discusses gaps in secure programming knowledge and skills of students.
- Learning and programming challenges of Rust: A Mixed-Method Study: A study on the learning and programming challenges in Rust.
- References and Borrowing - The Rust Programming Language: An online resource from the official Rust book that explains references and borrowing.
- RustEdu Workshop 2022 - RustViz: A video resource about RustViz and visualising ownership and borrowing.
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:
- 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.
- 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.
- Design Specification (by mid-December):
- Design document specifying the scope and features.
- Selection of appropriate visualisation techniques and representations.
- Tool Prototype (by the end of December):
- Development of an initial prototype of the visualisation tool based on the design specifications.
- Usability Testing and User Feedback (by mid-January):
- Testing of the tool (unit tests etc).
- Document and analyse user feedback for improvement.
- Final Tool (by the end of January):
- Refinement of the tool based on feedback.
- Development of the final version ready for public release.
- Documentation and Knowledge Dissemination (end of January):
- User guides and documentation for the tool.
- Preparation for submission of research findings.
- Project Scope and Plan Document (by the end of October):
-
Milestones:
- Project Initiation:
- Define objectives and scope.
- Identify potential risks and mitigation strategies.
- Background Research:
- Complete thorough background research report.
- Design Specification:
helloworld
application.- Complete design specification.
- Prototype Development:
- Develop a working prototype of the tool.
- Testing and Feedback:
- Conduct testing and gather feedback.
- Analyse both for refinements.
- Final Tool Development:
- Refine tool based on feedback and finish development.
- Documentation and Knowledge Dissemination:
- Create user guides and documentation.
- Prepare and submit findings.
- Project Initiation:
-
Risk Mitigation:
- 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.
- Technical Challenges:
- Maintain ongoing communication with my supervisor to address technical challenges effectively.
- Consider involving experts to resolve complex technical issues.
- Time Constraint:
- Have a clear schedule and effective project planning to ensure a timely completion.
- Scope Creep (uncontrolled expansion):
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:
- Usability Testing: Testing with the target audience, which includes novice and experienced Rust developers.
- 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.
- Functional Testing: Evaluate the functionality of the tool by testing its ability to accurately depict ownership and borrowing events within Rust code.
- 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.
- Quantitative Metrics: Collect data on interactions with the tool, including number of sessions, frequency and duration of tool usage, and specific tool features utilised.
- Qualitative Feedback: Feedback from users through surveys and interviews.