Changeset a2545593 for doc


Ignore:
Timestamp:
Mar 13, 2019, 10:20:24 AM (3 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
320e72a2, ab3a69c
Parents:
53bb8f1
Message:

Add ascription casts to future work

Location:
doc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • doc/bibliography/pl.bib

    r53bb8f1 ra2545593  
    11461146    author      = {Tarditi, David and Elliott, Archibald Samuel and Ruef, Andrew and Hicks, Michael},
    11471147    title       = {Checked C: Making C Safe by Extension},
    1148     booktitle   = {2018 IEEE Cybersecurity Development (SecDev)}
     1148    booktitle   = {2018 IEEE Cybersecurity Development (SecDev)},
    11491149    year = {2018},
    11501150    month = {September},
  • doc/theses/aaron_moss_PhD/phd/resolution-heuristics.tex

    r53bb8f1 ra2545593  
    381381The main challenge to implement this approach in \CFACC{} is applying the implicit conversions generated by the resolution process in the code-generation for the thunk functions that \CFACC{} uses to pass type assertions to their requesting functions with the proper signatures.
    382382
    383 Though performance of the existing algorithms is promising, some further optimizations do present themselves.
     383One \CFA{} feature that could be added to improve the ergonomics of overload selection is an \emph{ascription cast}; as discussed in Section~\ref{expr-cost-sec}, the semantics of the C cast operator are to choose the cheapest argument interpretation which is convertable to the target type, using the conversion cost as a tie-breaker.
     384An ascription cast would reverse these priorities, choosing the argument interpretation with the cheapest conversion to the target type, only using interpretation cost to break ties\footnote{A possible stricter semantics would be to select the cheapest interpretation with a zero-cost conversion to the target type, reporting a compiler error otherwise.}.
     385This would allow ascription casts to the desired return type to be used for overload selection:
     386
     387\begin{cfa}
     388int f$\(_1\)$(int);
     389int f$\(_2\)$(double);
     390int g$\(_1\)$(int);
     391double g$\(_2\)$(long);
     392
     393f((double)42);  $\C[4.5in]{// select f\(_2\) by parameter cast}$
     394(as double)g(42); $\C[4.5in]{// select g\(_2\) by return ascription cast}$
     395(double)g(42); $\C[4.5in]{// select g\(_1\) NOT g\(_2\) because of parameter conversion cost}$
     396\end{cfa}
     397
     398Though performance of the existing resolution algorithms is promising, some further optimizations do present themselves.
    384399The refined cost model discussed in Section~\ref{conv-cost-sec} is more expressive, but requires more than twice as many fields; it may be fruitful to investigate more tightly-packed in-memory representations of the cost-tuple, as well as comparison operations that require fewer instructions than a full lexicographic comparison.
    385400Integer or vector operations on a more-packed representation may prove effective, though dealing with the negative-valued $specialization$ field may require some effort.
Note: See TracChangeset for help on using the changeset viewer.