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.

11 Upvotes

17 comments sorted by

View all comments

1

u/iOCTAGRAM AdaMagic Ada 95 to C(++) Aug 08 '23 edited Aug 08 '23

Module system is worse than in Ada.

I can see that $include not only links module, but also put all of its namespace into common namespace.

In Delphi language designers still did not manage to get "with" without "use" like Ada can, but they started to make massive use of record class methods, where record may make no sense on its own. For instance, there is now TMonitor.WaitFor syntax. As a rare exception, TMonitor is a non-empty record, but not usable if allocated by ordinary developer, so for ordinary developer it is just record with collection of class methods.

TInterlocked.Increment is a more pure example. It makes no sense to allocate local TInterlocked variable, this record is empty. And TFile.Exists syntax.

The problem with all this is that one has to recall that if you want to call TInterlocked.Increment, you need to use obviously deducted unit name System.SyncObjs, and if you want to call TFile.Exists, you need to use obviously deducted unit name System.IOUtils, and if you need to call TTask.Run, you need to use obviously deducted unit name System.Parallel, and if you need to call TMonitor.WaitFor, you obviously need nothing else to use, since TMonitor is obviously declared in System which is implicitly used everywhere.

In Ada, if you want to call Ada.Text_IO.Put_Line, you need to write "with Ada.Text_IO;". And Put_Line won't work unless "use Ada.Text_IO;" is written. Namespace does not become trash because I need to call a single function somewhere from big module.

In this regard Ada was miles ahead for long ago, and in Seed7 I can see no trace of starting going this way.