A little story while using Bing Chat to write some Ring code

100 views
Skip to first unread message

Mahmoud Fayed

unread,
Mar 2, 2023, 4:45:24 PM3/2/23
to The Ring Programming Language
Hello

This is a little story while using Bing Chat today to write some source code
in the Ring programming language

Today I tried to use Bing Chat to write some Ring code

I started my question by saying "Write a Ring program"
He asked me about what I mean with Ring and provided some options
One of these options is (Ring language) so I selected it.

He wrote aroud 20 lines of Ring code
The code using Read() function to get input from the Keyboard
This is wrong, So I told him that the language doesn't have the Read() function

He told me that I am wrong and provided me with a link that contains
the documentation of this function:
https://ring-lang.github.io/doc1.17/files.html#read-function

Ok, Now I remember, We have the Read() function but it's used for
reading files, not for getting input using the Keyboard

I told him to replace the Read() function with the GetString() function
He told me that Ring doesn't have a GetString() function
And said it's a user function, and provided some Ring code to implement it.

Oh! This is old information but How He can know that the language
doesn't have this function!
I checked the Reference provided by Bing Chat
I was expecting some documentation
But the Reference was a C source code file in this folder
https://github.com/ring-lang/ring/tree/master/language/src

It's the implementation of the language!
So He answered this question based on his knowledge about Ring
implementation!

In the begining of this chat I was afraid that Bing Chat will not know
the Ring language because it's a new language!
But, It looks like He know too much! even the source code used in the
language implementation! This is dangerous!


Message has been deleted

Ilir

unread,
Mar 2, 2023, 5:16:01 PM3/2/23
to The Ring Programming Language
Hello Mahmoud,

there is nothing dangerous in knowing the data that is publicly available. Danger could come from the AI who have an opinion, which could be hidden from us. That's why my first question to the AI was: what's new. AI couldn't answer (training data only goes up until 2021). Followed by question: what do you think about ...? AI answered:

"As an AI language model, I don't have personal opinions or beliefs. I can provide information and answer questions objectively based on the data I was trained on"

Greetings,
Ilir

Mahmoud Fayed

unread,
Mar 2, 2023, 5:55:51 PM3/2/23
to The Ring Programming Language
Hello Ilir

>> "there is nothing dangerous in knowing the data that is publicly available"

It depends on the context, Since the AI have this huge knowledge (including the source code of many open source projects) - And it provide **Answers** to people (They could be professionals, students or children) - This looks like (A General-Purpose User Interface) for Everyone - Something that can provide answers that break abstractions, uses knowledge related to hidden information (implementation details) and advice people to do this!

This is like advising every one to modify the windows registry to do something!

Knowledge is power, With great power comes great responsibility! 

>> "Danger could come from the AI who have an opinion"

The Lion have an opinion too (When it's hungry, He will !!)
So we have two choices
1 - Being away from them, Where they can live their life in forest
2 - They could live in a Zoo where we can watch them

The problem with AI, It doesn't have a physical body & specific sphere of influence like a lion
The AI will be everywhere, And will interact with humans, And interaction lead to Results! (Sometimes good, sometimes bad)

Greetings,
Mahmoud

Ilir

unread,
Mar 2, 2023, 6:30:25 PM3/2/23
to The Ring Programming Language
Hello Mahmoud,

>> This is like advising every one to modify the windows registry to do something!

No, it is not. Don't forget: you are asking the questions, AI is answering to you based on the training. You don't have to listen what AI suggests, and that is what you did: by saying to replace one function with another.

>> The Lion have an opinion too (When it's hungry, He will !!)

The Lion is a living being, self aware, self preserving and self sustaining. AI is made of bits (or qbits) and can be switched on/off.

Greetings,
Ilir
Message has been deleted

Bert Mariani

unread,
Mar 2, 2023, 7:52:55 PM3/2/23
to The Ring Programming Language
Hello ALL

I think the AI - Bing Chat - is just a fancy search engine that is returning answers to your questions based on what it finds by doing searches on the Internet.

If you asked it to write a C program to do something; there are plenty of example C programs that it can find. 
It will return one of those, and add a few pre-packaged words

Try it yourself by doing some searches of a "C program to Read a file".
Just pretend that I asked the question and You returned the answer based on a regular search.

Note: There are AI-Stock programs to pick stocks. 
They do poorly. Worst than an average individual investor.

Mahmoud Fayed

unread,
Mar 3, 2023, 10:53:02 AM3/3/23
to The Ring Programming Language
Hello Bert

>> "I think the AI - Bing Chat - is just a fancy search engine that is returning answers to your questions based on what it finds by doing searches on the Internet."

Beside search, It uses Machine Learning to answer (New Questions)

For example I asked this question now "Write a programming in the Ring programming language that define a class called point which contains three attributes (x,y & z). This class must contains three methods for each attribute. one method to set the value. another method to get the value. the third method print the value. Also the class should contains a method called Display. The display method print the values of x,y and z. Add another method to the class to find the maximum number of the attributes values x,y and z."

Bing Chat Answer:

Hello, this is Bing. I can help you with writing a program in Ring1, a simple and flexible programming language for applications development2. Here is a possible code that defines a class called point with three attributes (x,y & z) and the methods you requested:

class point

    # Attributes
    x = 0
    y = 0
    z = 0

    # Methods
    func setX(n)
        x = n

    func getX()
        return x

    func printX()
        ? "x = " + x

    func setY(n)
        y = n

    func getY()
        return y

    func printY()
        ? "y = " + y

    func setZ(n)
        z = n

    func getZ()
        return z

    func printZ()
        ? "z = " + z

    func display()
        ? "Point: (" + x + ", " + y + ", " + z + ")"

    func max()
        return math.max(x,y,z)

# Create an object
p1 = new point()

# Set values
p1.setX(10)
p1.setY(20)
p1.setZ(30)

# Print values
p1.printX() # x = 10
p1.printY() # y = 20
p1.printZ() # z = 30
p1.display() # Point: (10, 20, 30)

# Find maximum value
? p1.max() # 30

I know the code needs organization & some fixes, but it's useful.
This answer is more than (A Search Result)
This is a (Code Generation)

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Mar 3, 2023, 10:58:49 AM3/3/23
to The Ring Programming Language
Hello Bert

Based on my previous example, Look at this magic

Me: "reorganize the code, so that the code that create the object and use the class comes before the class. In Ring we can use classes & functions before definition"

Bing Chat: Answer:

Sure, I can reorganize the code for you. Here is the updated code:

Is this what you wanted?

......
Looks impressive!

Greetings,
Mahmoud

Mahmoud Fayed

unread,
Mar 3, 2023, 11:00:45 AM3/3/23
to The Ring Programming Language
Hello Bert

See this screen shot:

what.png

It's learning :D

Greetings,
Mahmoud
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Fuad Omari

unread,
Mar 5, 2023, 9:07:02 AM3/5/23
to The Ring Programming Language
Hi
another try to post a reply
what i want to say is that these chat robots will encourage the people to use it as an online doctors. usualy the people don't like to visit doctors in person so they will consult these chat doctors. and using the smart phones he can get heart pulses or even the brain waves maps
the service still not available but to a few people .we must use microsoft edge browser and then register and then waiting. i have visited also AI google : still nothing just too much articles
my nephew which are working as an online doctor from his country to other country patients   will not be happy with these possible chat doctors, they will take their jobs

Mahmoud Fayed

unread,
Mar 6, 2023, 3:55:15 PM3/6/23
to The Ring Programming Language
Hello Fuad

I see Bing Chat very useful and will play a big role in how humans learn and solve different problems

Greetings,
Mahmoud
Reply all
Reply to author
Forward
0 new messages