:Seed7

{{Short description|Multi-platform general-purpose programming language designed by Thomas Mertez in 2005}}

{{primary sources|date=September 2018}}

{{Infobox programming language

| name = Seed7

| logo =

| paradigm = multi-paradigm: extensible, object-oriented, imperative, structured, generic, reflective

| typing = static, strong, safe, nominative, manifest

| implementations = open source reference implementation

| year = {{Start date and age|2005}}

| designer = Thomas Mertes

| latest release version = 2024-08-12

| latest release date = {{age in days|2024|08|12|show unit=full}} ago{{cite web | url=https://sourceforge.net/p/seed7/news/2024/08/new-seed7-release-2024-08-12/|access-date=16 August 2024|date=12 August 2024|title=New Seed7 Release 2024-08-12|first=Thomas|last=Mertes|via=SourceForge}}

| influenced by = Pascal, Modula-2, Ada, ALGOL 68, C, C++, Java

| operating system = Cross-platform: BSD, Linux, OS X, Unix, Windows

| license = GPL, LGPL (for the runtime library)

| file ext = .sd7, .s7i

}}

Seed7 is an extensible general-purpose programming language designed by Thomas Mertes. It is syntactically similar to Pascal and Ada. Along with many other features, it provides an extension mechanism.Daniel Zingaro, [http://www.cas.mcmaster.ca/sqrl/papers/SQRLreport47.pdf "Modern Extensible Languages"], SQRL Report 47 McMaster University (October 2007), page 16 ([http://www.danielzingaro.com/extensible.pdf alternate link]). Seed7 supports introducing new syntax elements and their semantics into the language, and allows new language constructs to be defined and written in Seed7.Abrial, Jean-Raymond and Glässer, Uwe, [https://books.google.com/books?id=hc8FIwfSQi8C&pg=PA166 "Rigorous Methods for Software Construction and Analysis"], {{ISBN|978-3-642-11446-5}}, Springer, 2010, page 166. For example, programmers can introduce syntax and semantics of new statements and user defined operator symbols. The implementation of Seed7 differs significantly from that of languages with hard-coded syntax and semantics.

Features

Seed7 supports the programming paradigms: imperative, object-oriented (OO), and generic. It also supports features such as call by name, multiple dispatch, function overloading, operator overloading, exception handling and arbitrary-precision arithmetic.

Major features include:

  • User defined statements and operators
  • Abstract data types
  • Templates without special syntax
  • Object-oriented with interfaces and multiple dispatch
  • Static typing
  • May be interpreted or compiled
  • Source code portability via supplied libraries that provide a common interface to different operating systems and windowing systems.
  • Runs under BSD, Linux, Mac OS X, Unix, Windows

Several programming language concepts are generalized:

The Seed7 project includes both an interpreter and a compiler. The interpreter starts programs very quickly, supporting fast program development. The compiler uses the parser and reflection interfaces from the run-time library to generate a C program, which is subsequently compiled to machine code. Compiled Seed7 programs can have comparable performance to C programs.{{Cite web|url=http://mensanator.com/mensanator/cycle/ultimate_cycle.htm|archive-url=https://web.archive.org/web/20131025193458/http://mensanator.com/mensanator/cycle/ultimate_cycle.htm|url-status=dead|archive-date=25 October 2013|access-date=19 August 2019|date=1 April 2010|title=The Quest for the Ultimate Cycle (includes a performance comparison between Python, Seed7 and C)|first=Paul|last=Stadfeld}}

=Features omitted=

  • Macros and a preprocessor
  • Modules and namespaces
  • Manual memory management
  • Pointers and NULL
  • Regular expressions
  • Default function parameters

Libraries

Seed7 has many libraries, covering areas including containers, numeric functions, lexical analysis, file manipulation, networking (sockets, Transport Layer Security (TLS/SSL), Hypertext Transfer Protocol (HTTP), HTTP Secure (HTTPS), File Transfer Protocol (FTP), Simple Mail Transfer Protocol (SMTP), etc.), graphics, pixmap and vector fonts, database independent API, Common Gateway Interface (CGI) support, data compression, archive files (tar, zip, cpio, ar, rpm), character encoding, time and date handling, XML processing, message digests and more.[http://seed7.sourceforge.net/libraries Seed7 libraries] These libraries reduce the need to use unportable operating system features and third-party libraries (which might not always be present) directly. Seed7 libraries contain abstraction layers for hardware, operating system and third-party libraries, e.g. graphic and database libraries. In other words, no changes are needed to move Seed7 programs between different processors or operating systems.

{{Anchor|TLS_library|Transport Layer Security}}

=TLS library=

Seed7 has its own implementation of Transport Layer Security.[http://seed7.sourceforge.net/libraries/tls.htm A Transport Layer Security (TLS) library written in Seed7] The library includes AES and elliptic-curve cryptography.

{{Anchor|database_library|database independent API}}

=Database abstraction API=

Seed7 provides a library with a database independent API.[http://seed7.sourceforge.net/manual/database.htm Database abstraction API] Programs can connect to MySQL, MariaDB, SQLite, PostgreSQL, Oracle, Open Database Connectivity (ODBC), Firebird, InterBase, IBM Db2 and SQL Server databases. Independent from the database prepared statements can be created, bind variables can be used, the statements can be executed and result sets can be fetched.

History

Seed7 is based on MASTER, an extensible programming language described in the diploma and doctoral theses of Thomas Mertes.Mertes, Thomas, "Entwurf einer erweiterbaren höheren Programmiersprache", Diploma thesis Vienna University of Technology (1984).([https://web.archive.org/web/20120205234431/https://www.complang.tuwien.ac.at/library/ibv/detail.php?nr=1082 Abstract])Mertes, Thomas, [http://seed7.sourceforge.net/thesis/doctorate "Definition einer erweiterbaren höheren Programmiersprache"], Doctoral thesis Vienna University of Technology (1986).([https://web.archive.org/web/20130509083209/http://www.complang.tuwien.ac.at/library/ibv/detail.php?nr=1083 Abstract]) Most of the original ideas of MASTER, such as user defined statements and operators, can be found in Seed7. A precompiler, to translate MASTER to Pascal, was proposed, but unimplemented, in the original project. In 1989, development began on an interpreter for MASTER, named HAL. In 2005, the MASTER and HAL projects were released as open source under the Seed7 project name. Since then new versions have been released every two or three weeks. As of version 2021-04-25 the Seed7 project contains more than 500,000 source lines of code and several hundred pages of documentation.

Mertes has said that the name Seed7 came from the concept of his ideas for the language being spread as seeds that would grow as others used it. The "7" part was added because it was a prime number that he felt sounded good with "seed".{{cite web | title=Coding Club: Presents - Seed7| url=https://www.youtube.com/watch?v=CwsdGZ5_5C4&t=1264s | accessdate=July 22, 2024 | date=July 4, 2024 | website=YouTube}}

Extension mechanism

An extension includes two parts: a syntax definition, giving a template for the new syntactic form, and a standard Seed7 function, used to define the semantics.

=Syntax definition=

The syntax definition uses the Seed7 Structured Syntax Description (S7SSD). A S7SSD statement like

$ syntax expr: .(). + .() is -> 7;

specifies the syntax of the + operator. The right arrow -> describes the associativity: Binding of operands from left to right. With 7 the priority of the + operator is defined. The syntax pattern .(). + .() is introduced and delimited with dots (.). Without dots the pattern is () + (){{or-inline|date=December 2024}}. The symbol () is a nonterminal symbol and + is a terminal symbol.[http://unobtainabol.blogspot.co.at/2015/03/the-seed7-programming-language.html David Gudeman (March 26, 2015), "The Seed7 Programming Language" (In Seed7 you can specify a syntax like this)] The S7SSD does not distinguish between different nonterminal symbols. Instead it only knows one nonterminal symbol: ().

=Semantic extension=

The definition of the + operator for complex numbers is just a function definition:

const func complex: (in complex: summand1) + (in complex: summand2) is func

result

var complex: sum is complex.value;

begin

sum.re := summand1.re + summand2.re;

sum.im := summand1.im + summand2.im;

end func;

References

{{reflist}}