I am happy to take a PR for this. I do have the tablet, and I assume it'll work with the UTM emulator running Ubuntu un my Mac. So, yeah, I should be able to test the code.
If you have API improvement, please absolutely posy them here or in an issue report. We will release 1.5.0 in a few months, which will limit future changes to the API - or in other words, whatever we can change now is easy. It will be hard to change the API later. ;-)
Added PR as #1451. Actually, it was not an API improvement, just a code issue.
Let me know if you cannot get it compiled.
-- -- Gonzalo Garramuño ggar...@gmail.com
maybe Matthias can evaluate the code quality, but I'm not sure if this is enough. Another important point would IMHO be to document the question (task) that was given to the AI to generate this particular code.
Note that we did not yet decide if we allow AI generated code at all in FLTK. There are certainly some important reasons NOT to allow AI generated code, and I read in PR #1451 "Code by ClaudeAI untested". This woule preclude accepting this PR, if we didn't allow AI generated code.
My opinion on AI generated code (in a nutshell, not yet finally thought about):
CONTRA:
1. Copyright: we don't know where the code comes from, and whose copyright might be on that code (maybe several places with different copyrights/licenses). We can't claim our own copyright (as given in the code).
This is indeed one issue that we agree on. I do hold the belief that copyright cannot be completely thrown out the window just yet, as both artists and coders could be easily taken advantage of, specially by big corporations. Someone that is creative (whether as artist, coder or both) should be allowed to benefit from his creation, specially if it brings joy to the world.
When I started coding with the help of AI, I did ask in some
occasions to the different chat bots whether they infringed on the
copyright. They denied it. I could not verify it either way. I
could only catch Gemini infringing on the copyright when it came
to YouTube. But I also do give them credit for trying not to.
When I asked Gemini for the lyrics of "Los castillos se quedaron
solos", they quickly showed a different (albeit similar) lyric.
However, when I asked them about a YouTube video that had uploaded
it without permission and asked for the lyrics from it, the engine
showed the real lyrics. Gray area.
Nowadays my belief is that all chatbots are no longer infringing
on copyright.
2. Maintainability: AI generated code can be complex (especially if events and third party libraries, e.g. Wayland core/protocol, come into play). Humans can't test and debug code they don't understand, etc. etc.
This I partially agree, but these days it highly depends on what Chatbot you are using (and whether you are *paying* for the generated code) and each chatbot keeps improving each day. As of today, ClaudeAI is the best free coding choice for *me*. It allows you to switch to different models (so you regulate yourself), it writes simple code to follow, generate explanations (both in the code and in the response), knows FLTK and python well enough (at least up to v1.4) and most people in the VFX circles I work on prefer it. The catch with the free ClaudeAI is the context and time window they have.
ChatGPT excels at explanations and translations of .po files. It is the one that knows literature the best and common answers to everyday affairs (legal and medical issues, etc). When most people think of AI, they think of ChatGPT. ChatGPT, in general, teaches you and does not give you code in general (at least for free). The good thing about ChatGPT (at least outside the US) is that it has no time limit (at least for me). It is my go AI for starting a project.
GrokAI is the fastest at giving you working code, unlike ClaudeAI which can take minutes to answer. It also knows how to go to public repositories with the user's permission. But with the transition to/from SpaceX, the quality of the code suffered and I do agree its code is now unmaintainable. We'll see how they do from now on, as according to the AI news I get, they now rent their servers to ClaudeAI too.
Gemini also does not have a time limit (at least for me). They excelled at FLTK knowledge, as they pinpointed ManoloFLTK's answer in the issue I posted about programmatically moving the windows. They went further than ClaudeAI providing a working (partial) solution but I needed to know more about the innards of FLTK Windows API to tell.
Perplexity: they were the first to put Google to shame in
searches, by linking answers and ranking AI pages.
Co-Pilot: never tried it as it does, afaik, have a web page.
Deepseek: again. Never tried it. Unfortunately, I do not speak
Chinese and I am too old to learn it.
3. Coding Style: how do we ensure that the AI generated code follows our coding style?
This is a non-issue with ClaudeAI. It generates code tailored in the style of FLTK or camel case when you feed a sample of it.
4. Code quality: who can evaluate this before we would include it in the library?
PRO:
1. Maybe easy to create, but: would this justify its usage, given the CON's above?
Except for the torn about copyright/legal issue, I would say
yes. Computers were created to simplify tasks (typing
originally). Programming *IS* hard. Particularly in highend
languages like C++, rust and assembler.
Nowadays Chatbots can generate code that is better and simpler
than most programmers (certainly they have surpassed me. They
have not surpassed Manolo, Linus, or yourself in CMake yet).
I want to live in a future where anyone creative can create a new software to solve a problem or a new piece of art to share with people.
In this particular case: maybe Matthias can evaluate the code quality, but I'm not sure if this is enough. Another important point would IMHO be to document the question (task) that was given to the AI to generate this particular code.
More opinions would be appreciated, but we must definitely make a qualified decision about this topic before we begin to include AI generated code at all.
Let me tell you a story about coding or where I think coding is
headed. Back at DD, when I started, I learnt TCL in a day and
improved one of the utilities of the facility. After Titanic, I
wanted to get access to a C compiler, as I already knew the
language from learning it in Argentina. C compilers were also
expensive. The head of the software department at the time (won't
mention his name) was extremely opposed to it. And, some of the
arguments against it were similar to the ones you mention
regarding AI. My code would be unmaintainable, I would not know
about the legal implications, etc. All valid points (still to
today), but.... my code worked and made artists happier for the
time being. Eventually something better would come along or I
would move on. In the US, where free competitio rules, this
brings progress.
2) Climate change. This is to me, the most important CON against
AI, more than copyright. We just don't realize or know for sure
how bad Earth is suffering and in what shape will the new
generations receive it. This is really the one issue that can
lead to a third world war and/or the extinction of humanity as we
know it. It can also lead to a "judgment day", where people like
me who abused of AI will need to be accountable for it.