COFFEE (Cinema 4D)
COFFEE was a computer scripting language that forms part of CINEMA 4D, a proprietary 3D graphics application. Although presented as an acronym the letters of the word COFFEE allegedly stand for Cinema Object-oriented Fery Fast Environment Enhancer, it is primarily a comic reference to Java, a considerably more famous computer language.
COFFEE has been discontinued with Release 20 of Cinema 4D in 2018.
Purpose
Like most scripting languages, COFFEE is used to extend or modify the functionality of the host software. This technique is preferable to writing a so-called plug-in module using a traditional language such as C for a number of reasons, among them:- The scripting language implicitly handles memory management on the user's behalf, where C does not;
- The language interpreter does not require programs to be compiled as a separate step before they can be used;
- A purpose-built scripting language can be tailored so that it lends itself to its intended usage. For example, COFFEE has built-in mathematical functions that are necessary for 3D graphics programming.
customised features can look and behave much like those supplied as standard.
Syntax and language features
COFFEE is a fairly typical curly bracket language and so it would look familiar to any previous user of C/C++, Java, Perl or anything along those lines. The function and object class definitions are closely modelled after those of C++. However, COFFEE is dynamically typed, and so variables are defined with a simple var keyword without any reference to their type. Unlike similar scripting languages such as Squirrel and JavaScript, COFFEE does not use a function keyword to introduce functions, nor does it require a return type or "void" return like C/C++ - the function definition simply begins with the function name.COFFEE's memory management is handled entirely by a garbage collection process; essentially this means that it looks after itself, and the programmer seldom needs to worry about it. However, it is possible to control the process explicitly when necessary.
3D graphics programming makes extensive use of certain mathematical techniques, notably trigonometry and vector arithmetic. COFFEE is well equipped in this area, with a good set of mathematical functions and a built-in vector datatype.