CeeSpot, or "c." is a program run as a Linux or UNIX command
interpreter using
the #!/usr/bin/ceespot or #!/bin/c. syntax.
After eating (and interpreting) any # comments at the beginning of the
file,
it compiles the rest and executes the result. This lets you
use a compiled
language as a script file. This is plausible now that
machines and compilers
are fast enough you don't notice a subsecond compile and link.
Go to the project page on SourceForge, here
This is a twisted hack. :-).
Some examples:
::::::::::::::
hello-c
::::::::::::::
#!/usr/bin/ceespot
#include <stdio.h>
int main(int argc, char **argv)
{
printf("hello, world\n");
return 0;
}
::::::::::::::
hello-cxx
::::::::::::::
#!/usr/bin/ceespot
# CC = g++
#include <iostream>
using namespace std;
int main( int argc, char **argv )
{
cout << "hello, world\n";
return 0;
}
::::::::::::::
hello-gcj
::::::::::::::
#!/usr/bin/ceespot
# CC = gcj
# CEXT = java
# CFLAGS = --main=Hello
class Hello {
public static void
main(String[] args) {
System.out.println("Hello, world!");
}
}
::::::::::::::
hello-x
::::::::::::::
#!/usr/bin/ceespot
# CFLAGS = -L/usr/X11R6/lib -lX11 -lXaw
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xaw/Label.h>
main(int argc,char **argv)
{
XtAppContext app_context;
Widget toplevel,hello;
toplevel = XtVaAppInitialize(&app_context,"XHello",NULL,0,
&argc,argv,NULL,NULL);
hello = XtVaCreateManagedWidget("Hello World!",labelWidgetClass,
toplevel,(void*)0);
XtRealizeWidget(toplevel);
XtAppMainLoop(app_context);
return 0;
}