Manual
Introduction
 previous   up   next 

1. INTRODUCTION

1.1 What is Seed7?

Seed7 is a general-purpose programming language. It is a higher level language compared to Ada, C++ and Java. In Seed7 new statements and operators can be defined easily. Functions with type results and type parameters are more elegant than the usual template or generics concept. Object orientation is used when it brings advantages and not in places when other solutions are more obvious. Although Seed7 contains several concepts of other programming languages it is generally not considered as a direct descendant of any other programming language.

The programmer should concentrate on problem solving instead of administration or the fulfillment of some paradigm. Therefore Seed7 allows programming in the "problem space" instead of bending everything into a small syntactic or semantic concept. The predefined constructs of Seed7 are defined in a way to be easy readable and understandable. This practical approach can be summarized as:

 Programming should be fun 

Seed7 programs can be interpreted or compiled. Therefore Seed7 can be used for scripting and for "real" programs.

1.2 Why a new programming language?

Conventional programming languages have a firmly given syntactic structure. The form of the statements, operators, declarations, procedures and functions is fixed in the language definition and cannot be changed by the user. It is only possible to declare new procedures, functions and in some languages also new operators. However the syntax of procedure, function and operator calls cannot be changed. Although this rigid pattern is favorable for the portability of programs, the improvement of the programming language is almost impossible. Extensions are however desirable, in order to repair existing weaknesses, to introduce new more obvious constructs and to adapt the programming language to different application areas. E.g.: In the area of mathematics the readability of a program can be substantially increased by the introduction of matrix and vector operators. After declaring an inner product and an outer (or cross) product for vectors it is possible to write e.g.

v1: = v2 cross v3;   write(v1 * v2);

Programs which search for some data in a database can become more understandable by using a for statement to loop over the tables. A usage of such a for statement could be:

for person1, person2
where person1.age = person2.age and
     person1.mother = person2.mother and
     person1 <> person2 do
   writeln("Twins: " <& person1.name <& " and " <& person2.name);
end for;

Such extensions make understanding, changing and debugging of a program easier.

1.3 Features of Seed7

Seed7 has the following features

But a new programming language differs not only from existing ones by new features. The real advantage comes from omitting features which are outdated.

Several concepts in use by other languages are not present

There are several concepts which are also used by other languages:

There are several concepts which are new

Several restrictions of other languages are released

1.4 How to read the manual

You can have several views of the Seed7 programming language. Dependent on the view you can concentrate on specific chapters.

For example Seed7 can be used as conventional programming language. In this case you are interested in how the statements look like, which types are available, which operators are predefined, how to declare variables and procedures and other things like these. The statements and the predefined types are described in chapter 4 (Predefined statements) and chapter 5 (Predefined types) and the declaration mechanism is described in chapter 3 (Declarations).

But Seed7 is also an object oriented programming language. In this case you are interested in how to define new classes, how instances are generated, the method calling mechanism, the predefined class hierarchy and other things like these. The object orientation of Seed7 is described in chapter 7 (Object orientation). A good example for classes and instances is the file system which is described in chapter 8 (The file system).

And Seed7 is also an extensible programming language. In this case you are interested in how to declare new statements, how to define new operators, assigning a priority and an associativity to operators and other things like these. An overview about syntax declarations can be found in Chapter 3.2 (Syntax declarations). A detailed description of the Seed7 syntax definitions can be found in chapter 9 (Structured syntax definition). Chapter 4 (Predefined statements) contains various examples of syntax and semantic declarations. The basic parts of the syntax are described in chapter 10 (Tokens) and chapter 11 (Expressions).


 previous   up   next