Converted Filet-o-Fish Literate Haskell code into a Technical Note
authorTimothy Roscoe <troscoe@inf.ethz.ch>
Fri, 2 Jun 2017 11:53:23 +0000 (13:53 +0200)
committerTimothy Roscoe <troscoe@inf.ethz.ch>
Fri, 2 Jun 2017 11:53:23 +0000 (13:53 +0200)
Signed-off-by: Timothy Roscoe <troscoe@inf.ethz.ch>

doc/024-fof/FiletOFish.lhs [new file with mode: 0644]
doc/024-fof/Hakefile [new file with mode: 0644]
doc/024-fof/top.tex [new file with mode: 0644]
doc/Hakefile
doc/style/barrelfish.bib
hake/Hakefile
tools/fof/FiletOFish.bib
tools/fof/Introduction.tex

diff --git a/doc/024-fof/FiletOFish.lhs b/doc/024-fof/FiletOFish.lhs
new file mode 100644 (file)
index 0000000..95179bd
--- /dev/null
@@ -0,0 +1,189 @@
+%% 
+%%  Template for Barrelfish technical notes.
+%%
+%%  Modified from the University of Stirling LaTeX technical report
+%%  style file and template with much gratitude.
+%%  
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Copyright (c) 2011, ETH Zurich.
+% All rights reserved.
+%
+% This file is distributed under the terms in the attached LICENSE file.
+% If you do not find this file, copies can be found by writing to:
+% ETH Zurich D-INFK, Universitaetstr. 6, CH-8092 Zurich. Attn: Systems Group.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \documentclass[a4paper]{article} 
+\documentclass[a4paper,twoside]{report} % If you want a report
+\usepackage{bftn}
+\usepackage{fullpage}
+%include polycode.fmt
+\usepackage{epigraph}
+\setlength{\epigraphrule}{0pt}
+\setlength{\beforeepigraphskip}{0pt}
+\setlength{\afterepigraphskip}{2\baselineskip}
+\usepackage{tikz}
+\usetikzlibrary{matrix,arrows}
+
+\title{Filet-o-Fish\\
+      \small{When French Cuisine Meets Swiss Fishes}
+}
+\author{Pierre-Evariste Dagand}
+%% \email{info@barrelfish.org}
+\tnnumber{024}
+\tnkey{FiletOFish}
+
+\begin{document}
+\maketitle                     % Uncomment for final draft
+
+\begin{versionhistory}
+\vhEntry{1.0}{02.06.2017}{TR}{Converted to Technical Note from Pierre's LHS}
+\end{versionhistory}
+
+\tableofcontents
+
+\input{Introduction}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\part{The Filet-o-Fish Language}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{IntroLanguage}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{Filet-o-Fish Syntax}
+\label{chap:fof_syntax}
+\epigraph{- None shall pass.\\
+          - I have no quarrel with you, good Sir Knight, but I must cross this bridge.\\
+          - Then you shall die.}{Monty Python}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{PureExpressions}
+\input{Constructs}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{Filet-o-Fish Semantics}
+\label{chap:fof_semantics}
+\epigraph{So, logically...\\
+          If...\\
+          she...\\ weighs...\\
+          the same as a duck,...\\
+          she's made of wood.}{Monty Python}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{Eval}
+\input{Expressions}
+\input{Semantics}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{Filet-o-Fish Operators}
+\label{chap:fof_operators}
+\epigraph{Listen. \\
+          Strange women lying in ponds distributing swords 
+          is no basis for a system of government. 
+          Supreme executive power derives from a mandate from the masses, 
+          not from some farcical aquatic ceremony.}{Monty Python}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{Constructs/Arrays}
+\input{Constructs/Conditionals}
+\input{Constructs/Enumerations}
+\input{Constructs/Functions}
+\input{Constructs/References}
+\input{Constructs/Strings}
+\input{Constructs/Structures}
+\input{Constructs/Typedef}
+\input{Constructs/Unions}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{Lib-C Operators}
+\label{chap:fof_libc}
+\epigraph{Mortician: Bring out your dead! [clang] \ldots \\
+          Customer:  Here's one -- nine pence. \\
+          Dead person: I'm not dead!\\
+          Mortician: What?\\
+          Customer: Nothing -- here's your nine pence.}{Monty Python}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{Libc/Printf}
+\input{Libc/Assert}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{Lib-barrefish Operators}
+\label{chap:fof_libbarrelfish}
+\epigraph{Here may be found the last words of Joseph of Aramathea.  He
+  who is valiant and pure of spirit may find the Holy Grail in the
+  Castle of uuggggggh}{Monty Python}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{Libbarrelfish/HasDescendants}
+\input{Libbarrelfish/MemToPhys}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\part{The Filet-o-Fish Compiler}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{Compile}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{The FoF Intermediate Language}
+\label{chap:il_fof}
+\epigraph{- [...] For, since the tragic death of her father -- \\
+          - He's not quite dead!\\
+          - Since the near fatal wounding of her father--\\
+          - He's getting better!\\
+          - For, since her own father\ldots who, when he seemed about to
+            recover, suddenly felt the icy hand of death upon him,\ldots\\
+          - Oh, he's died!\\
+          - And I want his only daughter to look upon me\ldots as her own
+            dad -- in a very real, and legally binding sense.
+            And I feel sure that the merger -- uh, the union -- between the
+            Princess and the brave, but dangerous, Sir Launcelot of Camelot...}{Monty Python}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{IL/FoF/FoF}
+\input{IL/FoF/Compile}
+\input{IL/FoF/Run}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter{The Paka Intermediate Language}
+\label{chap:il_paka}
+\epigraph{Listen, lad. \\
+  I've built this kingdom up from nothing.  When
+  I started here, all there was was swamp.  All the kings said I was
+  daft to build a castle in a swamp, but I built it all the same,
+  just to show 'em.  It sank into the swamp.\\
+  So, I built a second one. That sank into the swamp. \\
+  So I built a third one.  That burned down,
+  fell over, then sank into the swamp.  \\
+  But the fourth one stayed up. An' that's what your gonna get, lad -- the strongest castle in these
+  islands.}{Monty Python}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{IL/Paka/Syntax}
+\input{IL/Paka/Builders}
+\input{IL/Paka/Paka}
+\input{IL/Paka/Compile}
+\input{IL/Paka/Optimizer}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\appendix
+\part{Appendix}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input{FutureWork}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\bibliographystyle{plain}
+\bibliography{barrelfish}
+
+
+\end{document}
diff --git a/doc/024-fof/Hakefile b/doc/024-fof/Hakefile
new file mode 100644 (file)
index 0000000..3ee04a8
--- /dev/null
@@ -0,0 +1,80 @@
+----------------------------------------------------------------------
+-- Copyright (c) 2017, ETH Zurich.
+-- All rights reserved.
+--
+-- This file is distributed under the terms in the attached LICENSE file.
+-- If you do not find this file, copies can be found by writing to:
+-- ETH Zurich D-INFK, Universitaetstr. 6, CH-8092 Zurich. Attn: Systems Group.
+--
+-- Hakefile for /tools/fof
+--
+----------------------------------------------------------------------
+
+--
+-- Just builds documentation for now - Filet-o-Fish is only used as a library.
+--
+
+let
+  lhsfiles = [
+    "Compile",
+    "Constructs",
+    "Constructs/Arrays",
+    "Constructs/Conditionals",
+    "Constructs/Enumerations",
+    "Constructs/Functions",
+    "Constructs/References",
+    "Constructs/Strings",
+    "Constructs/Structures",
+    "Constructs/Typedef",
+    "Constructs/Unions",
+    "Eval",
+    "Expressions",
+    -- "FiletOFish",
+    "IL/FoF/Compile",
+    "IL/FoF/FoF",
+    "IL/FoF/Run",
+    "IL/Paka/Builders",
+    "IL/Paka/Compile",
+    "IL/Paka/Optimizer",
+    "IL/Paka/Paka",
+    "IL/Paka/Syntax",
+    "Libbarrelfish/GetAddress",
+    "Libbarrelfish/HasDescendants",
+    "Libbarrelfish/MemToPhys",
+    "Libc/Assert",
+    "Libc/Printf",
+    "Main",
+    "PureExpressions",
+    "Semantics"
+    ]
+  texfiles = [
+    "FutureWork",
+    "IntroLanguage",
+    "Introduction"
+    ]
+  lhsrule f = Rule ( [ Str "lhs2TeX",
+                       Str "-o",
+                       Out "tools" ("/tools/fof/" ++ f ++ ".tex"),
+                       In SrcTree "src" ("/tools/fof/" ++ f ++ ".lhs")
+                     ] )
+  texrule f = Rule ( [ Str "cp",
+                       In SrcTree "src" ("/tools/fof/" ++ f ++ ".tex"),
+                       Out "tools" ("/tools/fof/" ++ f ++ ".tex")
+                     ] )
+  lhsdeps = [ Dep BuildTree "tools" ("/tools/fof/" ++ f ++ ".tex") | f <- lhsfiles ]
+  texdeps = [ Dep BuildTree "tools" ("/tools/fof/" ++ f ++ ".tex") | f <- texfiles ]
+  in
+ [ buildTechNoteWithDeps "top.tex" "TN-024-FiletOFish.pdf" True False []
+   (lhsdeps ++ texdeps ++ [ Dep BuildTree "docs" "FiletOFish-from-lhs.tex" ])
+ ]
+ ++
+ [ lhsrule f | f <- lhsfiles ]
+ ++
+ [ texrule f | f <- texfiles ]
+ ++
+ [ Rule ( [ Str "lhs2TeX",
+            Str "-o",
+            Out "docs" "FiletOFish-from-lhs.tex", 
+            In SrcTree "src" "FiletOFish.lhs"
+          ] )
+ ]
diff --git a/doc/024-fof/top.tex b/doc/024-fof/top.tex
new file mode 100644 (file)
index 0000000..fbbd940
--- /dev/null
@@ -0,0 +1,5 @@
+%
+% Hack so that the top-level .tex file is always in the Source tree,
+% rather than generated in the Build tree.
+%
+\input{FiletOFish-from-lhs}
index 920cd81..a4a8e99 100644 (file)
@@ -34,6 +34,7 @@
          "TN-020-Sockeye.pdf",
          "TN-021-CPUDriver.pdf",
          "TN-022-ARMv8.pdf",
-         "TN-023-Coreboot.pdf" ]]
+         "TN-023-Coreboot.pdf",
+         "TN-024-FiletOFish.pdf" ]]
     "Documentation for Barrelfish"
 ]
index 4306693..e72d9a3 100644 (file)
@@ -1321,3 +1321,47 @@ D. E. Long and Carlos Maltzahn},
   title =    {Multiboot Specification (latest version)},
   note =     {\url{http://git.savannah.gnu.org/cgit/grub.git/tree/doc/multiboot.texi?h=multiboot}}
 }
+
+
+@Misc{kmett-free-monad,
+  author =       {Kmett, Edward},
+  title =        {Monads for Free},
+  year =         {2008},
+  url =          {http://comonad.com/reader/2008/monads-for-free/},
+}
+
+@Misc{hurricane-names,
+  author =       {National Hurricane Center},
+  title =        {Retired Hurricane Names Since 1954},
+  url =          {http://www.nhc.noaa.gov/retirednames.shtml},
+}
+
+@Misc{ramsey-hoopl,
+  author =       {Ramsey, Norman and Dias, John and Peyton Jones, Simon },
+  title =        {Hoopl: Dataflow Optimization Made Simple},
+  year =         {2009},
+  url =          {http://research.microsoft.com/en-us/um/people/simonpj/papers/c--/dfopt.pdf},
+}
+
+@article{necula-tvi,
+    author = {Necula, George C.},
+    title = {Translation validation for an optimizing compiler},
+    volume = {35},
+    year = {2000}
+
+}
+@article{swierstra-expression,
+       abstract = {This paper describes a technique for assembling both data types and functions from isolated individual components. We also explore how the same technology can be used to combine free monads and, as a result, structure Haskell's monolithic IO monad.},
+       author = {Swierstra, Wouter  },
+       citeulike-article-id = {2742096},
+       journal = {Journal of Functional Programming},
+       keywords = {expression-problem, functional-programming, language-haskell, monads},
+       number = {-1},
+       pages = {1--14},
+       posted-at = {2008-05-13 09:00:51},
+       priority = {0},
+       title = {Data types \`{a} la carte},
+       url = {http://journals.cambridge.org/action/displayAbstract?fromPage=online\&aid=1813324},
+       volume = {Forthcoming},
+       year = {2008}
+}
index fe90f86..ca21f6e 100644 (file)
@@ -71,6 +71,7 @@ in
     ," - 'help-boot':      show the boot sequences which can be initiated"
     ," - 'clean':          remove most generated files"
     ," - 'realclean':      remove all generated files (clears the build tree)"
+    ," - 'Documentation':  build all Technical Notes"
     ," - 'Makefile':       attempt to re-run hake"
     ,""
   ] ],
index f46258e..caf26dd 100644 (file)
@@ -1,4 +1,4 @@
-@inproceedings{mmcs-barrelfish,
+@inproceedings{schuepbach:mmcs08,
        author = {Schapbach, Adrian   and Peter, Simon   and Baumann, Andrew   and Roscoe, Timothy   and Barham, Paul   and Harris, Tim   and Isaacs, Rebecca  },
        booktitle = {Proceedings of the Workshop on Managed Many-Core Systems},
        citeulike-article-id = {3416014},
index 4ba3766..c3edef7 100644 (file)
@@ -5,7 +5,7 @@
 
 Filet-o-Fish, abbreviated \emph{FoF} hereafter, is a tool for the
 working language designer. Developed in the context of
-Barrelfish\cite{mmcs-barrelfish}, FoF aims at easing the development
+Barrelfish\cite{schuepbach:mmcs08}, FoF aims at easing the development
 of Domain-Specific Languages (DSL) as well as enhancing their
 safety. As a side effect of FoF's design, it also becomes easier for
 the user of a DSL to understand ``what is going on''.