Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EDT:Language Overview

Revision as of 14:51, 11 October 2011 by Unnamed Poltroon (Talk)

Introduction

This essay gives an overview of the EGL language. 

Compilation

In relation to any modern programming language, an automated process converts source code from a relatively abstract form to a more concrete, platform-specific one. For example, the logic might be compiled into machine code, or into byte codes that can be read by a virtual machine. 

[ summarize typical compilation.  identify how the EGL tech is different and why. ]

Types and values

In general usage, a type such as integer or string defines a set of values and a set of operations that can be applied to those values. For example, integers are whole numbers that can be added, subtracted, and so forth; and the number 5 is a value of that type.

The meaning is much the same in programming, where every value is “of a type.” The type defines the structure of the value and the set of operations that can be applied to the value.

Reference and value types

In general, types are of two kinds, reference and value:

  • A reference type defines an object, which is a value in a memory area that was allocated specifically to hold the value. The object is referenced from some logic and is an instance of the type. In this case, the words "value," "object," and "instance" are interchangeable.
  • A value type defines a value that is embedded in an object rather than being referenced from it.

In general, a field declaration is a coded statement that has two effects:

  • Declares a value of a type.
  • Names a memory area that provides access to the value. If the value is based on a reference type, the memory area holds an address or other detail that points to the value. If the value is based on a value type, the memory area contains the value itself.

Turning now to the syntax of EGL, here are field declarations:

   // variable declaration
   NumberOfCars INT;    
   
   // constant declaration
   const MINIMUMNUMBER INT = 2; 

The type is each case is INT, which is a value type for four-byte integers. The first statement declares a value variable, the second declares a value constant.

For a second example, you might declare a list of five integers by coding a statement like one of these:

   // variable declaration
   NumberOfVehicles INT[5];

   // constant declaration
   const MINIMUMNUMBERS INT[5] = [1,2,3,4,5];

Back to the top