" /> Kazuho at Work: January 2006 Archives

« December 2005 | Main | February 2006 »

January 17, 2006

C - 0.04

Version 0.04 of the C - a pseudo-interpreter of the C programming language, has been released.

Download: tgz / RPM

Install the RPM, or manually install the tarball by configure && make && make install.

In version 0.04, a compile cache has been implemented, speeding up the execution of often-used scripts / oneliners. Also, the interpreter has now been rewritten in C. With these improvements, not only CPU-intensive tasks but even the most simple scripts such as hello-world runs faster than perl when executed by the pseudo-interpreter... well, from the second time, acutally :-p

Main Features of C-0.04 are:

+ supports for ANSI C / C++ (runs as a wrapper of GCC)
+ native-code execution speed
+ compile cache
+ support for debugging (calls GDB)

For the newest information of the C interpreter, see C Archives.

January 10, 2006

C - 0.02

C - a pseudo-interpreter of the C programming language has now been updated to version 0.02.

To install, cp C-0_02 /usr/bin/C && chmod 755 /usr/bin/C.

Following features have been added:


-m option:
Support for source codes with the main function. Source files downloaded from the Internet can directly be executed.

% C -m uuencode.c.txt ...

debugger support:
By using the -d option, gdb can be used for debugging.

man page
To install the man page, pod2man --section=1 --center="Cybozu Labs" --release="C-0.02" /usr/bin/C > /usr/share/man/man1/C.1

#option directive
Compile options can be specified from within source files by using the #option directive.
For example, #option -cWall is equivalent to gcc -Wall, or to use strict; of perl.

Have fun.

For the newest information of the C interpreter, see C Archives.

January 08, 2006

C - a pseudo-interpreter of the C programming language

In order to write one-liners in C, I created a tiny wrapper for GCC.

C (pronounced large-C) is a pseudo-interpreter of the C programming language.

Without the need of manual compilation, developers can rapidly create scripts or write one-liners using the C programming language that runs at native-code speed.

C, the pseudo-interpreter, has several advantages over other scripting languages, such as perl.

  • very fast (100x faster than perl when calculating fib(40))
  • easy handling of binary data
  • good for testing system calls and C APIs


To install,copy the downloaded file to /usr/bin, and chmod 755.

Below are some examples.

% C -e 'printf("hello world\n")'
hello world

% C -cO3 -e 'int fib(int i) { return i > 2 ? fib(i-1) + fib(i-2) : 1; } printf("%d\n", fib(40))'
102334155

% C -e 'int t, sum = 0; while (fread(&t, sizeof(int), 1, stdin) == 1) sum += t;printf("%d", sum)' < data
31289

% cat hello.C
#! /usr/bin/C

printf("hello world\n");

% ./hello.C
hello world

For the newest information of the C interpreter, see C Archives.