Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
thesis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jasper Gräflich
thesis
Commits
773e3e7d
Commit
773e3e7d
authored
3 years ago
by
Jasper Clemens Gräflich
Browse files
Options
Downloads
Patches
Plain Diff
Set up thesis document
parent
99a7c1e3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#86533
passed
3 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
thesis/1-introduction.tex
+102
-0
102 additions, 0 deletions
thesis/1-introduction.tex
thesis/thesis.tex
+17
-0
17 additions, 0 deletions
thesis/thesis.tex
with
119 additions
and
0 deletions
thesis/1-introduction.tex
0 → 100644
+
102
−
0
View file @
773e3e7d
\chapter
{
Introduction
}
\section
{
The Rust Ownership and Borrow System
}
\subsection
{
Ownership
}
\begin{enumerate}
\item
Move semantics
\item
Drop responsibilities
\item
\lstinline
{
Clone
}
and
\lstinline
{
Copy
}
(and
\lstinline
{
Drop
}
)
\end{enumerate}
\subsection
{
Borrowing
}
\begin{enumerate}
\item
aliasing + mutability = race conditions
\item
The borrow checker prevents this
\item
two kinds of references
\item
returning a borrow to the owner (lexical lifetimes)
\end{enumerate}
\subsection
{
Non-Lexical Lifetimes
}
\begin{enumerate}
\item
Example: Correct but rejected program
\item
Solution: Early drop of reference/non-lexical lifetimes
\end{enumerate}
\subsection
{
Reborrows and Two-Phase Borrowing
}
\begin{enumerate}
\item
What is a reborrow?
\item
Example: Reborrows are correct but rejected
\item
Solution: Allow for Reborrows
\item
Using shared references after creating a unique one is correct but rejected
\item
Example
\item
Solution: Two-Phase Borrowing
\item
Note: This is not yet implemented
\end{enumerate}
\subsection
{
Loans and Regions
}
\begin{enumerate}
\item
What are loans and regions?
\item
regions as an alternative to lifetimes
\item
regions are more powerful
\item
Piggyback on the talk by
\href
{
https://www.youtube.com/watch?v=
_
agDeiWek8w
}{
Niko Matsakis
}
\item
Note: Polonius will be a new Borrowchecker using regions but it is unstable
\item
Note: concrete memory regions à la Cyclone vs abstract regions à la Polonius
\end{enumerate}
\section
{
Contracts and Refinement Types
}
\subsection
{
Contracts
}
\begin{enumerate}
\item
Preconditions, Postconditions, Invariants
\item
Hoare Logic
\item
Contracts are a Runtime Check
\item
Are there first-class contracts?
\item
Higher-order contracts (
\href
{
https://www2.ccs.neu.edu/racket/pubs/icfp2002-ff.pdf
}{
Findler, Felleisen
}
)
\end{enumerate}
\subsection
{
Refinement Types
}
\begin{enumerate}
\item
Independent Refinement Types
\item
Dependent Refinement Types/Refined Function Types
\item
Refinement Types are “first-class”
\end{enumerate}
\subsection
{
Liquid Types SMT Solving
}
\begin{enumerate}
\item
Refinement Types are not decidable
\item
SAT is decidable
\item
SMT is decidable
\item
Liquid Types =
$
\{
RefinementType | decidable
\}
$
\end{enumerate}
\subsection
{
Hybrid Type Checking
}
\begin{enumerate}
\item
Idea: Combine Contracts and Liquid Types
\item
Sprinkle in casts everywhere an assertion is made
\item
If the compiler can prove that this is ok or not ok, remove the cast (and potentially throw a compiler error)
\item
All other casts are dynamic and lead to a panic if they fail.
\item
In Rust,
\lstinline
{
Result
}
and
\lstinline
{
?
}
could be used instead. Problem: The error must be handled somewhere.
\end{enumerate}
\section
{
Other Extensions to a Type System
}
\subsection
{
Totality and Termination Metrics
}
\begin{enumerate}
\item
Some functions can panic or loop indefinitely
\item
In Rust,
\lstinline
{
!
}
as return type helps (such a function does definitely not terminate)
\item
There is no “may not terminate”, though, so you have to rely on the documentation
\item
You can prove that a loop/recursion finishes by termination metrics
\item
Panics can technically occur in every function (every function call needs memory space for a stack frame)
\item
But you can prove that there are no “high-level” panics in any execution path within a function
\end{enumerate}
\subsection
{
Purity and (algebraic) Effects
}
\begin{enumerate}
\item
Effects
\item
Handling (Example: Exceptions)
\item
Algebraic Effects
\item
Pure functions don’t have unhandled effects
\item
What counts as an effect (IO, allocation, computation)
\end{enumerate}
\subsection
{
(Other Substructural Types)
}
\begin{enumerate}
\item
Move semantics are affine types
\item
Clone and Copy is weakening
\item
\lstinline
{
#[must
_
use]
}
and relevant types
\item
Linear types
\item
Ordered types
\item
Uniqueness types
\end{enumerate}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
thesis/thesis.tex
0 → 100644
+
17
−
0
View file @
773e3e7d
% arara: lualatex
% arara: biber
% arara: lualatex
% arara: lualatex
\documentclass
[a4paper, oneside, article]
{
memoir
}
\input
{
../preamble.tex
}
\includeonly
{
1-introduction
}
\begin{document}
\include
{
1-introduction
}
\end{document}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment