🦋 Welcome to the former MAIN() IRC channel of the Raku Programming Language (raku.org). This channel has moved to Libera (irc.libera.chat #raku)
Set by lizmat on 23 May 2021.
00:03 reportable6 left 00:04 reportable6 joined 00:26 _ed joined 00:31 _ed left 00:51 tejr left
avuserow If I have an arbitrary object, is there a builtin way to know whether it matches an interface (role or class, basically a list of methods)? 01:29
tellable6 2021-06-12T20:21:19Z #raku <codesections> avuserow the most direct Raku translation of `for x in a.get("a", []): print(x)` is probably `for %a.keys { say %a{$_}}`
tbrowder japhb: thnx, very helpful!
avuserow I can do this as a starting point, I guess: 01:30
m: class Foo {method a {...}; method foo {say "foo"}}; role FooR {method foo {...}; method bar {...}}; say so all([Foo.can(.name) for FooR.^methods])
camelia False
01:30 tejr joined
avuserow .tell codesections yeah, that only tends to be an issue when I'm subscripting without an intermediate variable, like `for %a<b>.keys {}` vs `my %b := %a<b>; for %b.keys {}` 01:32
tellable6 avuserow, I'll pass your message to codesections
01:40 cornett joined
moon-child avuserow: raku is structurally typed, not nominally typed, so that's not very idiomatic 01:43
err, is nominally typed, _not_ structurally typed
e.g. you couldn't say 'my FooR $x = Foo.new'
avuserow okay, that makes sense 01:47
and my code probably muddled things a bit. what I'm trying to do is say "I want an object as a parameter that has a `quote` method. probably a DBDish subclass of some sort, but I won't stop you from passing in another class" 01:48
might just leave it untyped for now and let things happen 01:50
01:52 _________ left
moon-child in general it's better to not just assume that a method called 'quote' does what you want 01:57
somebody else might have reused the same name for a completely different purpose 01:58
02:04 Manifest0 left 02:06 Manifest0 joined
avuserow I guess. Within some domains, we do make these assumptions all the time. Sometimes it works well enough (maybe like `close` on file-like objects), sometimes less well (like how some languages use `+` to do both addition and string concatenation) 02:13
though I looked, and this might be a moot point. Only one module in the ecosystem implements what I'm looking for, so this might just be better as a hard dependency 02:14
02:20 _________ joined 02:29 _ed joined 02:37 _ed left 02:41 _________ left 02:46 _ed joined 02:51 _________ joined 02:52 _ed left 02:59 _ed joined 03:08 _ed left 03:15 _ed joined 03:20 _ed left 03:56 RandalSchwartz left 04:40 Eddward_ left 04:56 _ed joined 05:00 _ed left 05:18 Doc_Holliwood joined 05:27 gabiruh_ joined, gabiruh left 05:47 Kaiepi left, Kaiepi joined 05:56 Doc_Holliwood left 06:02 reportable6 left 06:04 ttubrian left 06:05 reportable6 joined 07:02 _ed joined 07:07 _ed left 07:10 kylese joined 08:10 benchable6 left, bisectable6 left, evalable6 left, linkable6 left, quotable6 left, unicodable6 left, greppable6 left, sourceable6 left, nativecallable6 left, squashable6 left, coverable6 left, committable6 left, statisfiable6 left, releasable6 left, tellable6 left, shareable6 left, reportable6 left, notable6 left, bloatable6 left, sourceable6 joined, releasable6 joined 08:11 quotable6 joined, bisectable6 joined, reportable6 joined, squashable6 joined, greppable6 joined, tellable6 joined, coverable6 joined, benchable6 joined 08:12 unicodable6 joined, evalable6 joined, statisfiable6 joined, bloatable6 joined 08:13 shareable6 joined, committable6 joined, notable6 joined, nativecallable6 joined, linkable6 joined 08:35 Doc_Holliwood joined 08:48 tobs left, Woodi left, markmarkmark left, kjp left 08:49 tobs joined, Woodi_ joined, kjp joined, markmarkmark joined 09:02 tinita left, JRaspass left, polettix left, JRaspass_ joined, tinita_ joined, polettix_ joined, JRaspass_ is now known as JRaspass, tinita_ is now known as tinita 09:31 Sgeo left 10:31 tellable6 left, quotable6 left, sourceable6 left, bisectable6 left, shareable6 left, evalable6 left, coverable6 left, bloatable6 left, releasable6 left, linkable6 left, statisfiable6 left, notable6 left, squashable6 left, committable6 left, greppable6 left, benchable6 left, reportable6 left, unicodable6 left, nativecallable6 left, linkable6 joined, statisfiable6 joined, releasable6 joined, notable6 joined 10:32 quotable6 joined, unicodable6 joined, bisectable6 joined, evalable6 joined, committable6 joined 10:33 tellable6 joined, reportable6 joined, shareable6 joined, bloatable6 joined, sourceable6 joined, greppable6 joined, squashable6 joined, coverable6 joined, benchable6 joined 10:34 nativecallable6 joined 11:09 sanikovich joined 11:10 sanikovich left 11:23 sarna joined 11:24 sarna left 11:42 tejr left 11:43 tejr joined 12:04 reportable6 left, reportable6 joined 12:13 Geth left 12:23 whati joined 12:26 whati left 12:28 RandalSchwartz joined
chronon I've been holding back from really taking Raku into my heart, waiting for the language to settle, and for a comprehensive book in the style of "Programming Perl" that I can just cover to cover and be confident that I have not missed anything an expert should know about the language. 12:59
As far as I can see there are a fair few out of date Perl 6 books, and a number of Perl->Raku conversion books, and a few speciality books, but nothing that I can recognise as the once and final definitive guide. 13:00
I know myself well enough to know that I will do the cover to cover read once only, and then won't slog though any other thick books. So I'd like to get my choice of book right. 13:01
Can anyone recommend a thorough and complete Raku book, or at least tell me that they are working on one? 13:02
moritz I don't think there is a thorough and complete book yet. 13:08
phogg It's hard to be thorough and complete with a language this big
13:12 _ed joined
chronon Maybe, but I would pay good money for one, even if it were a multi volume boxed set. Indeed I'd prefer a non-repetative set of smaller books than a single huge doorstopper to lug around. 13:13
Finding random bits of the puzzle online never works for me. I really appreciate well structured information like Programming Perl was. No fluff, no baby stuff, just solid well structured information that treated the reader like an adult. 13:16
13:16 _ed left 13:19 Guest99 joined
Guest99 hi 13:20
13:32 PotatoGim_ left 13:33 PotatoGim joined 13:44 chronon left, chronon joined 13:47 Guest99 left
MasterDuke chronon: i love Programming Perl (one of the only two programming reference books i've read cover-to-cover), but Raku is an even larger language. and with the ease of finding information online, i'm not sure how much of a market there is for a large printed reference book 14:20
14:47 linkable6 left, evalable6 left, evalable6 joined 14:50 linkable6 joined
chronon MasterDuke: So are we just living in a world where nobody values well structure well presented information? Are we now all just living in a forest of fragmented wiki docs and blogs none of which give the reader any understanding of the big picture? A world of cut&paste code fragments instead of anything approaching deep understanding? 14:53
ugexe its a huge effort for such a big language, and writing books isn't exactly lucrative or even profitable in many cases 14:54
of course we value those things... but there are other real world issues 14:55
chronon Would it be possible for a community driven book to work? Each small and specialised chapter written by an expert in that aspect? Overseen structurally by someone with complete understanding who can tie it all together?
I bet if we put money in a pot for that it could work. 14:56
IT'll be hard for the language to grow a userbase without solid books to give people the confidence. 14:57
ugexe if i was paid to write some chapters as an expert in some area i'd personally do it. definitely needs to be an inventive 14:58
moritz my one attempt at a multi-author raku book project was an abject failure
chronon Oh dear, why?
ugexe s/inventive/incentive/ 14:59
moritz chronon: people weren't delivering their chapters (too much else to do), and the project didn't have the right structure to replace those authors
15:00 ttubrian joined
chronon So was that a matter of insufficient incentives? 15:00
moritz also, after I felt I was one of maybe two authors who actually delivered, from a grand total of 5ish authors, I was getting frustrated
chronon Inequalit yis a fact of life. Best to accept it for the greater good. 15:01
moritz lack of incentives, lack of a deadlines and a way to deal with their expiry
chronon Right, so you now have a lot of valuable experience of how to set up such a project in future.
moritz some folks I really respected and liked working with didn't deliver, and I would have felt very weird going up to them and saying "you didn't write the chapter on $area-of-your-expertise, so I'm doing it, and you're not an author of this book anymore" 15:02
today, I would set up such a project very differently from the start, to deal more gracefully with such contingencies 15:03
chronon It would have to be like a contract (separated from one's personal feelings of friendship and admiration). If it were me, I'd want to offer some money on a quality and readability score, but also have a deadline beyond which it all halved, and a second deadline beyond which the author was assumed to have failed and got nothing. 15:04
But importantly, the amount of money offered would have to be quite decent, the kind of money that excites people to wake up and crack on with it.
Thhe kind of money one can put aside other work for, to prioritise the writing. 15:05
I wonder if the Perl Foundation would consider it worth funding. (Don't know anything about how that works.)
moritz that's not how it works, usually 15:06
writing a book is thousands hours of work
chronon I've written large book-like documents in a matter of weeks. But then I've known a lot about what I was writing, so it flowed. 15:07
moritz to be competitive with a good software engineer's salary, you'd have to raise in the order of 100..300k USD or so
that's not the order of magnitude that TPF deals in, nor that you can get funded by a kickstarter
nor from a publisher
it really needs to be a labor of love 15:08
chronon Well, perhaps the answer then is to give the actual writing to a lower level person who might not get such high salaries, but make sure they have access to pester a higher level expert for clarifications and proofreadings.
moritz and aligning enough authors to collaborate on such a labor of love is, well, difficult
chronon I am "between jobs" at the moment and enjoy writing. If I were just a little more knowledgeable about Raku I might volunteer. But with my current level of knowledge I'd feel like a baby teaching the prime minister about tax policy. 15:10
Well, if my goal is to become more knowledgeable, what is the best place to get reasonably well structure and comprehensive information about Raku? 15:11
15:12 kylese left, [Coke] joined
[Coke] whees, power outage last night. 15:12
ugexe i learned from design.raku.org/ (which predates implementation so isnt entirely accurate although the spirit is usually correct) and from the raku source code (which used to be a lot less optimized/nqp and thus was pretty useful for even new people to learn from) 15:16
its also taken me like 10(?) years to get to my level of proficiency so those likely arent very good alternatives 15:17
moritz chronon: for well-structured I would recommend some of the books out there; they won't teach you everything there is to know about raku, but enough that you can do some projects on your own 15:18
ugexe speaking of... zef turns 8 years old in 3 days
moritz and then you can learn from the projects, docs, from here, stackoverflow etc. 15:19
chronon Hmmm, you perople make learning Raku sound like learning Japanese or all of the works of Shakespeare or something. 15:21
ugexe if you want to be an expert? perhaps
to learn it, no
chronon How much bigger and more complex is it than Perl 5? I thought Raku was in part at least a consolidation and tidy up of the warts. Which should make it easier to learn. 15:22
ugexe significantly bigger and more complex than core Perl 15:24
chronon Surely the basic language syntax, control flow, variables, types, operators, IO, and so on cannot be vastly bigger than Perl 5. Where is the complexity mostly? Is it in the regex grammar syntax, or Unicode handling, or async, or where?
ugexe that doesnt mean its harder to learn, just that there is more to learn that is core to the language 15:25
since I hope an expert perl programmer is not just using core Perl but the rest of their tools
well there is OO, threads, and non-ref counting GC 15:26
a beginner that is learning probably doesnt have to care about these things though
chronon One of the things I always love about Perl 5 was the fact that there was so much in the core, and it was well integrated using contextual behaviour that did what you usually wanted. 15:27
Raku is more of that, adn so must feel even more empowering.
ugexe honestly design.raku.org/ might be up your alley despite the disclaimer i made earlier 15:29
chronon Hmm, I'll definitely check that out. Thanks. 15:30
I'm not a big fan of IDEs (I'm a vim freak) but has anyone tried and enjoyed Comma? Would using the community edition be a good way to learn my way through Raku?
tonyo i use vim
chronon :) 15:31
15:31 _ed joined
[Coke] I think there's a vim plugin (don't use it), but Comma might help and let you introspect things in the IDE to see what's what. 15:32
sorry, I mean vim plugin: (*I* don't use it)
chronon Ah! 15:33
I was confuseed for a mo.
[Coke] yays, as all the computer hardware seems to have survived the 2 power outages.
chronon Don't you have UPS?
[Coke] nope. 15:34
chronon moritz, when you and your crew were writing books, what were the prefered formats to write in? Were people using lightweight markups and converting? 15:42
Does anyone have a lightweight markup favourite for writing very large documents? 15:43
15:44 _ed left
chronon Well, does anyone know someone who might have an opinion on that? 15:51
moritz chronon: back in the days, we used some variant of POD; these days, I've mostly written stuff in Markdown 15:53
[Coke] Note that many of the crew here are on european time, so responses may be delayed.
moritz I love leanpub, which can render a book from markdown files in git, sell early versions, send updates to people when new version are avaialble etc.
[Coke] thanks chronon for the reminder to finally pick up a UPS. 15:54
chronon Should be late afternoon in Europe I think.
I used to have several UPS supporting my routers and wifi antennae for a community wifi I set up. Powercuts were frequent out there. Laptop batteries would last, but no good if the wifi is down. 15:55
Be sure to get a UPS that allows you to silence the beeper if you want to retain your sanity. Not all do. 15:56
Oh is leanpub a site, or service, or software? 15:57
ugexe easy enough to clip the speaker on them
chronon I actually did that in some of mine. Just got too fed up.
I like reStructuredText. It feels well designed. Not perfect, but I think it is better than Markdown for large documents as it has quite a few bookish features. 15:59
Ok, I found leanpub.com so it is at least a site, what else I wonder? 16:02
Looks like they use Markdown (or MSWord but that's crazy). 16:03
One other issue I have with Markdown is the large number of variants and lack of standardisation. Which kind of Markdown are leanpub using i wonder. 16:04
Ok, enough thinking out loud on a publically logged channel. Bye for now. 16:05
16:06 _ed joined 16:13 monkey_ joined, _ed left 16:14 _ed joined 16:22 _ed left 16:23 _ed joined, raaa joined 16:24 raaa left 16:29 Eddward_ joined, _ed left 16:58 _ed joined 17:02 _ed left 17:48 Sgeo joined 17:49 monkey_ left 18:03 reportable6 left 18:06 reportable6 joined 18:19 monkey_ joined 18:25 Tirifto left 18:27 Tirifto joined 18:30 chronon left 18:45 AntonOks joined 18:50 notna joined 19:07 jess left 19:18 _ed joined 19:26 _ed left 19:29 monkey_ left 19:44 AntonOks left 19:45 notna left 19:46 notna joined, notna left 19:56 _ed joined 20:32 _ed left
SmokeMachine Hi! sorry for insisting on this, but I really think `.reduce()` should be able to receive the aggregator as parameter... that would make it easier to fix something like this: 21:26
m: :{{"a" => 1} => {:10a}, {"b" => 2} => {:20b}, {"c"=>3}=>{:30c}}.reduce: -> |c ($_, %b) { say c; :{|%b, .value => .key} }
camelia \({:a(1)} => ${:a(10)}, {:c(3)} => ${:c(30)})
No such method 'value' for invocant of type 'List'. Did you mean
in block at <tmp> line 1
in block <unit> at <tmp> line 1

\(({:c(3)} => ${:c(30)}, {:a(10)} => {:a(1)}), {:b(2)}…
21:32 linkable6 left, evalable6 left 21:33 evalable6 joined 21:35 linkable6 joined 21:39 notna joined 21:44 notna left 22:15 _ed joined 22:24 _ed left 23:24 coverable6 left, sourceable6 left, evalable6 left, squashable6 left, notable6 left, shareable6 left, reportable6 left, committable6 left, bloatable6 left, unicodable6 left, statisfiable6 left, releasable6 left, linkable6 left, benchable6 left, greppable6 left, nativecallable6 left, bisectable6 left, quotable6 left, tellable6 left, committable6 joined 23:25 coverable6 joined, statisfiable6 joined, quotable6 joined, bisectable6 joined, tellable6 joined, greppable6 joined, sourceable6 joined, notable6 joined 23:26 evalable6 joined, shareable6 joined, linkable6 joined, bloatable6 joined 23:27 nativecallable6 joined, squashable6 joined, benchable6 joined, reportable6 joined, releasable6 joined, unicodable6 joined 23:36 squashable6 left, squashable6 joined 23:57 _ed joined