The C programming language has been around for a long time and is still used a lot nowadays. The core of the language is very solid, but other aspects are ...
The C programming language has been around for a long time and is still used a lot nowadays. The core of the language is very solid, but other aspects are showing their age. C2 attempts to modernize these parts, while keeping the feel of C. It should be seen as an evolution of C.
Bas van den Berg ()
C2 language
2014
3 / 37
Design
C2 Design goals
Higher development speed Same/better speed of execution Better compilation times Integrated build system Stricter syntax (easier for tooling) Great tooling (formatting tool, graphical refactoring tool) C2 programs can use C libraries (and vice-versa) Should be easy to learn for C programmers (evolution) Should support avoiding common mistakes
Bas van den Berg ()
C2 language
2014
4 / 37
Design
C2 Non-goals
higher-level features (garbage collection, classes, etc) completely new language
Bas van den Berg ()
C2 language
2014
5 / 37
Design
C improvement points
Lots of typing (header/forward declarations) Build system separate from language Variable syntax complex char *(*(**foo [][8])())[];
Bas van den Berg ()
C2 language
2014
6 / 37
Changes
From C to C2 No header files No forward declarations No includes necessary Integrated compiler option syntax Integrated Build system Compilation per target, not file Simplified type syntax Stricter error checking (uninitialized var usage is error) More built-in types (uint8,uint16,uint32,int8,int16,int32, ...) Some syntax cleanup ...
hello world.c2 module hello_world; import stdio as io; func int main(int argc, char*[] argv) { io.printf("Hello World!\n"); return 0; }
Spot the five differences...
Bas van den Berg ()
C2 language
2014
9 / 37
Concept: types
Example - Base Types types.c2 module types; public type Number int; type PNum int**; type IntArr int[20]; public type String const uint8*; type DoubleBufPtr DoubleBuf*; type DoubleBuf Buffer*[2];
All ’typedefs’ are uniform.. Bas van den Berg ()
C2 language
2014
10 / 37
Concept: types
Example - Function Types
function types.c2 module types; type CallBack func int(int a, utils.Point* p); type CBFunc func void (MyType* mt, ...); CBFunc[10] callbacks;
Note: declaring an array/pointer to function types requires to steps.
Register online at oasisanswers.com. Secure a spot ... practitioners and leadership, given dual licensure as an RN ... Kim is a registered nurse, with a Master of.
LIGHTING - If you are having a hard time seeing your work, then you need to let someone know and get something done about it. Stairways are a common problem area and require good lighting. EYE PROTECTION - It is too common to see workers who need eye
Jul 22, 2010 - A model programming language that promoted input, output as fundamental ... "Parallel composition of communicating sequential processes.".
... com puter s c i enc e. Ther e e x i s t s l i t t l e m at er i al o n t h e e f f e c t o n a programmer o f t h e fi r s t pr ogr am - . .... inserted preceding the application. c.
Jun 17, 2010 - 8. Aigaion. 10. Aiki Framework. 12. Asido. 13. Associate-O-Matic. 16. AutoTheme. 18 ..... webhosting providers started to include Adminer as MySQL managing tool into their portfolio of services. ...... Best Open Source solution.