Skip to content
Kameron Brooks edited this page Aug 17, 2019 · 2 revisions

CCL 1.3.1

What is CCL?

CCL(Contextual C-like Language) is a programming language that resembles the C language, that can be interpreted at run-time and derives its extended functionality from a predefined context that exists within the application.

What is the Syntax?

It is very similar to C. The features and syntax guide is here

What is the Purpose of CCL?

CCL was designed to be used with Unity games and applications. CCL provides a way to run script that is defined or loaded at run-time. With CCL, additional functionality can be added to your project after it is already released. There are a few reasons that a developer may want to do this. I will expand upon this concept here.

How does it work?

The basic idea behind CCL is that it is driven by a predefined "Context". Before a CCL script is run, a Context object is passed to the CCL script. The context defines the interface that is required for the script to interact with your application. CCL can act on the provided object to get data in and out of the application.

A CCL file or CCL script can be loaded while the game/application is running. The application can then compile the code into a new function and invoke that function.

The Future of CCL

Roadmap

The goals for CCL are to improve performance of compiled code. There will be compiler optimizations that make the compiled code faster at execution time. The interface between CCL and the Context object is reliant on reflection, which can be 1000 times slower than a member access operation. This can make context interactions slow. I will be implementing performance improvements in this area.

Eventually, the goal would be to push the limits of execution speed of dynamically added code and get execution times closer to native C#.

Pros and Cons

Pros

  • Run dynamic code
  • Insert functionality into an application after it is already released
  • Familiar style as C/javascript

Cons

  • Compiled CCL is about 10-100 times slower than executing C# code
  • Reliance on reflection (causes slowness)