From 691d66964215329ee8e84d2dd0355c5edad4e5d1 Mon Sep 17 00:00:00 2001 From: JKF Date: Wed, 3 Jun 2026 16:25:51 +0200 Subject: [PATCH] yeyeye --- slides/main.md | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/slides/main.md b/slides/main.md index d5df0da..8737ded 100644 --- a/slides/main.md +++ b/slides/main.md @@ -19,6 +19,11 @@ style: | #### Julius Fischer ###### 10. Juni 2026 +$$ +\def\leftcirc{{\triangleleft\kern-0.1em\circ}} +\def\myor{{\;|\;}} + +$$ --- # What are Destinations? @@ -64,12 +69,44 @@ map f (x:xs) dest = map f xs (push dest (f x)) --- # DPS in functional languages - Just add pointers to mutable data? - - $Int \mapsto Int \mapsto Int \mapsto \textcolor{red}{T}$ - - $\textcolor{red}{T *}\mapsto Int \mapsto Int \mapsto Int \mapsto Void$ + - $Int \mapsto Int \mapsto \textcolor{red}{T}$ + - $\textcolor{red}{T *}\mapsto Int \mapsto Int \mapsto \dots$ +- Multiple issues with this + - Memory safety + - Multilpe writes on shared memory + - Purity --- # Destination Calculus -- It's +- Basic FP terms +$$ +t, u := x \myor t' t \;|\; t ; t' \;|\; \dots +$$ +- Case for all datatypes +$$ +\begin{align} + \dots \myor + &case_m\;t\;of\;(v_1, v_2) \mapsto u \myor\\ + &case_m\;t\;of\;(Inl\;v_1) \mapsto u \myor \dots +\end{align} +$$ +- Additions for destination passing +$$ +\begin{align} + \dots \myor + & + new_\ltimes \myor + from_\ltimes t \myor + to_\ltimes t \myor + upd_\ltimes \; t \; with \; x \mapsto t' \myor\\ + & + t \blacktriangleleft t' \myor + t \leftcirc t' \myor + t \triangleleft () \myor + t \triangleleft Inl \myor + t \triangleleft (,) \myor \dots +\end{align} +$$ --- # Referenes