r/ProgrammingLanguages • • 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

81 comments sorted by

View all comments

Show parent comment

3

u/ThomasMertes 29d ago edited 29d ago

What kind of graphics are you trying to do?

2-D

Drawing primitives?

The description of the graphics library is here. It would be nice to get feedback about this description.

Why?

To allow writing portable graphic programs like these retro games or tools like the picture viewer.

Why would I want to learn some new language to convert a jpeg?

This is the wrong question. I created a Seed7 as practically usable programming language with these design principles. Seed7 is, among other things, capable of reading a JPEG (PNG, GIF, etc.) file. This is a proof that Seed7 is capable of solving real world problems.

If someone is interested how JPEG is read it is either possible to study a C library (which is usually hard to read) or the Seed7 JPEG library which might be easier to understand.

If you are against using C libraries, ...

This is a simplification. C is generally considered as not memory safe and there is a strong push (not only from governments) to move to memory safe languages. The graphic libraries written in Seed7 are just one part in the bigger movement which tries to replace C with something safer (like Rust or Seed7).