OS/2, eCS & ArcaOS - Technical > Programming

Using AI to Code for OS/2

(1/3) > >>

Martin Iturbide:
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:
For example.

I asked for a clone of "DosGetDateTime".


--- Code: ---#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;
}
--- End code ---

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

Regards

Neil Waldhauer:
It looks useless to me. localtime calls DosGetTimeDate, so every call will return 12:00 Jan 1, 1970. (or maybe garbage)

Ian Manners:
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.

Martin Iturbide:
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

Navigation

[0] Message Index

[#] Next page

Go to full version