HOME

TheInfoList



OR:

Seed7 is an extensible
general-purpose programming language In computer software, a general-purpose programming language (GPL) is a programming language for building software in a wide variety of application Domain (software engineering), domains. Conversely, a Domain-specific language, domain-specific pro ...
designed by Thomas Mertes. It is syntactically similar to Pascal and Ada. Along with many other features, it provides an extension mechanism. Daniel Zingaro
"Modern Extensible Languages"
SQRL Report 47
McMaster University McMaster University (McMaster or Mac) is a public research university in Hamilton, Ontario, Canada. The main McMaster campus is on of land near the residential neighbourhoods of Ainslie Wood, Ontario, Ainslie Wood and Westdale, Ontario, Westd ...
(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 paradigm A programming paradigm is a relatively high-level way to conceptualize and structure the implementation of a computer program. A programming language can be classified as supporting one or more paradigms. Paradigms are separated along and descri ...
s: imperative, object-oriented (OO), and generic. It also supports features such as call by name,
multiple dispatch Multiple dispatch or multimethods is a feature of some programming languages in which a Subroutine, function or Method (computer programming), method can be dynamic dispatch, dynamically dispatched based on the run time (program lifecycle phase), ...
, function overloading, operator overloading,
exception handling In computing and computer programming, exception handling is the process of responding to the occurrence of ''exceptions'' – anomalous or exceptional conditions requiring special processing – during the execution of a program. In general, an ...
and
arbitrary-precision arithmetic In computer science, arbitrary-precision arithmetic, also called bignum arithmetic, multiple-precision arithmetic, or sometimes infinite-precision arithmetic, indicates that calculations are performed on numbers whose digits of precision are po ...
. Major features include: * User defined statements and operators *
Abstract data type In computer science, an abstract data type (ADT) is a mathematical model for data types, defined by its behavior (semantics) from the point of view of a '' user'' of the data, specifically in terms of possible values, possible operations on data ...
s * Templates without special syntax * Object-oriented with interfaces and multiple dispatch *
Static typing In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a ''type'' (for example, integer, floating point, string) to every '' term'' (a word, phrase, or other set of symbols). Usu ...
* 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 Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
, Mac
OS X macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
,
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user 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, a ...
,
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
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 language's statements are converted into binary instructions for the processor to execute. The term is used as an adjective to describe concepts relat ...
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 language's statements are converted into binary instructions for the processor to execute. The term is used as an adjective to describe concepts relat ...
, can be used to define objects. * Templates are written as compile time functions with type parameters. *
Arrays An array is a systematic arrangement of similar objects, usually in rows and columns. Things called an array include: {{TOC right Music * In twelve-tone and serial composition, the presentation of simultaneous twelve-tone sets such that the ...
, hash maps and structs are not a hard-coded feature. Instead they are defined as abstract data type in
libraries A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
. *
Parser Parsing, syntax analysis, or syntactic analysis is a process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar by breaking it into parts. The term '' ...
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 character encoding standard used for electronic communication. Defined by the Unicode Standard, the name is derived from ''Unicode Transformation Format 8-bit''. Almost every webpage is transmitted as UTF-8. UTF-8 supports all 1,112,0 ...
and UTF-16. The Seed7 project includes both an interpreter and a
compiler In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
. 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 In computer programming, machine code is computer code consisting of machine language instructions, which are used to control a computer's central processing unit (CPU). For conventional binary computers, machine code is the binaryOn nonb ...
. Compiled Seed7 programs can have comparable
performance A performance is an act or process 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. Performance has evolved glo ...
to C programs.


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 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 term ...
, numeric functions,
lexical analysis Lexical tokenization is conversion of a text into (semantically or syntactically) meaningful ''lexical tokens'' belonging to categories defined by a "lexer" program. In case of a natural language, those categories include nouns, verbs, adjectives ...
, file manipulation, networking ( sockets,
Transport Layer Security Transport Layer Security (TLS) is a cryptographic protocol designed to provide communications security over a computer network, such as the Internet. The protocol is widely used in applications such as email, instant messaging, and voice over ...
(TLS/SSL),
Hypertext Transfer Protocol HTTP (Hypertext Transfer Protocol) 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 Web, wher ...
(HTTP), HTTP Secure (
HTTPS Hypertext Transfer Protocol Secure (HTTPS) is an extension of the Hypertext Transfer Protocol (HTTP). It uses encryption for secure communication over a computer network, and is widely used on the Internet. In HTTPS, the communication protoc ...
),
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 d ...
(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 the data, as in design and manufa ...
, pixmap and vector
font In metal typesetting, a font is a particular size, weight and style of a ''typeface'', defined as the set of fonts that share an overall design. For instance, the typeface Bauer Bodoni (shown in the figure) includes fonts " Roman" (or "regul ...
s, database independent API,
Common Gateway Interface file:Common Gateway Interface logo.svg, The official CGI logo from the spec announcement In computing, Common Gateway Interface (CGI) is an interface specification that enables web servers to execute an external program to process HTTP or HTTPS ...
(CGI) support,
data compression In information theory, data compression, source coding, or bit-rate reduction is the process of encoding information using fewer bits than the original representation. Any particular compression is either lossy or lossless. Lossless compressi ...
, archive files ( tar, 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 character (computing), characters, especially the written characters of human language, allowing them to be stored, transmitted, and transformed using computers. The numerical v ...
, time and date handling,
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
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 and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
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 system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
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, such as the Internet. The protocol is widely used in applications such as email, instant messaging, and voice over ...
. The library includes AES and
elliptic-curve cryptography Elliptic-curve cryptography (ECC) is an approach to public-key cryptography based on the algebraic structure of elliptic curves over finite fields. ECC allows smaller keys to provide equivalent security, compared to cryptosystems based on modula ...
.


Database abstraction API

Seed7 provides a library with a
database In computing, a database is an organized collection of data or a type of data store based on the use of a database management system (DBMS), the software that interacts with end users, applications, and the database itself to capture and a ...
independent API. Programs can connect to
MySQL MySQL () is an Open-source software, 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 rel ...
,
MariaDB MariaDB is a community-developed, commercially supported Fork (software development), fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. Developm ...
, SQLite, PostgreSQL,
Oracle An oracle is a person or thing considered to provide insight, wise counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. If done through occultic means, it is a form of divination. Descript ...
, Open Database Connectivity (ODBC), Firebird,
InterBase InterBase is a relational database management system (RDBMS) currently developed and marketed by Embarcadero Technologies. It runs on the operating systems Microsoft Windows, macOS, Linux, Oracle Solaris, Solaris, Android (operating system), Andr ...
, 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)
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, 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".


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 In mathematics, the associative property is a property of some binary operations that rearranging the parentheses in an expression will not change the result. In propositional logic, associativity is a Validity (logic), valid rule of replaceme ...
: 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

* - Homepage with FAQ, manual, screenshots, examples, library descriptions, benchmarks and a set of algorithms
Mirror of the Seed7 HomepageSeed7 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 Cerutti
*{{usurped,
An 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 and open source compilers Programming languages created in 2005 Software using the GNU General Public License Free and open source interpreters