Significantly Prettier and Easier C++ Syntax

Significantly Prettier and Easier C++ Syntax

Significantly Prettier and Easier C++ Syntax or SPECS is an alternative syntactic binding for the semantics of C++.

Design

Designed by Ben Werther and Damian Conway, SPECS has a LALR(1) parsable grammar, which means it is significantly easier to parse than standard C++ syntax, both for computers and for humans alike. Also unlike standard C++ syntax, in SPECS declarations do not look like uses. For example, the fundamental C++ allocation control function set_new_handler has this declaration in orthodox C++ syntax: void (*set_new_handler(void (*)(void)))(void);which in SPECS becomes: func set_new_handler : (^(void->void) -> ^(void->void));and using typedefs in C++: typedef void (*new_handler)(void); new_handler set_new_handler(new_handler);and in SPECS: type new_handler : ^(void->void); func set_new_handler : (new_handler -> new_handler);

Apart from the declaration syntax change, the template syntax is changed to use < [ ] > brackets to make the template keyword unnecessary, several overloaded syntax elements are separated for clarity, := is used for assignment (instead of =), = is used for comparison (instead of =), blocks for if-, for- and while-statements are mandatory, and there is no fallthrough for switch-statements.

Analogous to the way SPECS is an alternative syntax to C++, other programming languages with alternative syntaxes include: assembly language (the AT&T assembler syntax, the Intel syntax, and the High Level Assembly syntax); also various literate programming languages and their non-literate form.Sometimes a natural language such as Uzbek language has more than one significantly different written form.

External links

* [http://citeseer.ist.psu.edu/cache/papers/cs/3742/http:zSzzSzwww.cs.monash.edu.auzSz~damianzSzpaperszSzPSzSzSPECS.pdf/the-design-and-implementation.pdf The Design and Implementation of: An Alternative C++ Syntax]
* [http://citeseer.ist.psu.edu/cache/papers/cs/3742/http:zSzzSzwww.cs.monash.edu.auzSz~damianzSzpaperszSzPSzSzModestProposal.pdf/werther96modest.pdf A Modest Proposal: C++ Resyntaxed] a shorter version which cites the above


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Damian Conway — (* 5. Oktober 1964 in Melbourne, Australien) ist ein australischer Informatikprofessor, Buchautor, prominenter Perl Programmierer und vielgefragter Redner auf Fachkonferenzen. Inhaltsverzeichnis …   Deutsch Wikipedia

  • Damian Conway — during his keynote at OSDC 2011 Born October 5, 1964 (1964 10 05) (age 47) …   Wikipedia

  • SPECS — may refer to:* the SPECS brand of speed camera used in the United Kingdom * Significantly Prettier and Easier C++ SyntaxSee also specs …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”