Presentation is loading. Please wait.

Presentation is loading. Please wait.

C-- The lowest "high level" language... even lower than C.

Similar presentations


Presentation on theme: "C-- The lowest "high level" language... even lower than C."— Presentation transcript:

1 C-- The lowest "high level" language... even lower than C.

2 C-- Background Background  C-- was developed by Gill Bates at MIT as a term project for a course on compilers.  The name "C--" is the grade he got in the course.

3 Description of C--  C-- is designed to be even more "low level" than C.  It gives the programmer direct access to the stack, access to registers of the CPU, and very low level memory management.

4 Language Progression C B Algol C with Classes C++ Objective C C# C+- ("C more or less") C-- ("less than C") Time Progress C-- is "orthogonal" to all other languages. Java

5 Distinctive Characteristics  A C-- program requires even more instructions than the same program written in assembly language.  In this respect, C-- is similar to COBOL.

6 Design Goals Goals were to give the programmer low-level control access to computer resources.  programmer can change things he should not touch.  machine independence is not a goal.  security is not a goal  abstraction is not a goal -- computer programs should look like computer programs

7 Characteristics Memory Management  Programmer must manage memory himself Type System  Weak type checking … even weaker than C.  No automatic type promotion Pointers and Referencing  C pointers look easy in comparison to C— Weak Polymorphism  C-- doesn’t verify arguments, so you can pass any values to a function. No function overloading. Everything is the Programmer’s Responsibility!

8 Run-Time Stack for Method Invocations Memory

9 Sample C-- Program: compute a+b #include float sum( ) { // no formal parameters! // you must manage the stack pointer yourself static unsigned int sp = getstackpointer( ); a = (int) getstack(sp); // get the first parameter b = (float) getstack(sp+4); // get the second parameter float sum; // definition only, no storage &sum = stackalloc(sp+8); // allocate storage yourself! sum = (float)a + b; // no automatic type conversion putstack(sp + 8, sum); // put return value on the stack returnto getstack(sp – 4); // jump to return addr from stack }

10 Contribution to Computer Languages  No contributions that I could find.  All links to "C--" on the WWW have been erased!

11 Useful Applications  Still used at MIT as punishment for student who cheat on projects. (Cheater must do senior project in C--)

12 Resources  http://www.cs.mit.edu/compilers/c-- [obsolete]


Download ppt "C-- The lowest "high level" language... even lower than C."

Similar presentations


Ads by Google