r/ProgrammingLanguages • • Oct 29 '26

How programming languages approach graphics

Many general-purpose languages delegate graphics to third-party libraries (like SDL, Raylib, or OpenGL). Seed7 integrates portable 2-D graphics right into its standard library. This IMHO improves portability. I also thought about introducing operators / statements to do graphics, but until now I don't use operators or statements to do graphics.

29 Upvotes

81 comments sorted by

View all comments

1

u/Long_Investment7667 Oct 30 '26

Putting too much into a language or is standard (base) library makes it hard to evolve the language because you want old code to compile with newer compilers without code changes. This is “just” backwards compatibility but with a huge set of data (the code) that needs to be supported

1

u/ThomasMertes Oct 30 '26

Seed7 programs must start with:

$ include "seed7_05.s7i";

Note that this include file contains the version number 05. This opens the opportunity to introduce future versions of Seed7 with breaking changes.

1

u/Long_Investment7667 Oct 31 '26

Which still means I have to touch the code to use newer versions.

https://youtu.be/PNLHxR4EtYs?is=yEHDgt-w-ONyikus

1

u/ThomasMertes Oct 31 '26

Thank you for the link.

Which still means I have to touch the code to use newer versions.

Yes, but only if you need the new features. Think of the step from Python 2.0 to 3.0. This is addressed with my approach. If your Seed7 program wants to use the e.g. 27 version of Seed7 the program must start with:

$ include "seed7_27.s7i";

After that you can use the features of the new 27 version (and some features of the old 05 version will be gone).

Seed7 interpreter and compiler would be able to handle both, the old 05 version and the new 27 version. So there is no need to change your program after an interpreter/compiler upgrade.

Supporting two versions of the language is easy for Seed7, since syntax and semantics of the language are defined in libraries and not hard-coded in the compiler. Yes, the Seed7 statements and operators are defined in libraries.