Design and implementation of a data-oriented programming language solving complexities and runtime faults found in other languages
Fuente:
Zenodo
Enregistré dans:
| Auteur principal: | |
|---|---|
| Format: | Recurso digital |
| Langue: | anglais |
| Publié: |
Zenodo
2024
|
| Sujets: | |
| Accès en ligne: | |
| Tags: |
Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
|
| _version_ | 1866902121686761472 |
|---|---|
| author | Nordgren, Henrik |
| author_facet | Nordgren, Henrik |
| contents | <p>This thesis explores the design and implementation of Dash, a novel programming language based on data-oriented programming (DOP) principles, in order to prevent common software faults while preserving simplicity, reliability and performance. The DOP paradigm enforces immutability and generality for the sake of simplicity and reusability, while attempting to mitigate performance impacts. Moreover, DOP is considered a language agnostic paradigm with many implementations in other programming languages, creating an opportunity to explore how it could be implemented at the language level.</p> <p>The thesis examines software vulnerabilities listed in the Common Weakness Enumeration (CWE) database, in order to determine common software faults. By combining DOP principles with well-known safety mechanisms Dash implements language features like generic structural types, type predicates, explicit error handling and immutable data structures. The feasibility of DOP at the language level is demonstrated through a functioning compiler in Go using LLVM as the backend that implements the DOP principles as core language constructs. Moreover, the language's effectiveness is assessed by comparing it with Go and Rust in a number of areas, such as state management, type system capabilities, safety guarantees and code readability. </p> <p>The thesis finds that certain modifications of the original principles are required to successfully implement DOP at the language level. Most notably, the language implements generic structs with compile-time type checking to preserve flexibility and type safety, rather than using hash maps with string-based field references as prescribed by DOP. Additionally, because concrete types are required for compilation, the separation between data schema and data representation becomes more closely coupled at the language level. However, this is lessened by features like type predicates, optional types and union types. Furthermore, in order to handle program state transitions while preserving immutability, the language uses atomic compare-and-swap operations instead of the conventional stateful class approach outlined in DOP.</p> <p>This thesis reiterates how important careful language design is in preventing common software vulnerabilities. Dash's type system eliminates common issues like null pointer dereferences, type confusion and unhandled errors through compile-time checks and runtime guards. Integer overflow vulnerabilities are prevented through arbitrary precision number types, while string manipulation errors are mitigated by maintaining explicit length information rather than relying on null termination. Memory safety is enhanced through immutable data structures, reference counting and runtime checks, preventing faults such as use-after-free, expired pointer dereference and buffer overflow vulnerabilities.</p> <p>The evaluation shows that Dash's immutable state management and explicit error handling provide stronger safety guarantees than Go while being simpler than Rust's ownership system. While Dash's approach results in slightly more verbose code compared to Go and Rust, its type system combines Go's simplicity with additional safety features like type predicates and null safety, making it suitable for implementing simple and robust software systems.</p> <p>Further research is needed to thoroughly validate the language's design decisions and safety guarantees in the real world that go beyond the arithmetic evaluator. Dash's performance characteristics, especially in relation to memory management overhead and the efficiency of its error handling system in preventing runtime crashes, require more investigation in order to be empirically compared with other similar languages. Moreover, unimplemented parts of the language specification and areas such as memory management, concurrency, performance optimisations and developer tooling need to be implemented to make Dash production ready. </p> |
| format | Recurso digital |
| id | zenodo_https___doi_org_10_5281_zenodo_14246915 |
| institution | Zenodo |
| language | eng |
| publishDate | 2024 |
| publisher | Zenodo |
| record_format | zenodo |
| spellingShingle | Design and implementation of a data-oriented programming language solving complexities and runtime faults found in other languages Nordgren, Henrik LLVM programming language data-oriented programming compiler <p>This thesis explores the design and implementation of Dash, a novel programming language based on data-oriented programming (DOP) principles, in order to prevent common software faults while preserving simplicity, reliability and performance. The DOP paradigm enforces immutability and generality for the sake of simplicity and reusability, while attempting to mitigate performance impacts. Moreover, DOP is considered a language agnostic paradigm with many implementations in other programming languages, creating an opportunity to explore how it could be implemented at the language level.</p> <p>The thesis examines software vulnerabilities listed in the Common Weakness Enumeration (CWE) database, in order to determine common software faults. By combining DOP principles with well-known safety mechanisms Dash implements language features like generic structural types, type predicates, explicit error handling and immutable data structures. The feasibility of DOP at the language level is demonstrated through a functioning compiler in Go using LLVM as the backend that implements the DOP principles as core language constructs. Moreover, the language's effectiveness is assessed by comparing it with Go and Rust in a number of areas, such as state management, type system capabilities, safety guarantees and code readability. </p> <p>The thesis finds that certain modifications of the original principles are required to successfully implement DOP at the language level. Most notably, the language implements generic structs with compile-time type checking to preserve flexibility and type safety, rather than using hash maps with string-based field references as prescribed by DOP. Additionally, because concrete types are required for compilation, the separation between data schema and data representation becomes more closely coupled at the language level. However, this is lessened by features like type predicates, optional types and union types. Furthermore, in order to handle program state transitions while preserving immutability, the language uses atomic compare-and-swap operations instead of the conventional stateful class approach outlined in DOP.</p> <p>This thesis reiterates how important careful language design is in preventing common software vulnerabilities. Dash's type system eliminates common issues like null pointer dereferences, type confusion and unhandled errors through compile-time checks and runtime guards. Integer overflow vulnerabilities are prevented through arbitrary precision number types, while string manipulation errors are mitigated by maintaining explicit length information rather than relying on null termination. Memory safety is enhanced through immutable data structures, reference counting and runtime checks, preventing faults such as use-after-free, expired pointer dereference and buffer overflow vulnerabilities.</p> <p>The evaluation shows that Dash's immutable state management and explicit error handling provide stronger safety guarantees than Go while being simpler than Rust's ownership system. While Dash's approach results in slightly more verbose code compared to Go and Rust, its type system combines Go's simplicity with additional safety features like type predicates and null safety, making it suitable for implementing simple and robust software systems.</p> <p>Further research is needed to thoroughly validate the language's design decisions and safety guarantees in the real world that go beyond the arithmetic evaluator. Dash's performance characteristics, especially in relation to memory management overhead and the efficiency of its error handling system in preventing runtime crashes, require more investigation in order to be empirically compared with other similar languages. Moreover, unimplemented parts of the language specification and areas such as memory management, concurrency, performance optimisations and developer tooling need to be implemented to make Dash production ready. </p> |
| title | Design and implementation of a data-oriented programming language solving complexities and runtime faults found in other languages |
| topic | LLVM programming language data-oriented programming compiler |
| url | https://doi.org/10.5281/zenodo.14246915 |