Seed7
   HOME

TheInfoList



OR:

Seed7 is an
extensible Extensibility is a software engineering and systems design principle that provides for future growth. Extensibility is a measure of the ability to extend a system and the level of effort required to implement the extension. Extensions can be ...
general-purpose programming language designed by Thomas Mertes. It is syntactically similar to
Pascal Pascal, Pascal's or PASCAL may refer to: People and fictional characters * Pascal (given name), including a list of people with the name * Pascal (surname), including a list of people and fictional characters with the name ** Blaise Pascal, Frenc ...
and
Ada Ada may refer to: Places Africa * Ada Foah, a town in Ghana * Ada (Ghana parliament constituency) * Ada, Osun, a town in Nigeria Asia * Ada, Urmia, a village in West Azerbaijan Province, Iran * Ada, Karaman, a village in Karaman Province, T ...
. Along with many other features, it provides an extension mechanism. Daniel Zingaro
"Modern Extensible Languages"
SQRL Report 47 McMaster University (October 2007), page 16
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
"Rigorous Methods for Software Construction and Analysis"
, 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 Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of ...
(OO), and
generic Generic or generics may refer to: In business * Generic term, a common name used for a range or class of similar things not protected by trademark * Generic brand, a brand for a product that does not have an associated brand or trademark, other ...
. It also supports features such as call by name, multiple dispatch,
function overloading In some programming languages, function overloading or method overloading is the ability to create multiple functions of the same name with different implementations. Calls to an overloaded function will run a specific implementation of that f ...
, 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 * Runs under BSD,
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, whi ...
, Mac
OS X macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and la ...
,
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, ...
,
Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for se ...
Several programming language concepts are generalized: * Type declarations (which assign a name to a type) and function definitions take the form of constant definitions. * Compile-time expressions can execute user-defined functions. * Overloading and object-orientation (with multiple dispatch) are seen as common concepts. They just happen at different times:
compile time In computer science, compile time (or compile-time) describes the time window during which a computer program is compiled. The term is used as an adjective to describe concepts related to the context of program compilation, as opposed to concep ...
and run time, respectively. * Type names and type descriptions can be used as
parameter A parameter (), generally, is any characteristic that can help in defining or classifying a particular system (meaning an event, project, object, situation, etc.). That is, a parameter is an element of a system that is useful, or critical, when ...
and function result. * Functions, which are executed at
compile time In computer science, compile time (or compile-time) describes the time window during which a computer program is compiled. The term is used as an adjective to describe concepts related to the context of program compilation, as opposed to concep ...
, can be used to define objects. * Templates are written as compile time functions with type parameters. * Arrays, hash maps and
structs In computer science, a record (also called a structure, struct, or compound data) is a basic data structure. Records in a database or spreadsheet are usually called " rows". A record is a collection of ''fields'', possibly of different data ...
are not a hard-coded feature. Instead they are defined as abstract data type in libraries. * Parser and interpreter are part of the runtime library. * UTF-32 Unicode support. This avoids problems of variable-length encodings like
UTF-8 UTF-8 is a variable-length character encoding used for electronic communication. Defined by the Unicode Standard, the name is derived from ''Unicode'' (or ''Universal Coded Character Set'') ''Transformation Format 8-bit''. UTF-8 is capable of e ...
and UTF-16. The Seed7 project includes both an interpreter and a
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs tha ...
. 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 A performance is an act of staging or presenting a play, concert, or other form of entertainment. It is also defined as the action or process of carrying out or accomplishing an action, task, or function. Management science In the work place ...
to C programs.


Libraries

Seed7 has many libraries, covering areas including
containers A container is any receptacle or enclosure for holding a product used in storage, packaging, and transportation, including shipping. Things kept inside of a container are protected on several sides by being inside of its structure. The ter ...
, numeric functions, lexical analysis, file manipulation, networking ( sockets,
Transport Layer Security Transport Layer Security (TLS) is a cryptographic protocol designed to provide communications security over a computer network. The protocol is widely used in applications such as email, instant messaging, and voice over IP, but its use in securi ...
(TLS/SSL),
Hypertext Transfer Protocol The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide We ...
(HTTP), HTTP Secure ( HTTPS),
File Transfer Protocol The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network. FTP is built on a client–server model architecture using separate control and da ...
(FTP), Simple Mail Transfer Protocol (SMTP), etc.),
graphics Graphics () are visual images or designs on some surface, such as a wall, canvas, screen, paper, or stone, to inform, illustrate, or entertain. In contemporary usage, it includes a pictorial representation of data, as in design and manufacture, ...
, pixmap and vector
font In metal typesetting, a font is a particular size, weight and style of a typeface. Each font is a matched set of type, with a piece (a " sort") for each glyph. A typeface consists of a range of such fonts that shared an overall design. In mo ...
s, database independent API,
Common Gateway Interface In computing, Common Gateway Interface (CGI) is an interface specification that enables web servers to execute an external program, typically to process user requests. Such programs are often written in a scripting language and are commonly r ...
(CGI) support, data compression, archive files (
tar Tar is a dark brown or black viscous liquid of hydrocarbons and free carbon, obtained from a wide variety of organic materials through destructive distillation. Tar can be produced from coal, wood, petroleum, or peat. "a dark brown or black bi ...
, zip,
cpio cpio is a general file archiver utility and its associated file format. It is primarily installed on Unix-like computer operating systems. The software utility was originally intended as a tape archiving program as part of the Programmer's Work ...
, ar, rpm),
character encoding Character encoding is the process of assigning numbers to graphical characters, especially the written characters of human language, allowing them to be stored, transmitted, and transformed using digital computers. The numerical values tha ...
, time and date handling,
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. T ...
processing, message digests and more. 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 An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
and third-party libraries, e.g. graphic and database libraries. In other words, no changes are needed to move Seed7 programs between different
processors A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, a ...
or
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
s.


TLS library

Seed7 has its own implementation of
Transport Layer Security Transport Layer Security (TLS) is a cryptographic protocol designed to provide communications security over a computer network. The protocol is widely used in applications such as email, instant messaging, and voice over IP, but its use in securi ...
. The library includes AES and elliptic-curve cryptography.


Database abstraction API

Seed7 provides a library with a
database In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases ...
independent API. Programs can connect to
MySQL MySQL () is an open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A relational database ...
, MariaDB,
SQLite SQLite (, ) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the mo ...
,
PostgreSQL PostgreSQL (, ), also known as Postgres, is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. It was originally named POSTGRES, referring to its origins as a successor to the ...
,
Oracle An oracle is a person or agency considered to provide wise and insightful counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. As such, it is a form of divination. Description The word ...
,
Open Database Connectivity In computing, Open Database Connectivity (ODBC) is a standard application programming interface (API) for accessing database management systems (DBMS). The designers of ODBC aimed to make it independent of database systems and operating systems. An ...
(ODBC), Firebird, InterBase,
IBM Db2 Db2 is a family of data management products, including database servers, developed by IBM. It initially supported the relational model, but was extended to support object–relational features and non-relational structures like JSON a ...
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)
Abstract
Mertes, Thomas
"Definition einer erweiterbaren höheren Programmiersprache"
Doctoral thesis Vienna University of Technology (1986)
Abstract
Most of the original ideas of MASTER, such as user defined statements and operators, can be found in Seed7. A
precompiler In computer science, a preprocessor (or precompiler) is a program that processes its input data to produce output that is used as input in another program. The output is said to be a preprocessed form of the input data, which is often used by s ...
, 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.


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 () + (). The symbol () is a nonterminal symbol and + is a terminal symbol.David Gudeman (March 26, 2015), "The Seed7 Programming Language" (In Seed7 you can specify a syntax like this)
/ref> 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


External links

*{{Official website, seed7.sourceforge.net - Homepage with FAQ, manual, screenshots, examples, library descriptions, benchmarks and a set of algorithms
Seed7 at GitHubDownload Seed7
from its main repository at SourceForge
Seed7 at Rosetta Code
- Contains many Seed7 examples

explores the 3n+C extension of the Collatz Conjecture with Seed7 programs *Blog b
Remo LaubacherStatically linked Linux executables with GCJ, Seed7 and haXe
(2011) *Blog b
David Gudeman
(2015)
A FreeBSD port

see also here
maintained b
Pietro CeruttiAn OpenBSD port
provided by Brian Callahan
A Seed7 package for openSUSE/Fedora
(see als
here
o


A discussion where Seed7 is described as language where new syntax can actually be defined by language usersSeed7 at "Fossies" - the Fresh Open Source Software Archive
Multi-paradigm programming languages Statically typed programming languages Object-oriented programming languages Cross-platform software Extensible syntax programming languages Free software programmed in C Free compilers and interpreters Programming languages created in 2005 Software using the GPL license