r/ProgrammingLanguages • u/ThomasMertes • 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
View all comments
Show parent comment
1
u/ThomasMertes 29d ago edited 29d ago
I am not sure I understand your term "userspace library" correctly as all the libraries we are talking about here are in userspace (and not in operating system kernel space).
Can it be that you use "userspace library" for libraries written in Seed7 as opposed to libraries written in C. Is this your definition of "userspace library"?
Many languages provide libraries which are operating system dependent. For example an
X11library which is just available under Linux and awin32library which is just available under Windows. Based on these lower level libraries a higher level library could provide a portable graphics API. Maybe you would use the term "userspace library" for this higher level library.By design Seed7 has no operating system dependent libraries. There is neither an
X11library nor awin32library. This guarantees that it is impossible to write Seed7 programs, which run just under Linux or just under Windows. This is the precondition for the claim that it is impossible to write non-portable programs in Seed7. Every Seed7 program is automatically capable of running on all supported platforms.This design forces that system dependent parts of the runtime library are not available to Seed7 programs. This is the reason driver libraries (written in C) exist. The Job of these driver libraries is: Abstract everything that is operating system dependent away.