|
|
|
|
|
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 declared 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 a 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 searching some data can become more understandable by using a search statement instead of a search procedure. A call of a new declared search statement could be:
search person1.age = person2.age and
person1.mother = person2.mother and
person1 <> person2
when found
write("Twins: " <& person1.name <& " and " <& person2.name);
else
write("No twins found.");
end search;
Such extensions make understanding, changing and debugging of a program easier. 1.3 Features of Seed7Seed7 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
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 and 5 and the declaration mechanism is described in chapter 8. 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. A good example for classes and instances are the Files which are described in chapter 7. 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. How syntax declarations are done is described in chapter 3 and chapter 4 contains various examples of syntax and semantic declarations. The primary parts of the syntax are described in the chapters 9 and 10. |
|