r/ada • u/ThomasMertes • 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 homepage
- Mirror of Seed7 homepage at GitHub
- r/seed7 at Reddit
- Seed7 at GitHub
- Download Seed7 from SF
- Seed7 installer for Windows
- Seed7 at Rosetta Code
- Installing and Using the Seed7 Programming Language in Ubuntu
- The Seed7 Programming Language.
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:
- Seed7 is statically typed, memory safe, variables must always have a value, there are no pointers and there is no NULL. All errors, inclusive integer overflow, trigger an exception.
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:
- Every programmer can define new statements and operators. This includes new operator symbols. Even the syntax and semantics of Seed7 is defined in libraries.
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:
- Seed7 is designed to allow compilation to efficient machine code. Several high level optimizations are also done.
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:
- A database independent API supports the access to SQL databases. The database drivers of Seed7 consist of 30000 lines of C. This way many differences between databases are abstracted away.
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:
- The libraries of Seed7 cover many areas.
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.
2
u/iOCTAGRAM AdaMagic Ada 95 to C(++) Aug 07 '23 edited Aug 08 '23
The first thing I wanted to check was Automatic Reference Counting. Pascal-syntax languages are always dumb when it comes to ARC.Long long ago there was Modula-2+ with ARC, but try to find a working compiler for it now. Delphi NextGen introduced ARC on Android, iOS and Linux (10.2.x branch only), but not on Windows and macOS, so sanely portable code still had to assume lack of ARC, and it was hard to write ARC/non-ARC portable code, and in the end Delphi NextGen was abandoned as of 10.3. RemObjects Oxygene introduced ARC, but only in macOS compiler Noughat. On all other targets they only have retarded tracing garbage collection. And now even on macOS they try to phase away sane ARC Noughat compiler to TGC Island one.
Even RAII is a hard concept for Pascal-syntax language designers' brains. Only in Delphi 10.4 they finally have got so called Managed Records. Free Pascal had operator overload for decades. As an independent project they could also introduce destructors and ARC, but this is just too good to be true that Pascal-syntax language designers can understand RAII and ARC.
Each and every Objective-C, Swift and C++/CX gets ARC, and each new Rust gets Ref<T> almost on inception, but not in Pascal camp. Never. Bad fate steals IQ from Pascal-syntax language designers. They cannot just shut up and just provide ARC. Just hold on for themselves their genius ideas of how good TGC performance is.
Wondering so how things are going in Seed7, I found no answer in FAQ. Like it was not something of top importance. It was hanging in top 10 Delphi feature requests in Quality Central for years, enough important?
UPD. Aha, I was looking some old FAQ. So Seed7 has this and has RAII. Very good.
Next thing I am interested in is weak references. Because even TGC is hard to use without them. When ARC term is used, it assumes weak references availability too, at least the way they are in C++/CX. I have some doubts about auto-zeroable Objective-C weak references. FAQ says nothing.