WTF and Programming Languages
I dont know if you guys are aware of this talk, very funny , quite weird , so I thought why not share it with you https://www.destroyallsoftware.com/talks/wat
ROFL made my cry thanks for sharing XD On May 7, 2014, at 5:16 PM, kilon alios <kilon.alios@gmail.com> wrote:
I dont know if you guys are aware of this talk, very funny , quite weird , so I thought why not share it with you
Le 7 mai 2014 22:17, "kilon alios" <kilon.alios@gmail.com> a écrit :
I dont know if you guys are aware of this talk, very funny , quite weird
, so I thought why not share it with you
Yeah, Amber kind of alleviates some of these pain points...
I love these kind of snippets :) I have built a collection of freak expressions in Squeak3.9. Pharo 3.0 is less spectacular, above collection is shrinking dangerously... but there are still some not so unsurprising features to test for: 'hello' copyReplaceFrom: 6 to: 4 with: 'world'. (5 to: 10) at: 1.3. '' , #[119 104 97 116 63]. #[] , 'what?'. "honour is safe, it's sorta symmetric..." "Cases of special syntax. Is the behavior officially supported in some EBNF?" -2r-1. - 2. "Note the space between the two letters" 2014-05-07 22:47 GMT+02:00 phil@highoctane.be <phil@highoctane.be>:
Le 7 mai 2014 22:17, "kilon alios" <kilon.alios@gmail.com> a écrit :
I dont know if you guys are aware of this talk, very funny , quite weird
, so I thought why not share it with you
Yeah, Amber kind of alleviates some of these pain points...
On 07 May 2014, at 23:25, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:
I love these kind of snippets :)
I have built a collection of freak expressions in Squeak3.9. Pharo 3.0 is less spectacular, above collection is shrinking dangerously... but there are still some not so unsurprising features to test for:
These are actually not that funny, we should try to do something about them, or at least discuss them a bit.
'hello' copyReplaceFrom: 6 to: 4 with: 'world'.
#copyReplaceFrom:to:with: seems overloaded with the insert case, is that really necessary ? still the fact that the $o appears twice feels like a bug, no ?
(5 to: 10) at: 1.3.
understandable, scary, wrong, maybe use #asInteger on the index ?
'' , #[119 104 97 116 63]. #[] , 'what?'. "honour is safe, it's sorta symmetric..."
that is the ByteString/ByteArray dichotomy at work, may enforce the #species of the receiver and argument to be equal ?
"Cases of special syntax. Is the behavior officially supported in some EBNF?" -2r-1. - 2. "Note the space between the two letters"
These are at the (number) syntax level. Again scary, we should be (much) stricter in parsing.
2014-05-07 22:47 GMT+02:00 phil@highoctane.be <phil@highoctane.be>:
Le 7 mai 2014 22:17, "kilon alios" <kilon.alios@gmail.com> a écrit :
I dont know if you guys are aware of this talk, very funny , quite weird , so I thought why not share it with you
Yeah, Amber kind of alleviates some of these pain points...
On 08 May 2014, at 09:37, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 07 May 2014, at 23:25, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:
I love these kind of snippets :)
I have built a collection of freak expressions in Squeak3.9. Pharo 3.0 is less spectacular, above collection is shrinking dangerously... but there are still some not so unsurprising features to test for:
These are actually not that funny, we should try to do something about them, or at least discuss them a bit.
'hello' copyReplaceFrom: 6 to: 4 with: 'world'.
#copyReplaceFrom:to:with: seems overloaded with the insert case, is that really necessary ? still the fact that the $o appears twice feels like a bug, no ?
(5 to: 10) at: 1.3.
Amazing. But this is even better (3 to: 8 by: 2) at: 1.3
understandable, scary, wrong, maybe use #asInteger on the index ?
'' , #[119 104 97 116 63]. #[] , 'what?'. "honour is safe, it's sorta symmetric..."
that is the ByteString/ByteArray dichotomy at work, may enforce the #species of the receiver and argument to be equal ?
"Cases of special syntax. Is the behavior officially supported in some EBNF?" -2r-1. - 2. "Note the space between the two letters"
These are at the (number) syntax level. Again scary, we should be (much) stricter in parsing.
2014-05-07 22:47 GMT+02:00 phil@highoctane.be <phil@highoctane.be>:
Le 7 mai 2014 22:17, "kilon alios" <kilon.alios@gmail.com> a écrit :
I dont know if you guys are aware of this talk, very funny , quite weird , so I thought why not share it with you
Yeah, Amber kind of alleviates some of these pain points...
On Thu, May 8, 2014 at 9:37 AM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 07 May 2014, at 23:25, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> wrote:
I love these kind of snippets :)
I have built a collection of freak expressions in Squeak3.9. Pharo 3.0 is less spectacular, above collection is shrinking dangerously... but there are still some not so unsurprising features to test for:
These are actually not that funny, we should try to do something about them, or at least discuss them a bit.
'hello' copyReplaceFrom: 6 to: 4 with: 'world'.
#copyReplaceFrom:to:with: seems overloaded with the insert case, is that really necessary ? still the fact that the $o appears twice feels like a bug, no ?
'Helloworldo' was indeed very surprising. Silent failures like this seem pretty dangerous to me.
(5 to: 10) at: 1.3.
understandable, scary, wrong, maybe use #asInteger on the index ?
Especially when the index is intention revealing as in 'anInteger' :-(
'' , #[119 104 97 116 63]. #[] , 'what?'. "honour is safe, it's sorta symmetric..."
that is the ByteString/ByteArray dichotomy at work, may enforce the #species of the receiver and argument to be equal ?
Would you mind enlighten me on this dichotomy? In ByteArray I do see: asString "Convert to a String with Characters for each byte. Fast code uses primitive that avoids character conversion" ^ (String new: self size) replaceFrom: 1 to: self size with: self Ah, replaceFrom:to:with: again... It is the same Collection code for all of these. And now, we get >>asString, >>asWideString And in String>>new: sizeRequested "Answer an instance of this class with the number of indexable variables specified by the argument, sizeRequested." self == String ifTrue:[^ByteString new: sizeRequested] ifFalse:[^self basicNew: sizeRequested]. Mmh, okay... 1) no primitive in a method that says "Fast code uses primitive to avoid character conversion": is that normal? 2) self == String, so ^ByteString new I'd love to know if there is a clear explanation of all of this somewhere. Is there one?
"Cases of special syntax. Is the behavior officially supported in some EBNF?" -2r-1. - 2. "Note the space between the two letters"
These are at the (number) syntax level. Again scary, we should be (much) stricter in parsing.
The second - 2. I do not get as it prints a -2 SmallInteger. What's wrong there? Do you mean - 2 shouldn't be parsable? That I can get. Phil
2014-05-07 22:47 GMT+02:00 phil@highoctane.be <phil@highoctane.be>:
Le 7 mai 2014 22:17, "kilon alios" <kilon.alios@gmail.com> a écrit :
I dont know if you guys are aware of this talk, very funny , quite
weird , so I thought why not share it with you
Yeah, Amber kind of alleviates some of these pain points...
On 08 May 2014, at 10:39, phil@highoctane.be wrote:
'' , #[119 104 97 116 63]. #[] , 'what?'. "honour is safe, it's sorta symmetric..."
that is the ByteString/ByteArray dichotomy at work, may enforce the #species of the receiver and argument to be equal ?
Would you mind enlighten me on this dichotomy?
(String new: 10 withAll: $a) replaceFrom: 1 to: 3 with: #[65 66 67] startingAt: 1. (ByteArray new: 10 withAll: 16) replaceFrom: 1 to: 3 with: 'ABC' startingAt: 1. Primitive 105 allows you to mix ByteStrings and ByteArrays which is crucial for making certain system operations fast. Of course, once you take real encoding into account, this breaks.
On 08 May 2014, at 10:39, phil@highoctane.be wrote:
The second - 2. I do not get as it prints a -2 SmallInteger. What's wrong there? Do you mean - 2 shouldn't be parsable? That I can get.
It is an error (the space). It should either be -2 or 2 negated but - 2 is not a message send ...
2014-05-08 10:39 GMT+02:00 phil@highoctane.be <phil@highoctane.be>:
On Thu, May 8, 2014 at 9:37 AM, Sven Van Caekenberghe <sven@stfx.eu>wrote:
On 07 May 2014, at 23:25, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> wrote:
I love these kind of snippets :)
I have built a collection of freak expressions in Squeak3.9. Pharo 3.0 is less spectacular, above collection is shrinking dangerously... but there are still some not so unsurprising features to test for:
These are actually not that funny, we should try to do something about them, or at least discuss them a bit.
'hello' copyReplaceFrom: 6 to: 4 with: 'world'.
#copyReplaceFrom:to:with: seems overloaded with the insert case, is that really necessary ? still the fact that the $o appears twice feels like a bug, no ?
'Helloworldo' was indeed very surprising. Silent failures like this seem pretty dangerous to me.
Are you sure this is a failure ? :)
From the comment of SequenceableCollection>>copyReplaceFrom: start to: stop with: replacementCollection
... If stop is less than start, then this is an insertion;....start = size+1 means append after last character....
On 08 May 2014, at 10:58, Nicolai Hess <nicolaihess@web.de> wrote:
2014-05-08 10:39 GMT+02:00 phil@highoctane.be <phil@highoctane.be>: On Thu, May 8, 2014 at 9:37 AM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 07 May 2014, at 23:25, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:
I love these kind of snippets :)
I have built a collection of freak expressions in Squeak3.9. Pharo 3.0 is less spectacular, above collection is shrinking dangerously... but there are still some not so unsurprising features to test for:
These are actually not that funny, we should try to do something about them, or at least discuss them a bit.
'hello' copyReplaceFrom: 6 to: 4 with: 'world'.
#copyReplaceFrom:to:with: seems overloaded with the insert case, is that really necessary ? still the fact that the $o appears twice feels like a bug, no ?
'Helloworldo' was indeed very surprising. Silent failures like this seem pretty dangerous to me.
Are you sure this is a failure ? :) From the comment of SequenceableCollection>>copyReplaceFrom: start to: stop with: replacementCollection
... If stop is less than start, then this is an insertion;....start = size+1 means append after last character....
The why is the result not 'Helloworld' ? or 'Hellworldo' ? Why does the $o appear twice ?
Sven Van Caekenberghe-2 wrote
The why is the result not 'Helloworld' ? or 'Hellworldo' ? Why does the $o appear twice ?
Good point. Please take a moment to: 1. go to Ulysses 2. follow the account creation link 3. create an account on fogbugz 4. log in 5. create an issue report with: a. the vm version b. the image version c. your platform d. your social security number e. mother's maiden name f. name of first pet g. and, a reproducible way to cause the error 6. (optional, but preferable) followed up by a slice with tests a. re-log-in to fogbugz b. go back to the issue page because the fogbugz login page probably didn't redirect you to the issue c. add whoever is assigned as another person to notify because they will paradoxically not be included by default 7. (if 6) add class comments to classes that you didn't modify - and possibly have never heard of - to make the monkey happy 8. Weigh in on whether Pharo is or is not "Smalltalk" AND/OR whether a tomato is a fruit or a vegetable 9. Cross fingers and wait (but not as long as in Squeak) 10. Try to remember what you were doing before you fell down the rabbit hole 11. Check email for VPRI's final STEPS report while waiting IN CASE OF EMERGENCY: insert beer between or during any other step OR remember that we (meaning the Smalltalk, Smalltalk-inspired, Smalltalk-channelled, Smalltalk-related, and/or Dynabook-related identified persons and possibly spouses and probably children under 17.5) still have it far better than the rest of the programming world ;-P (hopefully obviously) ----- Cheers, Sean -- View this message in context: http://forum.world.st/WTF-and-Programming-Languages-tp4758263p4758348.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Le 8 mai 2014 18:30, "Sean P. DeNigris" <sean@clipperadams.com> a écrit :
Sven Van Caekenberghe-2 wrote
The why is the result not 'Helloworld' ? or 'Hellworldo' ? Why does the
$o
appear twice ?
Good point.
Please take a moment to: 1. go to Ulysses 2. follow the account creation link 3. create an account on fogbugz 4. log in 5. create an issue report with: a. the vm version b. the image version c. your platform d. your social security number e. mother's maiden name f. name of first pet g. and, a reproducible way to cause the error 6. (optional, but preferable) followed up by a slice with tests a. re-log-in to fogbugz b. go back to the issue page because the fogbugz login page probably didn't redirect you to the issue c. add whoever is assigned as another person to notify because they will paradoxically not be included by default 7. (if 6) add class comments to classes that you didn't modify - and possibly have never heard of - to make the monkey happy 8. Weigh in on whether Pharo is or is not "Smalltalk" AND/OR whether a tomato is a fruit or a vegetable 9. Cross fingers and wait (but not as long as in Squeak) 10. Try to remember what you were doing before you fell down the rabbit hole 11. Check email for VPRI's final STEPS report while waiting
IN CASE OF EMERGENCY: insert beer between or during any other step OR remember that we (meaning the Smalltalk, Smalltalk-inspired, Smalltalk-channelled, Smalltalk-related, and/or Dynabook-related identified persons and possibly spouses and probably children under 17.5) still have it far better than the rest of the programming world
;-P (hopefully obviously)
WAT?
----- Cheers, Sean -- View this message in context:
http://forum.world.st/WTF-and-Programming-Languages-tp4758263p4758348.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
looks I created quite an interesting discussion :) Glad you guys enjoyed and got inspired by the video. I amwatching your replies with interest. On Thu, May 8, 2014 at 10:55 PM, phil@highoctane.be <phil@highoctane.be>wrote:
Le 8 mai 2014 18:30, "Sean P. DeNigris" <sean@clipperadams.com> a écrit :
Sven Van Caekenberghe-2 wrote
The why is the result not 'Helloworld' ? or 'Hellworldo' ? Why does
the $o
appear twice ?
Good point.
Please take a moment to: 1. go to Ulysses 2. follow the account creation link 3. create an account on fogbugz 4. log in 5. create an issue report with: a. the vm version b. the image version c. your platform d. your social security number e. mother's maiden name f. name of first pet g. and, a reproducible way to cause the error 6. (optional, but preferable) followed up by a slice with tests a. re-log-in to fogbugz b. go back to the issue page because the fogbugz login page probably didn't redirect you to the issue c. add whoever is assigned as another person to notify because they will paradoxically not be included by default 7. (if 6) add class comments to classes that you didn't modify - and possibly have never heard of - to make the monkey happy 8. Weigh in on whether Pharo is or is not "Smalltalk" AND/OR whether a tomato is a fruit or a vegetable 9. Cross fingers and wait (but not as long as in Squeak) 10. Try to remember what you were doing before you fell down the rabbit hole 11. Check email for VPRI's final STEPS report while waiting
IN CASE OF EMERGENCY: insert beer between or during any other step OR remember that we (meaning the Smalltalk, Smalltalk-inspired, Smalltalk-channelled, Smalltalk-related, and/or Dynabook-related identified persons and possibly spouses and probably children under 17.5) still have it far better than the rest of the programming world
;-P (hopefully obviously)
WAT?
----- Cheers, Sean -- View this message in context:
http://forum.world.st/WTF-and-Programming-Languages-tp4758263p4758348.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
2014-05-08 18:29 GMT+02:00 Sean P. DeNigris <sean@clipperadams.com>:
Sven Van Caekenberghe-2 wrote
The why is the result not 'Helloworld' ? or 'Hellworldo' ? Why does the $o appear twice ?
Good point.
Please take a moment to: 1. go to Ulysses 2. follow the account creation link 3. create an account on fogbugz 4. log in 5. create an issue report with: a. the vm version b. the image version c. your platform d. your social security number e. mother's maiden name f. name of first pet g. and, a reproducible way to cause the error 6. (optional, but preferable) followed up by a slice with tests a. re-log-in to fogbugz b. go back to the issue page because the fogbugz login page probably didn't redirect you to the issue c. add whoever is assigned as another person to notify because they will paradoxically not be included by default 7. (if 6) add class comments to classes that you didn't modify - and possibly have never heard of - to make the monkey happy 8. Weigh in on whether Pharo is or is not "Smalltalk" AND/OR whether a tomato is a fruit or a vegetable 9. Cross fingers and wait (but not as long as in Squeak) 10. Try to remember what you were doing before you fell down the rabbit hole 11. Check email for VPRI's final STEPS report while waiting
IN CASE OF EMERGENCY: insert beer between or during any other step OR remember that we (meaning the Smalltalk, Smalltalk-inspired, Smalltalk-channelled, Smalltalk-related, and/or Dynabook-related identified persons and possibly spouses and probably children under 17.5) still have it far better than the rest of the programming world
;-P (hopefully obviously)
Oh, but wait, I opened some bug reports once upon a time... I just rediscovered http://bugs.squeak.org/view.php?id=5707 which links to http://bugs.squeak.org/view.php?id=7194 Not my fault if a forked happened ;) To continue around this very same example, every one knows that this should fail: 'hello' copyReplaceFrom: 3/2 to: 5/2 with: 'world'. Indeed, only integers should be used as indices! It should fail equally whether the argument is wide or not as you can see: 'hello' copyReplaceFrom: 3/2 to: 5/2 with: 'world' asWideString. Well yes, maybe non integer indices could be used, but Character>>negative is not understood It should fail equally whether the receiver is wide or not as you can see: 'hello' asWideString copyReplaceFrom: 3/2 to: 5/2 with: 'world' asWideString. A good lesson: tricky hacks like this always come with a price: index isNumber ifTrue: [^self at: index asInteger] ifFalse: [self errorNonIntegerIndex] The sooner failure, the better failure ;)
----- Cheers, Sean -- View this message in context: http://forum.world.st/WTF-and-Programming-Languages-tp4758263p4758348.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
2014-05-13 2:41 GMT+02:00 Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com>:
2014-05-08 18:29 GMT+02:00 Sean P. DeNigris <sean@clipperadams.com>:
Sven Van Caekenberghe-2 wrote
The why is the result not 'Helloworld' ? or 'Hellworldo' ? Why does the $o appear twice ?
Good point.
Please take a moment to: 1. go to Ulysses 2. follow the account creation link 3. create an account on fogbugz 4. log in 5. create an issue report with: a. the vm version b. the image version c. your platform d. your social security number e. mother's maiden name f. name of first pet g. and, a reproducible way to cause the error 6. (optional, but preferable) followed up by a slice with tests a. re-log-in to fogbugz b. go back to the issue page because the fogbugz login page probably didn't redirect you to the issue c. add whoever is assigned as another person to notify because they will paradoxically not be included by default 7. (if 6) add class comments to classes that you didn't modify - and possibly have never heard of - to make the monkey happy 8. Weigh in on whether Pharo is or is not "Smalltalk" AND/OR whether a tomato is a fruit or a vegetable 9. Cross fingers and wait (but not as long as in Squeak) 10. Try to remember what you were doing before you fell down the rabbit hole 11. Check email for VPRI's final STEPS report while waiting
IN CASE OF EMERGENCY: insert beer between or during any other step OR remember that we (meaning the Smalltalk, Smalltalk-inspired, Smalltalk-channelled, Smalltalk-related, and/or Dynabook-related identified persons and possibly spouses and probably children under 17.5) still have it far better than the rest of the programming world
;-P (hopefully obviously)
Oh, but wait, I opened some bug reports once upon a time... I just rediscovered http://bugs.squeak.org/view.php?id=5707 which links to http://bugs.squeak.org/view.php?id=7194 Not my fault if a forked happened ;)
To continue around this very same example, every one knows that this should fail: 'hello' copyReplaceFrom: 3/2 to: 5/2 with: 'world'. Indeed, only integers should be used as indices!
It should fail equally whether the argument is wide or not as you can see: 'hello' copyReplaceFrom: 3/2 to: 5/2 with: 'world' asWideString. Well yes, maybe non integer indices could be used, but Character>>negative is not understood
It should fail equally whether the receiver is wide or not as you can see: 'hello' asWideString copyReplaceFrom: 3/2 to: 5/2 with: 'world' asWideString.
A good lesson: tricky hacks like this always come with a price: index isNumber ifTrue: [^self at: index asInteger] ifFalse: [self errorNonIntegerIndex]
The sooner failure, the better failure ;)
Ah, finally a better illustration of what you obtain when you mix the bugs: 'hello' asWideString copyReplaceFrom: 11/2 to: 1/2 with: 'world'
----- Cheers, Sean -- View this message in context: http://forum.world.st/WTF-and-Programming-Languages-tp4758263p4758348.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
2014-05-13 2:51 GMT+02:00 Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com>:
2014-05-13 2:41 GMT+02:00 Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com>:
The sooner failure, the better failure ;)
Ah, finally a better illustration of what you obtain when you mix the bugs:
'hello' asWideString copyReplaceFrom: 11/2 to: 1/2 with: 'world'
Eventually, I could expect the behavior when invoking asWildString
2014-05-08 12:23 GMT+02:00 Sven Van Caekenberghe <sven@stfx.eu>:
On 08 May 2014, at 10:58, Nicolai Hess <nicolaihess@web.de> wrote:
2014-05-08 10:39 GMT+02:00 phil@highoctane.be <phil@highoctane.be>: On Thu, May 8, 2014 at 9:37 AM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 07 May 2014, at 23:25, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> wrote:
I love these kind of snippets :)
I have built a collection of freak expressions in Squeak3.9. Pharo 3.0 is less spectacular, above collection is shrinking dangerously... but there are still some not so unsurprising features to test for:
These are actually not that funny, we should try to do something about them, or at least discuss them a bit.
'hello' copyReplaceFrom: 6 to: 4 with: 'world'.
#copyReplaceFrom:to:with: seems overloaded with the insert case, is that really necessary ? still the fact that the $o appears twice feels like a bug, no ?
'Helloworldo' was indeed very surprising. Silent failures like this seem pretty dangerous to me.
Are you sure this is a failure ? :) From the comment of SequenceableCollection>>copyReplaceFrom: start to: stop with: replacementCollection
... If stop is less than start, then this is an insertion;....start = size+1 means append after last character....
The why is the result not 'Helloworld' ? or 'Hellworldo' ? Why does the $o appear twice ?
Un autre pour la route:
'hello' copyFrom: -3/2 to: -5/2.
Yes we know is and this is so funny. On 7/5/14 22:16, kilon alios wrote:
I dont know if you guys are aware of this talk, very funny , quite weird , so I thought why not share it with you
participants (10)
-
Ben Coman -
kilon alios -
Nicolai Hess -
Nicolas Cellier -
phil@highoctane.be -
Sean P. DeNigris -
Sebastian Sastre -
stepharo -
Sven Van Caekenberghe -
Yuriy Tymchuk