Cecil & Vortex FAQ

Q: How do I get the system installed initially?


Q: I'd like to experiment writing simple Cecil programs, to play around with its cool language features. How can I do this easily?

A: See $VORTEX_HOME/notes/QUICK-START-CECIL for instructions on running and using the Cecil read-eval-print interpreter. To write larger programs or to experiment with the typechecker, see the next two questions and answers.

Q: Now how do I compile a simple program using Vortex?

A: See $VORTEX_HOME/notes/QUICK-START-VORTEX. Also read the "How to Use the Vortex Compiler" document, available as $VORTEX_HOME/doc/vortex.ps or in HTML, postscript, or compressed postscript format from the Cecil/Vortex project web page from where the distribution was downloaded, explaining how to use Vortex.

Q: Wow, that was fantastic. How can I write my own Cecil program?

A: Write a file of Cecil code, and then compile it like towers.tst was compiled before. $VORTEX_HOME/Cecil/src/tests is a standard place for putting little test files. Larger programs can go in $VORTEX_HOME/Cecil/src/contrib or eventually in their own directory in $VORTEX_HOME/Cecil/src.

Q: I timed the execution of a little Cecil program I wrote, and it's really slow. What's the deal?

A: Benchmarking Vortex-compiled Cecil programs is non-trivial. In general, one should compile programs with full optimization (using the o2 Vortex option, for example) and with the library specialized for the application (by setting use_shared_libraries to false). This will usually get reasonable performance. Better performance can be had by profiling the application program and then recompiling the program using the program's profile data. The document "Performance Evaluation of Vortex-Compiled Programs", available in HTML, postscript, or compressed postscript code on the Cecil/Vortex project web page from where the distribution was downloaded, describes these issues in greater detail.

Q: I'd like to call some C or C++ code from my Cecil program. How can I do it?

A: The basic idea is to write a Cecil method whose body is something like "prim c_++ { ... }". Inside the braces can be arbitrary C/C++ code, such as calls out to other files. To get header files included first, at the top-level before your primitive method, add a "prim c_++ { ... };" global declaration; inside the braces can go whatever you'd normally put at the top-level before writing your C++ function, e.g. a #include directive. See examples in the existing Cecil standard library.

The tricky part is converting between Cecil-format arguments and C/C++ format data values. Each formal parameter of a Cecil argument has C++ type OOP, i.e. a tagged pointer value. Operations on OOPs (such as testing their type, extracting fields or elements, and converting to lower-level C/C++ types) may be found in $VORTEX_HOME/runtime/pic/src/oop.h.

Q: I have some other questions, but they're not answered here. What should I do?

A: Please send us email.

Cecil/Vortex Project