ChatGPT + FreeBASIC

General discussion for topics related to the FreeBASIC project or its community.
Provoni
Posts: 525
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: 525
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: 3503
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: 86
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: 3503
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: 86
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: 273
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.
Luxan
Posts: 273
Joined: Feb 18, 2009 12:47
Location: New Zealand

Re: ChatGPT + FreeBASIC

Post by Luxan »

Okay, so some time has passed and there have been some developments, like DeepSeek.

However, at the practical level I'm interested in an online ai chat client where I don't need to
worry about what I develop being visible to others, Meta's llama models don't meet that criterion.
Also, I don't want to contend with copyright infringements.
And of course, I'd like prompt and accurate replies.

So, I'm presently investigating open llama, which may meet most of these criteria.

Something I've discovered, if you want to use llamas locally, you'll likely require a GPU with compute
power and a considerable amount of VRAM, for smooth operation.

ChatGPT might help with this, or alternatives.
c-sanchez
Posts: 155
Joined: Dec 06, 2012 0:38

Re: ChatGPT + FreeBASIC

Post by c-sanchez »

Luxan wrote: Mar 25, 2025 21:14 Okay, so some time has passed and there have been some developments, like DeepSeek.

However, at the practical level I'm interested in an online ai chat client where I don't need to
worry about what I develop being visible to others, Meta's llama models don't meet that criterion.
Also, I don't want to contend with copyright infringements.
And of course, I'd like prompt and accurate replies.

So, I'm presently investigating open llama, which may meet most of these criteria.

Something I've discovered, if you want to use llamas locally, you'll likely require a GPU with compute
power and a considerable amount of VRAM, for smooth operation.

ChatGPT might help with this, or alternatives.
You could play around with Gemini 2.5 Pro, you can use it for free in Google AI Studio.
The context window is tremendously large, even for the answers, so you can give it FreeBasic code/documentation for reference.

I've done some fooling around with Python and DeepSeek, and while the responses are good, functional code, when the responses reach 8000~ characters it starts responding with errors in the code.

Whereas with tests I recently did with Gemini 2.5 Pro I have managed to get it to give me fully functional code over 39,000 characters.
I assume that this one can possibly maintain consistency in response with much more text.
c-sanchez
Posts: 155
Joined: Dec 06, 2012 0:38

Re: ChatGPT + FreeBASIC

Post by c-sanchez »

I have converted the window9 chm documentation to txt, then I passed it to Gemini and asked it to give me the documentation in plain text but better organized and with only text in English.

This was the result:
https://paste.gg/p/csanchez/f972b45fbd8 ... 1b20e59e7b
Luxan
Posts: 273
Joined: Feb 18, 2009 12:47
Location: New Zealand

Re: ChatGPT + FreeBASIC

Post by Luxan »

There's also freebasic documentation as a text file, in zip format, that's available.

I managed to install ollama, that runs a selection known as a manifest from various A.I groups,
this has the ability to use VRAM and system RAM, according to the brief note I read.
CUDA acceleration is possible, tensorflow is also usable.

The 0.60 version, which is new, is compatible with a recent version of Gemini and many others.

These run on my hardware, which is showing some limitations, yet purchasing a new
and proficient P.C system is expensive. I'm wondering how good the NPU option is, you still
require a considerable amount of RAM, for a GPU that's VRAM.

Some of these are proficient at producing code whilst others grind to a halt.

Meanwhile I'm using freebasic error checking as a guide during code production, and the examples
to provide a knowledge base. Occasionally seeking some help from an A.I. chatbot.
D.J.Peters
Posts: 8642
Joined: May 28, 2005 3:28
Contact:

Re: ChatGPT + FreeBASIC

Post by D.J.Peters »

@Luxan yes ollama was the game changer for me I use "qwen2.5-coder" for coding and "deepseek-r1" for brain storming I love it.

Code: Select all

ollama list
NAME                ID              SIZE
qwen2.5-coder:7B    2b0496514337    4.7 GB
deepseek-r1:8b      28f8fd6cdc67    4.9 GB
for visual AI tasks I use ComfyUI the portable Windows version.
https://docs.comfy.org/installation/com ... le_windows

Joshy
Imortis
Moderator
Posts: 1984
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: ChatGPT + FreeBASIC

Post by Imortis »

Is it really that hard to just learn to code properly?
D.J.Peters
Posts: 8642
Joined: May 28, 2005 3:28
Contact:

Re: ChatGPT + FreeBASIC

Post by D.J.Peters »

Imortis wrote: Mar 31, 2025 13:13 Is it really that hard to just learn to code properly?
No it's not I have done it the last 45 years and it paid all my bills !
But to day "AI prompting" how to say your issue to get the best results
are a big topic and should be learned also. (not only for young people)

Joshy
c-sanchez
Posts: 155
Joined: Dec 06, 2012 0:38

Re: ChatGPT + FreeBASIC

Post by c-sanchez »

Imortis wrote: Mar 31, 2025 13:13 Is it really that hard to just learn to code properly?
Photography: "Is it really that hard to learn how to develop photos in a darkroom?" (Everyone just uses smartphone filters and AI-enhanced editing now).

Language: "Is it really that hard to learn a new language?" (Everyone just points Google Translate at a menu and nods like they understood "despacito").

Math: "Is it really that hard to learn algebra?" (Calculators solve equations in seconds—why bother with x when you can just press "="?).

Art/Design: "Is it really that hard to sculpt with clay?" (3D printers create hyper-detailed designs with millimeter-perfect precision… and zero messy hands).

Music: "Is it really that hard to learn how to sing?" (Reggaeton stars make millions with heavily processed vocals, and even pros rely on Auto-Tune to sound "natural")

DeepSeek R1... :lol:
Post Reply