Seed7 is a general purpose programming language designed by Thomas Mertes. It is a higher level language compared to Ada, C/C++ and Java. The Seed7 interpreter and the example programs are open-source software. There is also an open-source Seed7 compiler. The compiler translates Seed7 programs to C programs which are subsequently compiled to machine code.
In Seed7 new statements and operators can be declared easily. Functions with type results and type parameters are more elegant than a template or generics concept. Object orientation is used where it brings advantages and not in places where other solutions are more obvious. Seed7 contains several concepts from Pascal, Ada, C, C++ and Java.
- Seed7 Website
- Seed7 Source on GitHub
- FAQ
- “Screenshots” - example programs with linked source, some web-runnable
The author posted on Reddit; quoting in part:
Seed7 is based on ideas from my diploma and doctoral theses about an extensible programming language (1984 and 1986). In 1989 development began on an interpreter and in 2005 the project was released as open source. Since then it is improved on a regular basis.
Seed7 is about readability, portability, performance and memory safety. There is an automatic memory management, but there is no garbage collection process, that interrupts normal processing. The templates and generics of Seed7 don't need special syntax. They are just normal functions, which are executed at compile-time.
Seed7 is an extensible programming language. The syntax and semantics of statements (and abstract data types, etc.) is defined in libraries. The whole language is defined in the library "seed7_05.s7i". You can extend the language syntactically and semantically (introduce new loops, etc.). In other languages the syntax and semantics of the language is hard-coded in the compiler.
Seed7 checks for integer overflow. You either get the correct result or an OVERFLOW_ERROR is raised. Unlike many JVM based languages Seed7 compiles to machine code ahead of time (GRAAL works ahead of time but it struggles with reflection). Unlike many systems languages (except Rust) Seed7 is a memory safe language.
Some programs written in Seed7 are:
Code Example
# Print a Fahrenheit-Celsius table with floating point numbers.
$ include "seed7_05.s7i"; # This must be included first.
include "float.s7i"; # Subsequent includes do not need a $.
const proc: main is func
local
const integer: lower is 0;
const integer: upper is 300;
const integer: increment is 20;
var integer: fahr is 0;
var float: celsius is 0.0;
begin
for fahr range lower to upper step increment do
celsius := float(5 * (fahr - 32)) / 9.0;
writeln(fahr lpad 3 <& " " <& celsius digits 2 lpad 6);
end for;
end func;