Mercurial > archived > louis > epitech > mq > rathaxes
comparison doc_recap_some_important_thoughts_about_the_current_compiler.patch @ 141:85c2fa6f6bd8
Wrap-up wip
author | Louis Opter <kalessin@kalessin.fr> |
---|---|
date | Sat, 08 Feb 2014 18:28:44 -0800 |
parents | |
children | cbff597d307e |
comparison
equal
deleted
inserted
replaced
140:a291b41efb69 | 141:85c2fa6f6bd8 |
---|---|
1 # HG changeset patch | |
2 # Parent 01873f017f54a0c625261b8a1f27052219a00141 | |
3 Recap important notes about the current compiler in a small document | |
4 | |
5 This should be used as a work document for the next compiler version. | |
6 | |
7 diff --git a/doc/rathaxes/technical/CMakeLists.txt b/doc/rathaxes/technical/CMakeLists.txt | |
8 --- a/doc/rathaxes/technical/CMakeLists.txt | |
9 +++ b/doc/rathaxes/technical/CMakeLists.txt | |
10 @@ -15,3 +15,5 @@ | |
11 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/technical_documentation_en.pdf | |
12 DESTINATION share/doc/rathaxes/) | |
13 ENDFOREACH(I ${DOCS}) | |
14 + | |
15 +ADD_LATEX_DOCUMENT(rtx_2k12_wrap_up.tex DEFAULT_PDF MANGLE_TARGET_NAMES) | |
16 diff --git a/doc/rathaxes/technical/rtx_2k12_wrap_up.tex b/doc/rathaxes/technical/rtx_2k12_wrap_up.tex | |
17 new file mode 100644 | |
18 --- /dev/null | |
19 +++ b/doc/rathaxes/technical/rtx_2k12_wrap_up.tex | |
20 @@ -0,0 +1,113 @@ | |
21 +\documentclass[american]{rtxarticle} | |
22 + | |
23 +\title{Rathaxes 2012 wrap-up} | |
24 + | |
25 +\author{Louis Opter} | |
26 + | |
27 +\begin{document} | |
28 + | |
29 +\maketitle | |
30 + | |
31 +\begin{abstract} | |
32 +The second version of the Rathaxes compiler, \emph{Rathaxes 2012}, started in | |
33 +2010 has been sunset in 2013. This document aims to highlight the issues and | |
34 +the lessons learned while trying to recode an e1000 driver with this compiler | |
35 +version. | |
36 + | |
37 +This document should serve as a reference for the next version of the Rathaxes | |
38 +compiler implemented in Python 3 with Pyrser. | |
39 +\end{abstract} | |
40 + | |
41 +\section{Design issues} | |
42 + | |
43 +\subsection{Unused features} | |
44 + | |
45 +The following compiler features: | |
46 + | |
47 +\begin{itemize} | |
48 +\item Advanced chunk selection (using the \texttt{with} statement); | |
49 +\item Register declarations. | |
50 +\end{itemize} | |
51 + | |
52 +Turned out to unecessary because: | |
53 + | |
54 +\begin{itemize} | |
55 +\item We decided to scope the first driver to a single kernel (Linux 2.6.32 and | |
56 + then 3.2.0); | |
57 +\item Register declarations were not clearly wired to the rest of the language | |
58 + and were simply too advanced to be used at first; | |
59 +\item Challenges appeared at other places. | |
60 +\end{itemize} | |
61 + | |
62 +It's also interesting to note that sequences weren't used to define algorithms | |
63 +as planned but were re-fitted as ``functions'' as we started to write object | |
64 +oriented code around Rathaxes types. Some sequences are also used to logically | |
65 +regroup chunks and pointcut but those chunks could be moved to types or could | |
66 +directly be top-level declarations within their interface. | |
67 + | |
68 +\subsection{Features we missed} | |
69 + | |
70 +The following compiler features: | |
71 + | |
72 +\begin{itemize} | |
73 +\item ``Object model''; | |
74 +\item Ref/Scalar; | |
75 +\item Error handling; | |
76 +\item Variadic sequences; | |
77 +\item Arrays support; | |
78 +\item Comments passthrough; | |
79 +\item Type coercion to \texttt{Builtin::symbol}. | |
80 +\end{itemize} | |
81 + | |
82 +Are really needed. | |
83 + | |
84 +\subsubsection{``Object model''} | |
85 + | |
86 +The driver code started to organically organize itself into types with methods | |
87 +and attributes that loosely correspond to classes. We ran different into | |
88 +issues: | |
89 + | |
90 +\begin{itemize} | |
91 +\item Methods call aren't working; | |
92 +\item Type dependencies aren't resolved correctly, so they aren't generated in | |
93 + the right order; | |
94 +\item \texttt{\$\{self\}} is ambiguous, how do you know when it's a scalar or a | |
95 + method? (this is important to define the init method); | |
96 +\item Abstract data types should probably be framed/defined in the language; | |
97 +\item Mappings aren't resolved recursively; | |
98 +\item Mappings can't use Rathaxes code in them (e.g: you can't use | |
99 + \texttt{\$\{Rathaxes::Type.ref\}} in a mapping definition); | |
100 +\item Circular dependencies aren't supported (in e1000 the rings and the | |
101 + hardware context are inter-dependant, you can't avoid that); | |
102 +\item Type injections in upper sub-system (i.e: inject \texttt{e1000::Context} | |
103 + into \texttt{Ethernet::Device}), that has been implemented with regular | |
104 + pointcut but we need another kind of pointcut to only weave the type (and | |
105 + not the full structure field). | |
106 +\end{itemize} | |
107 + | |
108 +\subsubsection{Error handling} | |
109 + | |
110 +This has been deliberately left out in Rathaxes 2012 but it seems that the | |
111 +biggest difficulty is going to define and then inject the error handling code | |
112 +into the parent chunk/context appropriately. | |
113 + | |
114 +\section{Implementation issues} | |
115 + | |
116 +Some bugs are imparing development: | |
117 + | |
118 +\begin{itemize} | |
119 +\item Expansion bugs: | |
120 +\begin{itemize} | |
121 +\item Obscure expansion issues solved by scoping thigns; | |
122 +\item Variable declarations leaking across different chunks; | |
123 +\item Chunk/Pointcut parameters not bound to the C variables (the parameters | |
124 + must be named like the C variables are). | |
125 +\end{itemize} | |
126 +\item CNorm issues: it's impossible to use annotation (e.g: \texttt{\_\_init}, | |
127 + \texttt{\_\_exit}, \texttt{\_\_iomem}, \ldots) or arbitrary typedef'd | |
128 + types; | |
129 +\item Some sequences call aren't working for obscure reasons (e.g: | |
130 + \texttt{DMA::unmap}). | |
131 +\end{itemize} | |
132 + | |
133 +\end{document} | |
134 diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt | |
135 --- a/rathaxes/samples/e1000/e1000.blt | |
136 +++ b/rathaxes/samples/e1000/e1000.blt | |
137 @@ -809,7 +809,7 @@ | |
138 | |
139 chunk LKM::code() | |
140 { | |
141 - static int rtx_e1000_tx_ring_alloc_resources(${e1000::TxRing.ref} self) | |
142 + static int rtx_e1000_tx_ring_alloc_resources(${e1000:::TxRing.ref} self) | |
143 { | |
144 ${Log::info("e1000_tx_ring_alloc_resources: TBD...")}; | |
145 return 0; |