»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
guifa is blind. 00:34
Where is the .first() for Lists in rakudo source? I checked under Any.pm6 and List.pm6 and it’s not there
timotimo Any-Iterable-Methods perhaps?
guifa Ah, yup there it is. 00:38
I’m going to leave that on my to-do to add an $pos bit, matching Str.index() 00:40
masak guifa: "teach a person how to fish" answer: `cd rakudo; git grep 'method first'` 06:56
guifa: if you add $pos, remember to also update the documentation -- kthx ;) 06:57
Geth doc: d6f7e8e072 | (JJ Merelo)++ | doc/HomePage.pod6
Adds link to Chinese translation from front page, closes #2903
08:06
dumarchie Hi there. I have a question about the intended and actual behavior of class Promise. 09:02
I can change the status of a Promise from Kept to Broken and vice versa. Is that intended behavior?
jnthn How? 09:03
m: my $p = Promise.new; $p.keep(1); $p.break("x")
camelia Access denied to keep/break this Promise; already vowed
in block <unit> at <tmp> line 1
09:04
dumarchie my $p = Promise.new; my $v = $p.vow; $v.keep(1); $v.break(2);
jnthn Ah, if you obtain the vow
Anyway, no, that's absolutely not something you should be doing. 09:05
dumarchie Ehm, not something I should be doing, or not something that should be possible? 09:05
jnthn I'd argue that a future version of the spec should explicitly forbid it; for now it's undefined behavior. 09:06
jnthn It costs something to enforce, but probably not much. 09:07
dumarchie I can try and make it impossible in the implementation.
jnthn That'd be nice. Also, an addition to the spectests repository so it's specified behavior would be good, if you've time/interest :) 09:08
dumarchie Is throwing an exception from a Lock.protect block okay?
jnthn Yes
It will release the lock
(protect uses LEAVE to make sure of that)
dumarchie Okay, I'll give it a try later today.
jnthn Nice, thanks. 09:15
dumarchie I'm not sure if an X::Promise::Vowed exception is appropriate, given the current documentation. 09:17
dumarchie doc.perl6.org/type/X::Promise::Vowed 09:18
Maybe introduce a new exception type X::Promise::Final ? 09:19
jnthn Hmm...not sure about final... X::Promise::Kept is kind of an option, though it's a bit odd in the broken case 09:33
X::Promise::Status could be reasonable as in "it's in the wrong status to perform this operation" 09:34
dumarchie I came up with "final" because it should only be possible to transition a promise from an initial Planned state to a final Kept or Broken state. 09:38
...and it's a bit shorter than X::Promise::IllegalTransition 09:40
dumarchie Okay, how about X::Promise::Vow::Exercised ? 09:52
...because it's about a Promise::Vow, which is documented as a object holding authority. 09:53
jnthn IllegalTransition is probably the clearest. I don't know that we need to go for shrot here. 10:22
dumarchie Okay, X::Promise::IllegalTransition it will be. With a $.promise attribute and message "Illegal attempt to keep/break this Promise (status: $!status)". 10:50
Shall I create an issue for the record?
In github.com/rakudo/rakudo/issues I mean ? 10:53
jnthn Yes, please
Xliff \o
jnthn: How was Riga? 10:54
Have you had any time to look at: github.com/jnthn/p6-io-socket-asyn.../issues/44
AlexDaniel she is adorable: imgur.com/a/5uc5R23 12:14
jnthn Xliff: Well, my course and talks seemed to go alright in Riga, but I also had a cold, which made it rather tiring, and I still barely feel I've recovered from it :) 12:21
Xliff: Didn't have time yet, alas 12:22
AlexDaniel jnthn: incorrect 12:24
jnthn: your keynote was amazing, not just alright :)
Xliff jnthn: Any recordings?
jnthn: And I hope you get over your code.
I have another potential MoarVM issue that will go up, soon.
El_Che Xliff: www.youtube.com/user/ShadowcatSystems/video on top
Xliff I keep putting it of....(hmmm) 12:25
AlexDaniel keynote: youtu.be/tenl6JEum5k?t=2748
ah, actually starts at youtu.be/tenl6JEum5k?t=2899 12:26
jnthn Xliff: I'm not sure I'll ever get over some of my code, but the cold hopefully ;) 12:27
AlexDaniel :D 12:28
jnthn
.oO( deopt.c /o\ )
12:29
Xliff jnthn: LOL! 13:01
I'm watching your talk ATM. I agree with AlexDaniel. And yes... s/code/cold/ -- Although your response was priceless. 13:02
And now I am encouraged to scour deopt.c for blackmail material.
:D
masak .oO( in this house, we don't scare our kids with the Bogeyman, but we _do_ scare them with deopt.c ) :P 13:11
tbrowder hi #perl6 13:17
tbrowder since python is so popular, and apparentl so rigid (only one way to do it), has anyone worked on a py2p6 translator? 13:19
sena_kun we do have a github.com/niner/Inline-Python 13:20
writing a translator is most likely not a very awesome idea 13:21
tbrowder ah, thnx, that should help. i have been working on google apis and they show python code for most examples. some apis show raw rest examples, but not always. being able to python will help a lot. 13:24
note we do have the p6 module for Oauth2! 13:25
@nine's inlinep5 has served me well! 13:26
guifa masak++ and noted on documentation. I’m going to do some massive documentation work as soon as I’m done with the dissertation. Until then @sad-faces.».say 13:44
masak jnthn: I looked in deopt.c and it was much cleaner than you gave me reason to expect :D 13:53
Xliff tbrowder: I have been transcoding python in my head for a while. What Google APIs are you working on? 14:17
(want help?)
m: my @a = ('a' ... 's'); @a.»say 14:18
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing dot on method call
at <tmp>:1
------> 3my @a = ('a' ... 's'); @a.»7⏏5say
expecting any of:
postfix
Xliff m: my @a = ('a' ... 's'); @a».say
camelia a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
tbrowder Xliff: gmail at the moment. i have maps working fine (i lost service for a while when they closed out their original api). i would like to be able to manage my gmail contacts via the api. 14:28
my maps code is still p5 (but transcoding to p6 is on my todo list). my gmail code is p6, as will be any contacts code. 14:29
p_gurra how do i express the p5 idiom "use lib '.';" 15:19
tadzik how about `use lib '.';`? :) 15:21
timotimo is that relative to the source file in both languages? 15:22
p_gurra :-) i've tried, but the thing i get is "'use lib' may not be pre-compiled"
Yes
timotimo what problem are you trying to solve with "use lib '.'" right now? 15:23
p_gurra i have pm6 file that try to use another pm6 file 15:24
... in the same directory
timotimo so it'd be too much effort to set up a META6 and everything?
Grinnz it is relative to cwd in Perl 5, which is why it's discouraged 15:25
p_gurra ehhhh ... for me anyway ...
i've just stared my p6 journey ...
Grinnz see metacpan.org/pod/lib::relative
timotimo how's your setup look like, do you have one p6 script that includes that one module and the one module includes the other? 15:26
Grinnz i'm sure it could be made much prettier in p6 ;)
timotimo because if your script already has "use TheFirst" in it and TheFirst has "use TheSecond" in it, it's enough to "perl6 -I. script.p6" 15:27
and both will be found
and if the script has "use lib '.';" in it, no need for the -I either 15:28
p_gurra my call is one-liner -> pm6 ( -> pm6 ...)
timotimo so i think you can just leave out the "use lib '.'"
p_gurra i'll try ...
timotimo another way is to put "no precompilation;" in front of "use lib '.'" but i would really not recommend this 15:30
p_gurra when i remove the use-libs and my oneliner looks: "perl6 -I. ..." the modules isnt used 15:32
timotimo you may have to put some "is export" in your modules to make stuff available
p_gurra i know
timotimo i don't know how to interpret "isn't used" 15:33
p_gurra and the linter complains about not finding the module and trying to use ... 15:34
I am trying ...
timotimo oh, is the one liner also in the same folder the modules are in? 15:35
p_gurra the subs in the module are not found
in the samt folder, yes
timotimo just "use TheOther" will not cause "use TheOne" to also have everything from TheOther available 15:36
i.e. re-exporting isn't automatic
p_gurra so i have to declare all "usage" at the top call? 15:38
timotimo there's a specification for a "use and re-export", but it's not implemented yet 15:39
p_gurra well, dont bother. i¨ll try some other way by moving the files around. 15:40
timotimo your script could just use both modules
p_gurra i'll try that. thnxs 15:41
timotimo i should have thought of that right away, lol
SmokeMachine timotimo: What is the specification for "use and re-export"? 16:07
timotimo i think it's something like "use Foo::Bar :EXPORT" 16:08
tbrowder just watched @jnthn's talk at riga on concurrency--excellent--looks like a good p6 marketing talk as it is! 16:37
rba AlexDaniel: You have started thinking about p6lerts and alerts.perl6.org? 16:47
AlexDaniel: colabti.org/irclogger/irclogger_lo...06-22#l411 16:49
AlexDaniel: Any thought from your side?
vrurg m: class Foo { has int $.a; }; use nqp; my $f := Foo.new; nqp::bindattr($f, Foo, q<$!a>, nqp::unbox_i(42)); say $f.a 16:53
camelia P6opaque: representation mismatch when storing value (of type Int) to attribute (of type int)
in block <unit> at <tmp> line 1
vrurg ^ anybody have an idea how to get this working?
tbrowder ref marketing: i'm trying to define a set of one or more videos to use to introduce p6 to programmers at a local venue. there are lots of linked on the p6 site, plus those at jnthn's site, but i would appreciate recommendations for the "best" knowing that is a tough request. if there is interest, maybe we could vote for an "approved" collection as a go-to resource for p6 marketers. 16:54
jnthn vrurg: Must be nqp::bindattr_i 17:09
dinner &
vrurg slapping himself into forehead.
jnthn: thanks!
AlexDaniel rba: well, if we can easily bring it back up, then fine 17:29
rba: but otherwise I'd much rather have a simple git repo with an .md file 17:30
cpan-p6 New module released to CPAN! Gnome::Gtk3::Glade (0.8.7) by 03MARTIMM 17:32
rba Alexdaniel: I can try to bring it back. If I didn’t manage we can look for other options. 17:34
AlexDaniel cool
cpan-p6 New module released to CPAN! Tomty (0.0.3) by 03MELEZHIK 18:49
Geth problem-solving: AlexDaniel assigned to jnthn Issue Reconsider Rakudo build structure github.com/perl6/problem-solving/issues/94
AlexDaniel assigned to jnthn Issue Support for custom knowhows isn't generic enough github.com/perl6/problem-solving/issues/90

Add one more template
If this looks alright, I'll add one for every label.
19:54
problem-solving: 8e2376159a | (Aleks-Daniel Jakimenko-Aleksejev)++ | .github/ISSUE_TEMPLATE/issue-template-language.md
Fix template name
20:16
Geth problem-solving: 1d70626aa9 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 8 files
Add issue templates for every label
20:29
pmurias tbrowder: python isn't really that rigid 20:38
tellable6 2019-08-22T13:34:18Z #perl6-dev <vrurg> pmurias: Could you check if R#3131 didn't break JS build? I can't because my nodejs is broken and I have no time to fight with it.
synopsebot R#3131 [closed]: github.com/rakudo/rakudo/pull/3131 Add p6clientcore ops
pmurias vrurg: I'll check it
tbrowder pmurias: thnx, i was just referencing something i think i heard jnthn say at riga 21:01
discord6 <Scimon> Working with python Devs they consider (there's one way to do it) to be a strength. Lots of time is spent in code reviews discussing the most pythonic way to do something. 21:21
tadzik hehe 21:22
so clearly it's not working
discord6 <Scimon> Plus PEP8 which mandates how you space your code and mandates an 80 character line limit...
<Scimon> It's tedious
<Scimon> Like the language
jnthn tbrowder: Hm, I don't recall making a comment like that... 21:23
pmurias tbrowder: the language philosophy encourages rigidness but it's a dynamic "scripting language" 21:25
tbrowder: so translating it would be hard
discord6 <Scimon> It's got type "hints" now. They are basically useless.
<Scimon> I first saw them just after writing my talk on signatures. I was not whelmed. 21:26
tbrowder jnthn: sorry, i just heard or saw the phrase somewhere recently.
excellent talk on concurrency, btw. 21:27
discord6 <Scimon> Perl6 signatures and multi call is just so powerful and useful everything else feels anaemic.
jnthn tbrowder: I did mention Python a bit in the performance talk, but I don't recall saying anything about it from a design perspective. :) 21:29
Well, other than "it has complex numbers built in" and other such :)
tbrowder sorry, just my brain cramp 21:31
jnthn No worries. 21:32
Though if the claim is "rigid" then it's arguable in various directions. :)
Certainly Perl 6 makes some kinds of static analysis a bit easier. 21:33
masak tadzik: I don't know if "so clearly it's not working" is the obvious conclusion to jump to there 22:11
tadzik masak: I'd say if the goal is to have one, obvious way to do things and then if you have to spend time arguing which one is it, then it's not really an obvious way ;) 22:12
masak tadzik: my personal summary has been that although "there should be one obvious way to do it" is clearly a "false" or unattainable ideal, the way the Python community makes that a goal is still beneficial
tadzik nodnod 22:13
masak I'll also note that I heard important Perl 5 people kvetch about perldoc's inability to give _one_ good way to do things, for beginners who aren't ready for details/depth
...during the Riga conf 22:14
I mean, I also agree with you that time spent arguing can get excessive 22:16
but there's a cost also to never arriving at a consensus way, or a cost to having a hundred different ways to do the same thing but no coherence 22:17
Grinnz indeed, and I think perlfaq is a good resource in that direction but unfortunately the new perldoc site has removed the ability to search it *grumble* 22:18
masak .oO( "we all value individual freedom and expressiveness" -- "great! how do you see that benefiting the community" -- "well, it depends quite a bit..." )
Grinnz but that's why i put perlfaq results first on perldoc.pl...
easy problems easy and hard problems possible, but preventing the likely worse ways from being chosen, that's the tough part 22:23
masak yes. 22:24
I really like the idea of the "pit of success" that's been popularized in the past decades 22:25
Grinnz meaning?
masak that is, if you're not sure what you're doing, the system you're using will most likely make your attempt successful
detailed knowledge is not required for success
Grinnz ah. that sounds like DWIM 22:26
masak whereas older systems were often designed (implicitly) with a "pit of failure"
I don't think "pit of success" is exactly the same as "DWIM"
DWIM has a dark side to it, that's why we coined "every DWIM has an equal and opposite WAT"
Grinnz the counter argument is that making suboptimal choices fail makes the suboptimal parts more obvious, where otherwise they may not be discovered until it's too late 22:27
masak aye -- that's why I like Perl's `my` better than Python/Ruby's "just auto-create a variable, whether there was a typo or not" 22:30
Grinnz in the end, the best APIs and designs sit in the gray area between these philosophies, IMO
masak I think failure is a good thing when errors are statically detectable 22:31
"error: this will never work"
mismatch between argument list and function signature is another good example of that
Grinnz sure. but there was a movement especially in older CPAN modules to accept arguments in a way that wasn't even documented, and doing a best-guess, which usually just led to problems 22:32
at the least, hugely overcomplicated argument parsing
masak that sounds like "bad DWIM" to me 22:33
Grinnz indeed
masak again, I take "pit of success" to be a somewhat less lead-infused version of DWIM 22:34
masak something akin to "if the user doesn't specify what they want, give them a default that is likely to succeed" 22:35
whereas DWIM is more "if the user doesn't specify what they want, try to guess, even if guessing is likely to go wrong"
Grinnz proper defaults can make a big difference in usability indeed 22:37
masak bringing it back to Python: I simultaneously believe that Python's ideal is unattainable, and that it's beneficial to try shooting for 22:41
jast what's a Python 22:42
timotimo a miserable pile of scales 22:43
jast (I may or may not write Python for a living) 22:44
sortiz \o
masak Python is an OK, if somewhat restricted, dialect of Perl 22:47
jast with some interesting black magic on topic
Python's descriptors are seriously weird 22:48
as are its metaclasses
timotimo descriptors, you mean how methods are detached from their instances but still remember them? or is that something totally different? 22:49
masak no, descriptors are what make that work
although they also do other things, such as attribute validation 22:50
they're kinda like proxies in a way
jast descriptors are basically class attributes (if that's what they call it) that magically turn into virtual attributes on instances with a __get__ and __set__ impl in the background
e.g. Django uses them to turn something like "class Foo(Model): [...] name = CharField()" into something they can parse into a model and monitor for changes and stuff 22:51
Geth whateverable: 981ab6f582 | (Aleks-Daniel Jakimenko-Aleksejev)++ | META6.json
Fix provides
masak __get__ and __set__ and __delete__ 22:54
masak (the last one which I personally think is one freedom too far on object attributes) 22:55
masak 'night, #perl6 23:16
timotimo night masak