Vis enkel innførsel

dc.contributor.authorSvartveit, Rudi Blaha
dc.date.accessioned2021-08-21T00:00:17Z
dc.date.available2021-08-21T00:00:17Z
dc.date.issued2021-08-03
dc.date.submitted2021-08-20T22:00:10Z
dc.identifier.urihttps://hdl.handle.net/11250/2770614
dc.description.abstractUser interfaces are difficult to get right, and implementing and maintaining them takes up a significant portion of development time. Ensuring that all dependencies between Graphical User Interface (GUI) widgets are maintained, such as the value of one being computed from another, can be challenging and prone to bugs with a standard callback-based approach. The dependency graph formed from relations and constraints between variables quickly becomes unwieldy for humans, especially with multi-directional dataflow and transitive dependencies. HotDrink is a library for declaratively modeling constraints between widgets as a constraint system. This model includes information about how to enforce the constraints, which the library can use to automatically enforce them when values are changed, a process called solving. The programmer can thus focus on individual constraints without being distracted by their effect on the rest of the system. Previous implementations of HotDrink have been written in TypeScript and Flow, but they sometimes suffer from poor performance in larger constraint systems. In this project, we have explored the design space of constraint-based GUI programming for web applications, with a focus on static typing and multithreading. We have developed the library hotdrink-rs, a version of HotDrink implemented in Rust. To improve the performance of the planning step of solving, we have used an optimization technique called pruning that can speed up planning by several orders of magnitude. This enables use of the library for modeling larger systems, and for more performance-sensitive tasks. Our implementation falls short in systems where this optimization is not effective, which suggests that experiments with further optimizations, e.g., incremental planning algorithms, should be done. The library also supports multithreaded execution of plans, which both speeds up solving and guarantees GUI responsiveness in the face of long-running computations. The GUI is thus also more resilient to programmer mistakes that cause long-running or non-terminating computations. We have also developed hotdrink-wasm, a library that wraps data structures from hotdrink-rs to allow the library to be compiled to WebAssembly. hotdrink-wasm supports the use of Web Worker-based threads for multithreaded constraint system solving with cancelable computations in web applications. Finally, we present more memory-efficient data structures for constraint systems by representing variable indices with individual bits. In addition to saving memory, it may also provide performance benefits by being more cache-friendly.
dc.language.isoeng
dc.publisherThe University of Bergen
dc.rightsCopyright the Author. All rights reserved
dc.subjectgui rust webassembly multiway dataflow constraint system multithreading
dc.titleMultithreaded Multiway Constraint Systems with Rust and WebAssembly
dc.typeMaster thesis
dc.date.updated2021-08-20T22:00:10Z
dc.rights.holderCopyright the Author. All rights reserved
dc.description.degreeMasteroppgave i Programutvikling samarbeid med HVL
dc.description.localcodePROG399
dc.description.localcodeMAMN-PROG
dc.subject.nus754199
fs.subjectcodePROG399
fs.unitcode12-12-0


Tilhørende fil(er)

Thumbnail

Denne innførselen finnes i følgende samling(er)

Vis enkel innførsel