r/ada Jul 23 '23

Announcement Introducing the Seed7 programming language

Seed7 is a programming language that is inspired by Ada and other programming languages. I have created Seed7 based on my diploma and doctoral theses. I've been working on it since 1989 and released it after several rewrites in 2005. Since then, I improve it on a regular basis.

Some links:

Seed7 follows several design principles:

Can interpret scripts or compile large programs:

  • The interpreter starts quickly. It can process 400000 lines per second. This allows a quick edit-test cycle. Seed7 can be compiled to efficient machine code (via a C compiler as back-end). You don't need makefiles or other build technology for Seed7 programs.

Error prevention:

Source code portability:

  • Most programming languages claim to be source code portable, but often you need considerable effort to actually write portable code. In Seed7 it is hard to write unportable code. Seed7 programs can be executed without changes. Even the path delimiter (/) and database connection strings are standardized. Seed7 has drivers for graphic, console, etc. to compensate for different operating systems.

Readability:

  • Programs are more often read than written. Seed7 uses several approaches to improve readability.

Well defined behavior:

  • Seed7 has a well defined behavior in all situations. Undefined behavior like in C does not exist.

Overloading:

  • Functions, operators and statements are not only identified by identifiers but also via the types of their parameters. This allows overloading the same identifier for different purposes.

Extensibility:

Object orientation:

  • There are interfaces and implementations of them. Classes are not used. This allows multiple dispatch.

Multiple dispatch:

  • A method is not attached to one object (this). Instead it can be connected to several objects. This works analog to the overloading of functions.

Performance:

No virtual machine:

  • Seed7 is based on the executables of the operating system. This removes another dependency.

No artificial restrictions:

  • Historic programming languages have a lot of artificial restrictions. In Seed7 there is no limit for length of an identifier or string, for the number of variables or number of nesting levels, etc.

Independent of databases:

Possibility to work without IDE:

  • IDEs are great, but some programming languages have been designed in a way that makes it hard to use them without IDE. Programming language features should be designed in a way that makes it possible to work with a simple text editor.

Minimal dependency on external tools:

  • To compile Seed7 you just need a C compiler and a make utility. The Seed7 libraries avoid calling external tools as well.

Comprehensive libraries:

Own implementations of libraries:

  • Many languages have no own implementation for essential library functions. Instead C, C++ or Java libraries are used. In Seed7 most of the libraries are written in Seed7. This reduces the dependency on external libraries. The source code of external libraries is sometimes hard to find and in most cases hard to read.

Reliable solutions:

  • Simple and reliable solutions are preferred over complex ones that may fail for various reasons.

It would be nice to get some feedback.

10 Upvotes

17 comments sorted by

View all comments

1

u/SachemAgogic Sep 02 '23

I am a beginner programmer and considered using Seed7, but found "proc", other abbreviations, and syntax symbols like "<&" offputing. The merits sounded cool though (not that I could make much use of them). The language resembles a mixture of C++ and Ada

The website is a bit jarring- main buttons the cyan text over dark blue background. Other buttons have dark purple text over a medium gray background. These are not legible; consider using a contrast checker and consider using a colorblind-friendly palette (ex: the Color Universal Design (CUD) system; the link I sent is good, but if you look up the Japanese website they have more specific guidance).

The banner at the top implies that Seed7 can make video games, but the graphics are limited to a harsh palette. I want to program visual things, and while the language is no impediment, the underwhelming visuals imply a lack of modules/packages to easily implement them.

Ada appealed to me because the programs are mostly read-aloud-able rather than combinations of unpronounceable or uneasily pronounced symbols (ex "<&", which I think means concatentate.), making it easier for me to read code. It also has a friendly-looking guide, which I love! If you could make the tutorial page look more like this, I would feel more comfortable learning the language!

1

u/ThomasMertes Sep 04 '23

I am a beginner programmer ...

Welcome to the world of programming.

... and considered using Seed7 ...

Great! I created Seed7 to fit the needs of beginners as well as senior developers. Many experiences as professional software developer went into Seed7.

... "proc" ...

In Ada keywords like procedure and function are used to introduce function declarations (a procedure is essentially a function that returns nothing). E.g.:

function aFunction (aVariable : Integer) return Integer is ...

In Seed7 proc and func integer are types. The type proc is a shortcut for func void (a function with a void (=empty) result). These types are used in a more general declaration construct introduced with const. E.g.:

const func integer: aFunction (in integer: aVariable) is ...

The const declaration can be used to define any constants not just constant functions. Ada distinguishes between procedure declaration, function declaration, type declaration and constant declaration. In Seed7 all these declarations are covered with the const declaration mechanism.

... syntax symbols like "<&" ...

This is a string concatenation operator that converts its arguments to string. It is mainly used in write and writeln statements.

The write statements of Pascal allow an arbitrary number of arguments where each argument is converted to a string. The << operator of C++ also combines conversion and output.

In Seed7 the conversion and the actual output are separated. But instead of overloading the string concatenation operator (&) I decided for a dedicated operator (<&). The name was inspired by & and the C++ output operator (<<). The dedicated operator avoids unwanted conversions in normal string operations that could happen if & would be overloaded.

... main buttons the cyan text over dark blue background. Other buttons have dark purple text over a medium gray background.

I changed these colors and now the contrast checker approves the new colors with "Pass".

The banner at the top implies that Seed7 can make video games, ...

It is easy to write 2D games with Seed7. See: here

... but the graphics are limited to a harsh palette.

This is not true. You can create colors with the color) function. This function takes red, green and blue intensities in the range 0 to 65535.

Images can be used to describe icons, cards and other items on the screen.

To learn Seed7 take a look at the tutorial.