Jump to content

Ch (computer programming)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 68.125.129.169 (talk) at 07:27, 20 October 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Ch, pronounced as C H, is an embedded C/C++ interpreter. It extends C and C++ for scripting capability, numerical computing and cross platform 2D/3D plottings.

Features

C/C++ compatible interpreter

Ch supports 1999 ISO C Standard (C99) and C++ classes. It is superset of C with C++ class. C99 major features such as complex numbers, variable length arrays (VLAs), IEEE-754 floating-point arithmetic, generic mathematical functions in C99 are suppported. Wide characters in Addendum 1 for C90 is also supported.

Embeddable scripting

As a C/C++ interpreter, it is a nice fit as an embedded scripting engine for C/C++ applications.

Shell programming and cross-platform scripting

Ch is a C-compatible shell similar as C-shell (csh). It can be used as login shell as well. Ch has a built-in string type for auto memory allocation and de-allocation. It makes scripting easier.

2D/3D plotting and numerical computing

Ch has built-in 2D/3D graphical plotting features and computational arrays for numerical computing. Linear system equation b = A*x can be written verbatim in Ch.


Examples

"Hello, world!" in Ch

There are two ways to run Ch code. One is:

#!/bin/ch
 printf("Hello world!\n");

Another is:

   #!/bin/ch
   #include <stdio.h>
   int main() {
   printf("Hello world!\n");
   }

Numerical computing in Ch

2D/3D plotting in Ch

References