Commits

David Barker committed 801fb7a

More work on syntax evaluation sections

  • Participants
  • Parent commits 22f3a6e

Comments (0)

Files changed (7)

File Dissertation/Dissertation.aux

 \@writefile{toc}{\contentsline {subsection}{\numberline {4.2.1}Arrow syntax}{29}}
 \@writefile{toc}{\contentsline {subsubsection}{Comparison with Haskell}{30}}
 \@writefile{toc}{\contentsline {subsection}{\numberline {4.2.2}Binding syntax}{30}}
-\@writefile{toc}{\contentsline {subsubsection}{Username two-way binding}{30}}
+\@writefile{toc}{\contentsline {subsubsection}{Username two-way binding}{31}}
 \@writefile{lof}{\contentsline {figure}{\numberline {4.1}{\ignorespaces The username two-way binding application}}{31}}
 \newlabel{fig:case_study_name}{{4.1}{31}}
 \@writefile{toc}{\contentsline {subsubsection}{List binding from a mock database}{32}}
-\@writefile{lof}{\contentsline {figure}{\numberline {4.2}{\ignorespaces The list binding application}}{32}}
-\newlabel{fig:case_study_list}{{4.2}{32}}
+\@writefile{lof}{\contentsline {figure}{\numberline {4.2}{\ignorespaces The list binding application}}{33}}
+\newlabel{fig:case_study_list}{{4.2}{33}}
 \@writefile{toc}{\contentsline {subsubsection}{Some other demo}{33}}
 \@writefile{toc}{\contentsline {section}{\numberline {4.3}Performance testing}{33}}
 \@writefile{toc}{\contentsline {subsection}{\numberline {4.3.1}Arrow performance}{33}}
-\@writefile{toc}{\contentsline {subsubsection}{Measuring technique}{33}}
+\@writefile{toc}{\contentsline {subsubsection}{Measuring technique}{34}}
 \@writefile{toc}{\contentsline {subsubsection}{Simple function results}{34}}
 \@writefile{lof}{\contentsline {figure}{\numberline {4.3}{\ignorespaces Performance of arrows, Funcs and normal functions in implementing simple functionality}}{35}}
 \newlabel{fig:simple_function_performance}{{4.3}{35}}
-\@writefile{toc}{\contentsline {subsubsection}{List function results}{35}}
-\@writefile{lof}{\contentsline {figure}{\numberline {4.4}{\ignorespaces Performance of arrows, Linq queries and normal (loop-based) functions in implementing simple list functionality}}{36}}
-\newlabel{fig:list_function_performance}{{4.4}{36}}
+\@writefile{toc}{\contentsline {subsubsection}{List function results}{36}}
 \@writefile{toc}{\contentsline {subsubsection}{Overhead due to arrow chaining}{36}}
 \newlabel{sec:arrow_chaining_overhead}{{4.3.1}{36}}
-\@writefile{lof}{\contentsline {figure}{\numberline {4.5}{\ignorespaces Execution times of chains of identity functions}}{37}}
-\newlabel{fig:arrow_chaining_overhead}{{4.5}{37}}
+\@writefile{lof}{\contentsline {figure}{\numberline {4.4}{\ignorespaces Performance of arrows, Linq queries and normal (loop-based) functions in implementing simple list functionality}}{37}}
+\newlabel{fig:list_function_performance}{{4.4}{37}}
 \@writefile{toc}{\contentsline {subsection}{\numberline {4.3.2}Binding performance}{37}}
+\@writefile{lof}{\contentsline {figure}{\numberline {4.5}{\ignorespaces Execution times of chains of identity functions}}{38}}
+\newlabel{fig:arrow_chaining_overhead}{{4.5}{38}}
 \@writefile{toc}{\contentsline {chapter}{\numberline {5}Conclusion}{39}}
 \@writefile{lof}{\addvspace {10\p@ }}
 \@writefile{lot}{\addvspace {10\p@ }}

File Dissertation/Dissertation.lof

 \contentsline {figure}{\numberline {3.8}{\ignorespaces WPF integration demo}}{25}
 \addvspace {10\p@ }
 \contentsline {figure}{\numberline {4.1}{\ignorespaces The username two-way binding application}}{31}
-\contentsline {figure}{\numberline {4.2}{\ignorespaces The list binding application}}{32}
+\contentsline {figure}{\numberline {4.2}{\ignorespaces The list binding application}}{33}
 \contentsline {figure}{\numberline {4.3}{\ignorespaces Performance of arrows, Funcs and normal functions in implementing simple functionality}}{35}
-\contentsline {figure}{\numberline {4.4}{\ignorespaces Performance of arrows, Linq queries and normal (loop-based) functions in implementing simple list functionality}}{36}
-\contentsline {figure}{\numberline {4.5}{\ignorespaces Execution times of chains of identity functions}}{37}
+\contentsline {figure}{\numberline {4.4}{\ignorespaces Performance of arrows, Linq queries and normal (loop-based) functions in implementing simple list functionality}}{37}
+\contentsline {figure}{\numberline {4.5}{\ignorespaces Execution times of chains of identity functions}}{38}
 \addvspace {10\p@ }
 \addvspace {10\p@ }
 \addvspace {10\p@ }

File Dissertation/Dissertation.log

-This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2012.10.5)  29 APR 2013 15:07
+This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9 64-bit) (preloaded format=pdflatex 2012.10.5)  29 APR 2013 20:39
 entering extended mode
 **Dissertation.tex
 
 Chapter 4.
 [27
 
-] [28] [29] <fig/CaseStudyNameBinding.png, id=214, 283.0575pt x 210.7875pt>
+] [28] [29] [30]
+<fig/CaseStudyNameBinding.png, id=217, 283.0575pt x 210.7875pt>
 File: fig/CaseStudyNameBinding.png Graphic file (type png)
 
 <use fig/CaseStudyNameBinding.png>
-Package pdftex.def Info: fig/CaseStudyNameBinding.png used on input line 642.
+Package pdftex.def Info: fig/CaseStudyNameBinding.png used on input line 640.
 (pdftex.def)             Requested size: 283.0568pt x 210.78699pt.
- [30] [31 <C:/Users/David/Documents/Visual Studio 2010/Projects/ArrowDataBindin
-g/Dissertation/fig/CaseStudyNameBinding.png>] <fig/CaseStudyListBinding.png, id
-=221, 596.2275pt x 423.5825pt>
+ [31 <C:/Users/David/Documents/Visual Studio 2010/Projects/ArrowDataBinding/Dis
+sertation/fig/CaseStudyNameBinding.png>]
+<fig/CaseStudyListBinding.png, id=221, 596.2275pt x 423.5825pt>
 File: fig/CaseStudyListBinding.png Graphic file (type png)
 
 <use fig/CaseStudyListBinding.png>
-Package pdftex.def Info: fig/CaseStudyListBinding.png used on input line 663.
+Package pdftex.def Info: fig/CaseStudyListBinding.png used on input line 661.
 (pdftex.def)             Requested size: 411.93877pt x 292.66003pt.
- [32 <C:/Users/David/Documents/Visual Studio 2010/Projects/ArrowDataBinding/Dis
-sertation/fig/CaseStudyListBinding.png>]
-[33] [34]
+ [32] [33 <C:/Users/David/Documents/Visual Studio 2010/Projects/ArrowDataBindin
+g/Dissertation/fig/CaseStudyListBinding.png>] [34]
 <fig/SimpleFunctionPerformanceChart.pdf, id=232, 496.44887pt x 258.75552pt>
 File: fig/SimpleFunctionPerformanceChart.pdf Graphic file (type pdf)
 
 <use fig/SimpleFunctionPerformanceChart.pdf>
 Package pdftex.def Info: fig/SimpleFunctionPerformanceChart.pdf used on input l
-ine 721.
+ine 719.
 (pdftex.def)             Requested size: 411.93877pt x 214.71175pt.
  [35 <C:/Users/David/Documents/Visual Studio 2010/Projects/ArrowDataBinding/Dis
 sertation/fig/SimpleFunctionPerformanceChart.pdf>]
 
 <use fig/ListFunctionPerformanceChart.pdf>
 Package pdftex.def Info: fig/ListFunctionPerformanceChart.pdf used on input lin
-e 740.
+e 738.
 (pdftex.def)             Requested size: 411.93877pt x 203.08247pt.
- [36 <C:/Users/David/Documents/Visual Studio 2010/Projects/ArrowDataBinding/Dis
-sertation/fig/ListFunctionPerformanceChart.pdf>] <fig/IdentityChains.pdf, id=37
-4, 496.51498pt x 216.57913pt>
+ [36]
+<fig/IdentityChains.pdf, id=310, 496.51498pt x 216.57913pt>
 File: fig/IdentityChains.pdf Graphic file (type pdf)
 
 <use fig/IdentityChains.pdf>
-Package pdftex.def Info: fig/IdentityChains.pdf used on input line 754.
+Package pdftex.def Info: fig/IdentityChains.pdf used on input line 752.
 (pdftex.def)             Requested size: 411.93877pt x 179.69122pt.
  [37 <C:/Users/David/Documents/Visual Studio 2010/Projects/ArrowDataBinding/Dis
-sertation/fig/IdentityChains.pdf>] [38
-
-]
+sertation/fig/ListFunctionPerformanceChart.pdf>]
+[38 <C:/Users/David/Documents/Visual Studio 2010/Projects/ArrowDataBinding/Diss
+ertation/fig/IdentityChains.pdf>]
 Chapter 5.
 [39
 
+
 ] [40
 
 ]
 \pc@column@2=\box30
 \pc@column@width@2=\dimen120
 Package parcolumns Info: Width of column 1 calculated as 194.2195pt on input li
-ne 944.
+ne 942.
 Package parcolumns Info: Width of column 2 calculated as 194.2195pt on input li
-ne 944.
+ne 942.
 [45
 
 ]
 Package parcolumns Info: Width of column 1 calculated as 194.2195pt on input li
-ne 999.
+ne 997.
 Package parcolumns Info: Width of column 2 calculated as 194.2195pt on input li
-ne 999.
+ne 997.
  [46]
 Package parcolumns Info: Width of column 1 calculated as 194.2195pt on input li
-ne 1044.
+ne 1042.
 Package parcolumns Info: Width of column 2 calculated as 194.2195pt on input li
-ne 1044.
+ne 1042.
  [47] [48]
 Package parcolumns Info: Width of column 1 calculated as 194.2195pt on input li
-ne 1086.
+ne 1084.
 Package parcolumns Info: Width of column 2 calculated as 194.2195pt on input li
-ne 1086.
+ne 1084.
  [49
 
 ]
 Package parcolumns Info: Width of column 1 calculated as 194.2195pt on input li
-ne 1128.
+ne 1126.
 Package parcolumns Info: Width of column 2 calculated as 194.2195pt on input li
-ne 1128.
+ne 1126.
  [50] [51
 
 ] [52
 Here is how much of TeX's memory you used:
  2973 strings out of 494045
  43745 string characters out of 3148387
- 271622 words of memory out of 3000000
+ 270622 words of memory out of 3000000
  6243 multiletter control sequences out of 15000+200000
  12938 words of font info for 46 fonts, out of 3000000 for 9000
  715 hyphenation exceptions out of 8191
- 27i,8n,40p,1132b,1520s stack positions out of 5000i,500n,10000p,200000b,50000s
+ 27i,8n,40p,1429b,1520s stack positions out of 5000i,500n,10000p,200000b,50000s
 <C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfo
 nts/cm/cmbx12.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/c
 mitt10.pfb><C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmmi10.p
 ogram Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmtt10.pfb><C:/Program Fi
 les/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmtt12.pfb><C:/Program Files/MiKT
 eX 2.9/fonts/type1/public/amsfonts/cm/cmtt8.pfb>
-Output written on Dissertation.pdf (64 pages, 562169 bytes).
+Output written on Dissertation.pdf (64 pages, 564149 bytes).
 PDF statistics:
  625 PDF objects out of 1000 (max. 8388607)
  0 named destinations out of 1000 (max. 500000)

File Dissertation/Dissertation.pdf

Binary file modified.

File Dissertation/Dissertation.synctex.gz

Binary file modified.

File Dissertation/Dissertation.tex

 
 One of the main syntactic achievements of the project was finding ways of writing all the arrow combinators such that under normal circumstances the user need never provide explicit type parameters. Given a typed lambda expression, for instance \texttt{(int x) => x + 1}, arrow construction is done with \texttt{Op.Arr((int x) => x + 1)}. From there, the type of this arrow is used to infer the types required for all the combinators -- composition, for example, is simply \texttt{arrow.Combine(otherArrow)}.
 
-Less successful was the \texttt{First} operator. As outlined in Section \ref{sec:simple_arrow_challenges}, many approaches were attempted for this, but all turned out slightly messy. The current preferred approach is \texttt{arrow.First(default(T))}, where \texttt{T} is the type parameter which cannot be inferred. However, \texttt{arrow.First<T>()} is arguably slightly better as it is clearer what it does (passing \texttt{default(T)} definitely qualifies as a `hack'), and so it is used in the arrow law listings of Appendix \ref{sec:arrow_laws} for clarity. The main problems are that it takes an extra type parameter and relies heavily on reflection, leading to slower execution.
+Less successful was the \texttt{First} operator. As outlined in Section \ref{sec:simple_arrow_challenges}, many approaches were attempted for this, but all turned out slightly messy. The current preferred approach is \texttt{arrow.First(default(T))}, where \texttt{T} is the type parameter which cannot be inferred. However, \texttt{arrow.First<T>()} is arguably slightly better as it is clearer what it does (passing \texttt{default(T)} definitely qualifies as a `hack'), and so it is used in the arrow law listings of Appendix \ref{sec:arrow_laws} for clarity. The main problems are that it takes an extra type parameter and relies heavily on reflection, leading to slower execution. This unfortunately leaves the \texttt{First} operator very inconvenient to use (so much so that the arrow law listings define an abbreviation for it). However, this was fortunately the only bad example and could probably be improved by using a slightly different operator in place of it\footnote{For instance, consider an operator \texttt{FirstThrough} which takes the arrow and then an arrow on pairs to pass the result through. The type of the arrow on pairs could be used by the compiler to infer the type missing from the \texttt{First} arrow preceding it, and the programmer could easily just supply an identity arrow of the appropriate type if they wanted a pure \texttt{First} operator}.
 
-Extension methods -- handy. However, Op preceding all non-extension methods is a faff, but this is because C$\sharp$ doesn't allow methods to be used without a containing class
+A slightly inconvenient (if sensible) feature of C$\sharp$ is the restriction that, unlike in many other similar languages, all methods have to be called on an object or class. Whilst in Java one could import all static methods from a class and use them as though they were defined locally, in C$\sharp$ they need to be prefixed with the class name (i.e. \texttt{StaticClass.Method()}). This of course presented a slight obstacle to making arrow code concise, as chains of operators would build up into messy expressions like \texttt{Combinators.And(Combinators.Arr(f1), Combinators.First(Combinators.Arr(f2)))}. By writing all combinators to be usable as extension methods, writing utility extension methods for \texttt{Func} objects (like \texttt{Func.Arr()} to make a \texttt{Func} into an arrow) and giving the class a short name for the worst case, I was able to keep this to a minimum and so keep combinator-heavy code relatively clean. The \texttt{Op.Combinator()} syntax is still fairly clumsy, but in many cases there was no easy way around this.
 
 \subsubsection{Comparison with Haskell}
 
 
 \subsection{Binding syntax}
 
-To evaluate how concise and readable the binding syntax is, a few case study applications were written using both normal WPF binding and arrow-based binding. The key code snippets from the resulting programs are listed in Appendix \ref{sec:case_studies}, and this section explores how the samples differ and how successful the attempt to simplify binding syntax and reduce boilerplate code was.
+The goals for binding syntax were similar to those for arrows: fundamentally, the objective was to make the syntax brief and clear. Specifically this meant removing all the boilerplate associated with WPF data binding and similar frameworks, whilst making it easy to understand what's going on. To evaluate how concise and readable the binding syntax is, a few case study applications were written using both normal WPF binding and arrow-based binding. The key code snippets from the resulting programs are listed in Appendix \ref{sec:case_studies}, and this section explores how the samples differ and how successful the attempt to simplify binding syntax and reduce boilerplate code was.
 
 \subsubsection{Username two-way binding}
 

File Dissertation/Dissertation.toc

 \contentsline {subsection}{\numberline {4.2.1}Arrow syntax}{29}
 \contentsline {subsubsection}{Comparison with Haskell}{30}
 \contentsline {subsection}{\numberline {4.2.2}Binding syntax}{30}
-\contentsline {subsubsection}{Username two-way binding}{30}
+\contentsline {subsubsection}{Username two-way binding}{31}
 \contentsline {subsubsection}{List binding from a mock database}{32}
 \contentsline {subsubsection}{Some other demo}{33}
 \contentsline {section}{\numberline {4.3}Performance testing}{33}
 \contentsline {subsection}{\numberline {4.3.1}Arrow performance}{33}
-\contentsline {subsubsection}{Measuring technique}{33}
+\contentsline {subsubsection}{Measuring technique}{34}
 \contentsline {subsubsection}{Simple function results}{34}
-\contentsline {subsubsection}{List function results}{35}
+\contentsline {subsubsection}{List function results}{36}
 \contentsline {subsubsection}{Overhead due to arrow chaining}{36}
 \contentsline {subsection}{\numberline {4.3.2}Binding performance}{37}
 \contentsline {chapter}{\numberline {5}Conclusion}{39}