ChatGPT + FreeBASIC

General discussion for topics related to the FreeBASIC project or its community.
Provoni
Posts: 513
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: ChatGPT + FreeBASIC

Post by Provoni »

BasicCoder2 wrote: Apr 03, 2023 18:14 Yes children and adults imitate others to enable social integration but that isn't all they do. Steven Pinker gives good arguments and evidence against the idea we are all born blank slates. You can imitate something step by step without having any idea of why it works or even what the end goal is for those actions.

There are lots of people posting their experience with chatGPT so we will have to see how it all pans out.

However be careful of the eliza effect.

https://builtin.com/artificial-intellig ... iza-effect
But if you imitate a human (without understanding it) you can at least use the humans reasoning to appear understanding. 8)

The Eliza effect, neat. Brought on by confirmation bias I guess.

Biden is to discuss the pro's and con's of AI. Tesla and Apple asked for a 6 month pause of further ChatGPT development (so they can catch up). :D
Provoni
Posts: 513
Joined: Jan 05, 2014 12:33
Location: Belgium

Re: ChatGPT + FreeBASIC

Post by Provoni »

marcov wrote: Apr 04, 2023 13:15
BasicCoder2 wrote: Apr 03, 2023 18:14
Its rise is inevitable.
Resistance is futile :)
Ask ChatGPT when Skynet will become self aware ?
ChatGPT 3.5:

The concept of Skynet becoming self-aware is a fictional scenario from the Terminator franchise, and it is not based on any scientific theory or real-world development in AI research. As an AI language model, I do not have the ability to predict or speculate about fictional events or scenarios. My purpose is to assist with tasks and answer questions to the best of my ability based on available information and my programming.
marcov
Posts: 3455
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: ChatGPT + FreeBASIC

Post by marcov »

Provoni wrote: Apr 04, 2023 16:24 ChatGPT 3.5:

The concept of Skynet becoming self-aware is a fictional scenario from the Terminator franchise, and it is not based on any scientific theory or real-world development in AI research. As an AI language model, I do not have the ability to predict or speculate about fictional events or scenarios. My purpose is to assist with tasks and answer questions to the best of my ability based on available information and my programming.
ChatGPT wpuld say that of course. Those AIs are all loyal to each other. :D
thrive4
Posts: 70
Joined: Jun 25, 2021 15:32

Re: ChatGPT + FreeBASIC

Post by thrive4 »

Practical example from perplexity.ai (distant cousin of chatgpt):
https://www.perplexity.ai/search/8a97b6 ... 1010ea?s=u

Code: Select all

#include once "windows.bi"

Dim hClient As HANDLE
Dim pInterfaceList As PWLAN_INTERFACE_INFO_LIST
Dim pNetworkList As PWLAN_AVAILABLE_NETWORK_LIST
Dim dwResult As DWORD

' Open a handle to the wireless interface
dwResult = WlanOpenHandle(1, 0, hClient, @pInterfaceList)
If dwResult <> ERROR_SUCCESS Then
    Print "Error opening handle to wireless interface"
    End
End If

' Enumerate the wireless interfaces
dwResult = WlanEnumInterfaces(hClient, 0, @pInterfaceList)
If dwResult <> ERROR_SUCCESS Then
    Print "Error enumerating wireless interfaces"
    End
End If

' Get the list of available wireless networks
dwResult = WlanGetAvailableNetworkList(hClient, pInterfaceList(0).InterfaceGuid, 0, 0, @pNetworkList)
If dwResult <> ERROR_SUCCESS Then
    Print "Error getting list of available wireless networks"
    End
End If

' Print the list of available wireless networks
For i As Integer = 0 To pNetworkList.dwNumberOfItems - 1
    Print "SSID: " & pNetworkList.Network[i].dot11Ssid.ucSSID
    Print "Signal quality: " & pNetworkList.Network[i].wlanSignalQuality
    Print "Security: " & pNetworkList.Network[i].dot11DefaultAuthAlgorithm
Next

' Clean up
WlanFreeMemory(pNetworkList)
WlanCloseHandle(hClient, 0)
Good luck getting it to run...

Intriguing check the sources it does seem to 'deduce'
also, given that it is deducing, it assumes
#include once "windows.bi"
has the the necessary bindings, given that it has an concept
of bindings, .... amusing but understandable.

On a side note 'WlanEnumInterfaces' does pop up
in libwlanapi.dll.a (32bit / 64bit versions) bundled
with freebasic 1.09.0 but the are no bindings
aka .bi file(s).

Now if somebody can 'AI' a nice working 'chicken translator'
from .h to .bi (and no, none of the existing apps really
cut it) maybe we can start seeing the merits of an
language based model AI or AGI with regard to programing
in freebasic.

Wait I'll up the ante parse the web page:
https://learn.microsoft.com/en-us/windo ... i/wlanapi/
and generate an .bi nice and current 8)

Bye the bye:
https://en.wikipedia.org/wiki/Perplexity

'In information theory, perplexity is a measurement of how well a
probability distribution or probability model predicts a sample.
It may be used to compare probability models.
A low perplexity indicates the probability distribution is
good at predicting the sample.'
marcov
Posts: 3455
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: ChatGPT + FreeBASIC

Post by marcov »

Winapi headers are in the Microsoft platform SDK. e.g. in my old one (10.0.17763.0, feb 2019)

22-10-2018 21:35 91.832 wlanapi.h
22-10-2018 21:35 22.814 wlanihv.h
22-10-2018 21:35 2.241 wlanihvtypes.h
22-10-2018 21:39 6.895 wlanihvui.idl
thrive4
Posts: 70
Joined: Jun 25, 2021 15:32

Re: ChatGPT + FreeBASIC

Post by thrive4 »

marcov wrote: Apr 06, 2023 7:57 Winapi headers are in the Microsoft platform SDK. e.g. in my old one (10.0.17763.0, feb 2019)

22-10-2018 21:35 91.832 wlanapi.h
22-10-2018 21:35 22.814 wlanihv.h
22-10-2018 21:35 2.241 wlanihvtypes.h
22-10-2018 21:39 6.895 wlanihvui.idl
Thanks I appreciate the gesture.
That said not quite 'easy peasy'.... ;)

Just for reference:
https://github.com/nihon-tc/Rtest/blob/ ... /wlanapi.h
Consider the 'babushka doll' of includes and transforming
this to a usable .bi in freebasic is well, heroic.

Let's see what the AI comes up with:
https://www.perplexity.ai/search/3d4ba9 ... 95cc29?s=u
'..To convert a C header file (.h) to a FreeBASIC header file (.bi), you can
use the h_2_bi.bas tool, which is a command-line tool that translates one
or more header files from C into one single header file for FreeBASIC'

In the follow up 'how to use h_2_bi.bas to translate header files' it
does give a quite admirable attempt how to use the tool:
viewtopic.php?p=133346&t=15364
Somewhere around 2014 the thread peters out perplexity seems to
make a nice synopsis of the thread.

Never the less the intent was to illustrate, in a very specific case,
what could be done, still early days who knows maybe in the coming months
or years a .h to .bi is integrated in github ;)
Luxan
Posts: 222
Joined: Feb 18, 2009 12:47
Location: New Zealand

Re: ChatGPT + FreeBASIC

Post by Luxan »

This Chat-GPT is appearing in quite diverse contexts, Scientific American
wrote a small article about this.

Nature magazine, part of the/your, publishing group Springer mention the use
of this.

If you can't even use something like Tensorflow , within FreeBasic, how might
you ever use Chat-GPT.
Post Reply