r/ProgrammingLanguages • u/ThomasMertes • 29d ago
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
30
u/msqrt 29d ago
Building simple 2D graphics into the standard library sounds pretty good (so the jump from CLI to a GUI isn't as massive), but for real-time 3D rendering you'll need to expose quite a bit of machinery to allow enough control for high performance. Modern graphics APIs are mostly about managing the state and synchronization of GPU tasks, with the actual graphics happening in user-written shader code. A language that did all of that natively would be great, but also difficult to design and probably prone to becoming outdated (graphics API philosophy has gone through some drastic changes in the past couple of decades, and the next shift seems to be bubbling beneath the surface.)