Personal tools
location: gti Cohort
 
Document Actions

Cohort

Cohort is an embeddable scripting engine specifically designed to meet the demands of video game developers, demands that go way beyond just having a small footprint and fast execution.

A good example is memory fragmentation - something developers continually have to battle. Cohort addresses this head-on by providing on-demand heap compaction, thus eliminating fragmentation issues caused by scripts.

This page itemizes many of Cohort's other features and should give developers a good idea of what they can expect. Cohort is still evolving and will not be available for general release till the first half of 2008. However, a few pre-release licenses are available for early adopters. Contact us for more information.

Engine Features

The Cohort Engine (i.e. runtime) is a C++ library/API that integrates directly in to your applications. The Engine consists of the Compiler, Machine and Shell, and has the following features:

  • Easy integration (Memory manager, file IO, output and timer interfaces).
  • Intuitive and clean API.
  • Advanced memory management:
    • Heap compaction.
    • Garbage collection.
    • Memory tracking and debugging.
    • Usage statistics.
    • Data dependency (GC) debugging.
  • Flexible build/configuration options.
  • Small footprint and fast byte-code execution.
  • Cross platform.
  • Supports 64 bit numbers and integers
  • Supports 64 bit architectures/compilers.
  • Threads and Co-routines.
  • Full CPU/GC profiling.
  • Automatically detects and corrects endian issues.

Language Features

Cohort is an imperative language made up of a blend of features and ideas found in Lua, Python and C:

  • Dynamically typed:
    • Booleans
    • Integers (signed 32 or 64 bit)
    • Numbers (float or double)
    • Strings and identifier literals
    • Native enums
    • Containers:
      • Tables.
      • Arrays.
      • Structs.
      • Classes and Objects.
  • Not case sensitive.
  • Module based.
  • Robust semantics
    • Explicit variable declarations.
    • const, public and private qualifiers.
    • Exceptions for invalid references.
  • Full complement of logical, bitwise and arithmetic operators.
  • Flow control
    • if-then-else, switch
    • for, foreach, while, until
    • continue, break
    • try, catch, finally (not yet implemented)
  • Native functions

Cohort is still evolving and language features are not set in stone. However, currently Cohort does not support and has no plans to support closures and/or multiple return values.

Configuration Options

Cohort's philosophy is to allow the user to pick and choose what features are important to him and to the task at hand.

Here are some of the options available to choose from:

  • 32 or 64 bit integers.
  • 32 or 64 bit numbers (floats vs doubles).
  • Compact-able Memory heap or standard memory heap.
  • Enable/Disable runtime exception checking.
  • Pure garbage collection or reference counting.
  • Enable/Disable various profiling and debugging code.

Cohort Shell/Command-line Debugger

Cohort comes with an embeddable "Shell". The Shell provides an interactive interface to the Cohort Engine. It is a simple but a very powerful tool.

Through the Shell you can:

  • View code and data
  • Modify code and data
  • Examine the state of the Cohort Engine
  • Execute code (i.e. interact with the application)
  • Load and unload modules
  • Profile code
  • Profile memory
  • Track data dependencies (i.e. debug GC issues)

The shell can also be extended by the developer to add new commands and features to the shell specifically for their game engine or application.

Cohort Debugger

Cohort's source-level remote debugger is still in development but will be part of the initial release package. When it reaches alpha more information will be made available.

 

Powered by Plone CMS, the Open Source Content Management System