Changeset 6d44da1 for doc


Ignore:
Timestamp:
Sep 25, 2018, 11:35:34 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
c6bbcdb
Parents:
341bb80 (diff), 7428ad9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into shared_library

Location:
doc
Files:
12 added
3 edited
95 moved

Legend:

Unmodified
Added
Removed
  • doc/bibliography/pl.bib

    r341bb80 r6d44da1  
    701701% B
    702702
     703@article{Michael13,
     704    contributer = {pabuhr@plg},
     705    author      = {Maged M. Michael},
     706    title       = {The Balancing Act of Choosing Nonblocking Features},
     707    journal     = cacm,
     708    volume      = 56,
     709    number      = 9,
     710    month       = sep,
     711    year        = 2013,
     712    pages       = {46--53},
     713    publisher   = {ACM},
     714    address     = {New York, NY, USA},
     715}
     716
    703717@incollection{beta:old,
    704718    keywords    = {beta, patterns, virtual types},
     
    908922
    909923@misc{Cforall,
     924    contributer = {pabuhr@plg},
    910925    key         = {Cforall},
    911     title       = {\textsf{C}{$\mathbf{\forall}$} Features},
    912     howpublished= {\url{https://plg.uwaterloo.ca/~cforall/features}},
     926    author      = {{\textsf{C}{$\mathbf{\forall}$} Features}},
     927    howpublished= {\href{https://plg.uwaterloo.ca/~cforall/features}{https://\-plg.uwaterloo.ca/\-~cforall/\-features}},
    913928    optnote     = {Accessed: 2018-01-01},
    914929}
     
    926941
    927942@misc{CFAStackEvaluation,
     943    contributer = {a3moss@plg},
    928944    author      = {Aaron Moss},
    929945    title       = {\textsf{C}$\mathbf{\forall}$ Stack Evaluation Programs},
    930946    year        = 2018,
    931     howpublished= {\href{https://cforall.uwaterloo.ca/CFAStackEvaluation.zip}{\textcolor{blue}{Q4: https://cforall.uwaterloo.ca/\-CFAStackEvaluation.zip}}},
     947    howpublished= {\href{https://cforall.uwaterloo.ca/CFAStackEvaluation.zip}{https://cforall.uwaterloo.ca/\-CFAStackEvaluation.zip}},
    932948    optnote     = {[Accessed May 2018]},
    933949}
    934950
    935951@article{Moss18,
    936     keywords    = {concurrency, C++},
     952    keywords    = {type systems, tuples, Cforall},
    937953    contributer = {pabuhr@plg},
    938954    author      = {Aaron Moss and Robert Schluntz and Peter A. Buhr},
    939955    title       = {\textsf{C}$\mathbf{\forall}$ : Adding Modern Programming Language Features to C},
    940956    year        = 2018,
     957    month       = aug,
    941958    journal     = spe,
    942     note        = {Accepted, to appear},
     959    note        = {\href{http://dx.doi.org/10.1002/spe.2624}{http://\-dx.doi.org/\-10.1002/\-spe.2624}},
    943960}
    944961
     
    962979    comment     = {
    963980        The evidence given is thin.
    964         }
     981    },
    965982}
    966983
     
    14161433}
    14171434
     1435@misc{NThreadCode13,
     1436    keywords    = {N-thread software-solution mutual exclusion},
     1437    contributer = {pabuhr@plg},
     1438    key         = {concurrent locking},
     1439    author      = {Peter A. Buhr and David Dice and Wim H. Hesselink},
     1440    title       = {concurrent-locking},
     1441    howpublished= {\href{https://github.com/pabuhr/concurrent-locking}{https://\-github.com/\-pabuhr/\-concurrent-locking}},
     1442    optnote     = {[Accessed April 2017]},
     1443}
     1444
    14181445@incollection{Reppy93,
    14191446    keywords    = {ML, concurrency, continuation passing},
     
    14891516    month       = dec,
    14901517    year        = 2017,
    1491     note        = {\href{http://plg.uwaterloo.ca/~usystem/pub/uSystem/u++-7.0.0.sh}{http://\-plg.\-uwaterloo.\-ca/\-$\sim$usystem/\-pub/\-uSystem/\-u++-7.0.0.sh}},
     1518    note        = {\href{https://plg.uwaterloo.ca/~usystem/pub/uSystem/uC++.pdf}{https://\-plg.uwaterloo.ca/\-~usystem/\-pub/\-uSystem/uC++.pdf}},
    14921519}
    14931520
     
    15561583}
    15571584
     1585@mastersthesis{Sun15,
     1586    author      = {Sun, Xianda},
     1587    title       = {Concurrent High-performance Persistent Hash Table In {J}ava},
     1588    school      = {School of Computer Science, University of Waterloo},
     1589    year        = 2015,
     1590    optaddress  = {Waterloo, Ontario, Canada, N2L 3G1},
     1591    note        = {\href{https://uwspace.uwaterloo.ca/handle/10012/10013}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/\-10013}},
     1592}
     1593
    15581594@book{Andrews91:book,
    15591595    keywords    = {concurrency},
     
    15801616
    15811617@mastersthesis{Delisle18,
    1582     author      = {Thierry Delisle },
     1618    keywords    = {concurrency, Cforall},
     1619    contributer = {pabuhr@plg},
     1620    author      = {Thierry Delisle},
    15831621    title       = {Concurrency in \textsf{C}$\mathbf{\forall}$},
    15841622    school      = {School of Computer Science, University of Waterloo},
    15851623    year        = 2018,
    1586     address     = {Waterloo, Ontario, Canada, N2L 3G1},
     1624    optaddress  = {Waterloo, Ontario, Canada, N2L 3G1},
    15871625    note        = {\href{https://uwspace.uwaterloo.ca/handle/10012/12888}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/\-12888}},
     1626}
     1627
     1628@article{Delisle18b,
     1629    keywords    = {concurrency, Cforall},
     1630    contributer = {pabuhr@plg},
     1631    author      = {Thierry Delisle and Peter A. Buhr},
     1632    title       = {Concurrency in \textsf{C}$\mathbf{\forall}$},
     1633    year        = 2018,
     1634    journal     = spe,
     1635    pages       = {1-32},
     1636    note        = {submitted},
    15881637}
    15891638
     
    18271876    key         = {Peter Buhr},
    18281877    title       = {CS343},
    1829     year        = 2017,
     1878    year        = 2018,
    18301879    howpublished= {\href{https://www.student.cs.uwaterloo.ca/~cs343}{https://\-www.student.cs.uwaterloo.ca/\-~cs343}},
    18311880}
     
    28642913    keywords    = {concurrency, mutual exclusion, performance experiment, software solutions},
    28652914    title       = {Fast mutual exclusion by the {T}riangle algorithm},
    2866     author      = {Wim H. Hesselink and Peter Buhr and David Dice},
     2915    author      = {Wim H. Hesselink and Peter A. Buhr and David Dice},
    28672916    journal     = ccpe,
    28682917    volume      = 30,
     
    28712920    month       = feb,
    28722921    publisher   = {John Wiley \& Sons},
    2873     note        = {\url{https://doi.org/10.1002/cpe.4183}}
     2922    note        = {\href{https://doi.org/10.1002/cpe.4183}{https://\-doi.org/\-10.1002/\-cpe.4183}}
    28742923}
    28752924
     
    32833332    edition     = {{S}imon {M}arlow},
    32843333    year        = 2010,
    3285     note        = {\href{https://haskell.org/definition/haskell2010.pdf}{https://haskell.org/\-definition/\-haskell2010.pdf}},
     3334    note        = {\href{https://haskell.org/definition/haskell2010.pdf}{https://\-haskell.org/\-definition/\-haskell2010.pdf}},
    32863335}
    32873336
     
    33573406}
    33583407
    3359 @article{Hesselink17,
     3408@article{Hesselink17b,
    33603409    keywords    = {concurrency, mutual exclusion, performance experiment, software solutions},
    33613410    title       = {High-Contention Mutual Exclusion by Elevator Algorithms},
    3362     author      = {Peter Buhr and David Dice and Wim H. Hesselink},
     3411    author      = {Peter A. Buhr and David Dice and Wim H. Hesselink},
    33633412    journal     = ccpe,
    3364     volumeopt   = 30,
    3365     numberopt   = 4,
     3413    volume      = 30,
     3414    number      = 18,
    33663415    year        = 2018,
    3367     month       = may,
     3416    month       = sep,
    33683417    publisher   = {John Wiley \& Sons},
    3369     note        = {\url{https://doi-org.proxy.lib.uwaterloo.ca/10.1002/cpe.4475}}
     3418    note        = {\href{https://doi-org.proxy.lib.uwaterloo.ca/10.1002/cpe.4475}{https://\-doi-org.proxy.lib.uwaterloo.ca/\-10.1002/\-cpe.4475}},
    33703419}
    33713420
     
    38463895% K
    38473896
     3897@inproceedings{Buhr96b,
     3898    author      = {Peter A. Buhr and Martin Karsten and Jun Shih},
     3899    title       = {{\small\textsf{KDB}}: A Multi-threaded Debugger for Multi-threaded Applications},
     3900    booktitle   = {Proceedings of SPDT'96: SIGMETRICS Symposium on Parallel and Distributed Tools},
     3901    publisher   = {ACM Press},
     3902    address     = {Philadelphia, Pennsylvania, U.S.A.},
     3903    month       = may,
     3904    year        = 1996,
     3905    pages       = {80-87},
     3906}
     3907
    38483908@article{Duggan96,
    38493909    keywords    = {concurrency, critical section},
    38503910    contributer = {pabuhr@plg},
    3851     author      = {Dominic Duggan and G. V. Cormack and John Ophel},
     3911    author      = {Dominic Duggan and Gordon V. Cormack and John Ophel},
    38523912    title       = {Kinded Type Inference for Parametric Overloading},
    38533913    journal     = acta,
     
    45334593% N
    45344594
     4595@techreport{Drepper03,
     4596    keywords    = {NPTL, threading, 1:1 model},
     4597    contributer = {pabuhr@plg},
     4598    author      = {Ulrich Drepper and Ingo Molnar},
     4599    title       = {The Native POSIX Thread Library for Linux},
     4600    institution = {Red Hat},
     4601    year        = 2003,
     4602    note        = {\href{http://www.cs.utexas.edu/~witchel/372/lectures/POSIX_Linux_Threading.pdf}{http://www.cs.utexas.edu/\-$\sim$witchel/\-372/\-lectures/\-POSIX\_Linux\_Threading.pdf}},
     4603}
     4604
    45354605@article{Haddon77,
    45364606    keywords    = {monitors, nested monitor calls},
     
    46564726    volume      = 9,
    46574727    pages       = {157-164},
     4728}
     4729
     4730@misc{nginx,
     4731    key         = {nginx},
     4732    author      = {{NGINX}},
     4733    howpublished= {\href{https://www.nginx.com}{https://\-www.nginx.com}},
    46584734}
    46594735
     
    47684844@misc{obj-c-book,
    47694845    keywords    = {objective-c},
    4770     contributor = {a3moss@uwaterloo.ca},
     4846    contributor = {pabuhr@plg},
    47714847    key         = {Objective-C},
    4772     title       = {Objective-C},
     4848    author      = {Objective-C},
    47734849    publisher   = {Apple Inc.},
    4774     year        = 2015,
    4775     howpublished= {\href{https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/ObjectiveC.html}{https://developer.apple.com/\-library/\-content/\-documentation/\-General/\-Conceptual/\-DevPedia-\-CocoaCore/\-ObjectiveC.html}},
     4850    year        = 2014,
     4851    howpublished= {\href{https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC}{https://\-developer.apple.com/\-library/archive/\-documentation/\-Cocoa/\-Conceptual/\-ProgrammingWithObjectiveC}},
    47764852    optnote     = {Accessed: 2018-03}
    47774853}
     
    47834859    title       = {{X}code 7 Release Notes},
    47844860    year        = 2015,
    4785     howpublished= {\href{https://developer.apple.com/library/content/documentation/Xcode/Conceptual/RN-Xcode-Archive/Chapters/xc7_release_notes.html}{https://developer.apple.com/\-library/\-content/\-documentation/\-Xcode/\-Conceptual/\-RN-Xcode-Archive/\-Chapters/\-xc7\_release\_notes.html}},
     4861    howpublished= {\href{https://developer.apple.com/library/content/documentation/Xcode/Conceptual/RN-Xcode-Archive/Chapters/xc7_release_notes.html}{https://\-developer.apple.com/\-library/\-content/\-documentation/\-Xcode/\-Conceptual/\-RN-Xcode-Archive/\-Chapters/\-xc7\_release\_notes.html}},
    47864862    optnote     = {Accessed: 2017-04}
    47874863}
     
    52835359}
    52845360
     5361@misc{perf,
     5362    contributer = {pabuhr@plg},
     5363    key         = {perf},
     5364    author      = {perf},
     5365    howpublished= {\href{https://perf.wiki.kernel.org/index.php/Tutorial}{https://\-perf.wiki.kernel.org/\-index.php/\-Tutorial}},
     5366}
     5367
     5368@misc{Verch12,
     5369    contributer = {pabuhr@plg},
     5370    author      = {Shaun Verch},
     5371    title       = {Performance Analysis of 64-Bit Capriccio},
     5372    month       = may,
     5373    year        = 2012,
     5374    howpublished= {\href{http://cs.brown.edu/research/pubs/theses/masters/2012/verch.pdf}{http://cs.brown.edu/\-research/\-pubs/\-theses/\-masters/\-2012/\-verch.pdf}},
     5375    optnote     = {Accessed: 2013-10-4}
     5376}
     5377
    52855378@article{Anderson90,
    52865379    keywords    = {spin locks, back off, performance},
     
    55035596    note        = {Proceedings of the OOPSLA'89 Conference, Oct. 1--6, 1989, New Orleans, Lousiana},
    55045597    abstract    = {},
     5598}
     5599
     5600@inproceedings{Buhr98,
     5601    keywords    = {profiling, monitoring, visualization},
     5602    contributer = {pabuhr@plg},
     5603    author      = {Peter A. Buhr and Robert Denda},
     5604    title       = {{$\mu$Profiler} : Profiling User-Level Threads in a Shared-Memory Programming Environment},
     5605    booktitle   = {Proceedings of the Second International Symposium on Computing in Object-Oriented Parallel Environments (ISCOPE'98)},
     5606    series      = {Lecture Notes in Computer Science},
     5607    publisher   = {Springer-Verlag},
     5608    volume      = 1505,
     5609    opteditor   = {Dennis Caromel and Rodney R. Oldehoeft and Marydell Tholburn},
     5610    address     = {Santa Fe, New Mexico, U.S.A.},
     5611    month       = dec,
     5612    year        = 1998,
     5613    pages       = {159-166},
    55055614}
    55065615
     
    58555964    keywords    = {Cyclone, existential types, polymorphism, type variables},
    58565965    contributer = {a3moss@plg},
    5857     author      = {D. Grossman},
     5966    author      = {Dan Grossman},
    58585967    title       = {Quantified Types in an Imperative Language},
    58595968    journal     = toplas,
     
    59646073}
    59656074
     6075@article{Ronsse03,
     6076    keywords    = {profiling, replay},
     6077    contributer = {pabuhr@plg},
     6078    author      = {Michiel Ronsse and De Bosschere, Koen and Mark Christiaens and Jacques Chassin de Kergommeaux and Dieter Kranzlm\"{u}ller},
     6079    title       = {Record/Replay for Nondeterministic Program Executions},
     6080    journal     = cacm,
     6081    month       = sep,
     6082    year        = 2003,
     6083    volume      = 46,
     6084    number      = 9,
     6085    pages       = {62-67},
     6086}
     6087
    59666088@article{Robinson48,
    59676089    keywords    = {recursion, Ackermann function},
     
    60026124}
    60036125
     6126@mastersthesis{Schuster99,
     6127    author      = {Oliver Schuster},
     6128    title       = {Replay of Concurrent Shared-Memory Programs},
     6129    school      = {Universit\"at Mannheim},
     6130    address     = {Mannheim, Deutschland},
     6131    year        = 1999,
     6132    month       = apr,
     6133    type        = {Diplomarbeit},
     6134    note        = {\href{ftp://plg.uwaterloo.ca/pub/theses/SchusterThesis.ps.gz}{ftp://\-plg.uwaterloo.ca/\-pub/\-theses/\-SchusterThesis.ps.gz}},
     6135}
     6136
    60046137@article{Euclid,
    60056138    keywords    = {Euclid},
     
    60336166    school      = {School of Computer Science, University of Waterloo},
    60346167    year        = 2017,
    6035     address     = {Waterloo, Ontario, Canada, N2L 3G1},
     6168    optaddress  = {Waterloo, Ontario, Canada, N2L 3G1},
    60366169    note        = {\href{https://uwspace.uwaterloo.ca/handle/10012/11830}{https://\-uwspace.uwaterloo.ca/\-handle/\-10012/\-11830}},
    60376170}
     
    68606993    contributer = {pabuhr@plg},
    68616994    key         = {TIOBE Index},
    6862     title       = {{TIOBE} Index},
     6995    author      = {{TIOBE Index}},
    68636996    howpublished= {\href{http://www.tiobe.com/tiobe_index}{http://\-www.tiobe.com/\-tiobe\_index}},
    68646997    optnote     = {Accessed: 2018-09},
     
    70007133    year        = 1980
    70017134}
     7135
     7136@misc{TraceCompass,
     7137    contributer = {pabuhr@plg},
     7138    key         = {Trace Compass},
     7139    author      = {{T}race {C}ompass},
     7140    howpublished= {\href{https://projects.eclipse.org/proposals/trace-compass}{https://\-projects.eclipse.org/\-proposals/\-trace-compass}},
     7141}
    70027142 
    70037143@article{Leroy00,
     
    71357275    title       = {Usability Challenges in Exception Handling},
    71367276    booktitle   = {5th International Workshop on Exception Handling (WEH)},
    7137     organization= {16th International Symposium on the Foundations of Software Engineering (FSE 16)},
     7277    optorganization= {16th International Symposium on the Foundations of Software Engineering (FSE 16)},
    71387278    address     = {Zurich, Switzerland},
    71397279    month       = jun,
     
    72797419}
    72807420
     7421@inproceedings{vonBehren03,
     7422    keywords    = {threads, events, web server},
     7423    contributer = {pabuhr@plg},
     7424    author      = {Rob von Behren and Jeremy Condit and Eric Brewer},
     7425    title       = {Why Events Are a Bad Idea (for high-concurrency servers)},
     7426    booktitle   = {HotOS IX: The 9th Workshop on Hot Topics in Operating Systems},
     7427    publisher   = {USENIX Association},
     7428    address     = {Lihue, Hawaii, U.S.A.},
     7429    month       = may,
     7430    year        = 2003,
     7431    pages       = {19-24},
     7432}
     7433
    72817434@techreport{Moss90,
    72827435    keywords    = {Swizzling, database},
     
    73437496    year        = 1986,
    73447497    editor      = {Norman Meyrowitz},
    7345     publisher   = sigplan # " 21(11)",
     7498    publisher   = sigplan,
    73467499    organization= {Association for Computing Machinery},
    73477500    address     = {Portland, Oregon},
    7348     month       = sep # { 29}
     7501    month       = sep,
    73497502}
    73507503
     
    73557508    year        = 1987,
    73567509    editor      = {Norman Meyrowitz},
    7357     publisher   = sigplan # " 22(12)",
     7510    publisher   = sigplan,
    73587511    organization= {Association for Computing Machinery},
    73597512    address     = {Orlando, Florida},
    7360     month       = oct # { 4--8}
     7513    month       = oct,
    73617514}
    73627515
     
    73677520    year        = 1988,
    73687521    editor      = {Norman Meyrowitz},
    7369     publisher   = sigplan # " 23(11)",
     7522    publisher   = sigplan,
    73707523    organization= {Association for Computing Machinery},
    73717524    address     = {San Diego, California},
    7372     month       = sep # { 25--30}
     7525    month       = sep,
    73737526}
    73747527
     
    73797532    year        = 1989,
    73807533    editor      = {Norman Meyrowitz},
    7381     publisher   = sigplan # " 24(10)",
     7534    publisher   = sigplan,
    73827535    organization= {Association for Computing Machinery},
    73837536    address     = {New Orleans, Louisiana},
    7384     month       = oct # { 1--6}
     7537    month       = oct,
    73857538}
    73867539
     
    73917544    year        = 1990,
    73927545    editor      = {Norman Meyrowitz},
    7393     publisher   = sigplan # " 25(10)",
     7546    publisher   = sigplan,
    73947547    organization= {Association for Computing Machinery},
    73957548    address     = {Ottawa, Canada},
    7396     month       = oct # { 21--25}
     7549    month       = oct,
    73977550}
    73987551
     
    74037556    year        = 1991,
    74047557    editor      = {Andreas Paepcke},
    7405     publisher   = sigplan # " 26(11)",
     7558    publisher   = sigplan,
    74067559    organization= {Association for Computing Machinery},
    74077560    address     = {Phoenix, Arizona},
    7408     month       = oct # { 6--11}
    7409 }
     7561    month       = oct,
     7562}
  • doc/papers/general/Paper.tex

    r341bb80 r6d44da1  
    196196\author[1]{Robert Schluntz}
    197197\author[1]{Peter A. Buhr}
    198 \author[]{\textcolor{blue}{Q1 AUTHOR NAMES CORRECT}}
    199198\authormark{MOSS \textsc{et al}}
    200199
     
    208207The C programming language is a foundational technology for modern computing with millions of lines of code implementing everything from hobby projects to commercial operating systems.
    209208This installation base and the programmers producing it represent a massive software engineering investment spanning decades and likely to continue for decades more.
    210 Nevertheless, C, which was first standardized almost 30 \textcolor{blue}{CHANGE ``40'' TO ``30''} years ago, lacks many features that make programming in more modern languages safer and more productive.
     209Nevertheless, C, which was first standardized almost 30 years ago, lacks many features that make programming in more modern languages safer and more productive.
    211210The goal of the \CFA project (pronounced ``C for all'') is to create an extension of C that provides modern safety and productivity features while still ensuring strong backward compatibility with C and its programmers.
    212211Prior projects have attempted similar goals but failed to honor the C programming style;
     
    226225
    227226
     227\vspace*{-10pt}
    228228\section{Introduction}
    229229
    230230The C programming language is a foundational technology for modern computing with millions of lines of code implementing everything from hobby projects to commercial operating systems.
    231231This installation base and the programmers producing it represent a massive software engineering investment spanning decades and likely to continue for decades more.
    232 The TIOBE index~\cite{TIOBE} \textcolor{blue}{CHANGE ``TIOBE'' TO ``The TIOBE index''} ranks the top five most \emph{popular} programming languages as Java 15\%, \Textbf{C 12\%}, \Textbf{\CC 5.5\%}, and Python 5\%, \Csharp 4.5\% = 42\%, where the next 50 languages are less than 4\% each with a long tail.
     232The TIOBE index~\cite{TIOBE} ranks the top five most \emph{popular} programming languages as Java 15\%, \Textbf{C 12\%}, \Textbf{\CC 5.5\%}, and Python 5\%, \Csharp 4.5\% = 42\%, where the next 50 languages are less than 4\% each with a long tail.
    233233The top three rankings over the past 30 years are as follows.
    234 \newpage
    235 \textcolor{blue}{MOVE TABLE HERE}
    236234\begin{center}
    237235\setlength{\tabcolsep}{10pt}
     
    246244\lstMakeShortInline@%
    247245\end{center}
    248 
    249246Love it or hate it, C is extremely popular, highly used, and one of the few systems languages.
    250247In many cases, \CC is often used solely as a better C.
    251 Nevertheless, C, which was first standardized almost 30 \textcolor{blue}{CHANGE ``40'' TO ``30''} years ago~\cite{ANSI89:C}, lacks many features that make programming in more modern languages safer and more productive.
     248Nevertheless, C, which was first standardized almost 30 years ago~\cite{ANSI89:C}, lacks many features that make programming in more modern languages safer and more productive.
    252249
    253250\CFA (pronounced ``C for all'' and written \CFA or Cforall) is an evolutionary extension of the C programming language that adds modern language features to C, while maintaining source and runtime compatibility in the familiar C programming model.
     
    281278ultimately, a compiler is necessary for advanced features and optimal performance.
    282279% The translator design is based on the \emph{visitor pattern}, allowing multiple passes over the abstract code-tree, which works well for incrementally adding new feature through additional visitor passes.
    283 Two key translator components are expression analysis, determining expression validity and what operations are required for its implementation, and code generation, dealing with multiple forms of overloading, polymorphism, and multiple return values by converting them into C code for a C compiler that supports none of these features.
     280Two key translator components are expression analysis, determining expression validity and what operations are required for its implementation, and code generation, dealing with multiple forms of overloading, polymorphism, and multiple return values by converting them into the C code for a C compiler that supports none of these features.
    284281Details of these components are available in chapters 2 and 3 in the work of Bilson~\cite{Bilson03} and form the base for the current \CFA translator.
    285282% @plg2[8]% cd cfa-cc/src; cloc libcfa
     
    345342Section~\ref{sec:libraries} includes a number of examples of how this overloading simplifies \CFA programming relative to C.
    346343Code generation for these overloaded functions and variables is implemented by the usual approach of mangling the identifier names to include a representation of their type, while \CFA decides which overload to apply based on the same ``usual arithmetic conversions'' used in C to disambiguate operator overloads.
    347 \textcolor{blue}{REMOVE ``We have the following as an example''}
     344
    348345\newpage
    349 \textcolor{blue}{UPDATE FOLLOWING PROGRAM EXAMPLE WITH ADJUSTED COMMENTS TO FIT PAGE WIDTH.}
    350346\begin{cfa}
    351347int max = 2147483647;                                           $\C[4in]{// (1)}$
     
    362358In some cases, hundreds of names can be reduced to tens, resulting in a significant cognitive reduction.
    363359In the above, the name @max@ has a consistent meaning, and a programmer only needs to remember the single concept: maximum.
    364 To prevent significant ambiguities, \CFA uses the return type in selecting overloads, \eg in the assignment to @m@, the compiler use @m@'s type to unambiguously select the most appropriate call to function @max@ (as does Ada).
     360To prevent significant ambiguities, \CFA uses the return type in selecting overloads, \eg in the assignment to @m@, the compiler uses @m@'s type to unambiguously select the most appropriate call to function @max@ (as does Ada).
    365361As is shown later, there are a number of situations where \CFA takes advantage of available type information to disambiguate, where other programming languages generate ambiguities.
    366362
     
    380376\label{sec:poly-fns}
    381377
    382 The signature feature of \CFA is parametric-polymorphic functions~\cite{forceone:impl,Cormack90,Duggan96} with functions generalized using a @forall@ clause (giving the language its name). \textcolor{blue}{REMOVE ``as follows''}
     378The signature feature of \CFA is parametric-polymorphic functions~\cite{forceone:impl,Cormack90,Duggan96} with functions generalized using a @forall@ clause (giving the language its name).
    383379\begin{cfa}
    384380`forall( otype T )` T identity( T val ) { return val; }
     
    395391
    396392Since bare polymorphic types provide a restricted set of available operations, \CFA provides a \newterm{type assertion}~\cite[pp.~37-44]{Alphard} mechanism to provide further type information, where type assertions may be variable or function declarations that depend on a polymorphic type variable.
    397 For example, the function @twice@ can be defined using the \CFA syntax for operator overloading. \textcolor{blue}{REMOVE ``as follows''}
     393For example, the function @twice@ can be defined using the \CFA syntax for operator overloading.
    398394\begin{cfa}
    399395forall( otype T `| { T ?+?(T, T); }` ) T twice( T x ) { return x `+` x; }  $\C{// ? denotes operands}$
     
    409405Crucial to the design of a new programming language are the libraries to access thousands of external software features.
    410406Like \CC, \CFA inherits a massive compatible library base, where other programming languages must rewrite or provide fragile interlanguage communication with C.
    411 A simple example is leveraging the existing type-unsafe (@void *@) C @bsearch@ to binary search a sorted float array. \textcolor{blue}{REMOVE ``as follows''}
     407A simple example is leveraging the existing type-unsafe (@void *@) C @bsearch@ to binary search a sorted float array.
    412408\begin{cfa}
    413409void * bsearch( const void * key, const void * base, size_t nmemb, size_t size,
     
    605601To enable interoperation among equivalent instantiations of a generic type, the translator saves the set of instantiations currently in scope and reuses the generated structure declarations where appropriate.
    606602A function declaration that accepts or returns a concrete generic type produces a declaration for the instantiated structure in the same scope, which all callers may reuse.
    607 For example, the concrete instantiation for @pair( const char *, int )@ is \textcolor{blue}{REMOVE ``as follows.''}
     603For example, the concrete instantiation for @pair( const char *, int )@ is
    608604\begin{cfa}
    609605struct _pair_conc0 {
     
    634630If a dynamic generic type is declared to be passed or returned by value from a polymorphic function, the translator can safely assume that the generic type is complete (\ie has a known layout) at any call site, and the offset array is passed from the caller;
    635631if the generic type is concrete at the call site, the elements of this offset array can even be statically generated using the C @offsetof@ macro.
    636 As an example, the body of the second @value@ function is implemented as \textcolor{blue}{REMOVE ``follows.''}
     632As an example, the body of the second @value@ function is implemented as
    637633\begin{cfa}
    638634_assign_T( _retval, p + _offsetof_pair[1] ); $\C{// return *p.second}$
     
    640636\newpage
    641637\noindent
    642 \textcolor{blue}{NO PARAGRAPH INDENT} Here, @_assign_T@ is passed in as an implicit parameter from @otype T@, and takes two @T *@ (@void *@ in the generated code), a destination and a source, and @_retval@ is the pointer to a caller-allocated buffer for the return value, the usual \CFA method to handle dynamically sized return types.
     638Here, @_assign_T@ is passed in as an implicit parameter from @otype T@, and takes two @T *@ (@void *@ in the generated code), a destination and a source, and @_retval@ is the pointer to a caller-allocated buffer for the return value, the usual \CFA method to handle dynamically sized return types.
    643639@_offsetof_pair@ is the offset array passed into @value@;
    644 this array is generated at the call site as \textcolor{blue}{REMOVE ``follows.''}
     640this array is generated at the call site as
    645641\begin{cfa}
    646642size_t _offsetof_pair[] = { offsetof( _pair_conc0, first ), offsetof( _pair_conc0, second ) }
     
    677673
    678674Another useful pattern enabled by reused dtype-static type instantiations is zero-cost \newterm{tag structures}.
    679 Sometimes, information is only used for type checking and can be omitted at runtime. \textcolor{blue}{REMOVE ``As an example, we have the following''}
     675Sometimes, information is only used for type checking and can be omitted at runtime.
    680676\begin{cquote}
    681677\lstDeleteShortInline@%
     
    724720Both approaches are awkward.
    725721% FIX
    726 Alternatively, a programming language can directly support returning multiple values, \eg \CFA provides the following. \textcolor{blue}{REPLACE ``in \CFA, we have the following'' WITH ``\CFA provides the following''}
     722Alternatively, a programming language can directly support returning multiple values, \eg \CFA provides the following.
    727723\begin{cfa}
    728724[ int, int ] div( int num, int den );           $\C{// return two integers}$
     
    745741As such, \CFA allows assigning multiple values from a function into multiple variables, using a square-bracketed list of lvalue expressions (as above), called a \newterm{tuple}.
    746742
    747 However, functions also use \newterm{composition} (nested calls), with the direct consequence that MRVFs must also support composition to be orthogonal with single-returning-value functions (SRVFs), \eg, \CFA provides the following. \textcolor{blue}{REPLACE ``As an example, we have the following'' WITH ``\CFA provides the following''}
     743However, functions also use \newterm{composition} (nested calls), with the direct consequence that MRVFs must also support composition to be orthogonal with single-returning-value functions (SRVFs), \eg, \CFA provides the following.
    748744\begin{cfa}
    749745printf( "%d %d\n", div( 13, 5 ) );                      $\C{// return values seperated into arguments}$
     
    781777printf( "%d %d\n", qr );
    782778\end{cfa}
    783 \CFA also supports \newterm{tuple indexing} to access single components of a tuple expression. \textcolor{blue}{REMOVE ``as follows''}
     779\CFA also supports \newterm{tuple indexing} to access single components of a tuple expression.
    784780\begin{cfa}
    785781[int, int] * p = &qr;                                           $\C{// tuple pointer}$
     
    809805In the call to @f@, @x@ is implicitly flattened so the components of @x@ are passed as two arguments.
    810806In the call to @g@, the values @y@ and @10@ are structured into a single argument of type @[int, int]@ to match the parameter type of @g@.
    811 Finally, in the call to @h@, @x@ is flattened to yield an argument list of length 3, of which the first component of @x@ is passed as the first parameter of @h@, and the second component \textcolor{blue}{CHANGE ``components'' TO ``component''} of @x@ and @y@ are structured into the second argument of type @[int, int]@.
    812 The flexible structure of tuples permits a simple and expressive function call syntax to work seamlessly with both SRVFs and MRVFs \textcolor{blue}{REMOVE ``and''} with any number of arguments of arbitrarily complex structure.
     807Finally, in the call to @h@, @x@ is flattened to yield an argument list of length 3, of which the first component of @x@ is passed as the first parameter of @h@, and the second component of @x@ and @y@ are structured into the second argument of type @[int, int]@.
     808The flexible structure of tuples permits a simple and expressive function call syntax to work seamlessly with both SRVFs and MRVFs with any number of arguments of arbitrarily complex structure.
    813809
    814810
    815811\subsection{Tuple assignment}
    816812
     813\enlargethispage{-10pt}
    817814An assignment where the left side is a tuple type is called \newterm{tuple assignment}.
    818815There are two kinds of tuple assignment depending on whether the right side of the assignment operator has a tuple type or a nontuple type, called \newterm{multiple} and \newterm{mass assignment}, respectively.
     
    828825Both kinds of tuple assignment have parallel semantics, so that each value on the left and right sides is evaluated before any assignments occur.
    829826As a result, it is possible to swap the values in two variables without explicitly creating any temporary variables or calling a function, \eg, @[x, y] = [y, x]@.
    830 This semantics means mass assignment differs from C cascading
    831 \newpage
    832 assignment (\eg @a = b = c@) in that conversions are applied in each individual assignment, which prevents data loss from the chain of conversions that can happen during a cascading assignment.
     827This semantics means mass assignment differs from C cascading assignment (\eg @a = b = c@) in that conversions are applied in each individual assignment, which prevents data loss from the chain of conversions that can happen during a cascading assignment.
    833828For example, @[y, x] = 3.14@ performs the assignments @y = 3.14@ and @x = 3.14@, yielding @y == 3.14@ and @x == 3@, whereas C cascading assignment @y = x = 3.14@ performs the assignments @x = 3.14@ and @y = x@, yielding @3@ in @y@ and @x@.
    834829Finally, tuple assignment is an expression where the result type is the type of the left-hand side of the assignment, just like all other assignment expressions in C.
     
    857852[int, int, int] y = x.[2, 0, 2];                        $\C{// duplicate: [y.0, y.1, y.2] = [x.2, x.0.x.2]}$
    858853\end{cfa}
    859 It is also possible for a member access to contain other member accesses. \textcolor{blue}{REMOVE ``, as follows.''}
     854It is also possible for a member access to contain other member accesses.
    860855\begin{cfa}
    861856struct A { double i; int j; };
     
    969964Since nothing is known about a parameter pack by default, assertion parameters are key to doing anything meaningful.
    970965Unlike variadic templates, @ttype@ polymorphic functions can be separately compiled.
    971 For example, the following is a \textcolor{blue}{CHANGE ``As an example, we have the following'' TO ``For example, the following is a''} generalized @sum@ function.
     966For example, the following is a generalized @sum@ function.
    972967\begin{cfa}
    973968int sum$\(_0\)$() { return 0; }
     
    1003998Unlike C variadic functions, it is unnecessary to hard code the number and expected types.
    1004999Furthermore, this code is extendable for any user-defined type with a @?+?@ operator.
    1005 Summing \textcolor{blue}{REMOVE ``up''} arbitrary heterogeneous lists is possible with similar code by adding the appropriate type variables and addition operators.
     1000Summing arbitrary heterogeneous lists is possible with similar code by adding the appropriate type variables and addition operators.
    10061001
    10071002It is also possible to write a type-safe variadic print function to replace @printf@:
     
    10391034Tuples are implemented in the \CFA translator via a transformation into \newterm{generic types}.
    10401035For each $N$, the first time an $N$-tuple is seen in a scope, a generic type with $N$ type parameters is generated.
    1041 For example, the following \textcolor{blue}{CHANGE ``, as follows:'' TO ``For example, the following''}
     1036For example, the following
    10421037\begin{cfa}
    10431038[int, int] f() {
     
    15191514\end{cfa}
    15201515
    1521 \textcolor{blue}{PARAGRAPH INDENT} Finally, \CFA provides a Java-like  @finally@ clause after the catch clauses.
     1516Finally, \CFA provides a Java-like  @finally@ clause after the catch clauses.
    15221517\begin{cfa}
    15231518try {
     
    16551650
    16561651C declaration syntax is notoriously confusing and error prone.
    1657 For example, many C programmers are confused by a declaration as simple as the following. \textcolor{blue}{CHANGE ``simple a declaration as in'' TO ``declaration as simple as''}
     1652For example, many C programmers are confused by a declaration as simple as the following.
    16581653\begin{cquote}
    16591654\lstDeleteShortInline@%
     
    17091704% Specifically, the character @*@ is used to indicate a pointer, square brackets @[@\,@]@ are used to represent an array or function return value, and parentheses @()@ are used to indicate a function parameter.
    17101705However, unlike C, \CFA type declaration tokens are distributed across all variables in the declaration list.
    1711 For instance, variables @x@ and @y@ of type pointer to integer are defined in \CFA as \textcolor{blue}{REMOVE ``follows.''}
     1706For instance, variables @x@ and @y@ of type pointer to integer are defined in \CFA as
    17121707\begin{cquote}
    17131708\lstDeleteShortInline@%
     
    19591954Since \CFA in not object oriented, adopting dynamic scoping does not make sense;
    19601955instead, \CFA adopts \CC static nesting, using the member-selection operator ``@.@'' for type qualification, as does Java, rather than the \CC type-selection operator ``@::@'' (see Figure~\ref{f:TypeNestingQualification}).
     1956In the C left example, types @C@, @U@ and @T@ are implicitly hoisted outside of type @S@ into the containing block scope.
     1957In the \CFA right example, the types are not hoisted and accessible.
    19611958
    19621959\begin{figure}
     
    20282025\vspace*{-8pt}
    20292026\end{figure}
    2030 
    2031 In the C left example, types @C@, @U@ and @T@ are implicitly hoisted outside of type @S@ into the containing block scope.
    2032 In the \CFA right example, the types are not hoisted and accessible.
    20332027
    20342028
     
    20662060For details of the code-generation placement of implicit constructor and destructor calls among complex executable statements, see section~2.2 in the work of Schlintz~\cite{Schluntz17}.
    20672061
    2068 \CFA also provides syntax for \newterm{initialization} and \newterm{copy}. \textcolor{blue}{REMOVE ``, as follows''}
     2062\CFA also provides syntax for \newterm{initialization} and \newterm{copy}.
    20692063\begin{cfa}
    20702064void ?{}( VLA & vla, int size, char fill = '\0' ) {  $\C{// initialization}$
     
    21312125
    21322126A simple example is allowing the underscore, as in Ada, to separate prefixes, digits, and suffixes in all \CFA constants, \eg @0x`_`1.ffff`_`ffff`_`p`_`128`_`l@, where the underscore is also the standard separator in C identifiers.
    2133 \CC uses a single quote as a separator, but it is restricted among digits, precluding its use in the literal prefix or suffix, \eg @0x1.ffff@@`'@@ffffp128l@, and causes problems with most \textcolor{blue}{Q2 CHANGE ``IDEs'' TO ``integrated development environments (IDEs)''}, which must be extended to deal with this alternate use of the single quote.
     2127\CC uses a single quote as a separator, but it is restricted among digits, precluding its use in the literal prefix or suffix, \eg @0x1.ffff@@`'@@ffffp128l@, and causes problems with most integrated development environments (IDEs), which must be extended to deal with this alternate use of the single quote.
    21342128
    21352129
     
    22032197y = "12345678901234567890123456789"|`mp| + "12345678901234567890123456789"|`mp|;
    22042198\end{cfa}
    2205 Because \CFA uses a standard function, all types and literals are applicable, as well as overloading and conversions, where @?`@ \textcolor{blue}{USE CHARACTER \lstinline@`@ NOT \textsf{'}} denotes a postfix-function name and @`@ \textcolor{blue}{USE CHARACTER \lstinline@`@ NOT `} denotes a postfix-function call.
     2199Because \CFA uses a standard function, all types and literals are applicable, as well as overloading and conversions, where @?`@ denotes a postfix-function name and @`@ denotes a postfix-function call.
    22062200}%
    22072201\begin{cquote}
     
    23452339\lstMakeShortInline@%
    23462340\end{cquote}
    2347 The result is a significant reduction in names to access typed constants. \textcolor{blue}{REMOVE ``, as follows.''}
     2341The result is a significant reduction in names to access typed constants.
    23482342\begin{cquote}
    23492343\lstDeleteShortInline@%
     
    23902384\lstMakeShortInline@%
    23912385\end{cquote}
    2392 The result is a significant reduction in names to access math functions. \textcolor{blue}{REMOVE ``, as follows.''}
     2386The result is a significant reduction in names to access math functions.
    23932387\begin{cquote}
    23942388\lstDeleteShortInline@%
     
    24372431\lstMakeShortInline@%
    24382432\end{cquote}
    2439 The result is a significant reduction in names to access the utility functions. \textcolor{blue}{REMOVE ``, as follows.''}
     2433The result is a significant reduction in names to access the utility functions.
    24402434\begin{cquote}
    24412435\lstDeleteShortInline@%
     
    24582452In addition, there are polymorphic functions, like @min@ and @max@, that work on any type with operator @?<?@ or @?>?@.
    24592453
    2460 The following shows one example where \CFA \textcolor{blue}{ADD SPACE} \emph{extends} an existing standard C interface to reduce complexity and provide safety.
     2454The following shows one example where \CFA \emph{extends} an existing standard C interface to reduce complexity and provide safety.
    24612455C/\Celeven provide a number of complex and overlapping storage-management operations to support the following capabilities.
    24622456\begin{list}{}{\itemsep=0pt\parsep=0pt\labelwidth=0pt\leftmargin\parindent\itemindent-\leftmargin\let\makelabel\descriptionlabel}
     
    26492643\label{s:MultiPrecisionIntegers}
    26502644
    2651 \CFA has an interface to the \textcolor{blue}{Q3 CHANGE ``GMP multiprecision'' TO ``GNU multiple precision (GMP)''} signed integers~\cite{GMP}, similar to the \CC interface provided by GMP.
     2645\CFA has an interface to the GNU multiple precision (GMP) signed integers~\cite{GMP}, similar to the \CC interface provided by GMP.
    26522646The \CFA interface wraps GMP functions into operator functions to make programming with multiprecision integers identical to using fixed-sized integers.
    26532647The \CFA type name for multiprecision signed integers is @Int@ and the header file is @gmp@.
     
    27422736Figure~\ref{fig:eval} and Table~\ref{tab:eval} show the results of running the benchmark in Figure~\ref{fig:BenchmarkTest} and its C, \CC, and \CCV equivalents.
    27432737The graph plots the median of five consecutive runs of each program, with an initial warm-up run omitted.
    2744 All code is compiled at \texttt{-O2} by gcc or g++ 6.4.0, with all \CC code compiled as \CCfourteen. \textcolor{blue}{CHANGE ``\CC{}fourteen'' TO ``\CCfourteen''}
    2745 The benchmarks are run on an Ubuntu 16.04 workstation with 16 GB of RAM and a 6-core AMD FX-6300 CPU with 3.5 GHz \textcolor{blue}{REMOVE ``of''} maximum clock frequency.
     2738All code is compiled at \texttt{-O2} by gcc or g++ 6.4.0, with all \CC code compiled as \CCfourteen.
     2739The benchmarks are run on an Ubuntu 16.04 workstation with 16 GB of RAM and a 6-core AMD FX-6300 CPU with 3.5 GHz maximum clock frequency.
    27462740
    27472741\begin{figure}
     
    27702764\end{table}
    27712765
     2766\enlargethispage{-10pt}
    27722767The C and \CCV variants are generally the slowest with the largest memory footprint, due to their less-efficient memory layout and the pointer indirection necessary to implement generic types;
    27732768this inefficiency is exacerbated by the second level of generic types in the pair benchmarks.
     
    28602855Tuples are a generalization of @std::pair@, in that they allow for arbitrary length, fixed-size aggregation of heterogeneous values.
    28612856Operations include @std::get<N>@ to extract values, @std::tie@ to create a tuple of references used for assignment, and lexicographic comparisons.
    2862 \CCseventeen \textcolor{blue}{CHANGE ``\CC{}seventeen TO ``\CCseventeen''} proposes \emph{structured bindings}~\cite{Sutter15} to eliminate predeclaring variables and the use of @std::tie@ for binding the results.
     2857\CCseventeen proposes \emph{structured bindings}~\cite{Sutter15} to eliminate predeclaring variables and the use of @std::tie@ for binding the results.
    28632858This extension requires the use of @auto@ to infer the types of the new variables; hence, complicated expressions with a nonobvious type must be documented with some other mechanism.
    28642859Furthermore, structured bindings are not a full replacement for @std::tie@, as it always declares new variables.
  • doc/user/user.tex

    r341bb80 r6d44da1  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Thu Jul 26 17:29:05 2018
    14 %% Update Count     : 3366
     13%% Last Modified On : Fri Aug 31 07:54:50 2018
     14%% Update Count     : 3396
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    210210Even with all its problems, C continues to be popular because it allows writing software at virtually any level in a computer system without restriction.
    211211For system programming, where direct access to hardware, storage management, and real-time issues are a requirement, C is usually the only language of choice.
    212 The TIOBE index~\cite{TIOBE} for July 2018 ranks the top 5 most \emph{popular} programming languages as: \Index*{Java} 16\%, C 14\%, \Index*[C++]{\CC{}} 7.5\%, Python 6\%, Visual Basic 4\% = 47.5\%, where the next 50 languages are less than 4\% each, with a long tail.
     212The TIOBE index~\cite{TIOBE} for July 2018 ranks the top five most \emph{popular} programming languages as \Index*{Java} 16\%, C 14\%, \Index*[C++]{\CC{}} 7.5\%, Python 6\%, Visual Basic 4\% = 47.5\%, where the next 50 languages are less than 4\% each, with a long tail.
    213213The top 3 rankings over the past 30 years are:
    214214\begin{center}
     
    351351The 2011 C standard plus GNU extensions.
    352352\item
    353 \Indexc[deletekeywords=inline]{-fgnu89-inline}\index{compilation option!-fgnu89-inline@{\lstinline[deletekeywords=inline]@-fgnu89-inline@}}
     353\Indexc[deletekeywords=inline]{-fgnu89-inline}\index{compilation option!-fgnu89-inline@{\lstinline[deletekeywords=inline]$-fgnu89-inline$}}
    354354Use the traditional GNU semantics for inline routines in C11 mode, which allows inline routines in header files.
    355355\end{description}
     
    455455#endif
    456456
    457 ®#include_next <bfdlink.h>                                      §\C{// must have internal check for multiple expansion}§
     457®#include_next <bfdlink.h>                      §\C{// must have internal check for multiple expansion}§
    458458®
    459459#if defined( with ) && defined( __CFA_BFD_H__ ) §\C{// reset only if set}§
     
    504504
    505505C, \CC, and Java (and many other programming languages) have no exponentiation operator\index{exponentiation!operator}\index{operator!exponentiation}, \ie $x^y$, and instead use a routine, like \Indexc{pow}, to perform the exponentiation operation.
    506 \CFA extends the basic operators with the exponentiation operator ©?\?©\index{?\\?@\lstinline@?\?@} and ©?\=?©\index{?\\=?@\lstinline@?\=?@}, as in, ©x \ y© and ©x \= y©, which means $x^y$ and $x \leftarrow x^y$.
     506\CFA extends the basic operators with the exponentiation operator ©?\?©\index{?\\?@©?\?©} and ©?\=?©\index{?\\=?@©\=?©}, as in, ©x \ y© and ©x \= y©, which means $x^y$ and $x \leftarrow x^y$.
    507507The priority of the exponentiation operator is between the cast and multiplicative operators, so that ©w * (int)x \ (int)y * z© is parenthesized as ©((w * (((int)x) \ ((int)y))) * z)©.
    508508
     
    516516256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i
    517517\end{cfa}
    518 Parenthesis are necessary for the complex constants or the expression is parsed as ©1.0f+(2.0fi \ 3.0f)+2.0fi©.
     518Parenthesis are necessary for complex constants or the expression is parsed as ©1.0f+®(®2.0fi \ 3.0f®)®+2.0fi©.
    519519The exponentiation operator is available for all the basic types, but for user-defined types, only the integral-computation versions are available.
    520520For returning an integral value, the user type ©T© must define multiplication, ©*©, and one, ©1©;
     
    527527
    528528
    529 %\subsection{\texorpdfstring{\protect\lstinline@if@ Statement}{if Statement}}
    530 \subsection{\texorpdfstring{\LstKeywordStyle{if} Statement}{if Statement}}
    531 
    532 The ©if© expression allows declarations, similar to ©for© declaration expression:
    533 \begin{cfa}
    534 if ( int x = f() ) ...                                          §\C{// x != 0}§
    535 if ( int x = f(), y = g() ) ...                         §\C{// x != 0 \&\& y != 0}§
    536 if ( int x = f(), y = g(); ®x < y® ) ...        §\C{// relational expression}§
    537 \end{cfa}
    538 Unless a relational expression is specified, each variable is compared not equal to 0, which is the standard semantics for the ©if© expression, and the results are combined using the logical ©&&© operator.\footnote{\CC only provides a single declaration always compared not equal to 0.}
     529%\subsection{\texorpdfstring{\protect\lstinline@if@/\protect\lstinline@while@ Statement}{if Statement}}
     530\subsection{\texorpdfstring{\LstKeywordStyle{if}/\LstKeywordStyle{while} Statement}{if/while Statement}}
     531
     532The ©if©/©while© expression allows declarations, similar to ©for© declaration expression.
     533(Does not make sense for ©do©-©while©.)
     534\begin{cfa}
     535if ( ®int x = f()® ) ...                                        §\C{// x != 0}§
     536if ( ®int x = f(), y = g()® ) ...                       §\C{// x != 0 \&\& y != 0}§
     537if ( ®int x = f(), y = g(); x < y® ) ...        §\C{// relational expression}§
     538if ( ®struct S { int i; } x = { f() }; x.i < 4® ) §\C{// relational expression}§
     539
     540while ( ®int x = f()® ) ...                                     §\C{// x != 0}§
     541while ( ®int x = f(), y = g()® ) ...            §\C{// x != 0 \&\& y != 0}§
     542while ( ®int x = f(), y = g(); x < y® ) ... §\C{// relational expression}§
     543while ( ®struct S { int i; } x = { f() }; x.i < 4® ) ... §\C{// relational expression}§
     544\end{cfa}
     545Unless a relational expression is specified, each variable is compared not equal to 0, which is the standard semantics for the ©if©/©while© expression, and the results are combined using the logical ©&&© operator.\footnote{\CC only provides a single declaration always compared not equal to 0.}
    539546The scope of the declaration(s) is local to the @if@ statement but exist within both the ``then'' and ``else'' clauses.
     547
     548
     549%\subsection{\texorpdfstring{\protect\lstinline@for@ Statement}{for Statement}}
     550\subsection{\texorpdfstring{\LstKeywordStyle{for} Statement}{for Statement}}
     551
     552The ©for©/©while©/©do-while© loop-control allows empty or simplified ranges.
     553An empty conditional implies ©1©.
     554The up-to range ©~©\index{~@©~©} means exclusive range [M,N);
     555the up-to range ©~=©\index{~=@©~=©} means inclusive range [M,N].
     556The down-to range ©-~©\index{-~@©-~©} means exclusive range [N,M);
     557the down-to range ©-~=©\index{-~=@©-~=©} means inclusive range [N,M].
     558©0© is the implicit start value;
     559©1© is the implicit increment value for an up-to range and ©-1© for an implicit down-to range.
     560The loop index is polymorphic in the type of the start value or comparison value when start is implicitly ©0©.
     561\begin{cquote}
     562\begin{tabular}{@{}ll|l@{}}
     563\multicolumn{2}{c|}{for control} & \multicolumn{1}{c}{output} \\
     564\hline
     565\begin{cfa}
     566while ®()® { sout | "empty"; break; }
     567do { sout | "empty"; break; } while ®()®;
     568for ®()® { sout | "empty"; break; }
     569for ( ®0® ) { sout | "A"; }
     570for ( ®1® ) { sout | "A"; }
     571for ( ®10® ) { sout | "A"; }
     572for ( ®1 ~= 10 ~ 2® ) { sout | "B"; }
     573for ( ®10 -~= 1 ~ -2® ) { sout | "C"; }
     574for ( ®0.5 ~ 5.5® ) { sout | "D"; }
     575for ( ®5.5 -~ 0.5® ) { sout | "E"; }
     576for ( ®i; 10® ) { sout | i; }
     577for ( ®i; 1 ~= 10 ~ 2® ) { sout | i; }
     578for ( ®i; 10 -~= 1 ~ -2® ) { sout | i; }
     579for ( ®i; 0.5 ~ 5.5® ) { sout | i; }
     580for ( ®i; 5.5 -~ 0.5® ) { sout | i; }
     581for ( ®ui; 2u ~= 10u ~ 2u® ) { sout | ui; }
     582for ( ®ui; 10u -~= 2u ~ -2u® ) { sout | ui; }
     583int start = 3, comp = 10, inc = 2;
     584for ( ®i; start ~ comp ~ inc + 1® ) { sout | i; }
     585\end{cfa}
     586&
     587\begin{cfa}
     588sout | endl;
     589sout | endl;
     590sout | endl;
     591sout | endl;
     592sout | endl;
     593sout | endl;
     594sout | endl;
     595sout | endl;
     596sout | endl;
     597sout | endl;
     598sout | endl;
     599sout | endl;
     600sout | endl;
     601sout | endl;
     602sout | endl;
     603sout | endl;
     604sout | endl;
     605
     606sout | endl;
     607\end{cfa}
     608&
     609\begin{cfa}
     610empty
     611empty
     612empty
     613
     614A
     615A A A A A A A A A A
     616B B B B B
     617C C C C C
     618D D D D D
     619E E E E E
     6200 1 2 3 4 5 6 7 8 9
     6211 3 5 7 9
     62210 8 6 4 2
     6230.5 1.5 2.5 3.5 4.5
     6245.5 4.5 3.5 2.5 1.5
     6252 4 6 8 10
     62610 8 6 4 2
     627
     6283 6 9
     629\end{cfa}
     630\end{tabular}
     631\end{cquote}
    540632
    541633
     
    800892
    801893
     894% for ()  => for ( ;; )
     895% for ( 10 - t ) => for ( typeof(10 - t) ? = 0 ; ? < 10 - t; ? += 1 ) // using 0 and 1
     896% for ( i ; 10 - t ) => for ( typeof(10 - t) i = 0 ; i < 10 - t; i += 1 ) // using 0 and 1
     897% for ( T i ; 10 - t ) => for ( T i = 0 ; i < 10 - t; i += 1 ) // using 0 and 1
     898% for ( 3~9 ) => for ( int ? = 3 ; ? < 9; ? += 1 ) // using 1
     899% for ( i ; 3~9 ) => for ( int i = 3 ; i < 9; i += 1 ) // using 1
     900% for ( T i ; 3~9 ) => for ( T i = 3 ; i < 9; i += 1 ) // using 1
     901
     902
    802903%\subsection{\texorpdfstring{Labelled \protect\lstinline@continue@ / \protect\lstinline@break@}{Labelled continue / break}}
    803904\subsection{\texorpdfstring{Labelled \LstKeywordStyle{continue} / \LstKeywordStyle{break} Statement}{Labelled continue / break Statement}}
     
    805906While C provides ©continue© and ©break© statements for altering control flow, both are restricted to one level of nesting for a particular control structure.
    806907Unfortunately, this restriction forces programmers to use \Indexc{goto} to achieve the equivalent control-flow for more than one level of nesting.
    807 To prevent having to switch to the ©goto©, \CFA extends the \Indexc{continue}\index{continue@\lstinline@continue@!labelled}\index{labelled!continue@©continue©} and \Indexc{break}\index{break@\lstinline@break@!labelled}\index{labelled!break@©break©} with a target label to support static multi-level exit\index{multi-level exit}\index{static multi-level exit}~\cite{Buhr85}, as in Java.
     908To prevent having to switch to the ©goto©, \CFA extends the \Indexc{continue}\index{continue@©continue©!labelled}\index{labelled!continue@©continue©} and \Indexc{break}\index{break@©break©!labelled}\index{labelled!break@©break©} with a target label to support static multi-level exit\index{multi-level exit}\index{static multi-level exit}~\cite{Buhr85}, as in Java.
    808909For both ©continue© and ©break©, the target label must be directly associated with a ©for©, ©while© or ©do© statement;
    809910for ©break©, the target label can also be associated with a ©switch©, ©if© or compound (©{}©) statement.
     
    890991\end{figure}
    891992
    892 Both labelled ©continue© and ©break© are a ©goto©\index{goto@\lstinline@goto@!restricted} restricted in the following ways:
     993Both labelled ©continue© and ©break© are a ©goto©\index{goto@©goto©!restricted} restricted in the following ways:
    893994\begin{itemize}
    894995\item
Note: See TracChangeset for help on using the changeset viewer.