Lisaac
Encyclopedia
Lisaac is a compiled object-oriented programming language
Object-oriented programming language
This is a list of object-oriented programming programming languages.-Languages with object-oriented features:*ABAP*Ada 95*AmigaE*BETA*Blue*Boo*C++*C#*COBOL*Cobra*ColdFusion*Common Lisp*COOL*CorbaScript*Clarion*CLU*Curl*D*Dylan*E*Eiffel...

 based on prototype
Prototype-based programming
Prototype-based programming is a style of object-oriented programming in which classes are not present, and behavior reuse is performed via a process of cloning existing objects that serve as prototypes. This model can also be known as classless, prototype-oriented or instance-based programming...

 concepts, with system programming
System programming
System programming is the activity of programming system software. The primary distinguishing characteristic of systems programming when compared to application programming is that application programming aims to produce software which provides services to the user System programming (or systems...

 facilities and design by contract
Design by contract
Design by contract , also known as programming by contract and design-by-contract programming, is an approach to designing computer software...

.

Lisaac's developers admired both Self's flexibility and dynamic inheritance, and Eiffel
Eiffel (programming language)
Eiffel is an ISO-standardized, object-oriented programming language designed by Bertrand Meyer and Eiffel Software. The design of the language is closely connected with the Eiffel programming method...

's static typing and design by contract
Design by contract
Design by contract , also known as programming by contract and design-by-contract programming, is an approach to designing computer software...

 features. Seeking to combine these two apparently contradictory feature sets, Lisaac was created.

Lisaac was designed as the language in which the Isaac operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

 would be programmed.

The Lisaac transpiler produces optimized ANSI C
ANSI C
ANSI C refers to the family of successive standards published by the American National Standards Institute for the C programming language. Software developers writing in C are encouraged to conform to the standards, as doing so aids portability between compilers.-History and outlook:The first...

 code, which can then be compiled on every architecture with an appropriate C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 which makes Lisaac a real multi-platform language. Compiling 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

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

Basic syntax

Lisaac is case sensitive. Keywords are capitalized (Section, Header, Public, …), type identifiers are written in upper case letters (INTEGER, BOOLEAN, OBJECT, …), and identifiers denoting variables and slots are written in lower case letters. Objects are composed of slots, which can be data or code. The ':' symbol is used to declare types. Slot names are prefixed with a '+' or '-' symbol to indicate whether the slot is local to an object or shared between objects.

Parentheses are used to delimit lists of semicolon separated statements. Statement lists may have zero, one or more return values. The ':=' symbol is used to bind a slot to a statement or statement list that is executed at the loading/initialization of an object. The '<-' symbol is used to bind a slot to a statement list that is executed on the call of the slot.

Dynamic inheritance

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

Section Header

- 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_stream <-

(
putimage decode_to_bitmap;
)

Operator redefining

In Lisaac, an operator
Operator (programming)
Programming languages typically support a set of operators: operations which differ from the language's functions in calling syntax and/or argument passing mode. Common examples that differ by syntax are mathematical arithmetic operations, e.g...

 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
Generic programming
In a broad definition, generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameters...

are supported, for instance:

ARRAY(E), DICTIONARY(KEY,VALUE)

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK