It works as advertised (you have to build it as part of the llvm tree, near clang) and it's amazingly cool:
llvm diciu$ ./Release+Asserts/bin/cling
**** Welcome to the cling prototype! ****
* Type C code and press enter to run it *
* Type .q, exit or ctrl+D to quit *
*****************************************
[cling]$ FILE * f = fopen("/dev/random", "r");
[cling]$ unsigned char rnd;
[cling]$ int i=0;
[cling]$ while(++i<10) { fread(&rnd, sizeof(rnd), 1, f); printf("%03d\n", rnd); }
201
161
186
086
056
092
125
063
203
[cling]$ .q

1 comments:
I can't get it to compile for me. After following instructions to get llvm I get the following error.
make[1]: Entering directory `/opt/cling/build/lib/Support'
llvm[1]: Compiling APFloat.cpp for Debug+Asserts build
In file included from /opt/cling/llvm/lib/Support/APFloat.cpp:15:
In file included from /opt/cling/llvm/include/llvm/ADT/APFloat.h:104:
In file included from /opt/cling/llvm/include/llvm/ADT/APInt.h:18:
In file included from /opt/cling/llvm/include/llvm/ADT/ArrayRef.h:13:
In file included from /opt/cling/llvm/include/llvm/ADT/SmallVector.h:17:
/opt/cling/llvm/include/llvm/Support/type_traits.h:20:10: fatal error:
'utility' file not found
#include
^
1 error generated.
Post a Comment