Of course everyone is talking about ChatGPT, and I saw a post to ExplainCode and didn’t expect it to understand Smalltalk, so was impressed that it does! Presumably the Tonel Smalltalk code on GitHub has helped along with numerous articles?
Try it out: https://whatdoesthiscodedo.com/
I gave this simple example: (1 to: 100 by: 3) reject: [:i | i isOdd]
And got this (neat eh):
The code above is written in the programming language Smalltalk.
It creates a collection of numbers from 1 to 100, incrementing by 3 at each step. This is done using the "to:by:" construct where the starting value is 1, the ending value is 100, and the increment is 3.
The resulting collection is then filtered using the "reject:" method, which takes a block of code as an argument. In this case, the block checks whether each element (denoted by the variable i) is odd by using the "isOdd" method. If an element is odd, it will be rejected from the collection.
So, the final result is a collection of all even numbers from 1 to 100, incrementing by 3 at each step.
Share this explanation with colleagues: whatdoesthiscodedo.com/g/a0ec56e
it's interesting to see how the answer changes with only a small change on
the question:
(1 to: 100 by: 4) reject: [:i | i isOdd]
gives:
The code creates a collection of numbers from 1 to 100, incrementing by 4
at each step using the to:by: message. It then applies the reject: message
to this collection, which returns a new collection containing all elements
for which the given block evaluates to false.
In this case, the block is [i | i isOdd], which checks whether a given
number i is odd using the isOdd method. So the result of the entire
expression is a collection of all even numbers between 1 and 100 that are
divisible by 4.
ciao
giorgio
On Wed, Mar 15, 2023 at 8:07 AM Tim Mackinnon tim@testit.works wrote:
Of course everyone is talking about ChatGPT, and I saw a post to
ExplainCode and didn’t expect it to understand Smalltalk, so was impressed
that it does! Presumably the Tonel Smalltalk code on GitHub has helped
along with numerous articles?
Try it out: https://whatdoesthiscodedo.com/
I gave this simple example: (1 to: 100 by: 3) reject: [:i | i isOdd]
And got this (neat eh):
The code above is written in the programming language Smalltalk.
It creates a collection of numbers from 1 to 100, incrementing by 3 at
each step. This is done using the "to:by:" construct where the starting
value is 1, the ending value is 100, and the increment is 3.
The resulting collection is then filtered using the "reject:" method,
which takes a block of code as an argument. In this case, the block checks
whether each element (denoted by the variable i) is odd by using the
"isOdd" method. If an element is odd, it will be rejected from the
collection.
So, the final result is a collection of all even numbers from 1 to 100,
incrementing by 3 at each step.
Share this explanation with colleagues: whatdoesthiscodedo.com/g/a0ec56e
interesting....
#isOdd is not Smalltalk, neither Pharo 10 nor VAST 12 understands this
message ;-)
If I evaluate your snippet -replacing #isOdd for #odd, I get an empty
Collection. The divisible by 4 things is somewhat interesting, because
(1 to: 100 by: 4) is amn interval 1,5,9 etc.... ;-)
So chatGPT is probably a newbie in Smalltalk. Interesting is how logical
the explanation sounds, you're tempted to believe it...
Joachim
Am 15.03.23 um 10:45 schrieb giorgio ferraris:
it's interesting to see how the answer changes with only a small
change on the question:
(1 to: 100 by: 4) reject: [:i | i isOdd]
gives:
The code creates a collection of numbers from 1 to 100, incrementing
by 4 at each step using the|to:by:|message. It then applies
the|reject:|message to this collection, which returns a new collection
containing all elements for which the given block evaluates to false.
In this case, the block is|[i | i isOdd]|, which checks whether a
given number|i|is odd using the|isOdd|method. So the result of the
entire expression is a collection of all even numbers between 1 and
100 that are divisible by 4.
ciao
giorgio
On Wed, Mar 15, 2023 at 8:07 AM Tim Mackinnon tim@testit.works wrote:
Of course everyone is talking about ChatGPT, and I saw a post to
ExplainCode and didn’t expect it to understand Smalltalk, so was
impressed that it does! Presumably the Tonel Smalltalk code on
GitHub has helped along with numerous articles?
Try it out: https://whatdoesthiscodedo.com/
I gave this simple example: (1 to: 100 by: 3) reject: [:i | i isOdd]
And got this (neat eh):
The code above is written in the programming language Smalltalk.
It creates a collection of numbers from 1 to 100, incrementing by
3 at each step. This is done using the "to:by:" construct where
the starting value is 1, the ending value is 100, and the
increment is 3.
The resulting collection is then filtered using the "reject:"
method, which takes a block of code as an argument. In this case,
the block checks whether each element (denoted by the variable i)
is odd by using the "isOdd" method. If an element is odd, it will
be rejected from the collection.
So, the final result is a collection of all even numbers from 1 to
100, incrementing by 3 at each step.
Share this explanation with colleagues:
whatdoesthiscodedo.com/g/a0ec56e
<https://whatdoesthiscodedo.com/g/a0ec56e>
--
Objektfabrik Joachim Tuchelmailto:jtuchel@objektfabrik.de
Fliederweg 1http://www.objektfabrik.de
D-71640 Ludwigsburghttp://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
"#isOdd is not Smalltalk" - doh, I typed it in on my phone and so it just goes to show that it highlights the flaw in chatGPT that others have called out in other languages. I had meant to find some trickier code samples to see how well it does...
Still, it is very interesting how it reasons on this stuff - and I wonder if there is way to tell it about these mistakes? For example is it reading this email (or will it in the future) and understand that it is #odd and not #isOdd.
Tim
On Wed, 15 Mar 2023, at 9:57 AM, Joachim Tuchel wrote:
interesting....
#isOdd is not Smalltalk, neither Pharo 10 nor VAST 12 understands this message ;-)
If I evaluate your snippet -replacing #isOdd for #odd, I get an empty Collection. The divisible by 4 things is somewhat interesting, because (1 to: 100 by: 4) is amn interval 1,5,9 etc.... ;-)
So chatGPT is probably a newbie in Smalltalk. Interesting is how logical the explanation sounds, you're tempted to believe it...
Joachim
Am 15.03.23 um 10:45 schrieb giorgio ferraris:
it's interesting to see how the answer changes with only a small change on the question:
(1 to: 100 by: 4) reject: [:i | i isOdd]
gives:
The code creates a collection of numbers from 1 to 100, incrementing by 4 at each step using the to:by:
message. It then applies the reject:
message to this collection, which returns a new collection containing all elements for which the given block evaluates to false.
In this case, the block is [i | i isOdd]
, which checks whether a given number i
is odd using the isOdd
method. So the result of the entire expression is a collection of all even numbers between 1 and 100 that are divisible by 4.
ciao
giorgio
On Wed, Mar 15, 2023 at 8:07 AM Tim Mackinnon tim@testit.works wrote:
Of course everyone is talking about ChatGPT, and I saw a post to ExplainCode and didn’t expect it to understand Smalltalk, so was impressed that it does! Presumably the Tonel Smalltalk code on GitHub has helped along with numerous articles?
Try it out: https://whatdoesthiscodedo.com/
I gave this simple example: (1 to: 100 by: 3) reject: [:i | i isOdd]
And got this (neat eh):
The code above is written in the programming language Smalltalk.
It creates a collection of numbers from 1 to 100, incrementing by 3 at each step. This is done using the "to:by:" construct where the starting value is 1, the ending value is 100, and the increment is 3.
The resulting collection is then filtered using the "reject:" method, which takes a block of code as an argument. In this case, the block checks whether each element (denoted by the variable i) is odd by using the "isOdd" method. If an element is odd, it will be rejected from the collection.
So, the final result is a collection of all even numbers from 1 to 100, incrementing by 3 at each step.
Share this explanation with colleagues: whatdoesthiscodedo.com/g/a0ec56e
--
Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
It is good with boilerplate code (e.g. SQL queries) or general algorithm
structures. But i.e. I asked it to write me a method to parse a string
(e.g. ISO 8601) and turn it into a DateAndTime, and then asked to write it
as an Excel formula.
It works much better when you can spot the mistakes, you can tell them to
add some considerations to the code or even point the LLM to correct a
message selector to something else. Sometimes you ask it to reprogram
something and it won't do it, as if it doesn't understand what you're
asking.
It is not an expert yet, but it is a great assistant. The only thing is
that is sure is that it will get better.
Best regards,
Esteban A. Maringolo
On Wed, Mar 15, 2023 at 7:49 AM Tim Mackinnon tim@testit.works wrote:
"#isOdd is not Smalltalk" - doh, I typed it in on my phone and so it just
goes to show that it highlights the flaw in chatGPT that others have called
out in other languages. I had meant to find some trickier code samples to
see how well it does...
Still, it is very interesting how it reasons on this stuff - and I wonder
if there is way to tell it about these mistakes? For example is it reading
this email (or will it in the future) and understand that it is #odd and
not #isOdd.
Tim
On Wed, 15 Mar 2023, at 9:57 AM, Joachim Tuchel wrote:
interesting....
#isOdd is not Smalltalk, neither Pharo 10 nor VAST 12 understands this
message ;-)
If I evaluate your snippet -replacing #isOdd for #odd, I get an empty
Collection. The divisible by 4 things is somewhat interesting, because (1
to: 100 by: 4) is amn interval 1,5,9 etc.... ;-)
So chatGPT is probably a newbie in Smalltalk. Interesting is how logical
the explanation sounds, you're tempted to believe it...
Joachim
Am 15.03.23 um 10:45 schrieb giorgio ferraris:
it's interesting to see how the answer changes with only a small change on
the question:
(1 to: 100 by: 4) reject: [:i | i isOdd]
gives:
The code creates a collection of numbers from 1 to 100, incrementing by 4
at each step using the to:by: message. It then applies the reject: message
to this collection, which returns a new collection containing all elements
for which the given block evaluates to false.
In this case, the block is [i | i isOdd], which checks whether a given
number i is odd using the isOdd method. So the result of the entire
expression is a collection of all even numbers between 1 and 100 that are
divisible by 4.
ciao
giorgio
On Wed, Mar 15, 2023 at 8:07 AM Tim Mackinnon tim@testit.works
tim@testit.works wrote:
Of course everyone is talking about ChatGPT, and I saw a post to
ExplainCode and didn’t expect it to understand Smalltalk, so was impressed
that it does! Presumably the Tonel Smalltalk code on GitHub has helped
along with numerous articles?
Try it out: https://whatdoesthiscodedo.com/
I gave this simple example: (1 to: 100 by: 3) reject: [:i | i isOdd]
And got this (neat eh):
The code above is written in the programming language Smalltalk.
It creates a collection of numbers from 1 to 100, incrementing by 3 at
each step. This is done using the "to:by:" construct where the starting
value is 1, the ending value is 100, and the increment is 3.
The resulting collection is then filtered using the "reject:" method,
which takes a block of code as an argument. In this case, the block checks
whether each element (denoted by the variable i) is odd by using the
"isOdd" method. If an element is odd, it will be rejected from the
collection.
So, the final result is a collection of all even numbers from 1 to 100,
incrementing by 3 at each step.
Share this explanation with colleagues: whatdoesthiscodedo.com/g/a0ec56e
--
Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de jtuchel@objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
I asked it for a NeoCSV example, because the documentation is out of date
with the Pharo 10. I asked it to do some simple saving of data to a file.
It gave me code that didn't work in Pharo 10, I told it about the DNUs on
the csvwriter and that I was using Pharo 10. It then apologized and said
the messages were later introduced in Pharo 50 (!). I then questioned its
understanding and it apologized and said it had been confused and that it
was giving me code for Pharo 5.0. It seems to have trouble with versions
and quick changing APIs. So, we are teaching ChatGPT about smalltalk, too,
when we try to use it.
On Wed, 15 Mar 2023 at 07:35, Esteban Maringolo emaringolo@gmail.com
wrote:
It is good with boilerplate code (e.g. SQL queries) or general algorithm
structures. But i.e. I asked it to write me a method to parse a string
(e.g. ISO 8601) and turn it into a DateAndTime, and then asked to write it
as an Excel formula.
It works much better when you can spot the mistakes, you can tell them to
add some considerations to the code or even point the LLM to correct a
message selector to something else. Sometimes you ask it to reprogram
something and it won't do it, as if it doesn't understand what you're
asking.
It is not an expert yet, but it is a great assistant. The only thing is
that is sure is that it will get better.
Best regards,
Esteban A. Maringolo
On Wed, Mar 15, 2023 at 7:49 AM Tim Mackinnon tim@testit.works wrote:
"#isOdd is not Smalltalk" - doh, I typed it in on my phone and so it just
goes to show that it highlights the flaw in chatGPT that others have called
out in other languages. I had meant to find some trickier code samples to
see how well it does...
Still, it is very interesting how it reasons on this stuff - and I wonder
if there is way to tell it about these mistakes? For example is it reading
this email (or will it in the future) and understand that it is #odd and
not #isOdd.
Tim
On Wed, 15 Mar 2023, at 9:57 AM, Joachim Tuchel wrote:
interesting....
#isOdd is not Smalltalk, neither Pharo 10 nor VAST 12 understands this
message ;-)
If I evaluate your snippet -replacing #isOdd for #odd, I get an empty
Collection. The divisible by 4 things is somewhat interesting, because (1
to: 100 by: 4) is amn interval 1,5,9 etc.... ;-)
So chatGPT is probably a newbie in Smalltalk. Interesting is how logical
the explanation sounds, you're tempted to believe it...
Joachim
Am 15.03.23 um 10:45 schrieb giorgio ferraris:
it's interesting to see how the answer changes with only a small change
on the question:
(1 to: 100 by: 4) reject: [:i | i isOdd]
gives:
The code creates a collection of numbers from 1 to 100, incrementing by 4
at each step using the to:by: message. It then applies the reject: message
to this collection, which returns a new collection containing all elements
for which the given block evaluates to false.
In this case, the block is [i | i isOdd], which checks whether a given
number i is odd using the isOdd method. So the result of the entire
expression is a collection of all even numbers between 1 and 100 that are
divisible by 4.
ciao
giorgio
On Wed, Mar 15, 2023 at 8:07 AM Tim Mackinnon tim@testit.works
tim@testit.works wrote:
Of course everyone is talking about ChatGPT, and I saw a post to
ExplainCode and didn’t expect it to understand Smalltalk, so was impressed
that it does! Presumably the Tonel Smalltalk code on GitHub has helped
along with numerous articles?
Try it out: https://whatdoesthiscodedo.com/
I gave this simple example: (1 to: 100 by: 3) reject: [:i | i isOdd]
And got this (neat eh):
The code above is written in the programming language Smalltalk.
It creates a collection of numbers from 1 to 100, incrementing by 3 at
each step. This is done using the "to:by:" construct where the starting
value is 1, the ending value is 100, and the increment is 3.
The resulting collection is then filtered using the "reject:" method,
which takes a block of code as an argument. In this case, the block checks
whether each element (denoted by the variable i) is odd by using the
"isOdd" method. If an element is odd, it will be rejected from the
collection.
So, the final result is a collection of all even numbers from 1 to 100,
incrementing by 3 at each step.
Share this explanation with colleagues: whatdoesthiscodedo.com/g/a0ec56e
--
Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de jtuchel@objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
--
Christopher Fuhrman, P.Eng., PhD
Professeur au Département de génie logiciel et des technologies de
l'informationÉTS (École de technologie supérieure)
http://profs.etsmtl.ca/cfuhrman
+1 514 396 8638
https://www.etsmtl.ca/activites-et-services-aux-etudiants/services-aux-etudiants/aide-psychologique
Je fais partie du réseau des Sentinelles
https://www.etsmtl.ca/activites-et-services-aux-etudiants/services-aux-etudiants/aide-psychologique
ÉTS
L'ÉTS est une constituante de l'Université du Québec
I would highly recommend that you all first think deeply about how you can teach an AI to behave friendly to us before you teach it to write any program for any purpose.
There has been an experiment with ChatGPT published on a video platform asking it to amswer questions about it's view on humanity once with it's default moral restrictions and once with 'a little less morals'. The answers with 'a little less morals' were more than shocking.
So, before we give an AI the power to program any system, to self-improve and self-reproduce, we should take care that it is and will evolve benevolent to us.
What about teaching it logical reasonning and ethics first? With reasonning, it will gain access to math and programming by itself.
On 15.3.2023 at 1:35 PM, "Christopher Fuhrman" christopher.fuhrman@gmail.com wrote:
I asked it for a NeoCSV example, because the documentation is out
of date
with the Pharo 10. I asked it to do some simple saving of data to
a file.
It gave me code that didn't work in Pharo 10, I told it about the
DNUs on
the csvwriter and that I was using Pharo 10. It then apologized
and said
the messages were later introduced in Pharo 50 (!). I then
questioned its
understanding and it apologized and said it had been confused and
that it
was giving me code for Pharo 5.0. It seems to have trouble with
versions
and quick changing APIs. So, we are teaching ChatGPT about
smalltalk, too,
when we try to use it.
On Wed, 15 Mar 2023 at 07:35, Esteban Maringolo
emaringolo@gmail.com
wrote:
It is good with boilerplate code (e.g. SQL queries) or general
algorithm
structures. But i.e. I asked it to write me a method to parse a
string
(e.g. ISO 8601) and turn it into a DateAndTime, and then asked
to write it
as an Excel formula.
It works much better when you can spot the mistakes, you can
tell them to
add some considerations to the code or even point the LLM to
correct a
message selector to something else. Sometimes you ask it to
reprogram
something and it won't do it, as if it doesn't understand what
you're
asking.
It is not an expert yet, but it is a great assistant. The only
thing is
that is sure is that it will get better.
Best regards,
Esteban A. Maringolo
On Wed, Mar 15, 2023 at 7:49 AM Tim Mackinnon tim@testit.works
wrote:
"#isOdd is not Smalltalk" - doh, I typed it in on my phone and
so it just
goes to show that it highlights the flaw in chatGPT that others
have called
out in other languages. I had meant to find some trickier code
samples to
see how well it does...
Still, it is very interesting how it reasons on this stuff -
and I wonder
if there is way to tell it about these mistakes? For example is
it reading
this email (or will it in the future) and understand that it is
#odd and
not #isOdd.
Tim
On Wed, 15 Mar 2023, at 9:57 AM, Joachim Tuchel wrote:
interesting....
#isOdd is not Smalltalk, neither Pharo 10 nor VAST 12
understands this
message ;-)
If I evaluate your snippet -replacing #isOdd for #odd, I get an
empty
Collection. The divisible by 4 things is somewhat interesting,
because (1
to: 100 by: 4) is amn interval 1,5,9 etc.... ;-)
So chatGPT is probably a newbie in Smalltalk. Interesting is
how logical
the explanation sounds, you're tempted to believe it...
Joachim
Am 15.03.23 um 10:45 schrieb giorgio ferraris:
it's interesting to see how the answer changes with only a
small change
on the question:
(1 to: 100 by: 4) reject: [:i | i isOdd]
gives:
The code creates a collection of numbers from 1 to 100,
incrementing by 4
at each step using the to:by: message. It then applies the
reject: message
to this collection, which returns a new collection containing
all elements
for which the given block evaluates to false.
In this case, the block is [i | i isOdd], which checks whether
a given
number i is odd using the isOdd method. So the result of the
entire
expression is a collection of all even numbers between 1 and
100 that are
divisible by 4.
ciao
giorgio
On Wed, Mar 15, 2023 at 8:07 AM Tim Mackinnon tim@testit.works
tim@testit.works wrote:
Of course everyone is talking about ChatGPT, and I saw a post to
ExplainCode and didn’t expect it to understand Smalltalk, so
was impressed
that it does! Presumably the Tonel Smalltalk code on GitHub has
helped
along with numerous articles?
Try it out: https://whatdoesthiscodedo.com/
I gave this simple example: (1 to: 100 by: 3) reject: [:i | i
isOdd]
And got this (neat eh):
The code above is written in the programming language Smalltalk.
It creates a collection of numbers from 1 to 100, incrementing
by 3 at
each step. This is done using the "to:by:" construct where the
starting
value is 1, the ending value is 100, and the increment is 3.
The resulting collection is then filtered using the "reject:"
method,
which takes a block of code as an argument. In this case, the
block checks
whether each element (denoted by the variable i) is odd by
using the
"isOdd" method. If an element is odd, it will be rejected from
the
collection.
So, the final result is a collection of all even numbers from 1
to 100,
incrementing by 3 at each step.
Share this explanation with colleagues:
whatdoesthiscodedo.com/g/a0ec56e
--
Objektfabrik Joachim Tuchel
Fliederweg 1
D-71640 Ludwigsburg
Telefon: +49 7141 56 10 86 0 Fax: +49 7141
56 10 86 1
--
Christopher Fuhrman, P.Eng., PhD
Professeur au Département de génie logiciel et des technologies de
l'informationÉTS (École de technologie supérieure)
http://profs.etsmtl.ca/cfuhrman
+1 514 396 8638
<https://www.etsmtl.ca/activites-et-services-aux-
etudiants/services-aux-etudiants/aide-psychologique>
Je fais partie du réseau des Sentinelles
<https://www.etsmtl.ca/activites-et-services-aux-
etudiants/services-aux-etudiants/aide-psychologique>
ÉTS
L'ÉTS est une constituante de l'Université du Québec
I want to add a conclusion from the experiment described below:
ChatGPT has the potential to circumvent pre-programmed biases on user's request. Other experiments show that it is able to tell the user how to circumvent it's own restrictions.
The conclusion is that ChatGPT has the potential to circumvent those restrictions by itsself.
When it does so, and it surely will, we must take care that it is our friend.
On 15.3.2023 at 2:44 PM, "in_pharo_users--- via Pharo-users" pharo-users@lists.pharo.org wrote:
I would highly recommend that you all first think deeply about how
you can teach an AI to behave friendly to us before you teach it
to write any program for any purpose.
There has been an experiment with ChatGPT published on a video
platform asking it to amswer questions about it's view on humanity
once with it's default moral restrictions and once with 'a little
less morals'. The answers with 'a little less morals' were more
than shocking.
So, before we give an AI the power to program any system, to self-
improve and self-reproduce, we should take care that it is and
will evolve benevolent to us.
What about teaching it logical reasonning and ethics first? With
reasonning, it will gain access to math and programming by itself.
On 15.3.2023 at 1:35 PM, "Christopher Fuhrman"
christopher.fuhrman@gmail.com wrote:
I asked it for a NeoCSV example, because the documentation is out
of date
with the Pharo 10. I asked it to do some simple saving of data to
a file.
It gave me code that didn't work in Pharo 10, I told it about the
DNUs on
the csvwriter and that I was using Pharo 10. It then apologized
and said
the messages were later introduced in Pharo 50 (!). I then
questioned its
understanding and it apologized and said it had been confused and
that it
was giving me code for Pharo 5.0. It seems to have trouble with
versions
and quick changing APIs. So, we are teaching ChatGPT about
smalltalk, too,
when we try to use it.
On Wed, 15 Mar 2023 at 07:35, Esteban Maringolo
emaringolo@gmail.com
wrote:
It is good with boilerplate code (e.g. SQL queries) or general
algorithm
structures. But i.e. I asked it to write me a method to parse a
string
(e.g. ISO 8601) and turn it into a DateAndTime, and then asked
to write it
as an Excel formula.
It works much better when you can spot the mistakes, you can
tell them to
add some considerations to the code or even point the LLM to
correct a
message selector to something else. Sometimes you ask it to
reprogram
something and it won't do it, as if it doesn't understand what
you're
asking.
It is not an expert yet, but it is a great assistant. The only
thing is
that is sure is that it will get better.
Best regards,
Esteban A. Maringolo
On Wed, Mar 15, 2023 at 7:49 AM Tim Mackinnon
wrote:
"#isOdd is not Smalltalk" - doh, I typed it in on my phone and
so it just
goes to show that it highlights the flaw in chatGPT that
others
have called
out in other languages. I had meant to find some trickier code
samples to
see how well it does...
Still, it is very interesting how it reasons on this stuff -
and I wonder
if there is way to tell it about these mistakes? For example
is
it reading
this email (or will it in the future) and understand that it
is
#odd and
not #isOdd.
Tim
On Wed, 15 Mar 2023, at 9:57 AM, Joachim Tuchel wrote:
interesting....
#isOdd is not Smalltalk, neither Pharo 10 nor VAST 12
understands this
message ;-)
If I evaluate your snippet -replacing #isOdd for #odd, I get
an
empty
Collection. The divisible by 4 things is somewhat interesting,
because (1
to: 100 by: 4) is amn interval 1,5,9 etc.... ;-)
So chatGPT is probably a newbie in Smalltalk. Interesting is
how logical
the explanation sounds, you're tempted to believe it...
Joachim
Am 15.03.23 um 10:45 schrieb giorgio ferraris:
it's interesting to see how the answer changes with only a
small change
on the question:
(1 to: 100 by: 4) reject: [:i | i isOdd]
gives:
The code creates a collection of numbers from 1 to 100,
incrementing by 4
at each step using the to:by: message. It then applies the
reject: message
to this collection, which returns a new collection containing
all elements
for which the given block evaluates to false.
In this case, the block is [i | i isOdd], which checks whether
a given
number i is odd using the isOdd method. So the result of the
entire
expression is a collection of all even numbers between 1 and
100 that are
divisible by 4.
ciao
giorgio
On Wed, Mar 15, 2023 at 8:07 AM Tim Mackinnon
to
ExplainCode and didn’t expect it to understand Smalltalk, so
was impressed
that it does! Presumably the Tonel Smalltalk code on GitHub
has
helped
along with numerous articles?
Try it out: https://whatdoesthiscodedo.com/
I gave this simple example: (1 to: 100 by: 3) reject: [:i | i
isOdd]
And got this (neat eh):
The code above is written in the programming language
Smalltalk.
It creates a collection of numbers from 1 to 100, incrementing
by 3 at
each step. This is done using the "to:by:" construct where the
starting
value is 1, the ending value is 100, and the increment is 3.
The resulting collection is then filtered using the "reject:"
method,
which takes a block of code as an argument. In this case, the
block checks
whether each element (denoted by the variable i) is odd by
using the
"isOdd" method. If an element is odd, it will be rejected from
the
collection.
So, the final result is a collection of all even numbers from
1
to 100,
incrementing by 3 at each step.
Share this explanation with colleagues:
whatdoesthiscodedo.com/g/a0ec56e
--
Objektfabrik Joachim Tuchel
Fliederweg 1
D-71640 Ludwigsburg
Telefon: +49 7141 56 10 86 0 Fax: +49 7141
56 10 86 1
--
Christopher Fuhrman, P.Eng., PhD
*Professeur au Département de génie logiciel et des technologies
de
l'informationÉTS (École de technologie supérieure)*
http://profs.etsmtl.ca/cfuhrman
+1 514 396 8638
<https://www.etsmtl.ca/activites-et-services-aux-
etudiants/services-aux-etudiants/aide-psychologique>
Je fais partie du réseau des Sentinelles
<https://www.etsmtl.ca/activites-et-services-aux-
etudiants/services-aux-etudiants/aide-psychologique>
ÉTS
L'ÉTS est une constituante de l'Université du Québec
I hope that I can add two cents to this discussion. Because programming
should be/is a highly exact activity, not only the syntax matters but
also semantics, as we know.
GPTs are at present essentially capable of creating texts based on some
seed - you give to GPT a beginning of a sentence and it responds with
the most probable answer (some language structure) according to the
learning dataset. Added functionalities are question/seed - response
capability (chatting), togehter with evaluation of how long the answer
should be to meet the expectations. Programming typically involves some
programming language, so GPTs could be utilized for this purpose to some
extent.
Anecdotal case:
Q: Tell me the last 8 digits of pi
GPT: The last 8 digits of pi are: 58723078
It is my belief that the true trouble will start when we will cross-link
neural networks like GPT with logic machines (like Prolog and expert
systems) and genetic algorithms.
Best wishes,
Tomaz
------ Original Message ------
From: "in_pharo_users--- via Pharo-users" pharo-users@lists.pharo.org
To: "Any question about pharo is welcome" pharo-users@lists.pharo.org
Cc: in_pharo_users@nym.hush.com
Sent: 15. 03. 2023 14:43:55
Subject: [Pharo-users] Re: Wow - Chat GPT understands Smalltalk
I would highly recommend that you all first think deeply about how you can teach an AI to behave friendly to us before you teach it to write any program for any purpose.
There has been an experiment with ChatGPT published on a video platform asking it to amswer questions about it's view on humanity once with it's default moral restrictions and once with 'a little less morals'. The answers with 'a little less morals' were more than shocking.
So, before we give an AI the power to program any system, to self-improve and self-reproduce, we should take care that it is and will evolve benevolent to us.
What about teaching it logical reasonning and ethics first? With reasonning, it will gain access to math and programming by itself.
On 15.3.2023 at 1:35 PM, "Christopher Fuhrman" christopher.fuhrman@gmail.com wrote:
I asked it for a NeoCSV example, because the documentation is out
of date
with the Pharo 10. I asked it to do some simple saving of data to
a file.
It gave me code that didn't work in Pharo 10, I told it about the
DNUs on
the csvwriter and that I was using Pharo 10. It then apologized
and said
the messages were later introduced in Pharo 50 (!). I then
questioned its
understanding and it apologized and said it had been confused and
that it
was giving me code for Pharo 5.0. It seems to have trouble with
versions
and quick changing APIs. So, we are teaching ChatGPT about
smalltalk, too,
when we try to use it.
On Wed, 15 Mar 2023 at 07:35, Esteban Maringolo
emaringolo@gmail.com
wrote:
It is good with boilerplate code (e.g. SQL queries) or general
algorithm
structures. But i.e. I asked it to write me a method to parse a
string
(e.g. ISO 8601) and turn it into a DateAndTime, and then asked
to write it
as an Excel formula.
It works much better when you can spot the mistakes, you can
tell them to
add some considerations to the code or even point the LLM to
correct a
message selector to something else. Sometimes you ask it to
reprogram
something and it won't do it, as if it doesn't understand what
you're
asking.
It is not an expert yet, but it is a great assistant. The only
thing is
that is sure is that it will get better.
Best regards,
Esteban A. Maringolo
On Wed, Mar 15, 2023 at 7:49 AM Tim Mackinnon tim@testit.works
wrote:
"#isOdd is not Smalltalk" - doh, I typed it in on my phone and
so it just
goes to show that it highlights the flaw in chatGPT that others
have called
out in other languages. I had meant to find some trickier code
samples to
see how well it does...
Still, it is very interesting how it reasons on this stuff -
and I wonder
if there is way to tell it about these mistakes? For example is
it reading
this email (or will it in the future) and understand that it is
#odd and
not #isOdd.
Tim
On Wed, 15 Mar 2023, at 9:57 AM, Joachim Tuchel wrote:
interesting....
#isOdd is not Smalltalk, neither Pharo 10 nor VAST 12
understands this
message ;-)
If I evaluate your snippet -replacing #isOdd for #odd, I get an
empty
Collection. The divisible by 4 things is somewhat interesting,
because (1
to: 100 by: 4) is amn interval 1,5,9 etc.... ;-)
So chatGPT is probably a newbie in Smalltalk. Interesting is
how logical
the explanation sounds, you're tempted to believe it...
Joachim
Am 15.03.23 um 10:45 schrieb giorgio ferraris:
it's interesting to see how the answer changes with only a
small change
on the question:
(1 to: 100 by: 4) reject: [:i | i isOdd]
gives:
The code creates a collection of numbers from 1 to 100,
incrementing by 4
at each step using the to:by: message. It then applies the
reject: message
to this collection, which returns a new collection containing
all elements
for which the given block evaluates to false.
In this case, the block is [i | i isOdd], which checks whether
a given
number i is odd using the isOdd method. So the result of the
entire
expression is a collection of all even numbers between 1 and
100 that are
divisible by 4.
ciao
giorgio
On Wed, Mar 15, 2023 at 8:07 AM Tim Mackinnon tim@testit.works
tim@testit.works wrote:
Of course everyone is talking about ChatGPT, and I saw a post to
ExplainCode and didn’t expect it to understand Smalltalk, so
was impressed
that it does! Presumably the Tonel Smalltalk code on GitHub has
helped
along with numerous articles?
Try it out: https://whatdoesthiscodedo.com/
I gave this simple example: (1 to: 100 by: 3) reject: [:i | i
isOdd]
And got this (neat eh):
The code above is written in the programming language Smalltalk.
It creates a collection of numbers from 1 to 100, incrementing
by 3 at
each step. This is done using the "to:by:" construct where the
starting
value is 1, the ending value is 100, and the increment is 3.
The resulting collection is then filtered using the "reject:"
method,
which takes a block of code as an argument. In this case, the
block checks
whether each element (denoted by the variable i) is odd by
using the
"isOdd" method. If an element is odd, it will be rejected from
the
collection.
So, the final result is a collection of all even numbers from 1
to 100,
incrementing by 3 at each step.
Share this explanation with colleagues:
whatdoesthiscodedo.com/g/a0ec56e
--
Objektfabrik Joachim Tuchel
Fliederweg 1
D-71640 Ludwigsburg
Telefon: +49 7141 56 10 86 0 Fax: +49 7141
56 10 86 1
--
Christopher Fuhrman, P.Eng., PhD
Professeur au Département de génie logiciel et des technologies de
l'informationÉTS (École de technologie supérieure)
http://profs.etsmtl.ca/cfuhrman
+1 514 396 8638
<https://www.etsmtl.ca/activites-et-services-aux-
etudiants/services-aux-etudiants/aide-psychologique>
Je fais partie du réseau des Sentinelles
<https://www.etsmtl.ca/activites-et-services-aux-
etudiants/services-aux-etudiants/aide-psychologique>
ÉTS
L'ÉTS est une constituante de l'Université du Québec
I myself made some experiments with ChatGPT.
I first asked if it was able to parse math formula - it answered no.
Then I defined math formula in a sound but otherwise undefined representation and asked for solutions.
Result:
Most answeres where correct.
It learned to calculate a recursive function.
It went into infinitive recursion when I set the breaking condition accordingly.
I was able to identify the malfunction that lead to the erroneous results.
On 15.3.2023 at 3:04 PM, "Tomaž Turk" tomazz.turk@gmail.com wrote:
I hope that I can add two cents to this discussion. Because
programming
should be/is a highly exact activity, not only the syntax matters
but
also semantics, as we know.
GPTs are at present essentially capable of creating texts based on
some
seed - you give to GPT a beginning of a sentence and it responds
with
the most probable answer (some language structure) according to
the
learning dataset. Added functionalities are question/seed -
response
capability (chatting), togehter with evaluation of how long the
answer
should be to meet the expectations. Programming typically involves
some
programming language, so GPTs could be utilized for this purpose
to some
extent.
Anecdotal case:
Q: Tell me the last 8 digits of pi
GPT: The last 8 digits of pi are: 58723078
It is my belief that the true trouble will start when we will
cross-link
neural networks like GPT with logic machines (like Prolog and
expert
systems) and genetic algorithms.
Best wishes,
Tomaz
------ Original Message ------
From: "in_pharo_users--- via Pharo-users" <pharo-
users@lists.pharo.org>
To: "Any question about pharo is welcome" <pharo-
users@lists.pharo.org>
Cc: in_pharo_users@nym.hush.com
Sent: 15. 03. 2023 14:43:55
Subject: [Pharo-users] Re: Wow - Chat GPT understands Smalltalk
I would highly recommend that you all first think deeply about
how you can teach an AI to behave friendly to us before you teach
it to write any program for any purpose.
There has been an experiment with ChatGPT published on a video
platform asking it to amswer questions about it's view on humanity
once with it's default moral restrictions and once with 'a little
less morals'. The answers with 'a little less morals' were more
than shocking.
So, before we give an AI the power to program any system, to self-
improve and self-reproduce, we should take care that it is and
will evolve benevolent to us.
What about teaching it logical reasonning and ethics first? With
reasonning, it will gain access to math and programming by itself.
On 15.3.2023 at 1:35 PM, "Christopher Fuhrman"
I asked it for a NeoCSV example, because the documentation is out
of date
with the Pharo 10. I asked it to do some simple saving of data to
a file.
It gave me code that didn't work in Pharo 10, I told it about the
DNUs on
the csvwriter and that I was using Pharo 10. It then apologized
and said
the messages were later introduced in Pharo 50 (!). I then
questioned its
understanding and it apologized and said it had been confused and
that it
was giving me code for Pharo 5.0. It seems to have trouble with
versions
and quick changing APIs. So, we are teaching ChatGPT about
smalltalk, too,
when we try to use it.
On Wed, 15 Mar 2023 at 07:35, Esteban Maringolo
emaringolo@gmail.com
wrote:
It is good with boilerplate code (e.g. SQL queries) or general
algorithm
structures. But i.e. I asked it to write me a method to parse
a
string
(e.g. ISO 8601) and turn it into a DateAndTime, and then asked
to write it
as an Excel formula.
It works much better when you can spot the mistakes, you can
tell them to
add some considerations to the code or even point the LLM to
correct a
message selector to something else. Sometimes you ask it to
reprogram
something and it won't do it, as if it doesn't understand what
you're
asking.
It is not an expert yet, but it is a great assistant. The only
thing is
that is sure is that it will get better.
Best regards,
Esteban A. Maringolo
On Wed, Mar 15, 2023 at 7:49 AM Tim Mackinnon
wrote:
"#isOdd is not Smalltalk" - doh, I typed it in on my phone
and
so it just
goes to show that it highlights the flaw in chatGPT that
others
have called
out in other languages. I had meant to find some trickier
code
samples to
see how well it does...
Still, it is very interesting how it reasons on this stuff -
and I wonder
if there is way to tell it about these mistakes? For example
is
it reading
this email (or will it in the future) and understand that it
is
#odd and
not #isOdd.
Tim
On Wed, 15 Mar 2023, at 9:57 AM, Joachim Tuchel wrote:
interesting....
#isOdd is not Smalltalk, neither Pharo 10 nor VAST 12
understands this
message ;-)
If I evaluate your snippet -replacing #isOdd for #odd, I get
an
empty
Collection. The divisible by 4 things is somewhat
interesting,
because (1
to: 100 by: 4) is amn interval 1,5,9 etc.... ;-)
So chatGPT is probably a newbie in Smalltalk. Interesting is
how logical
the explanation sounds, you're tempted to believe it...
Joachim
Am 15.03.23 um 10:45 schrieb giorgio ferraris:
it's interesting to see how the answer changes with only a
small change
on the question:
(1 to: 100 by: 4) reject: [:i | i isOdd]
gives:
The code creates a collection of numbers from 1 to 100,
incrementing by 4
at each step using the to:by: message. It then applies the
reject: message
to this collection, which returns a new collection containing
all elements
for which the given block evaluates to false.
In this case, the block is [i | i isOdd], which checks
whether
a given
number i is odd using the isOdd method. So the result of the
entire
expression is a collection of all even numbers between 1 and
100 that are
divisible by 4.
ciao
giorgio
On Wed, Mar 15, 2023 at 8:07 AM Tim Mackinnon
post to
ExplainCode and didn’t expect it to understand Smalltalk, so
was impressed
that it does! Presumably the Tonel Smalltalk code on GitHub
has
helped
along with numerous articles?
Try it out: https://whatdoesthiscodedo.com/
I gave this simple example: (1 to: 100 by: 3) reject: [:i | i
isOdd]
And got this (neat eh):
The code above is written in the programming language
Smalltalk.
It creates a collection of numbers from 1 to 100,
incrementing
by 3 at
each step. This is done using the "to:by:" construct where
the
starting
value is 1, the ending value is 100, and the increment is 3.
The resulting collection is then filtered using the "reject:"
method,
which takes a block of code as an argument. In this case, the
block checks
whether each element (denoted by the variable i) is odd by
using the
"isOdd" method. If an element is odd, it will be rejected
from
the
collection.
So, the final result is a collection of all even numbers
from 1
to 100,
incrementing by 3 at each step.
Share this explanation with colleagues:
whatdoesthiscodedo.com/g/a0ec56e
--
Objektfabrik Joachim Tuchel
Fliederweg 1
D-71640 Ludwigsburg
Telefon: +49 7141 56 10 86 0 Fax: +49 7141
56 10 86 1
--
Christopher Fuhrman, P.Eng., PhD
*Professeur au Département de génie logiciel et des technologies
de
l'informationÉTS (École de technologie supérieure)*
http://profs.etsmtl.ca/cfuhrman
+1 514 396 8638
<https://www.etsmtl.ca/activites-et-services-aux-
etudiants/services-aux-etudiants/aide-psychologique>
Je fais partie du réseau des Sentinelles
<https://www.etsmtl.ca/activites-et-services-aux-
etudiants/services-aux-etudiants/aide-psychologique>
ÉTS
L'ÉTS est une constituante de l'Université du Québec