Comparing Conventional- and Modern Programming Languages for Developing a File System

Most of the software stack is built upon C today. C is a very flexible language, but the flexibility also brings some safety risks, particularly when handling memory through pointers. Rust is a new programming language which can guarantee memory safety without performance-heavy runtime services such...

Full description

Bibliographic Details
Main Authors: Laos, Pontus, Libot, Alexander
Format: Others
Language:English
Published: Malmö universitet, Institutionen för datavetenskap och medieteknik (DVMT) 2021
Subjects:
C
Online Access:http://urn.kb.se/resolve?urn=urn:nbn:se:mau:diva-43451
id ndltd-UPSALLA1-oai-DiVA.org-mau-43451
record_format oai_dc
spelling ndltd-UPSALLA1-oai-DiVA.org-mau-434512021-06-30T05:24:08ZComparing Conventional- and Modern Programming Languages for Developing a File SystemengJämförelse av konventionella- och moderna programmeringsspråk för utveckling av ett filsystemLaos, PontusLibot, AlexanderMalmö universitet, Institutionen för datavetenskap och medieteknik (DVMT)2021File SystemRustCEXT2FilsystemRustCEXT2Computer SciencesDatavetenskap (datalogi)Most of the software stack is built upon C today. C is a very flexible language, but the flexibility also brings some safety risks, particularly when handling memory through pointers. Rust is a new programming language which can guarantee memory safety without performance-heavy runtime services such as garbage collection. In this article, two partial file systems are implemented based on the design of EXT2. One system is implemented in C — Nafs — and one system is implemented in Rust — Rufs. A number of benchmarks are also developed, with the purpose of testing the most common features of a file system. After running the benchmarks, the results showed that Nafs provided better performance for all but one feature. There could be many reasons for this, and some hypotheses are discussed. Aspects like different compiler optimizations, the use of pointer dereferencing vs. data structure representation, using dynamic memory, and using system calls are considered. Some optimizations to Rufs are also implemented, and their impact analyzed. Earlier research has shown that Rust can guarantee memory safety while still providing good performance. It has also shown that Rust can be used to implement system programs, such as operating system kernels. Over the course of this article, it is shown that safe Rust can be used to implement a file system — thereby guaranteeing a memory safe program. It is also shown that a file system implemented in safe Rust provides worse performance than a similar system written in C. Future work will have to tell whether a file system can be as performant in Rust as in C, by using different implementation methods or unsafe Rust for some of the most performance critical parts of the system. Student thesisinfo:eu-repo/semantics/bachelorThesistexthttp://urn.kb.se/resolve?urn=urn:nbn:se:mau:diva-43451application/pdfinfo:eu-repo/semantics/openAccess
collection NDLTD
language English
format Others
sources NDLTD
topic File System
Rust
C
EXT2
Filsystem
Rust
C
EXT2
Computer Sciences
Datavetenskap (datalogi)
spellingShingle File System
Rust
C
EXT2
Filsystem
Rust
C
EXT2
Computer Sciences
Datavetenskap (datalogi)
Laos, Pontus
Libot, Alexander
Comparing Conventional- and Modern Programming Languages for Developing a File System
description Most of the software stack is built upon C today. C is a very flexible language, but the flexibility also brings some safety risks, particularly when handling memory through pointers. Rust is a new programming language which can guarantee memory safety without performance-heavy runtime services such as garbage collection. In this article, two partial file systems are implemented based on the design of EXT2. One system is implemented in C — Nafs — and one system is implemented in Rust — Rufs. A number of benchmarks are also developed, with the purpose of testing the most common features of a file system. After running the benchmarks, the results showed that Nafs provided better performance for all but one feature. There could be many reasons for this, and some hypotheses are discussed. Aspects like different compiler optimizations, the use of pointer dereferencing vs. data structure representation, using dynamic memory, and using system calls are considered. Some optimizations to Rufs are also implemented, and their impact analyzed. Earlier research has shown that Rust can guarantee memory safety while still providing good performance. It has also shown that Rust can be used to implement system programs, such as operating system kernels. Over the course of this article, it is shown that safe Rust can be used to implement a file system — thereby guaranteeing a memory safe program. It is also shown that a file system implemented in safe Rust provides worse performance than a similar system written in C. Future work will have to tell whether a file system can be as performant in Rust as in C, by using different implementation methods or unsafe Rust for some of the most performance critical parts of the system.
author Laos, Pontus
Libot, Alexander
author_facet Laos, Pontus
Libot, Alexander
author_sort Laos, Pontus
title Comparing Conventional- and Modern Programming Languages for Developing a File System
title_short Comparing Conventional- and Modern Programming Languages for Developing a File System
title_full Comparing Conventional- and Modern Programming Languages for Developing a File System
title_fullStr Comparing Conventional- and Modern Programming Languages for Developing a File System
title_full_unstemmed Comparing Conventional- and Modern Programming Languages for Developing a File System
title_sort comparing conventional- and modern programming languages for developing a file system
publisher Malmö universitet, Institutionen för datavetenskap och medieteknik (DVMT)
publishDate 2021
url http://urn.kb.se/resolve?urn=urn:nbn:se:mau:diva-43451
work_keys_str_mv AT laospontus comparingconventionalandmodernprogramminglanguagesfordevelopingafilesystem
AT libotalexander comparingconventionalandmodernprogramminglanguagesfordevelopingafilesystem
AT laospontus jamforelseavkonventionellaochmodernaprogrammeringssprakforutvecklingavettfilsystem
AT libotalexander jamforelseavkonventionellaochmodernaprogrammeringssprakforutvecklingavettfilsystem
_version_ 1719414601670459392