Lisaac

Lisaac is the first compiled object-oriented language based on prototype concepts, with system programming facilities and design by contract.

Lisaac's developers admired both Self's flexibility and dynamic inheritance, and Eiffel's static typing and design by contract features. Seeking to combine these two apparently contradictory feature sets, Lisaac was created.

Lissac was designed as the language in which the Isaac operating system would be programmed in.

The Lisaac compiler produces optimized ANSI C code, which can then be compiled on every architecture with an appropriate C compiler which makes Lisaac a real multi-platform language. Compilation results show that it is possible to obtain executables from a high-level prototype-based language that are as fast as C programs.

Despite being strongly typed, there is no difference between code and data.

Features

  • Communications protection mechanisms
  • Hardware facilities
    • System interrupts support
    • Driver memory mapping
  • Despite being compiled, all objects retain their dynamic abilities

Dynamic inheritance

The parent of each object is just a slot that can be assigned as required in the code, for instance:

- NAME := DECOD_MPEG2_TO_SCREEN

section INHERIT

- videoparent : OBJECT <- 

  + result : OBJECT;

 typ 
 .when 1 then { result := WINDOW;} 
 .when 2 then { result := VIDEO_VGA;} 
 .when 3 then { result := VIDEO_TVOUT;};

 result 


section PUBLIC

- typ : INTEGER;

- decode_flux <-


 putimage decode_to_bitmap; 
)

Operator redefining

In Lisaac, an operator is a slot and can be redefined. For example overloading the + operator for a NUMERIC object:

- '+'  left 80  other:SELF :SELF <- self - -other;

Or for a matrix:

- '+'  left 80  other:SELF :SELF <- 

(
   + result : SELF; 

   result := SELF.create count; 
   1.to tab.count do { 
           i : INTEGER; 
       result.put (item i+other.item i) to i; 
   };

   result
)

Genericity

Generic objects are supported, for instance:

ARRAY[E], DICTIONARY[KEY,VALUE]

Contract Programming

Contract programming using Z notation is provided.

Notes and references

fr:Lisaac