The latest Tweets from Coley Forest (@c). Woodland wanderer and wild forest gardener. Runs on music and photosynthesis. United States. This is a generic function which combines its arguments. The default method combines its arguments to form a vector. All arguments are coerced to a common.
Wikibooks Contributors Present:
C Programming
C Programming
Table of Contents[edit]
This book is intended for intermediate readers. |
A PDF version is available. (info) |
A printable version of C Programming is available. (edit it) |
An E-Book Reader optimized PDF Version is available. |
Introduction[edit]
- Why Learn C?
- History
- What you need before you can learn
- Obtaining a Compiler
Beginning C[edit]
- Intro Exercise
- Preliminaries
- Basics of Compilation
- Programming Structure and Style
- Variables
- Simple Input and Output
- Operators and type casting
- Arrays and Strings
- Program Flow Control
- Procedures and Functions
- Standard Libraries
- Exercises
Intermediate C[edit]
- Advanced Data Types
- Pointers and Relationship to Arrays
- Memory Management
- Error Handling
- Stream I/O
- String Manipulation
- Further Math
- Libraries
Advanced C[edit]
- Common Practices
- Preprocessor Directives and Macros
- Sockets and Networking (UNIX)
- Serialization and X-Macros
- Coroutines
C and Beyond[edit]
- Particularities of C
- Low-level I/O
- C Trigraph
- Language Overloading and Extensions
- Combining Languages
- Object Oriented Programming: The GObject System
- Commented Source Code Library
Computer Science[edit]
Some of the following are C adaptations of articles from the Computer programming book.
- Statements
- Side Effects and Sequence Points
Reference Tables[edit]
This section has some tables and lists of C entities.
- Standard Library Reference
- Preprocessor Reference
- Language Reference
Platform Reference[edit]
- POSIX
- GNU C Library
- MS Windows
Appendices[edit]
- C Compilers Reference List
- Index
- Links
- Exercise Solutions
Related Wikibooks[edit]
Retrieved from 'https://en.wikibooks.org/w/index.php?title=C_Programming&oldid=3584977'
Paradigm | imperative |
---|---|
Designed by | Simon Peyton Jones and Norman Ramsey |
First appeared | 1997 |
Typing discipline | static, weak |
Website | https://www.cs.tufts.edu/~nr/c--/index.html |
Influenced by | |
C |
C-- (pronouncedcee minus minus) is a C-like programming language. Its creators, functional programming researchers Simon Peyton Jones and Norman Ramsey[1][2], designed it to be generated mainly by compilers for very high-level languages rather than written by human programmers. Unlike many other intermediate languages, its representation is plain ASCII text, not bytecode or another binary format.
Design[edit]
C-- is a 'portable assembly language', designed to ease the task of implementing a compiler which produces high quality machine code. This is done by having the compiler generate C-- code, delegating the harder work of low-level code generation and optimisation to a C-- compiler.
Work on C-- began in the late 1990s. Since writing a custom code generator is a challenge in itself, and the compiler back ends available to researchers at that time were complex and poorly documented, several projects had written compilers which generated C code (for instance, the original Modula-3 compiler). However, C is a poor choice for functional languages: it does not guarantee tail call optimization, or support accurate garbage collection or efficient exception handling. C-- is a simpler, tightly-defined alternative to C which does support all of these things. Its most innovative feature is a run-time interface which allows writing of portable garbage collectors, exception handling systems and other run-time features which work with any C-- compiler.
The language's syntax borrows heavily from C. It omits or changes standard C features such as variadic functions, pointersyntax, and aspects of C's type system, because they hamper certain essential features of C-- and the ease with which code-generation tools can produce it.
The name of the language is an in-joke, indicating that C-- is a reduced form of C, in the same way that C++ is basically an expanded form of C. (In C-like languages, '--' and '++' are operators meaning 'decrement' and 'increment'.)
C-- is a target platform for the Glasgow Haskell Compiler.[3] Some of C--'s developers, including Simon Peyton Jones, João Dias, and Norman Ramsey, work or have worked on the Glasgow Haskell Compiler.
Type system[edit]
The C-- type system is deliberately designed to reflect constraints imposed by hardware rather than conventions imposed by higher-level languages. In C--, a value stored in a register or memory may have only one type: bit vector. However, bit vector is a polymorphic type and may come in several widths, e.g., bits8, bits32, or bits64. In addition to the bit-vector type, C-- also provides a Boolean type bool, which can be computed by expressions and used for control flow but cannot be stored in a register or in memory. As in an assembly language, any higher type discipline, such as distinctions between signed, unsigned, float, and pointer, is imposed by the C-- operators or other syntactic constructs in the language.
See also[edit]
References[edit]
- ^Nordin, Thomas; Jones, Simon Peyton; Iglesias, Pablo Nogueira; Oliva, Dino (1998-04-23). 'The C– Language Reference Manual'.Cite journal requires
|journal=
(help) - ^Reig, Fermin; Ramsey, Norman; Jones, Simon Peyton (1999-01-01). 'C–: a portable assembly language that supports garbage collection'.Cite journal requires
|journal=
(help) - ^'An improved LLVM backend'.
External links[edit]
Retrieved from 'https://en.wikipedia.org/w/index.php?title=C--&oldid=912753454'