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

2

u/Inconstant_Moo 🧿 Pipefish 29d ago

I provided basic bmp, jpeg and png libraries, and color to support them. gif is coming soon. However, if you want to do high-performance graphics in Pipefish, you can get the support you need --- just visit a psychiatrist, and when they ask you that question about "have you thought of harming yourself or others", say "yes".

2

u/ThomasMertes 29d ago

Are you talking about png.pf?

This file has a lot of golang { ... } constructs, so it is essentially GO code and not Pipefish.

2

u/Inconstant_Moo 🧿 Pipefish 29d ago

In the same way that Python is essentially C, yes. That's the beauty of it, almost all of my standard libraries are industrial-strength and maintained by top-tier SWEs at a FAANG company, none of whom I am paying.

2

u/ThomasMertes 29d ago

FAANG does not pay either. AFAIK most libraries are provided by an unpaid developer in Nebraska. So the libraries you use are probably not maintained by top-tier SWEs at a FAANG company. In addition to that I have doubts that FAANG would guarantee quality.

Your png.pf tells me:

Pipefish is capable of calling GO, which is capable of doing the real work.

This is okay and I wish Pipefish all the best.

The goal for Seed7 differs from this:

Seed7 is capable of doing the real work, like GO does.

Reading a graphics file in GO or Seed7 needs many pieces, to be achievable. This involves reading big- or little-endian data, decompression (deflate, LZW, LZMA, huffman, arithmethic compression, etc.), interfacing the graphics library and much more. In GO all these things are available and in Seed7 as well.

I use this approach on one hand to show how capable Seed7 is and on the other hand I am skeptical towards huge C libraries where the number of developers and the understanding of the code is small.

Most security related bugs come from huge C libraries where almost nobody understands the code.

0

u/Inconstant_Moo 🧿 Pipefish 29d ago

FAANG does not pay either. AFAIK most libraries are provided by an unpaid developer in Nebraska.

These claims are spurious and have been debunked.

In addition to that I have doubts that FAANG would guarantee quality.

Well of course nothing can guarantee quality, but (a) the sheer number of people they have depending on their standard libraries must do something to maintain quality (b) their test suites are huge (c) you know that thing in cartoons where the guy steps on a rake and it flips up and hits him in the face? I've done that twice in the same day, so if it's between them and me maybe it should be them.

I use this approach on one hand to show how capable Seed7 is ...

I use my approach to show how capable Pipefish is. Of helping people to steal things things. A great philosopher once spoke of the advantages of theft over honest toil, and I forget the rest of the quote but one day I'm definitely going to find out if he had anything positive to say about slapping idiots round the back of the head, we need more philosophers who are also enablers.

---

FYI, the only parts of the Go stdlib written in C are parts of cgo (the C FFI), parts of os/user, and the parts of net that do domain name resolution. Both of the last two are optional and have pure Go versions but the default is to use C. I don't know why. Reasons.

3

u/ThomasMertes 28d ago

FAANG does not pay either. AFAIK most libraries are provided by an unpaid developer in Nebraska.

These claims are spurious and have been debunked.

No, this famous XKCD strip unfortunately describes reality. See the list of projects with few maintainers I posted.

Referring to libraries written by FAANG you wrote:

(a) the sheer number of people they have depending on their standard libraries must do something to maintain quality (b) their test suites are huge

If FAANG companies sell libraries this is probably true. But spending money on a library and giving it away for free is usually not their thing. Adobe Flash was given away for free and it was not famous for being well tested and bug free. Companies want to make money, which is okay.

If you think that FAANG software is better, fine for you. I have a different view. And I think that most standard libraries are written by open source volunteers and not by FAANG.

In my daily life I use Linux, bash, GCC, clang, emacs, X11, etc. All of these are open source and nothing is from any FAANG company.

I use my approach to show how capable Pipefish is. Of helping people to steal things things.

Yes, I know that Pipefish is capable of calling Go, as shown in png.pf.

FYI, the only parts of the Go stdlib written in C are parts of cgo (the C FFI), ...

According to my definition of memory safety Go is not a memory safe language (look up the article on my argumentation for that). From my point of view allowing direct calls to C functions or Go functions both make a language memory unsafe. So, if Pipefish allows direct calls to Go or C, it is not a memory safe language. If you read my article you see that I consider many languages as not memory safe.

2

u/Inconstant_Moo 🧿 Pipefish 28d ago

If FAANG companies sell libraries this is probably true. But spending money on a library and giving it away for free is usually not their thing. Adobe Flash was given away for free and it was not famous for being well tested and bug free. Companies want to make money, which is okay.

If you think that FAANG software is better, fine for you. I have a different view. And I think that most standard libraries are written by open source volunteers and not by FAANG.

I'm talking specifically about Go, and the history of its development is well-known. Its standard libraries were built in-house and Golang is free and open-source. This is because Google built it not to sell to people but to use themselves to write software with. For this they wanted reliability and the many eyeballs that FOSS brings to a project. Unlike Adobe Flash, their standard libraries are famous for being well-tested and bug-free. Worldwide in production I estimate people are calling for example their time library between 10 billion and 100 billion times a second. If there was something wrong with it, someone would notice. I am only one person, spread thin, I'm not going to try and reimplement that better. Time is short, time is long.

1

u/ThomasMertes 28d ago

I'm talking specifically about Go, ...

Now I got it. You were talking about the G in FAANG. :-)

Google probably sees Go like Sun saw Java. I can imagine that they put a lot of effort in improving and pushing Go.

Did you take a look at my "Achieving memory safety" article and what do you think about the description of my graphics library?

2

u/Inconstant_Moo 🧿 Pipefish 28d ago

Now I got it. You were talking about the G in FAANG. :-)

What the rest of them do has no implications for the Pipefish stdlibs.

Google probably sees Go like Sun saw Java. I can imagine that they put a lot of effort in improving and pushing Go.

Not really. No language has the same history as Java. Having failed as a language for embedded systems, it pivoted to being used for embedded apps in the browser, and then when it failed at that too, Sun spent a literal billion dollars on advertising to persuade Business Idiots that despite having failed at the thing it was designed for and the thing it was redesigned for, it was somehow the perfect language to solve enterprise problems that it wasn't designed for at all.

Did you take a look at my "Achieving memory safety" article ...

I did. Guarantees are good of course, but then so are escape hatches ... it depends on the use-case for Seed7, which I'm afraid I haven't dived into much yet.

... and what do you think about the description of my graphics library?

I'm puzzled by why you have your own fonts.

String array images are cute. This is the sort of thing though that Go/Pipefish would omit from their standard libraries on the grounds that it's not a standard --- pretty much everything in the Go stdlibs has an ISO number, rather than just being a nice thing to have.

-2

u/arthurno1 29d ago

Most security related bugs come from huge C libraries where almost nobody understands the code.

Mnjah. How do you think people hack and develop those libraries if nobody understands the code? That is of course nonsense. If you truly believe that than it is you who don't understand the code and coding process.

Programming is hard. We people have hard time to keep big networks of code and details and myriads of branches and interactions that can happen. That has been known since 1950s, and is the motivation behind programming language and software engineering research that has being going since than. "Safe languages" are "safe" because they eliminate possibility for programmers to make certain class of errors through usually some sort of clever automation, like automated memory management for example.

So while yes, huge code bases are of course problem for humans to digest, I certainly wouldn't say that "almost nobody understands the code". Also to note, LLMs are another proof that we humans are bad at keeping too many details in our head. I have been finding bugs that have been in a certain compiler since 20 years back because nobody had time to think of or test certain paths that aren't taken normally, but LLM spits them in seconds. The same for the easy optimizations.

3

u/ThomasMertes 29d ago
  • XZ Utils (liblzma): For years, it was primarily maintained by one person (Lasse Collin) in his spare time. Maybe you can remember the XZ Utils Backdoor Incident (2024).
  • Dnsmasq (Billions of Routers and IoT Devices): Primarily developed by one person (Simon Kelley).
  • OpenSSL: Historically maintained by just two or three core volunteers (often referred to as "the two Steves").
  • Ncurses: Primarily developed by one person (Thomas Dickey).
  • libreadline: Primarily developed by one person (Chet Ramey).
  • SQLite (The Most Deployed Software on Earth): Developed by a hyper-exclusive core team of just three developers (led by D. Richard Hipp).

0

u/arthurno1 28d ago

Honestly, I don't understand what you argument is here, and how is that in yours favor? You seem to argue that we should not use software developed by hobbyst/small teams because there can be vulnerabilities? Is that what you are trying to say there?

So why should anyone than use an entire programming language, with an entire "standard library", graphics library, database. network, etc, all developed by a single person, you? :)

By the way, Linux, Windows, Chrome, Firefox, MS Office, Libre Office, etc, many, many, many other software projects have had various bugs, security-wise or others. So how does that hang together with your theory, why do they have bugs?

Because there is a "lone developer" in the chain, or something? Or perhaps because, as I said, software development is complex and humans have hard time to keep everything in their heads.

Compare to lazer measuring and cutting: similarly humans can't see to a 1000th part of a millimeter, but a CNC machine with a lazer cutter and optics can. What humans are better at is creative problem solving, seeing parallels and adapting solutions from other areas of life which machines (LLMs) can't seem to be able to do. At least not for now.

3

u/ThomasMertes 28d ago

My list proofs that huge C libraries exist, where almost nobody understands the code. And these libraries are used a lot. This is exactly what the famous XKCD strip addresses. It is NOT nonsense that just a few people hack and develop those libraries.

So why should anyone than use an entire programming language, with an entire "standard library", graphics library, database. network, etc, ...

For the same reasons why XZ Utils, Dnsmasq, OpenSSL, Ncurses, libreadline, and SQLite are used: People like to use what is provided for free and don't care about the size of the development team. Additionally Seed7 and its libraries are memory safe (unlike XZ Utils, Dnsmasq, OpenSSL, Ncurses, libreadline, and SQLite which are not, because they are written in C).

You can take a look at "Achieving memory safety" to see why Seed7 is memory safe although it is implemented in C.

By the way, Linux, Windows, Chrome, Firefox, MS Office, Libre Office, etc, many, many, many other software projects have had various bugs, security-wise or others.

Many of these bugs are because the programs are written in C, which is not memory safe. Your examples proof what I say: C is not memory safe and therefore triggers bugs.

Because there is a "lone developer" in the chain, or something?

No

Or perhaps because, as I said, software development is complex and humans have hard time to keep everything in their heads.

Exactly. And the choice of using C makes it IMHO harder to keep everything in their heads.

-1

u/arthurno1 28d ago

My list proofs that huge C libraries exist, where almost nobody understands the code.

Your list does not proof that nobody understands those libraries. It just proves that you don't understand what you are talking about, as I said in the opening of my first comment. Downvoting each of my comments just show you are an emotional person who can't take when you are wrong, and that will also reflect on your software, because you will make decisions just to assure you are the right one.

By the way, we already know that "huge" libraries exist, nobody lives in the isolated island as you seem to think, and yes we have all seen the comic. While there is a certain truth in it, otherwise it wouldn't be funny, that is not a tautology in the sense you are interpreting it. Also, for the record, neither xy, nor sqlite are directly "huge libraries that nobody undrstands". Your list proofs that bugs exist in software, it also proofs that other people understand those libraries because they have found bugs and fixed them. It also proofs that you don't really understand what you are into, since the argument you are making is against your own case and proposal for other people to use your language and your libraries.

Your examples proof what I say: C is not memory safe and therefore triggers bugs.

You wish you said that, but that is not what you are saying. What you are saying, whether you are just honestly mistaken or intellectually dishonest, is that bugs are there because "huge libraries are developed by lone developers and nobody understands them".

That was the argument I refuted in my very first comment, and you try to reinforce with your list. Which is a shit take on a mistake, if I am allowed to express myself that way. C and memory safety is a completely different topic you are regressing into. I can discuss that too if you want:

Many of these bugs are because the programs are written in C, which is not memory safe.

Sure, C is not memory safe, but memory safety is only a class of bugs; there are other bugs and also other aspects to safety, not just memory safety: type safety, thread/concurrency safety, cryptographic safety, injection vulnerabilities are what I remember while I type this. There is probably more.

For your article on memory safety:

Either these things are guaranteed by the language, or every developer must manually handle them. Non-memory-safe languages shift burden from the language implementation to the developers.

We are in agreement in general, that is my standpoint too, either language implements it, but than you have to accept a small performance hit where compiler can't proof the bounds for example. For the record also, I didn't argue people should use C.

I can also comment the end of your article, since I have read it, and I don't see you touch on the performance. For the performance of your language, you don't speak about how you manage writes to elements stored in collections, and what is the performance of dereferencing pointers in tight loops in your collections. From my eperience on hacking compilers, recently mostly a Common Lisp compiler I would guess pretty shit, similar to this discussion.

2

u/ThomasMertes 28d ago

I should have written:

Many security related bugs come from huge C libraries where almost nobody understands the code.

Sorry for that. Most was wrong. Using the word many is hopefully better. Note that I wrote ALMOST, which you left out every time you cited me. "nobody understands the code" is nonsense, but "almost nobody understands the code" is IMHO not nonsense. To make it clear: My critic is towards C and not about the size of the development team.

BTW.: I did not downvote you and I declare you as "winner" of this discussion. :-)

→ More replies