C--

C - (C minus minus ) is a very C-like programming language or intermediate language for generation by the compiler. The inventor of C -, Simon Peyton Jones and Norman Ramsey, both researchers in the field of functional programming, invented C - more for use as an intermediate language to machine code compiler for languages ​​of maximum rather than ' normal programmed " language. Unlike other intermediate languages ​​is C - ASCII text, not bytecode (eg, the intermediate code of Java) or other binary formats.

Design and history

C - is a "portable assembly language ", which is intended to simplify the implementation of a compiler that will produce very good machine code by the compiler simply generates C code --- and the low-level optimization and implementation a C compiler --- leaves.

Work on C - began in the late 1990s. Because writing a code generator itself is difficult, and the compiler backends then the researchers openly available, were complex and poorly documented, wrote many projects compiler, the C code generated ( the original Modula - 3 compiler worked so, as well as early versions of GHC). However, C is a bad language choice as an intermediate language for functional languages ​​; for example, supports C, no recursion, does not have garbage collection or an efficient exception handling. C - is a simpler, streamlined standardized language than C that has all these features. The biggest feature of C - is a runtime interface, which enables writing example of portable garbage collector, exception handling systems and other run -time extensions that run --- with any C compiler.

The syntax of C - leans heavily on the C. However, in some C syntax properties are removed or changed, such as variadic functions, pointer syntax, and aspects of the type system of C because they have certain basic features of C - disturb, and the simple producibility by compiler and code generators more difficult.

The name C - is basically an insider joke ( and - are used in C-like languages ​​for in-or decrementing ): C is a C-based language with advanced compared to C functions (C is shorthand for C = C 1), that is C - the C language with reduced functionality (C - is the shorthand notation for C = C - 1)).

C - is a target language of the Glasgow Haskell Compiler, an adaptation of the language could be the main target language. Some C --- developers, including Simon P. Jones, João Dias and Norman Ramsey who worked at Glasgow Haskell Compiler already.

Type System

As in many assembly languages ​​is any higher type discrimination, for example, between signed and unsigned, float, etc. only pointers introduced by the operators and other language constructs.

The C --- type system is intentionally designed so that it is the limitations of the hardware rather than reproduces the type systems of higher languages. In C - A value that is stored in a register or a memory cell that have only one type, namely a bit vector. A bit vector is a polymorphic type and can occur in different word widths, eg bits8, bits32 or bits64. In addition to the bit vector has C - also a Boolean type bool, although it can occur as a solution for expressions and can be used to control program flow, but can not be stored in a register or in memory.

Sphinx C -

The name C - was already used for an earlier programming language that was designed in the 1990s by Peter Cellik for x86 computers. Sphinx C - integrated x86 assembly elements in C.

157339
de