Welcome, Guest | Home | Search | Login | Register
Author Asking ChatGPT to write a program for System 7. (Read 7792 times)
ReleaseTheGeese
32 MB
***
Posts: 37
Division 1 Computer Support
View Profile thranpages
on: December 18, 2022, 18:47

Having some fun with our future AI overlord.

I asked ChatGPT, could you write me a program in Pascal for Macintosh System 7 that makes a simple window appear?

I admit I was trying to stump it. Surprisingly it spat out the following:

Code: [Select]
program SimpleWindow;

{$O+}
{$IFNDEF THINK_PASCAL}
  {$F+}
{$ENDIF}

{$IFC THINK_PASCAL then}
  {$LINKER_FLAGS -lbsd}
{$ENDC}

uses
  {$IFDEF THINK_PASCAL}
  Types, Events, Windows, Controls, Dialogs, Quickdraw,
  {$ELSE}
  MacOSAll,
  {$ENDIF}
  Strings;

const
  kMyWindowID = 128;

var
  gDone: Boolean;

function MyFilterProc(aDialog: DialogPtr; aEvent: EventRecord; var aItemHit: Integer): Boolean;
  begin
    MyFilterProc := False;
    if (aEvent.what = keyDown) then
      begin
        if (aEvent.message and charCodeMask = $0D) then
          begin
            aItemHit := 1;
            MyFilterProc := True;
          end;
      end;
  end;

procedure DoDialog;
  var
    dlog: DialogPtr;
    itemHit: Integer;
  begin
    dlog := GetNewDialog(kMyWindowID, nil, Pointer(-1));
    ModalDialog(@MyFilterProc, itemHit);
    DisposeDialog(dlog);
  end;

begin
  gDone := False;
  while not gDone do
    begin
      case WaitNextEvent(everyEvent, gEvent, Sleep(60), nil) of
        inMenuBar:
          begin
            case MenuSelect(gEvent.where) of


Then it gave up at the end. Not bad, though I wonder how well it did? If any S7 pascalites care to chip in. I am more of a C-nile myself ;)
68040
512 MB
*****
Posts: 950
68k - thy kingdom come, thy will be done !
View Profile
Reply #1 on: December 18, 2022, 18:57

I was already stumped at ChatGPT AI(??)
Bolkonskij
Administrator
1024 MB
*****
Posts: 2023
View Profile Cornica - Video Entertainment for Mac OS users
Reply #2 on: December 19, 2022, 19:19

No real Pascal knowledge here. On a first glance, I can't seem to see it call the Toolbox routine CreateNewWindow() for opening a (b&w) window which is the essentially starting point for a Macintosh application. For whatever reason, it uses GetNewDialog() ? Maybe I don't get it, it's a possibility :-) I also don't see it properly initializing the Toolbox before that.  Interestingly, it gets the 128 as resource ID right.

Still, the ChatGPT AI hype gets a bit annoying lately. To me, in the end it's just another database with a lot of nested IFs to find the info you're looking for. Feed it, it will thrive. Starve it, it will fail. Much less a revolution, than just an evolution.
Last Edit: December 19, 2022, 19:57 by Bolkonskij
68040
512 MB
*****
Posts: 950
68k - thy kingdom come, thy will be done !
View Profile
Reply #3 on: December 19, 2022, 20:56

A typical chat bot "AI" answers complex questions with some gibberish it snatched from the net or previous user input. Those AI engines outsource the "sense making" part to the brain of the observer, by guessing what (s)he is looking for and presenting any text snippet that might fit that assumption.

Its like a Psychic on steroids, relying on the human to assume intelligence, where there are nothing more than blind algorithms at work, performing statistical guesswork and throwing text sequences back at you whose content they don't understand.

Most readers will not be able/willing to do the detailed analysis Bolkonskij has done and instead just conclude that there must be a real intellect behind it.

And according to the Eliza rules, as soon as an AI engine can fool the observer into assuming its intelligent, the engine is assumed to be intelligent. So we hand more and responsibilities over to code sequences, that are doing sophisticated statistical correlations - and nothing more.

Yet the problem with statistical hits is that they are mostly on target - mostly.
Last Edit: December 19, 2022, 20:58 by 68040
Pages: [1]

© 2021 System7Today.com.
The Apple Logo, Macintosh™, Mac OS™, and others property of Apple Computer, Inc.
This site is in no way affiliated with Apple Computer, Inc.