🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 8 June 2022.
Nemokosch @variables have this semantics that the elements are scalars in disguise, despite the fact that a normal scalar apparently can get away without this 00:00
rir What language is your reference point?
Nemokosch quite literally any semi-mainstream C-family/imperative language. Java, C, Javascript, Pascal, Python, you name it 00:01
I know, Java and languages "beyond" mix plain value variables and reference variables 00:03
But that both has a clear rationale and rather easy semantics to get by 00:04
rir If @$a works for you, you can do that. I would guess you have more theory and practical experience, but I a bit more knowledge of Raku. 00:05
Nemokosch Also, I think it's unfair to always pick on poor @ - % is probably not any better
it's just hashes are overall less common, in my case at least
I feel this topic is an endless pit 00:06
00:07 reportable6 left
rir You might want to check out flattening, append, push, decont, containers, and itemization. 00:07
Nemokosch I accept 3 major gotchas about @ and it's like a hydra
they just don't stop coming
rir Or you might want to use a simpler language. 00:08
japhb It's only an endless pit if you keep digging ... if you don't want to use @ or %, then ... just don't.
Nemokosch This just feels like a too big segment of the language and hence it casts a big shadow
00:09 reportable6 joined
rir Good point @japhb, coming mostly from Perl, I didn't consider that. 00:09
Nemokosch if something that is useful in 1% of cases is represented as if it were in, say, 30% of cases, that makes you wonder about the overall design
Also, how much time and effort do they eat up for the core devs themselves? Couldn't that time be better spent? 00:11
japhb It's useful in more cases than it appears you are giving it credit for. But think of it like this, since Raku was designed by a linguist ... does English actually need the verb tense often seen as "would have been"? How about "had wanted"? They are useful and add to the language ... but not required to buy eggs. 00:12
Nemokosch Raku is actually a language where one could really just invent these variable types if they actually needed them
00:13 lichtkind left
Nemokosch but they keep proving themselves unworthy of being the same sort of "first class citizen" $ variables (that is, variables with variable semantics...) are 00:13
japhb Nah, you're just not seeing all the ways sigils are used. They mark parts of speech, they constrain types, they provide default container types, they document intent, .... 00:14
Nemokosch The analogy with English actually fits - "had used" only takes knowledge of simple past and present perfect ("perfect" in general) 00:15
one could quite literally invent a "past perfect perfect" or something; from what I know, this sort of humor actually exists in the anglophone world 00:16
You know, I've been holding on and trying to use @ for "positionals", as it was intended. It *could* work. 00:17
It *could* work - if it had proper assignment, and if it integrated with type constraints, at least. 00:18
Then I could say, okay, the elements are scalars for technical reasons, this is a conceptual constraint: one can decide for or against it, given the situation 00:20
japhb The elements are scalars because assignment is not the same as binding. 00:21
Nemokosch Indeed. And @variables have this "list assignment" instead of anything like a variable assignment. 00:22
rir Going back to your first code: @a[0] is a List because that is what you gave it.
Nemokosch it is a *Scalar* List 00:23
rir No, it is an instance of List containing instances of Any 00:24
Nemokosch It is a Scalar, that's what the $() denotes
and unfortunately it indeed iterates as a Scalar - as one sole element 00:25
japhb That `@v =` implies list assignment is a feature, not a bug. If you just want to grab the object, you can use `$v =` (if you want an assignable Scalar), or `@v :=` (if you want to bind an existing positional to another @-sigiled variable)
rir m: $(0,1).WHAT 00:26
camelia ( no output )
rir m: say $(0,1).WHAT
camelia (List)
Nemokosch that's not the type of the container 00:27
rir Right!
Nemokosch I don't even know how to retrieve the type of the container tbh
rir It is in a container that treats its contents as one item. 00:28
Nemokosch m: say $(0,1).VAR.^name
camelia Scalar
Nemokosch oh yeah
japhb: I know this is "not a bug", and I cannot help but knock my head to the wall, wondering about the design process... 00:30
japhb Try taking it from a different angle -- assume there are valid and good reasons for it (if only because people are telling you there are) and try to understand them, rather than assuming the designers were idiots (they REALLY weren't). 00:32
Nemokosch "list assignment" is responsible for a very significant share of WATs regarding these List-contained variables 00:33
japhb Have you heard of the "waterbed theory of complexity"? 00:34
Nemokosch I'm not assuming anything, man. I've been trying to find out and understand those reasons for at least half a year.
I do feel I'm left with "well just assume they weren't idiots", though
japhb But you're coming back over and over again to the WATs you see, rather than letting go and investigating the DWIMs. 00:35
WAT and DWIM are duals.
The waterbed theory of complexity says that at some point after getting rid of unnecessary complexity, you reach a point where every attempt to remove complexity in one place ("pushing down on the waterbed") just makes some other place more complex (just like the water flowing to another spot and pushing it up). 00:37
Raku (and to a lesser extent, Perl before it) push *hard* down on some places. Inevitably, other spots rise up.
Nemokosch Look, I like this language; I wouldn't have invested nearly a year into it if I didn't. However, I think the learning process I've been going through gives me some legitimacy to say: the "spokespeople" of Raku are very clever at advertising Raku as a very intuitive and DWIM language - which it in fact really isn't. 00:38
If I were really looking for easy reasonings and predictable results, I would have gone back to Python a long time ago.
rir I didn't get that, I thought Raku would be a large and complex language given that has "everything" and a sink 00:40
Nemokosch And you were right I think 00:41
japhb Raku is intuitive in the same way that gravity is, post-Einstein. Everyone understands that an apple falls, and a spaceship orbits. Those who look deeper can see why GPS satellites have to care about both motion and gravitational field effects on time.
Nemokosch But I, probably among others, got hooked in by clever presentations, from the likes of Liz, Bruce Gray and Leon (sorry forgot the surname) that never forgot to illustrate how intuitive Raku really is 00:42
japhb I think you might be right at the stage where your are *beginning* to grasp General Relativity, and it is twisting your mind in knots.
*you are 00:43
Nemokosch Again, I'm not blaming them or anything; I think it was a clever move
But I hope that they are actually aware of the complexity and I do think they are
japhb "Make the easy things easy, and the hard things possible." It's been one of Larry's slogans for decades now. 00:44
Nemokosch On a slightly unrelated note: Raku already has way better documentation than Typescript in my opinion 00:47
which also illustrates that one doesn't even need proper documentation if half of the world is using and developing the language, lol
I remembered this because... yeah, the complexity of Raku hit me earlier than the complexity of Typescript, simply because I wouldn't have assumed Typescript is really capable of anything, and there were no pointers 00:50
Anyway, if I were to get someone started in Raku (which I'm trying to be but easier said than done), I would definitely warn them about quite a number of things 00:57
and perhaps I'd say "@ % well it's better to stay away from them, nothing to lose"
00:58 Nemokosch left
japhb Or rather than making an absolute statement, you can make it relative to yourself: "I don't find myself using @ or % -- the way they actually work doesn't fit the way my mind works. Thankfully, they're not actually *necessary* for basic stuff." 01:03
rir Some things have a curve and some things are boring. 01:06
Anton Antonov <@297037173541175296> Well, teach them Hungarian first, then Raku. 01:12
Nemokosch That's also nice 01:13
01:19 Kaiepi left
Certain stuff is not worth relativizing. I've crossed the jungle, if I want to get others involved, I won't say "well I do not fancy being hit by vines, monkeys and insects all at once but it's your journey..." 01:20
The important thing is to get them _to the point_ where they can make an informed choice eventually 01:21
And I'm willing to take the responsibility for keeping a newbie away from this stuff until we can see whether the language is working out well for them or not 01:23
japhb How do you know how their mind works? 01:32
Nemokosch Look, if a spider bites you and it hurts, how do you know it would hurt for others as well? 01:47
You don't actually know but you are confident enough to rather take the risk of misjudgement 01:48
01:56 Garbanzo left 01:57 Garbanzo joined 02:00 Kaiepi joined 02:04 tejr left 02:05 tejr joined 02:14 Kaiepi left 03:14 nativecallable6 left, committable6 left, releasable6 left, linkable6 left, tellable6 left, benchable6 left, reportable6 left, sourceable6 left, shareable6 left, evalable6 left, greppable6 left, statisfiable6 left, bisectable6 left, coverable6 left, bloatable6 left, notable6 left, quotable6 left, unicodable6 left, notable6 joined 03:15 committable6 joined, bisectable6 joined, nativecallable6 joined, statisfiable6 joined, releasable6 joined, shareable6 joined 03:16 benchable6 joined, bloatable6 joined, coverable6 joined, greppable6 joined, quotable6 joined, evalable6 joined 03:17 tellable6 joined, reportable6 joined, unicodable6 joined, sourceable6 joined, linkable6 joined 04:17 reportable6 left, bisectable6 left, statisfiable6 left, nativecallable6 left, bloatable6 left, releasable6 left, greppable6 left, unicodable6 left, notable6 left, sourceable6 left, tellable6 left, linkable6 left, quotable6 left, shareable6 left, benchable6 left, coverable6 left, evalable6 left, committable6 left, coverable6 joined 04:18 tellable6 joined, statisfiable6 joined, benchable6 joined, linkable6 joined 04:19 notable6 joined, reportable6 joined, committable6 joined, shareable6 joined, bloatable6 joined, nativecallable6 joined, greppable6 joined, unicodable6 joined 04:20 quotable6 joined, releasable6 joined, sourceable6 joined, evalable6 joined, bisectable6 joined 04:34 GreaseMonkey left 04:46 Garbanzo left 05:00 Sankalp left 05:02 Sankalp joined 05:04 Colere left 05:05 Colere joined 05:07 Furor joined 05:08 archenoth left 05:09 archenoth joined 05:10 Colere left 05:13 Sgeo left 05:20 greaser|q joined 05:22 leah2 left 05:24 leah2 joined 05:59 [Coke]_ joined 06:02 [Coke] left 06:07 reportable6 left 06:09 reportable6 joined 06:11 melezhik joined, melezhik left 06:12 abraxxa joined 06:16 abraxxa left
japhb I think of it more like lactose intolerance. If you've got it, it sucks to trigger it. And there are *absolutely* a fair portion of adults who would share that misery. There are *also* a fair portion of adults who literally have not issue with it whatsoever. And for those who do have lactose intolerance, there's a more-or-less easy way to avoid the pain: Just take a lactase enzyme pill before consuming 06:17
dairy, and be done with it.
06:17 abraxxa joined
japhb You can let people know that *if* they are lactose intolerant, there's a simple workaround, and you can even offer to share your lactase pills. But you don't know just by looking at someone whether they actually *are* lactose intolerant or not. 06:18
And not telling *them* about ice cream (or yogurt, or kefir, or whatever) because *you* are lactose intolerant makes no sense. 06:21
06:25 melezhik joined, melezhik left
japhb To sum up: If you eat ice cream and get sick, that does not mean that some random other adult is going to. It just means you lack the genetic mutation needed to process the lactose as an adult, and you didn't prepare by taking lactase. 06:29
06:30 guifa left 06:33 mexen joined
Nemokosch as I said, my level of confidence is above the lactose intolerance example and it's more similar to the spider bite actually 06:37
> I do feel I'm left with "well just assume they weren't idiots", though
06:38 guifa joined
I do have actual, reasonable, discussable points, not just some sort of "intolerance" that one can cut short with "each to their own" 06:39
06:43 greaser|q left, greaser|q joined 06:44 greaser|q is now known as GreaseMonkey
I have mentioned the assigment for example. That's probably the biggest and most fundamental concern. All the other imperative (broadly meant) languages I've ever come across have the Scalar semantics as the _variable_ semantics. Namely: C, C++, Java, C#, Python, Javascript, Pascal, PHP. 06:47
What are we taken away with the List container semantics? Well, basically the usual variable assignment which is fundamental in Raku as well: 1. function parameter traits are weird for @variables, there is no readonly vs rw distinction 2. You cannot assign to the topic variable if it came as a @variable, it will fail 3. related to the last two points, you cannot swap @variables as easily as with $variables, 06:54
07:10 guifa left
rba Looks like cloudflare is having some troubles atm. You can use docs.rakulang.site/ and raku.rakulang.site/ as an alternative for the moment. 07:13
07:23 bolli24 joined 07:24 bolli24 left
samebchase lizmat: Any future plans to add Mastodon toots about Raku in the weekly? 07:26
07:29 guifa joined
Nemokosch what is that? 07:35
moritz open source / federated alternative to twitter 07:36
07:38 guifa left
Nemokosch sounds huge 07:39
07:42 guifa joined 08:14 dakkar joined 08:22 frost joined
jjatria m: use Test; class A { }; multi sub infix:<eqv>( Any, A ) { note "CALLED"; True }; say 1 eqv A; is-deeply 1, A 09:06
camelia CALLED
True
not ok 1 -
# Failed test at <tmp> line 1
# expected: A
# got: 1
jjatria I expected defining my own `eqv` would allow me to customise the behaviour of `is-deeply`, but something is not going as I expected 09:07
09:13 equinox joined 09:14 guifa left, equinox left 09:15 guifa joined
moritz Test doesn't import your definition of infix:<eqv> 09:24
which was originally envisioned by the language specification, but it *really* hard to implement in a way that doens't turn everything into a crawl
jjatria Ah, I see... that's a pity 09:27
lizmat samebchase: if you see toots worth mentioning, please note them here using weekly:
jjatria Thanks for the explanation, though, that makes sense
lizmat I'm not ready to take on another Twitter, it's a time sink enough as it is :-)
09:32 lichtkind joined 10:32 linkable6 left, evalable6 left 10:33 evalable6 joined, linkable6 joined 11:20 p6steve left 11:21 p6steve joined 11:27 p6steve left 11:28 p6steve joined 11:33 p6steve left 11:34 p6steve joined 11:36 abraxxa left 11:52 [Coke]_ is now known as [Coke] 12:07 reportable6 left 12:08 reportable6 joined 12:42 p6steve left 12:53 xinming left 12:54 p6steve joined 12:59 p6steve left 13:06 Furor is now known as Colere 13:07 kawaii_ joined
kawaii_ If there are two modules which both provide a Type of the same name (i.e. UUID and LibUUID), how can I specify which kind I want when setting a constraint? 13:07
tellable6 hey kawaii_, you have a message: gist.github.com/5231a99be12750c6ce...4b5a1b0a8b 13:08
13:15 p6steve joined 13:28 jgaz joined 13:36 frost left 13:51 Sgeo joined 13:55 Kaiepi joined
rir Following is the core of github.com/rakudo/rakudo/issues/4945 which has gotten no attention. I hope that is because of my poor presentation because I can possibly improve that. I can even take advice on that. 14:13
m: my %a = a=>0, b=>0, c=>0, d=>0; my %b = key=>{ b=>1, c=>1}; %a ,= %b<key>;
camelia Odd number of elements found where hash initializer expected:
Found 9 (implicit) elements:
Last element seen: ${:b(1), :c(1)}
in block <unit> at <tmp> line 1
14:26 p6steve left 14:33 p6steve joined 14:40 p6steve left 14:42 p6steve joined 14:46 p6steve left 14:47 p6steve joined 14:56 p6steve left 14:58 p6steve joined, ProperNoun left 14:59 guifa left 15:00 ProperNoun joined 15:02 p6steve left 15:04 p6steve joined 15:08 guifa joined, guifa left
Xliff How can I get t he create table statement for at specific table using DBIish? 15:25
rir Xliff, I recall SQL providing that. With Pg, you could use \dt with the psql client or probe the appropriate template database. More a SQL than a DBIish issue. 15:35
Xliff, I Don't recall SQL providing that.
15:45 guifa joined, guifa left, rir left 15:50 Guest16 joined, Guest16 left
dakkar Xliff: in general, you don't 16:08
if you're using MySQL, you can do `show create table $something` and get a 1-row, 2-column result back (table name, create table statement)
but that's not in any SQL standard 16:09
16:09 jgaz left
dakkar the "standard way" is to query a bunch of tables in the `information_schema` 16:14
but that doesn't give you a `create table`, it gives you all the details that the dbms is using
16:26 avuserow left 16:27 avuserow joined 16:37 dakkar left 16:41 linkable6 left 16:42 linkable6 joined 16:47 jgaz joined
[Coke] any cro devs in this channel? 16:51
new docs site could use some eyes on github.com/croservices/cro-webapp/issues/73 and github.com/croservices/cro-http/issues/131 16:53
sena_kun [Coke], jnthn, but he is aware I believe. :)
17:11 mexen left 17:38 m6502 joined 17:40 jgaz left, m6502 left, jgaz joined 17:47 n1to joined 17:57 jgaz left, sena_kun left 17:59 sena_kun joined 18:07 reportable6 left 18:08 reportable6 joined 18:23 morte_ joined, japhb left 18:28 japhb joined 18:35 japhb left 18:37 japhb joined 18:49 jgaz joined
Anton Antonov Are the presentations in the conference in Huston this week available online? 18:55
19:00 sena_kun left 19:01 sena_kun joined 19:16 morte_ left 19:39 japhb left 19:43 simcop2387 left 19:44 perlbot left 19:45 japhb joined 19:48 morte_ joined
sienet_ja_LSD[m] afaik yes, but maybe afterwards 19:57
Anton Antonov Ok, thanks 19:59
20:07 morte_ left 21:07 greppable6 left, reportable6 left, releasable6 left, benchable6 left, evalable6 left, nativecallable6 left, committable6 left, notable6 left, unicodable6 left, sourceable6 left, linkable6 left, quotable6 left, statisfiable6 left, bisectable6 left, shareable6 left, tellable6 left, coverable6 left, bloatable6 left 21:08 bloatable6 joined, unicodable6 joined, nativecallable6 joined, notable6 joined, reportable6 joined 21:09 coverable6 joined, quotable6 joined, statisfiable6 joined 21:10 benchable6 joined, tellable6 joined, linkable6 joined, releasable6 joined, greppable6 joined, evalable6 joined, committable6 joined, bisectable6 joined 21:11 sourceable6 joined, shareable6 joined 21:32 jgaz left 21:35 n1to left 21:50 codesections73 joined 22:50 nativecallable6 left, committable6 left, coverable6 left, bloatable6 left, notable6 left, statisfiable6 left, evalable6 left, tellable6 left, greppable6 left, unicodable6 left, shareable6 left, bisectable6 left, quotable6 left, linkable6 left, releasable6 left, sourceable6 left, reportable6 left, benchable6 left 22:51 reportable6 joined, linkable6 joined, sourceable6 joined, greppable6 joined 22:52 notable6 joined, bisectable6 joined, benchable6 joined, nativecallable6 joined, quotable6 joined, tellable6 joined, committable6 joined, bloatable6 joined, shareable6 joined, evalable6 joined 22:53 coverable6 joined, statisfiable6 joined, unicodable6 joined, releasable6 joined 23:01 lichtkind left