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

Show parent comment

2

u/Inconstant_Moo 🧿 Pipefish Oct 30 '26

But no, there we are another version of "my C" is nicer looking than "your C".

But for the use-cases people write those things for, that's kind of what they want. People are going to want to say "Yes your abstractions are very nice but I want to do <thing> to make hot loop go brr. I need to get these scissors from here to there very quickly and no programming language is going to stop me from running with them."

And so you delegate the creation of abstractions to the writers of libraries and frameworks and the language primitives expose the metal.

The sameness of the projects is that most indie langdevs who aren't me have followed similar career trajectories that led them to want to solve similar problems.

3

u/arthurno1 Oct 30 '26 edited Oct 30 '26

Interestingly enough, I am downvoted to death in another thread about similar topic, where I say exactly the same as you say here: some people want their hot loops go brrr and they refuse any higher-level overhead.

I think personally, for the security and productivity reasones, people would have to accept they have to give up the direct access to their hardware. I remember 90s and game development discussions: people claimed there will never be serious games made in Windows OS and DOS will continue to live because games need total access to the hardware to go brrr. We all know the history.

Yes, that is the controversy of today's software dev: you have experts and scientists who propagate higher level languages and abstractions for safety and productivity, and than you have an indie developer who just learned programming, did a benchmark and found the benchmark runs faster in an unsafe language, and they want that. I am guilty myself of the same: I wrote a fast software in Lisp which equals the optimized C++ version (by someone else) just to demonstrate this exact thing. Now, that does not mean I advocate for unsafe languages. What I truly believe is that most people don't really need those 5% ~ 10% of the performance, especially not in the interactive applications like games or office software. While yes, we do need system languages, that let us access low level hardware, like C++, C, or Rust, I don't think that people need to develop user-facing software in those languages. In my opinion, they are better left to system development, like drivers and kernels, low-level systems, where you need to access low-level hardware registers and systems.

Look at Quake I; back on the hardware of the time, they achieved interactive frame rates in OpenGL. Carmack wasn't complaining about getting access to low-level hardware. Back in that time Carmack even invented Quake C, because well, the speed was enough. If you ask an indie dev today: only pure C, Rust, C++ ... insert compiled language is enough for everything.

So yeah, I agree with you, the flavor of the day is what shapes discussions and what people do to.

2

u/Inconstant_Moo 🧿 Pipefish 29d ago

What I truly believe is that most people don't really need those 5% ~ 10% of the performance, especially not in the interactive applications like games or office software.

Games though have an unlimited ability to use up clock cycles, you can always use them to render things better.

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.

2

u/arthurno1 29d ago

Yes, definitely; that is a good take on it. People have different priorities and make different choices, sometimes even contradictory, so if language designers will cater to everyone, they have to have to make a tradeoff.