Use AI to do portage or software on MorphOS?
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2154 from 2003/4/10
    From: France
    Hello,

    i would like to use AI to do portage and software for MorphOS.

    Do you know if there is specific IA for that?

    Example: give the MorphOS SDK and SDL2 SDK to an IA to help to do portage and software will be possible?
  • »04.09.24 - 15:45
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Tcheko
    Posts: 529 from 2003/2/25
    From: France
    Quote:

    Papiosaur wrote:
    Hello,

    i would like to use AI to do portage and software for MorphOS.

    Do you know if there is specific IA for that?

    Example: give the MorphOS SDK and SDL2 SDK to an IA to help to do portage and software will be possible?


    It is unlikely. AI is mostly untrained on amiga stuff. It will probably fail to grasp specifics of the plateform.

    From my own experience, I once tried to make Gemini spit AmigaOS oriented code, I had to correct it numerous times for producing something that would work...

    Hint: it does shit, AI isn't magic.

    You still *need* to:
    - know how to write code,
    - how the API is supposed to work,
    - understand the AI produced garbage,
    - correct it where it fails.

    Still, you can try to ask Claude or install Cursor and try to prompt it to build a complete MUI example from scratch, like for example a simple window with a close button in the middle.

    And don't forget to let us know the result. :)
    Quelque soit le chemin que tu prendras dans la vie, sache que tu auras des ampoules aux pieds.
    -------
    I need to practice my Kung Fu.
  • »04.09.24 - 16:04
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2154 from 2003/4/10
    From: France
    Quote:

    Papiosaur: i would like you learn the MorphOS SDK


    Quote:

    Claude: I appreciate your interest in having me learn the MorphOS SDK. However, I'm an AI language model without the ability to actively learn or update my knowledge base in real-time during our conversation. My training is fixed, and I don't have the capability to install or interact with software development kits.

    That said, I'd be happy to discuss what I know about MorphOS development and provide some general information about developing for MorphOS. If you're interested in learning the MorphOS SDK yourself, I can offer some guidance on where to start or what resources might be helpful.

    Would you like me to share some general information about MorphOS development? Or perhaps you have specific questions about certain aspects of developing for MorphOS that I could try to address based on my existing knowledge?


    :-)
  • »04.09.24 - 16:42
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2154 from 2003/4/10
    From: France
    After some discussions with Claude, this is it's first C source code working on MorphOS:

    Quote:


    #include <stdio.h>

    int main(void)
    {
    printf("Hello, MorphOS World!\n");
    return 0;
    }



    I will continue to discuss with him :-)

    [EDIT] Version PRO is 21,60€/month, i would like to get it because he has send me MUI source code too...

    If somebody want to support me i continue to learn C langage on MorphOS, don't hesitate :-)
  • »04.09.24 - 17:18
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    Throwing money at AI and expecting it to actually be usable in this scenario is waste of money I'm afraid.

    AI does have some uses but this isn't one of them.
  • »04.09.24 - 18:10
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 3079 from 2003/3/5
    From: Canada
    Quote:

    What is the include to support UTF-8 in a MUI GUI please ?


    You have to set MUIA_Unicode to TRUE for every object that's supposed to treat its text as UTF.
  • »04.09.24 - 22:05
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2154 from 2003/4/10
    From: France
    Quote:

    jacadcaps a écrit :
    You have to set MUIA_Unicode to TRUE for every object that's supposed to treat its text as UTF.

    Thanks jacadcaps for this info.

    This a new code proposed by Claude after many, many, many dialog :-)

    Code:
    #include <exec/types.h>
    #include <libraries/mui.h>
    #include <proto/exec.h>
    #include <proto/dos.h>
    #include <proto/intuition.h>
    #include <proto/graphics.h>
    #include <proto/muimaster.h>
    #include <proto/utility.h>
    #include <clib/alib_protos.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>

    #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))

    // Définition des identifiants de menu
    #define MENUID_ABOUT 1
    #define MENUID_QUIT 2

    struct Library *MUIMasterBase;

    static BOOL Open_Libs(void)
    {
    if (!(MUIMasterBase = OpenLibrary("muimaster.library", 0)))
    return FALSE;
    return TRUE;
    }

    static void Close_Libs(void)
    {
    if (MUIMasterBase)
    CloseLibrary(MUIMasterBase);
    }

    int main(int argc, char *argv[])
    {
    Object *app, *window, *button, *text, *aboutwin;
    ULONG signals;
    BOOL running = TRUE;

    if (!Open_Libs())
    {
    printf("Cannot open libsn");
    return 0;
    }

    app = ApplicationObject,
    MUIA_Application_Title, "Mon Application MUI",
    MUIA_Application_Version, "$VER: MonApp 1.0 (01.01.24)",
    MUIA_Application_Copyright, "©2024 Yannick BUCHY",
    MUIA_Application_Author, "Yannick BUCHY",
    MUIA_Application_Description, "Une application MUI simple",
    MUIA_Application_Base, "MONAPP",
    MUIA_Application_UseRexx, FALSE,

    SubWindow, window = WindowObject,
    MUIA_Window_Title, "Ma Fenêtre MUI",
    MUIA_Window_ID, MAKE_ID('M','A','I','N'),
    MUIA_Window_Width, 400,
    MUIA_Window_Height, 200,
    MUIA_Window_MenuStrip, MenustripObject,
    Child, MenuObject,
    MUIA_Menu_Title, "Fichier",
    Child, MenuitemObject,
    MUIA_Menuitem_Title, "À propos",
    MUIA_Menuitem_CopyStrings, TRUE,
    MUIA_Menuitem_Shortcut, "A",
    MUIA_UserData, MENUID_ABOUT,
    End,
    Child, MenuitemObject,
    MUIA_Menuitem_Title, "Quitter",
    MUIA_Menuitem_CopyStrings, TRUE,
    MUIA_Menuitem_Shortcut, "Q",
    MUIA_UserData, MENUID_QUIT,
    End,
    End,
    End,
    MUIA_Unicode, TRUE,
    WindowContents, VGroup,
    Child, VSpace(20),
    Child, HGroup,
    Child, HSpace(20),
    Child, VGroup,
    Child, HGroup,
    Child, HSpace(0),
    Child, button = SimpleButton("Cliquez-moi!"),
    Child, HSpace(0),
    End,
    Child, text = TextObject,
    MUIA_Text_Contents, "",
    MUIA_Text_PreParse, "33c",
    MUIA_Frame, MUIV_Frame_None,
    MUIA_Text_Copy, TRUE,
    MUIA_Unicode, TRUE,
    End,
    End,
    Child, HSpace(20),
    End,
    Child, VSpace(20),
    End,
    End,

    SubWindow, aboutwin = WindowObject,
    MUIA_Window_Title, "À propos",
    MUIA_Window_ID, MAKE_ID('A','B','O','U'),
    MUIA_Unicode, TRUE,
    WindowContents, VGroup,
    Child, TextObject,
    MUIA_Text_Contents, "33cnMon Application MUInn"
    "Version: 1.0n"
    "©2024 Yannick BUCHYnn"
    "Une application MUI simple",
    MUIA_Text_PreParse, "33c",
    MUIA_Unicode, TRUE,
    End,
    Child, HGroup,
    Child, HSpace(0),
    Child, SimpleButton("OK"),
    Child, HSpace(0),
    End,
    End,
    End,
    End;

    if (!app)
    {
    printf("Cannot create application.n");
    Close_Libs();
    return 0;
    }

    SetAttrs(button,
    MUIA_Unicode, TRUE,
    MUIA_FixWidth, 120,
    TAG_DONE);

    SetAttrs(text, MUIA_FixWidthTxt, "Bienvenue dans votre première application MUI !", TAG_DONE);

    DoMethod(button, MUIM_Notify, MUIA_Pressed, FALSE,
    text, 3, MUIM_Set, MUIA_Text_Contents, "Bienvenue dans votre première application MUI !");

    DoMethod(window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
    app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);

    DoMethod(aboutwin, MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
    aboutwin, 3, MUIM_Set, MUIA_Window_Open, FALSE);

    set(window, MUIA_Window_Open, TRUE);

    while (running)
    {
    ULONG id = DoMethod(app, MUIM_Application_Input, &signals);

    switch (id)
    {
    case MUIV_Application_ReturnID_Quit:
    case MENUID_QUIT:
    if ((MUI_RequestA(app, 0, 0, "Quitter ?", "_Oui|_Non", "Êtes-vous sûr ?", 0)) == 1)
    running = FALSE;
    break;
    case MENUID_ABOUT:
    set(aboutwin, MUIA_Window_Open, TRUE);
    break;
    }
    if (running && signals) Wait(signals);
    }

    set(window, MUIA_Window_Open, FALSE);

    if (app) MUI_DisposeObject(app);
    Close_Libs();
    return 0;
    }


    UTF-8 seems only supported in the text string, not in title window and requester, menu doesn't work but he don't know the MorphOS SDK.
  • »05.09.24 - 05:03
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Tcheko
    Posts: 529 from 2003/2/25
    From: France
    Quote:

    Papiosaur wrote:
    [...] he don't know the MorphOS SDK.


    While most of the code is somewhat ok (ie: it is valid C), it is still full of stuff that will simply not work. For example, the MUI event processing loop is wrong...

    Also, it (and not he, this is not a real person here...) failed to use MorphOS specifics like our About window class for example.

    Anyway, this clearly shows that:

    - AI isn't a magic wand that is capable of producing 'production' code
    - You still need to understand/write code
    - You still need to know how the API stuff is supposed to work (in this case MUI).

    The result is still interesting nonetheless. This AI has been able to produce some kind of MUI construct which is probably really uncommon in its training set (ie: there isn't large code base of MUI code example on the web compared to GTK, KDE, or whatever GUI toolkit)

    Which brings the question of the use of such data to train their AI model. Has copyright been respected for ex? :)

    Having an AI capable of doing that means that they *scraped* deeeeep in the web for having a decent (ie: very very very large) training dataset.

    Anyway. This code needs to be human corrected in all cases.

    Next step: request a makefile for building it.

    Good luck for building something with Claude. And you'll need a fair amout of :)
    Quelque soit le chemin que tu prendras dans la vie, sache que tu auras des ampoules aux pieds.
    -------
    I need to practice my Kung Fu.
  • »05.09.24 - 06:56
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2154 from 2003/4/10
    From: France
    @Tcheko, for sure it's not the "best" way to do "a clean MorphOS code" but Claude had comments for each line and help me to understand better the C source code. It's for me a tool to progress.

    To continue learn and try to begin a C project for MorphOS: could i share MorphOS SDK (or parts?) to the AI (Claude)?
  • »05.09.24 - 07:13
    Profile Visit Website
  • MorphOS Developer
    geit
    Posts: 1044 from 2004/9/23
    IMHO, AI is better used to find problems and learn from that.

    e.g. handing over a code you cannot find an issue with and simply ask what it is doing. It gives a new perspective. Or asking for a simple function to copy and paste into your code.

    The point is you are learning from that. In my opinion it was always the better option to take some working code and start there by modifying it, instead of digging in e.g. MUI docs. The AI can assist there and hint out the functions or classes required and point on language errors and typos, but the code is usually non working crap you need to check/test yourself.

    Especially with MorphOS you need to have a model trained for Amiga/MorphOS stuff and C to get decent usable results.
  • »05.09.24 - 14:08
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 3079 from 2003/3/5
    From: Canada
    Quote:

    Papiosaur wrote:
    To continue learn and try to begin a C project for MorphOS: could i share MorphOS SDK (or parts?) to the AI (Claude)?



    Noone can stop you, really. But I am not sure what your expectation is here.... LLMs don't have a large enough context to be able to analyze the SDK. You have to train them on the SDK instead.
  • »05.09.24 - 14:13
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2154 from 2003/4/10
    From: France
    @jacadcaps and geit

    Claude AI is impressive, it can analyze log file, learn from source code and i'm sure learn the MorphOS SDK and help to develop specific program for MorphOS.

    For sure, the user must ask what he wants, compile, test, try to understand the code (the AI help to understand), fix problems with the help of the AI or not.

    For the moment, Claude AI has realizeds a small gui with some MUI widgets and perform action with them.

    It's very interesting for me, beginning in C on MorphOS.
  • »05.09.24 - 15:27
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Tcheko
    Posts: 529 from 2003/2/25
    From: France
    Quote:

    Papiosaur wrote:
    @Tcheko, for sure it's not the "best" way to do "a clean MorphOS code" but Claude had comments for each line and help me to understand better the C source code. It's for me a tool to progress.

    To continue learn and try to begin a C project for MorphOS: could i share MorphOS SDK (or parts?) to the AI (Claude)?



    Nothing is said in the license about training AI with MorphOS SDK documentation.

    Afaik, you can copy paste things to prompt to help the 'AI' 'understand' better the context. So, go on...

    And indeed, AI can be a 'good' teacher unless it hallucinates and spit total non sense... I would suggest using multiple AIs to cross correct each of them. Haha. Gonna cost you $$$ :)

    Learning to code is nice. I wish you the best journey in this amazing and infinite realm. :)
    Quelque soit le chemin que tu prendras dans la vie, sache que tu auras des ampoules aux pieds.
    -------
    I need to practice my Kung Fu.
  • »05.09.24 - 17:31
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 799 from 2007/10/23
    From: Gelsenkirchen,...
    LineF? Are you sure, you have PPC code at all?
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »06.09.24 - 11:24
    Profile
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    (I promised myself to shy away from further comments here but I will break my promise to myself...)

    This is exactly why you should not use AI for coding, especially if you're not yourself skilled enough to understand and judge the quality of the code produced. You will have little understanding what the code does and why it has issues.

    LLM itself doesn't understand what it generates and why, either. This is beyond the capabilities of a language model. If you ask it to explain why the code crashes it will attempt to explain it (with confidence) and will likely be totally wrong in its explanation. Since it doesn't have actual understanding this is the best it can do.

    LLMs are at a stage that they're quite convincing in producing totally wrong information. This is deceptive and dangerous.

    That being said, as long as the limitations are understood the LLMs can be very useful tool for e.g, summarizing information. But always verify the results...

    [ Edited by Piru 06.09.2024 - 17:22 ]
  • »06.09.24 - 13:53
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Zylesea
    Posts: 2056 from 2003/6/4
    Piru, indeed the LLMs are quite convincing. They don‘t don‘t do these hesitation noises or small pauses, but just eloquently generate output. I had quite some fun with chemistry and AI (am better on chemistry than on programming, hence…) - solutions on my problems sounded pretty convincing but were way off the real solutions. Funnily this bad chemistry results correlate with the overall poor chemitry coverage in the net.
    Nontheless the AIs con do very useful stuff.
    --
    http://via.bckrs.de

    Whenever you're sad just remember the world is 4.543 billion years old and you somehow managed to exist at the same time as David Bowie.
    ...and Matthias , my friend - RIP
  • »06.09.24 - 15:22
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2154 from 2003/4/10
    From: France
    Now i know the limitation, it's not perfect of course with many errors. It's very important to ask good question. It's a IA with big knowledge but don't think as said Piru, the AI do without reflect. and often don't understand what do you want exactly...

    Now i have a GUI with many MUI widgets with informations about their statute, its a good start to progress i think.

    @polluks: maybe the AI has generate includes from 68k, i will investigate.

    [EDIT] A usage very interesting of the AI, it can create a documentation in french (or other language i think too) for the MorphOS SDK from files and can propose code example too (to correct maybe)
  • »06.09.24 - 16:12
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2154 from 2003/4/10
    From: France
    This is a first exe "created by me and the AI". The goal is just have some MUI Widgets usable with returns of values if possible.

    ShowCase
    butterfly.png

    Copy these 2 files to RAM: and run ShowCase

    Snapshot

    Some MUI widgets, interactions from them, no bug found, menu to quit

    Some gadgets don't work for the moment.

    I have "helped" the AI with some MUI sources (https://www.morphos-storage.net/?id=2024901) and some MUI doc from SDK.

    Difficult to explain to the AI what i want exactly and understand what it need, but i begin to understand structure of C source code and some commands :-)

    Many many ask to the AI to get this first executable: many source code obtained by the AI and some manual changes in code to keep the MUI Widgets working, recompilation, retest, reask to AI,etc.

    I found the result interesting.

    Next steps:

    - requesters
    - listview
    - others MUI Widgets
    - gauge

    To be continued...
  • »07.09.24 - 14:08
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2154 from 2003/4/10
    From: France
    I begin a listview but i don't find the separator to insert multi column names.

    I use this command:

    Code:
    SetAttrs(list, MUIA_LIST_TITLE, "Column 1" ? "Column 2", TAG_DONE);

    I didn't see the information in MUI Docs for List and Listview file.

    Thanks
  • »07.09.24 - 20:30
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 3079 from 2003/3/5
    From: Canada
    Listviews are obsolete and should not be used. Use List.mui directly.
  • »07.09.24 - 22:47
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Papiosaur
    Posts: 2154 from 2003/4/10
    From: France
    Thanks jacadcaps, i believed that List was a part of Listviews and Listview was an evolution of List with columns, sort options, etc.

    For me Examples/MUI/ListExample.c and ListExample2.c was "Listviews".

    My command line is for "List" i think.

    [EDIT] I must confuse with the term "Listview" from Hollywood
  • »08.09.24 - 07:28
    Profile Visit Website
  • Moderator
    Kronos
    Posts: 2304 from 2003/2/24
    Some examples are unchanged since MUI3.8.

    Using List/ListView combo is not really an issue other than making the code a bit less readable.

    As for using multi column modes you have to:

    - set MUIA_List_Format
    - set MUIA_LIst_Title to TRUE
    - either supply a DisplayHook (MUIA_List_DisplayHook) or overload MUIM_List_Display

    You should be able to just start with ListExample.
    Which btw does not use ListView in the current SDK.

    ListExample2 uses MUIA_Listview_Input directly on the List object which is how it should be done.


    [ Edited by Kronos 08.09.2024 - 09:03 ]
  • »08.09.24 - 08:00
    Profile