Gamma < Software < Home
Gamma™ Programming Language
Advanced Interpreted Programming Language
Gamma was developed to address the frustrations we found trying to build complex control systems using C and C++. We wanted a programming language that would reduce the time and effort required to implement control strategies. Gamma has evolved into a powerful and dynamic language used in mission critical systems all over the world.

For code examples, please see the Gamma documentation.

Features and Benefits

Familiar Grammar.
Gamma has a syntax that is similar to C or C++. This means that the learning curve is very small. One of our goals in developing Gamma was to provide a development environment that was familiar to most programmers, but was much easier than programming in languages like C.

Support for Photon microGUI. (GammaPhoton)
Photon microGUI is the windowing system of choice for QNX 4 and QNX 6. The download archive for Gamma includes support for the Photon microGUI Toolkit.

Gamma maps the entire Photon widget set as object classes, giving you live access to every widget resource. Gamma greatly enhances the Photon call-back mechanism, allowing you to attach code directly to a call-back. The class mechanism in Gamma lets you attach any number of resources to a Photon widget, at any time. Activities that are difficult in C are trivial in Gamma.

Support for MySQL. (GammaMySQL)
The MySQL database server is the world's most popular open source database. Its architecture makes it extremely fast and easy to customize. Arbitrary queries can be mapped to classes such that each record in the query result becomes an instance of that class. The columns in the query are instance variables in the class. All of this is done on the fly as the query is made.

Support for GTK. (GammaGTK)
GTK (which stands for 'GIMP Toolkit') is an Open Source Free Software GUI Toolkit, primarily developed for use with the X-Windows System. There is an ongoing project to port GTK to Microsoft Windows and the BeOS. Gamma support for GTK is currently offered as a DLL for QNX 6 and Linux.

GTK is one of two GUI toolkits that are in prominence in X-Windows, the other one being KDE. GTK is the underlying toolkit for the Gnome windowing interface, which is gaining widespread industry support as the interface of choice for X-Windows. GTK is the toolkit with which you develop applications for the Gnome windowing interface.
 

OS Support:
 - Linux
 - QNX 6
 - QNX 4
Licensing Info

GammaPhoton
Examples

By providing Gamma support for GTK we make it easy for you to create powerful applications using GTK. Gamma can be used to produce GTK applications that display real-time process data and provide dynamic user interaction.

Gamma maps the complete GTK widget set as object classes. Gamma is currently the only way to write a program that responds to QNX messages as well as GTK+ events.

Object Oriented Programing.
Gamma implements Object Oriented Programming features which provide a single-inheritance class mechanism with instance variables and methods. Since Gamma is an interpreter, the object definitions are truly dynamic, allowing for run-time extensibility.

Advanced Memory Management.
Most run-time errors occur as a result of memory faults or memory leaks. In a traditional environment, more debugging time is spent on memory problems than any other kind of error. Gamma implements an advanced memory management system with garbage collection that eliminates memory bugs and leaks.

Dynamic Scoping.
Most compiled languages use lexical scoping, which means that a variable is defined only where it is visibly declared, either as an external global, file global, or local variable. Gamma uses dynamic scoping, meaning that a variable is defined in any function which defines it, and in any function which the defining function subsequently calls. This powerful mechanism allows the programmer to override global variables by defining them in a higher scope, and then calling a function which believes itself to be using a global variable.

One useful side-effect of dynamic scoping is that functions and variables do not have to be declared before they are used in other functions. The function or variable only has to be declared when the other function is actually run.

Active Values.
An active value is a symbol which also carries code to be executed whenever its value changes. This is useful for adding side-effects to program variables. For example, it might be very useful to add a function which will update a Photon widget whenever a variable changes. Active values also make it possible to implement algorithms such as forward-chaining expert systems very easily. An active value is established by calling the add-set-function function.

Lists.
Gamma borrows the list data structure from its artificial intelligence roots to make data intensive operation easier. Since Gamma uses the SCADALisp engine, it inherits the rich set of list manipulation functions for which LISP is known.

Timers.
Timers are one of the easiest and most powerful features of Gamma. One line of Gamma code gives you one-shot, interval or time-of-day program timers.

Dynamic Arrays.
Another powerful feature of Gamma are dynamic arrays. To make an array in Gamma the developer can use either the array() or make-array() functions. The array() function creates a pre-built array while the make-array() function creates an empty array of a given size. If the programmer attempts to write to an element beyond the end of the array, the array will expand to accept the new element. This mechanism allows the programmer to approximate the size of the array, and then increase its size as necessary simply by using it. Gamma arrays are dynamically resized as they are used, making array over-runs and off-by-one errors a thing of the past.

Error Handling.
The error handling mechanism within Gamma allows you to trap any run-time error, including segmentation and floating point faults. You can then program escape strategies to deal with errors more effectively. There are two basic means of trapping and handling errors.
  1. Execute a protected block of code, and specify an error handler which is only executed if an error occurs within the protected code. If an error occurs, the error handling code is executed, and the error condition is cleared. This is the TRY/CATCH mechanism.
  2. Execute a protected block of code, and specify a second block of code which must be executed even if an error occurs in the first block. Normally when an error occurs, the execution stack is unwound to the nearest error handler, aborting any intervening execution immediately. If a block of code must be run, even when an error occurs, we want to unwind protect that code. After the error is dealt with, it is passed on up the stack rather than being cleared. This is the PROTECT/UNWIND mechanism.

Interact with running programs.
Gamma programs can be modified as they run, in place, at the end user location. If you choose to design your application to accept new code 'on-the-fly' then you can fix programs or download modifications without shutting down the whole system. Download new code and you can have the application read in the new code and execute it without any interruption to user.

 

Copyright © 1995 - 2010, Cogent Real-Time Systems Inc.