Author Topic: Using AI to Code for OS/2  (Read 6172 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Using AI to Code for OS/2
« on: March 31, 2023, 12:24:23 am »
Hi

Today I was talking with a friend and he told me he is using a lot ChatGPT (https://chat.openai.com) to generate code for applications.

I was wondering if someone with better skill than me can do some crazy experiments to try to clone some of the OS/2 functions, an maybe try to move closer to the crazy dream of an open source OS/2 implementation.

I was asking ChatGPT to clone me some OS/2 CPI functions, but I'm not sure if it is providing me things that does work, since I don't have the skill to compile and test those things.

Can someone with more development skill try to see if something can be taught to the AI and produce something that will work for us?


Regards.

Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Using AI to Code for OS/2
« Reply #1 on: March 31, 2023, 12:29:44 am »
For example.

I asked for a clone of "DosGetDateTime".

Code: [Select]
#include <time.h>
#include <os2.h>

APIRET DosGetDateTime(PDATETIME pdtm)
{
    time_t current_time;
    struct tm *local_time;

    // Get the current time
    current_time = time(NULL);

    // Convert the current time to a local time
    local_time = localtime(&current_time);

    // Set the fields of the DATETIME structure
    pdtm->year = local_time->tm_year + 1900;
    pdtm->month = local_time->tm_mon + 1;
    pdtm->day = local_time->tm_mday;
    pdtm->hours = local_time->tm_hour;
    pdtm->minutes = local_time->tm_min;
    pdtm->seconds = local_time->tm_sec;
    pdtm->weekday = local_time->tm_wday;
    pdtm->milliseconds = 0;

    return NO_ERROR;
}

But I have no idea if it is providing something that may work for us.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 1024
  • Karma: +24/-0
    • View Profile
    • Blonde Guy
Re: Using AI to Code for OS/2
« Reply #2 on: March 31, 2023, 12:36:38 am »
It looks useless to me. localtime calls DosGetTimeDate, so every call will return 12:00 Jan 1, 1970. (or maybe garbage)
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Ian Manners

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 464
  • Karma: +10/-0
  • I am the computer, it is me.
    • View Profile
    • ComKal Networks Australia
Re: Using AI to Code for OS/2
« Reply #3 on: March 31, 2023, 03:54:34 am »
AI is not A.I., it is still Deep Learning (D.L.) but marketing.. There are some real A.I. but these are mostly still in labs but I digress.

OpenAI, and most if not all commercially available variants have been trained on a lot of data fed to it from the internet (including Github) and other sources (all that data that Microsoft and a few other companies collect). This data has been filtered to stop the programs from returning some real out there results (search the news for some early results). OpenAI and others are at the novelty stage and I think they were released too early but they are still useful as long as the user does not go overboard and expect miracles.

Most AI (excluding some purpose built ones in labs) will give results for large programs that are similar to early scan to text applications in that you need one or many people to manually scan the code for errors and apply fixes. Most news stories, and even test research articles of any length produced by AI still require a human to go through and fix obvious mistakes but its getting better but a good and experienced human editor can still normally spot these articles unless a human has taken the output and rewritten it.

It will be a long wait until we can expect this technology to do something like write a large program (example, Open Office), or an operating
system but for smaller programs the technology should be fine as long as a human that knows coding has given it at least a once over. I would expect programing code that covers something like Filepage (~ 40 pages) that I used for os2site.com would be riddled with errors but would still produce something that would be a good start as long as you knew enough about the programming language to spot and fix the errors.

Current AI is another tool, our job is to learn how to use it effectively, and when to use it.
Cheers
Ian B Manners

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Using AI to Code for OS/2
« Reply #4 on: March 31, 2023, 04:43:48 pm »
Hi

Even that ChatGPT did "lie" to me on the past, I had corrected it asking to double check the source.
 
I think there may be some potential to light the work of some developers and possible try to help produce some code structure skeletons that may light a little bit the work.

I would love if someone with more developer skill than me can try to generate some samples that will compile on OS/2 and try to make the AI to correct some issues and at the end become a useful assistant to OS/2 developers.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1317
  • Karma: +26/-0
    • View Profile
Re: Using AI to Code for OS/2
« Reply #5 on: April 01, 2023, 03:08:41 am »
Perhaps not quite that great at writting correct (contextually speaking) code, however, what I am hoping it might be able to do is to become a real-time OS/2 tech "oracle", meaning: it has digested massive amounts of data during it's Inference stage...now that it has been deployed, given it's quite capable NLP skillset, it may be capable of filling in the blanks that any starting OS/2 programmer might have, such as:

1) i am looking at this particular API but don't know what this parameter is?

or

2) show me some examples of this API being used in real code

In other words, imagine having a forum like our very own here, but full-time staffed by a massive compilation of knowledge that has been stored and processed.

Ian Manners

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 464
  • Karma: +10/-0
  • I am the computer, it is me.
    • View Profile
    • ComKal Networks Australia
Re: Using AI to Code for OS/2
« Reply #6 on: April 01, 2023, 05:41:09 am »
A follow on from what Dariusz talks about, I just read this at The Register. Great example of how to use ChatGPT API's.
https://www.theregister.com/2023/03/30/socket_chatgpt_malware/
Cheers
Ian B Manners

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Using AI to Code for OS/2
« Reply #7 on: September 17, 2023, 04:25:01 pm »
Now it was the turn for FreedomGTP (https://chat.freedomgpt.com):

Hello do you know about OS/2?

Yes, I am familiar with OS/2. It was a proprietary operating system that was developed by IBM in the 1980s as an alternative to Microsoft Windows. However, it never gained significant market share and was eventually replaced by other operating systems such as Windows NT and Linux.

Is the source code of OS/2 available online?

The source code for OS/2 is not freely available online, but there are still some communities dedicated to its development and maintenance. You can find more information on their websites or forums if you're interested in learning more about it.

Which OS/2 community do you know?

One active community for OS/2 is called "The OSBC", which stands for Open Source Business Computing. They focus on developing open-source software based on the original OS/2 codebase, including utilities, applications, and even a web browser. Another community worth mentioning is "eComStation", which is a commercial version of OS/2 that includes additional features and support.

this is wrong I havent see that the OSBC is trying to make an open source clone of OS/2.

While they don't have the same goal as creating an exact clone of OS/2, The OSBC does work on developing open-source software based on the original OS/2 codebase. This includes utilities, applications, and even a web browser. Their efforts aim to keep the legacy of OS/2 alive while also promoting open-source development.

Do you have a link? or reference to that?

Sure! Here's a link to their website where you can learn more about their projects and goals: https://www.osbc.org/. Additionally, here's a quote from one of their members regarding their intentions with OS/2: "Our main goal is to preserve the heritage of OS/2 by keeping the original codebase alive and well, while at the same time pushing forward with new technologies and ideas."

Spoiler Note: https://www.osbc.org/ Sent me to the Ocean State Baptist Church. This AI only provides you limited "credits" and it sucked bad for this questions. So fun  ;D

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

David McKenna

  • Hero Member
  • *****
  • Posts: 742
  • Karma: +24/-0
    • View Profile
Re: Using AI to Code for OS/2
« Reply #8 on: September 17, 2023, 05:45:07 pm »
LOL.. so much for the 'Intelligence' part of AI.

Regards,

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 331
  • Karma: +23/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Using AI to Code for OS/2
« Reply #9 on: September 17, 2023, 08:09:54 pm »
Spoiler Note: https://www.osbc.org/ Sent me to the Ocean State Baptist Church.

https://www.osbc.com gets you the page for the 'Open Source Business Conference' to be held in San Francisco on May 16-17, 2011. I wonder if the bot knows how we can get tickets for this event...

Doug Clark

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +7/-1
    • View Profile
Re: Using AI to Code for OS/2
« Reply #10 on: September 20, 2023, 05:34:31 pm »
Are you SURE the baptists aren't working on building open source OS/2?

Their motto, after all,  is  hope, truth, and community.