An article published in IEEE Spectrum, June 2002

Ch Solves Portability Headaches

--- It lets you use new or legacy C code regardless of platform

by Professor Gary Wang, University of Manitoba

Several years ago I was developing an engineering expert system on a VAX min-computer. However, a SUN workstation using X-windows was hosting the maintenance interface of the system's knowledge base. With the VAX machine running the VMS operating system and the Sun running UNIX, I had two operating systems to worry about. I was often confused and had a hard time making my code work on both machines.

Soon after, I had to develop a production scheduling system on a Windows-based system. That meant learning Windows programming, which to me seemed a completely new language even though I was familiar with C syntax it is based on. Nowadays, Java, JavaScript, Perl, Python, VB, and other languages are popular.

But thanks to Ch language environment from SoftIntegration, Inc., I have far less to struggle with. Essentially a superset of C language interpreter, it is fully compatible with ISO C90 standard and independent to any platform. With Ch, I can program in C for my research and for web applications, without worrying about program portability or learning new programming languages. What's written for Unix can be immediately executed in Windows, and vice versa.

For my research, I write many programs for Unix; but I run the programs mainly on a Windows-based PC. Were it not for CH, it would be time-consuming as well as frustrating to port all my legacy Unix Programs to Windows.

I installed Ch Professional Edition, version 2.1, for Windows on my desktop. Every one of my legacy C/C++ programs worked gracefully on the PC without fuss of tweaking codes and without going through the tedious edit-compile-link-debug cycle. A program with a single .c file and multiple header files runs readily in Ch with on modification. One with multiple .c files and header files needs a simple separate command file that gives the names of all .c files for Ch, but the original source code does not require any modification.

Another rewarding feature is that Ch is also a genuine C shell. Beginners find it easy to use. If a students type "printf("Hello, World!")", Ch will print "Hello World!" on screen. This interactive mode really helps students learn C. In Windows, Ch enables over 100 Unix commands, including vi, ls, rm, awk, grep, and find, to interact with C code directly.

In addition, Ch provides many numerical analyses routines and plotting tools for scientific computation, similar to Matlab's. With Ch you can solve simultaneous and differential equations, Fourier transform, and so on, very quickly. Similarly, you can generate plots easily and display and print them out directly, or else export them in a variety of different file formats. A plot may even be generated as on the fly using a CGI script in a Web server for display in a Web browser. It can also be copied and pasted using, for example, Microsoft Word.

Students in disciplines other than computer science can just learn C and save their energies for their own disciplines without struggling with programming as well. Also, as an interpreter, Ch can save a lot of time during program development. It requires no compilation and linking and, because it is a compact language, just a few lines of code can perform many complex tasks.

As a C interpreter superset, Ch supports major features in the latest C standard, called C99, classes in C++, and standards such as Posix, X11/Motif, Open-GL, ODBC, and GTK+. Its built-in graphical support, CGI for Web servers, and numeric extensions make Ch very appealing. Computational arrays implemented in Ch as first-class objects and variable-length arrays are very useful for matrix computation and linear algebra. Advanced numerical analysis functions in Ch are as complete and simple as with Matlab, though the Ch toolkits for numeric features need to be expanded to be comparable to Matlab's in power and depth.

Scientists, engineers, and researchers will find Ch an environment in which they can easily and quickly prototype software and test new ideas, aided by many supporting tools in C, a programming language most of us already know. Contact: SoftIntegration, Inc., 216 F Street, # 68, Davis, CA 95616; phone, + 530 297 7398; fax, + 530 297 7392; email, sales@softintegration.com; Web, http://www.softintegration.com.


Note: "This material is presented to ensure timely dissemination of scholarly and technical work. Copyright and all rights therein are retained by authors or by other copyright holders. All persons copying this information are expected to adhere to the terms and constraints invoked by each author's copyright. In most cases, these works may not be reposted without the explicit permission of the copyright holder."