Repository navigation
Expand file tree
/
Copy pathCore.tex
More file actions
64 lines (53 loc) · 2.81 KB
/
Copy pathCore.tex
File metadata and controls
64 lines (53 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
\section{Copilot Core}~\label{sec:core}
\todo{Discuss the implemenation of Copilot Core}
\todo{Discuss the issues surroudning GADT}
There are a few key issues when implementing structs:
\begin{itemize}
\item
While structs are \emph{type-less}, there is currently no easy way to use records in Copilot. Therefore, a type of \texttt{Bool} is attached to structs in Copilot.
\item
Fields are currently passed through Core as Externs using tags that prepend the name of the struct.
\item
Using a struct in a Copilot specification is not syntactically pleasant and done in a roundabout manner.
\item
It is still difficult to nest structs in Haskell.
\end{itemize}
To improve structs in Copilot, they need to be mapped more appropriately in Core, beginning with switching their implementation to that of either a record or a tuple.
\begin{itemize}
\item \texttt{Core.hs} : The main file. Is used for exporting prototypes only.
\end{itemize}
Folder : Core
\begin{itemize}
\item \texttt{Error.hs} : The file for crashing everything with the functions \texttt{badUsage} and \texttt{impossible}. Use those functions with parsimony (especially impossible, because it will ask the user to send a mail to Lee).
\item \texttt{Expr.hs} : The place where the Expressions of the Core AST is defined.
\item \texttt{External.hs} : The file where External variables, functions, arrays, structs, and struct fields are gathered from the specification (for use by the back end).
\item \texttt{Interpret.hs} :
\item \texttt{Locals.hs} :
\item \texttt{MakeTags.hs} : The file in which you MakeTags. A tag is a unique identifier (a tag), which is added to some nodes of the AST so that it is possible to distinguish them in a map (external variables call, etc ...).
\item \texttt{Operators.hs} : The place where all the operators of the Core AST are defined.
\item \texttt{PrettyDot.hs} : The dot pretty printer. Cf the section \ref{sec:pretty}
\item \texttt{PrettyPrint.hs} : The text pretty printer. Cf the section \ref{sec:pretty}
\item \texttt{Random.hs} :
\item \texttt{Spec.hs} : The place where the Core AST is defined. This AST is not the same as the Reified AST from the Language module (confusion may occur).
\item \texttt{StructMarshal.hs} : DEPRECATED - Eli
\item \texttt{Type.hs} : The place defining typing for Core, but not for the back end.
\end{itemize}
Subfolder : Type
\begin{itemize}
\item \texttt{Dynamic.hs} :
\item \texttt{Eq.hs} :
\item \texttt{Equality.hs} : The file where different instances of Core types can be compared.
\item \texttt{Read.hs} :
\item \texttt{Show.hs} :
\item \texttt{Uninitialized.hs} :
\end{itemize}
Subfolder : Random
\begin{itemize}
\item \texttt{Gen.hs} :
\item \texttt{Weight.hs} :
\end{itemize}
Subfolder : Interpret
\begin{itemize}
\item \texttt{Eval.hs} :
\item \texttt{Render.hs} :
\end{itemize}