🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
00:15 m_athias left 00:22 m_athias joined 00:30 JRaspass left 00:32 pecastro left
gfldex .seen raiph 00:39
tellable6 gfldex, I saw raiph 2021-02-22T00:18:21Z in #raku: <raiph> SmokeMachine: goodnight; I hope you dream of throwing dictionaries through hoops :)
gfldex .tell raiph we don't need to wait for RakuAST. see: gist.github.com/79ac4c5505086b37bf...fac89084db 00:40
tellable6 gfldex, I'll pass your message to raiph 00:41
gfldex also functional > OO
00:47 peteretep_ left 00:51 clarjon1 left 00:52 clarjon1 joined 00:56 neshpion left
guifa2 "Unable to allocate an array of 18446744073709551612 elements… " <--- weak Raku, weak. (kidding, somehow I borked the XML module ) 01:09
01:09 linkable6 left 01:11 linkable6 joined 01:15 mowcat left 01:26 squashable6 left
codesections Well, searching the Internet for 18446744073709551612 tells me that it's both one of the bests planets in No Man's Sky and a valid FedEx tracking number 01:26
01:26 linkable6 left
codesections so I guess Raku isn't up to storing all NMS planets in a single array 01:27
01:27 linkable6 joined
codesections ...or whatever _really bad_ program design that would need an array with the length of a FedEx tracking number 01:28
01:29 squashable6 joined
codesections "I know, I'll just store the string 'invalid' or 'valid' at the array index of each tracking #" 01:29
01:44 lucasb left 02:08 JRaspass joined 02:16 cj left, cj joined 02:17 pel left, pel joined
moon-child hmmm, is this a bug? 02:19
m: my uint32 $x = -1; say $x; my uint64 $y = -1; say $y;
camelia 4294967295
02:27 gnufr33dom joined 02:42 edk_ joined 02:43 JRaspass left 02:44 dataangel left, kvw_5_ joined 02:48 kvw_5 left 03:00 leont left
codesections moon-child: do we just not *have* uint64s? (which is a bug, of course) 03:06
m: my uint64 $i = 9223372036854775807; say $i + 1
camelia -9223372036854775808
codesections m: my int64 $i = 9223372036854775807; say $i + 1
camelia -9223372036854775808
guifa2 codesections: we do have them 03:32
but I'd bet that -1 is getting boxed somehow
it's VERY easy to switch out of native semantics
hrm 03:36
03:49 neshpion joined
guifa2 codesections: I'm actually trying to see how those are even compiled differently. I just tried with uint8 (which properly wraps) and uint64, and the AST is identical, but it's not showing me all the options used 03:58
04:12 japhb left 04:16 aindilis joined 04:17 xelxebar_ left 04:18 japhb joined 04:19 xelxebar joined
guifa2 codesections: whoa 04:23
Look at the gitblame
04:28 kaiwulf left 04:32 aindilis left 04:34 aindilis joined 05:02 samcv left 05:03 samcv joined 05:23 Garbanzo left 05:24 Garbanzo joined 05:35 neshpion left 05:57 rindolf joined 06:16 parabolize left 06:33 brtastic joined 06:38 jmcgnh left 06:55 jmcgnh joined 07:08 Garbanzo left 07:16 guifa2 left 07:23 brtastic left 07:26 guifa2 joined 07:28 Geth joined 07:42 Sgeo left 07:49 domidumont joined 07:57 abraxxa joined 07:59 guifa2 left 08:01 wamba joined, abraxxa left 08:02 abraxxa joined 08:30 stigo left 08:40 leont joined 08:42 dakkar joined 08:47 Doc_Holliwood joined 09:05 JRaspass joined 09:14 pecastro joined 09:24 aluaces left 09:25 aluaces joined
gfldex lolibloggedalittle: gfldex.wordpress.com/2021/02/24/pa...-dispatch/ 09:26
09:36 mowcat joined 09:44 edk_ is now known as e 09:51 xinming left 09:52 xinming joined 10:04 cgfbee joined 10:08 MasterDuke left 10:22 MasterDuke joined 11:04 gnufr33dom left 11:05 berber44 left 11:08 shlomif joined 11:10 rindolf left 11:11 shlomif is now known as rindolf 11:29 MasterDuke left 11:30 MasterDuke joined 11:34 kerframil joined 11:40 Doc_Holliwood left 11:44 sena_kun left 11:46 xinming left 11:47 xinming joined 11:53 mowcat left 12:08 PimDaniel joined
PimDaniel \o 12:08
I'm trying to translate Python code and Python preserve hash key type , well say , at least String/Num. 12:09
But Raku hash key is allways and Str. How could we do a workaround for this?
tyil PimDaniel: do you want to mix int and str keys in a single hash? 12:11
PimDaniel tyil. I do not understand your question? Sorry i'm a few tired. 12:12
12:12 xinming left, xinming joined
tyil docs.raku.org/language/hashmap#Non...ject_hash) 12:12
PimDaniel: do you want to make all keys in a Hash of type Int, or do you want to be able to use both Int and Str keys in a single Hash? 12:14
PimDaniel My entry hash is '%(john => [ 1,2,3] , june => [4,5,6]) or %(1 => [8,11,12], 4 => [6,9,2])
tyil in that example, why would you need to keep the keys as Ints? I don't think anything would break by stringifying them 12:15
PimDaniel which leads numbers key 1,4 to string : "1", "4"..., i look at your url, thank's.
Good question: it is due to the algorithm that commutes keys to values (and the opposite) and compare them. And sometime this leads to a type mismatch. 12:17
I should probably post the code but it is quite complex: you have 3 methods, a while(True) loop and and recursing method. The algorithm is Hopcropft and Karp bipartit graph. 12:19
The problem is "probably" i should have to reconsider the problem from scratch with Raku. 12:22
12:23 wamba left
PimDaniel But since i discovered what is the problem and am close to achieve it, i try to find a solution. 12:24
12:24 Black_Ribbon left 12:36 sena_kun joined 12:42 sxmx left 12:45 _________ left, _________ joined
PimDaniel tyil May be declaring hash my %h{Any} will make it? ... 12:47
tyil potentially 12:48
12:50 wamba joined
PimDaniel Thank's for your help tyil! 12:51
tyil good luck
12:55 sxmx joined 12:58 PimDaniel left 13:18 PimDaniel joined
PimDaniel Pfff i don't even understand at all the sense of := vs = assignment. And such of all why and when should i use one or the orther. This is very confuse to me. 13:20
13:23 JRaspass left 13:40 jjmerelo left
PimDaniel ok think it's just an object. 13:40
kinda address.
lizmat PimDaniel: in Raku, hashes by default will coerce their keys to Str 13:50
but if you want to have a different types of keys, you can specify that 13:51
m: my %oh{Any} = 42, "a", 666, "b"; say .WHAT for %oh.keys 13:52
camelia (Int)
PimDaniel True lizmat, i'm studing this.
lizmat oki!
PimDaniel I try to have an %h{Any} but i discover my problem else elsewhere. 13:53
Confusion with hash and positionnals.
when we write a => b, c => d; is it hash or positionnals? 13:54
Raku is full of confusing concepts.
and is not easier than Perl5 at all.
lizmat Well, if you're coming from Perl, then you have a lot of false friends :-) 13:55
PimDaniel True!
I think it's even better to comme from Python or PHP. 13:56
lizmat ok, let's take this one step at a time
my $b = a => 42
PimDaniel hum...
lizmat in that case, a => 42 is a Pair
if you say:
PimDaniel hum hum...
lizmat if you say: my $l = a => 42, b => 666
that's a List of Pairs
PimDaniel ok 13:57
lizmat note that in Raku, the comma is the List builder, **not** the parentheses
if you say: my %h = a => 42, b => 666
then you're initializing a hash with a List of Pairs
the hash initializer will take a Pair as indicating a key and value to set 13:58
but it will also take non-Pair values
if you say: my %h = "a",42,"b",666
then that would be the same, because the initializer will take alternating values to be key/value 13:59
m: my %h = "a",42,"b"
camelia Odd number of elements found where hash initializer expected:
Found 3 (implicit) elements:
Last element seen: "b"
in block <unit> at <tmp> line 1
PimDaniel ok i understand this and this is what i observed.
SO, suppose i want to initiate a hash{Str} with a constructor. 14:00
lizmat so that would mean you would **only** accept Str as keys, and *not* have have any other types coerced to Str, right ? 14:01
PimDaniel i don't need to pass the constructor parameter a hash: i can pass it a list of Pair, No?
lizmat yup
PimDaniel for example : 1 => [3], '1' => [1,2,3],'2' =>[10,11,12],2 => [3,4,5], 6 => [3], 7 => [3,5,8], '7' => [11,1,2] 14:02
whatch that you have a trap here!
I'm very twisted! 14:04
lizmat m: my %h{Any} = 1 => [3], '1' => [1,2,3],'2' =>[10,11,12],2 => [3,4,5], 6 => [3], 7 => [3,5,8], '7' => [11,1,2]; dd %h
camelia Hash[Any,Any] %h = (my Any %{Any} = "1" => $[1, 2, 3], 1 => $[3], 2 => $[3, 4, 5], "2" => $[10, 11, 12], 6 => $[3], 7 => $[3, 5, 8], "7" => $[11, 1, 2])
lizmat m: say 1 === "1"
camelia False
PimDaniel yess, i have === into my algorithm 14:05
it it is especially the reason why... all of this.
in fact : i'm loosing my types in my constructor parameters. 14:06
lizmat ah, gist?
PimDaniel How do we declare a list of positionnal as parameters in a new sub 14:07
well this is another question.
14:08 Sgeo joined
lizmat sub foo($one, $two) 14:09
ah, a List of positionals?
yeah, that is still underdeveloped in Raku 14:10
PimDaniel In other words : what is the that could feet for 1 => [3], '1' => [1,2,3],'2' =>[10,11,12],2 => [3,4,5], 6 => [3], 7 => [3,5,8], '7' => [11,1,2] directly sent to the constructor.
lizmat m: sub foo(List $l) { dd $l }; foo 1,2
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling foo(Int, Int) will never work with declared signature (List $l)
at <tmp>:1
------> 3sub foo(List $l) { dd $l }; 7⏏5foo 1,2
lizmat m: sub foo(List $l) { dd $l }; foo (1,2) 14:11
camelia $(1, 2)
PimDaniel probaly make a subset
lizmat yeah, there's that, or maybe look at the Rake module in the ecosystem
PimDaniel but i need to preserve types as is.
lizmat alternately, (which is probably better for performance anyway), is to create a class for that list 14:12
PimDaniel I think i allready dit it: i must look at my codes.
lizmat in Perl, using a hash or a list as an object, is usually the fastest way to do things, because of the overhead of accessors 14:13
PimDaniel hum may be. The 1st goal is to preserve the types into my hash class attribute at least.
lizmat in Raku, using objects is almost *always* faster
PimDaniel Good to know.
lizmat so that's one of the false friends you need to get rid of 14:14
PimDaniel I watched it is sometimes very slow without good reasons.
lizmat see e.g. github.com/Raku/CCR/blob/main/Rema...-classy.md 14:15
PimDaniel I mean compare to others interpreted langages like Per5,Python,PHP, and others.
Thank you very much.
PimDaniel lizmat : your url is very interesting: raku is so wide than i'm allways wondering : what is the best way? And often the way i choose does not feet. 14:22
lizmat yeah, it can be overwhelming initially
just that you're at a beach, and are learning to swim: nobody expects you to be able to swim across :-) 14:23
Altreus PimDaniel: I think you mean fit not feet :D 14:27
PimDaniel True: Sorry for English. 14:29
*my English
lizmat PimDaniel: the native English speakers are in a minority here.. :-) 14:30
PimDaniel in France too :)))
14:30 kaiwulf joined
PimDaniel I meand the good English speakers. :)) 14:31
14:33 Doc_Holliwood joined
PimDaniel back later, thank's to all of you. 14:33
14:33 PimDaniel left
Altreus I have been learning French :o maybe I can get practice here and there 14:57
lizmat bien sûr! 14:58
Altreus I say some very silly things in my French lessons, half-remembered from school or just invented Franglais 14:59
codesections .ask moritz: do you happen to remember what the index in the old irclog.perlgeek.de URLs corresponds to (e.g., the `13961377` in irclog.perlgeek.de/perl6-dev/2017-...13961377)? Is it a timestamp of some sort? (I'm going to try to update some links to point to the colabti archive) 15:01
tellable6 codesections, I'll pass your message to moritz
15:01 gnufr33dom joined
codesections or if anyone else knows ^^^^ 15:01
moritz codesections: that ID was an autoincrement key (with negative values for messages that were back-imported later 15:03
codesections ah. So not super useful right now. shame
15:07 hungrydonkey joined 15:10 JRaspass joined 15:21 hungrydonkey left 15:23 Doc_Holliwood left 15:34 xinming left, lizmat left 15:36 xinming joined 15:48 lizmat joined 15:54 parabolize joined 15:58 mowcat joined 16:03 mowcat left, gnufr33dom left 16:08 jmerelo joined 16:25 dataangel joined, Geth left 16:42 zxcvz joined 16:48 mowcat joined 16:49 kaiwulf left 17:36 dakkar left 17:50 xinming left, xinming joined 17:58 domidumont left 18:03 m_athias left, m_athias joined 18:05 xinming left 18:07 xinming joined 18:14 JRaspass left 18:22 xinming left 18:23 xinming joined 18:32 guifa2 joined 18:35 brtastic joined 18:41 _jrjsmrtn joined 18:42 __jrjsmrtn__ left 18:53 camelia left 18:54 aborazmeh joined 18:57 xinming left 19:00 xinming joined
codesections woo: www.reddit.com/r/rakulang/comments...aku_files/ 19:09
19:09 zxcvz left 19:11 xinming left 19:12 xinming joined
guifa2 codesections: still not for rakutest though 19:13
19:19 camelia joined 19:27 aborazmeh left 19:33 jmerelo left 19:44 Doc_Holliwood joined 19:48 JRaspass joined 19:56 xinming left, xinming joined 20:04 camelia left
codesections Yeah. Shame about that, but still. Code highlighting seems especially helpful for new/curious users, and having it for the .raku files will go a long way 20:06
20:07 camelia joined 20:09 camelia left
tonyo check out colorForth for syntax highlighting done right 20:09
20:10 camelia joined 20:12 xinming left
codesections tonyo: you mean like this? github.com/narke/colorForth/blob/m..._bochs.png 20:13
20:13 xinming joined
codesections that looks slightly appalling :) 20:13
20:14 sortiz joined 20:18 camelia left
tonyo yea 20:22
it's pretty interesting, actually (as is forth) from a language pov
codesections yeah, agreed re: forth. 20:23
20:24 camelia joined
codesections I'm not the right audience for that color scheme – I prefer very little color (my current colors are basically emacsthemes.com/themes/nordless-theme.html) 20:24
But trying out a forth is on my to-play-with list. Maybe factor? factorcode.org/ 20:26
hobbs that's a "technically this has a color" theme
20:27 xinming left 20:28 xinming joined
hobbs I expect you would call mine fruit salad: i.imgur.com/GukELdp.png 20:28
guifa2 egads mine eyes
that magenta
hobbs yeah I should probably change that one, it's not a feature I ever used when I tweaked the scheme
codesections agreed :-)
hobbs it doesn't spend much time on the screen 20:29
but I would probably lavender it up a bit
maybe I'll do that
codesections and I genuinely don't think I could read more than a few words in the TODO blue. (But maybe that's all it has?i)
hobbs yeah, it's only used for TODO and XXX 20:30
Out of the box it was like white on red
codesections s/'has?i'/has?/
codesections spent too long thinking through the syntax for that regex 20:31
hobbs :)
20:38 telex left 20:39 telex joined 21:12 xinming left 21:13 xinming joined 21:18 telex left, telex joined 21:34 xinming left 21:36 xinming joined
rba tonyo: Did you ask for access logs on modules.raku.org? 21:37
21:39 wamba left 21:40 brtastic left 21:43 brtastic joined 21:50 Garbanzo joined 22:08 xinming left 22:10 sena_kun left 22:11 sena_kun joined, xinming joined 22:23 sxmx left 22:25 xinming left, sxmx joined 22:27 xinming joined 22:48 aindilis` joined 22:49 aindilis left 22:51 xinming left 22:52 xinming joined 22:55 aindilis` left 22:56 Black_Ribbon joined 23:04 xinming left, xinming joined 23:14 rindolf left 23:49 MasterDuke left