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
2
u/P-39_Airacobra 29d ago
The irony of the issue is that if we just relinquished control, hardware could arguably become much faster. So much of hardware advances are being spent trying to run C fast, when the problem with C is that ANYTHING can happen, which makes it inherently difficult to optimize while still being correct.
C compilers themselves run into this problem consistently, where optimization needs to be opt-in because there’s no way to optimize C without breaking its semantics in some subtle way.
This is the problem with languages that expose everything: ultimately when you give the programmer the choice, you also give them the responsibility; that is, the compiler/architecture can no longer step in and make assumptions for you.
Is this a bad thing? Not inherently; though it is a costly trade-off for sure.