Return to search

ElmSr: A Structure Editor for Elm

Structure editors have been available for many decades, and for multiple programming languages. Historically, they have been recommended for teaching new programmers. Currently, they are recommended by advocates of Model Driven Development. However, they are not widely used, except for the special case of graphical structure editors commonly referred to as "block-based editors" such as Scratch. Although structure editors were first introduced for procedural languages, and they could be used for any type of language, current structure editors target object-oriented languages, almost exclusively, and build in many assumptions related to object orientation. The notable exception, Hazel, targets a functional language, exploits the strong typing typical of functional languages and emphasizes the use of typed holes. This thesis introduces ElmSr, a structure editor developed for teaching the Elm programming language to novice programmers. As with most structure editors, ElmSr allows the developer to directly edit the Abstract Syntax Tree, without the intermediary of a compiler. As with Hazel, ElmSr's AST is typed, and transformations preserve types. Also typical of tree editors written in functional languages, ElmSr uses a zipper data structure to encode both the tree and a cursor position, making for efficient tree edits. Like other structure editors, ElmSr is designed to make common tasks simple and efficient. In our case, common tasks match the steps students are taught in the "Algebraic Thinking" curriculum developed at McMaster University. Some steps are common to almost all programming, such as arithmetic expression entry and modification (which has been previously identified as a weak point for structure editors). Other steps, like definition integration, and support for function calls and control structures are specific to our curriculum. This aspect of usability was evaluated by comparing the number of keystrokes necessary for a benchmark task, using ElmSr, using VS Code following our structured development approach, and using VS Code solely for text entry. ElmSr was much more efficient than VS Code for structured editing, and still more efficient than linear code entry. / Thesis / Master of Science (MSc)

Identiferoai:union.ndltd.org:mcmaster.ca/oai:macsphere.mcmaster.ca:11375/29828
Date January 2024
CreatorsOsmani, Narges
ContributorsAnand, Christopher, Computing and Software
Source SetsMcMaster University
LanguageEnglish
Detected LanguageEnglish
TypeThesis

Page generated in 0.0017 seconds