🦋 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:00
Doc_Holliwood joined
00:01
Doc_Holliwould left
|
|||
rbt | Profile after: rbt.ca/profile-1584662492.294586.html#/routines | 00:02 | |
Changes: github.com/cosimo/perl6-string-crc...f86c82a576 | |||
Still not exactly wonderful. cksum is about 500 times faster. | |||
00:03
Doc_Holliwould joined
|
|||
MasterDuke | rbt: changing to loop() was faster for you? | 00:03 | |
00:03
holli left
|
|||
rbt | Yeah, reliably by a few seconds. | 00:04 | |
MasterDuke | huh. how are you testing? | ||
rbt | use String::CRC32; | ||
my $filename = '/home/rbt/Downloads/testfiles/IMG_20180818_200909.jpg'; | |||
my $body = $filename.IO.slurp(:bin); | |||
my $start-time = now; | |||
my $crc = String::CRC32::crc32($body); | |||
say "DURATION: ", now - $start-time; | |||
say "CRC: ", $crc; | |||
Pulling .elems out was important, otherwise it was called every cycle. | 00:05 | ||
00:06
holli joined
00:07
Doc_Holliwood left,
wildtrees left
00:09
Doc_Holliwood joined,
Doc_Holliwould left
00:11
Doc_Holliwould joined
00:12
holli left
00:14
holli joined
00:15
Doc_Holliwood left
00:18
Doc_Holliwood joined,
Doc_Holliwould left
|
|||
MasterDuke | rbt: how does this path compare for you? gist.github.com/MasterDuke17/89b12...2d6856f927 | 00:18 | |
*patch | 00:19 | ||
00:20
Doc_Holliwould joined,
holli left
|
|||
rbt | MasterDuke: Running. | 00:21 | |
My Version: | 00:22 | ||
DURATION: 8.5288935 | |||
DURATION: 8.90089845 | |||
DURATION: 8.38934993 | |||
Your version: | |||
DURATION: 20.6358398 | |||
DURATION: 20.6340732 | |||
DURATION: 21.3765229 | |||
This is Rakudo version 2020.01 built on MoarVM version 2020.01.1 | |||
implementing Perl 6.d. | |||
00:22
guifa left,
holli joined
00:23
Doc_Holliwood left
|
|||
MasterDuke | huh. your version is slower for me | 00:24 | |
rbt | Neat. | 00:25 | |
MasterDuke | This is Rakudo version 2020.02.1-207-g9429728cb built on MoarVM version 2020.02.1-47-g3c3ad0678 | ||
00:26
Doc_Holliwould left,
Doc_Holliwood joined
|
|||
rbt | Running rakudobrew for 2020.02.1. I'll give it a go in a bit. | 00:27 | |
00:28
Doc_Holliwould joined
00:29
holli left
00:31
holli joined
00:32
Doc_Holliwood left
00:33
Doc_Holliwood joined
00:34
Doc_Holliwould left,
lichtkind left
00:37
Doc_Holliwould joined
|
|||
MasterDuke | rbt: also, you could try making @CRC_TABLE an int array in your version, should help some more | 00:37 | |
00:37
holli left
00:39
holli joined
00:40
Doc_Holliwood left
|
|||
rbt | Like this? | 00:40 | |
-my @CRC_TABLE = | |||
+my int @CRC_TABLE = | |||
This is Rakudo version 2020.02.1 built on MoarVM version 2020.02.1 | 00:41 | ||
Original: 23.77407696 23.4043312 23.1602506 | |||
MasterDuke patch: 20.3623889 19.8017556 20.1483947 | |||
My Patch: 8.03932501 7.7126718 7.76500124 | |||
MasterDuke | huh | ||
rbt | Mine + Int table: 9.0697465 10.605331 9.2615094 | ||
Linux rbt-inspiron-123 5.3.0-40-generic #32-Ubuntu SMP Fri Jan 31 20:24:34 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux | |||
00:42
Doc_Holliwood joined
|
|||
MasterDuke | i don't really understand those differences in results | 00:42 | |
rbt | Perhaps I stumbled on some kind of memory layout thing that improves throughput for my specific setup. | ||
00:43
Doc_Holliwould left
|
|||
rbt | Or, would Blob work differently due to being from a file instead of a string? | 00:43 | |
MasterDuke | i don't think so... | 00:44 | |
can you try with what i was doing? `String::CRC32::crc32("abcdefghijklmnopqrstuvwxyz0123456789~!#^_+;:./>?" x 100_000)` | |||
00:45
Doc_Holliwould joined
00:46
holli left
00:48
holli joined,
Doc_Holliwood left
|
|||
rbt | TEST: time r -e 'use String::CRC32; say String::CRC32::crc32("abcdefghijklmnopqrstuvwxyz0123456789~!#^_+;:./>?" x 100_000)' | 00:49 | |
Original: 0m15.660s 0m15.752s | |||
MasterDuke Patch: 0m12.312s 0m12.106s | |||
My Patch: 0m7.111s 0m7.099s | |||
My Patch + Int table: 0m8.444s 0m8.741s | |||
Thought I would try out your test just to rule out something with Blob. | |||
00:51
Doc_Holliwood joined,
Doc_Holliwould left
|
|||
MasterDuke | and i just tried your patch again and it still isn't much faster for me. i guess some weird hardware/compiler/os difference | 00:52 | |
00:53
Doc_Holliwould joined
00:54
holli left
00:56
holli joined,
Doc_Holliwood left
|
|||
rbt | For my actual use I ended up with run 'cksum', :out, :in and the timings are closer to 20 milliseconds for my sample file. | 00:57 | |
00:58
hungrydonkey joined
01:00
Doc_Holliwould left,
Doc_Holliwood joined
|
|||
MasterDuke | could you try another small change (to your version), `my int $char = $b.read-int8($i)` instead of `$b[$i]`? | 01:02 | |
01:02
Doc_Holliwould joined,
holli left
01:04
holli joined
01:05
Doc_Holliwood left
|
|||
rbt | Not really a measurable difference. | 01:06 | |
MasterDuke | oh well | 01:07 | |
01:08
Doc_Holliwould left,
Doc_Holliwood joined
01:10
Doc_Holliwould joined,
holli left
01:13
holli joined,
wamba joined,
caterfxo joined,
Doc_Holliwood left
01:15
caterfxo left
01:16
Doc_Holliwould left,
Doc_Holliwood joined
01:17
aborazmeh joined,
aborazmeh left,
aborazmeh joined
01:18
Doc_Holliwould joined
01:19
Altai-man_ joined,
holli left
01:21
holli joined,
sena_kun left,
Doc_Holliwood left
01:22
pilne joined
|
|||
MasterDuke | timotimo: any idea why MVM_frame_find_lexical_by_name and MVM_multi_cache_find_callsite_args would be the 2nd and 3rd most expensive functions for that String::CRC32 code? | 01:23 | |
01:24
Doc_Holliwood joined,
wamba left,
Doc_Holliwould left
|
|||
MasterDuke | oh, but that's only for the loop() version | 01:25 | |
01:26
Doc_Holliwould joined
01:27
holli left
01:29
holli joined
|
|||
pilne | So I've recently gotten infatuated with "how" prolog works(logic/declarative paradigm), I'm a hobby coder, is there somewhere to start with raku to utilize it as a solver, or if it isn't something in existance yet, would a module or a inline::prolog kinda thing be lower-hanging fruit for doing | 01:29 | |
logic/declarative kinda stuff in raku? | |||
01:29
Doc_Holliwood left
01:32
Doc_Holliwould left
01:33
Doc_Holliwood joined,
aborazmeh left,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
01:35
Doc_Holliwould joined,
holli left
01:37
holli joined
01:38
Doc_Holliwood left
01:40
Doc_Holliwood joined
01:41
Doc_Holliwould left
01:43
Doc_Holliwould joined
01:44
holli left
01:46
holli joined,
Doc_Holliwood left
01:48
Doc_Holliwood joined
01:49
vike left,
Doc_Holliwould left
01:51
aborazmeh left,
Doc_Holliwould joined
01:52
holli left
01:53
Redfoxmoon left,
Redfoxmoon joined
01:54
holli joined
01:55
Doc_Holliwood left
|
|||
AlexDaniel | pilne: I don't think Raku currently offers anything similar | 01:56 | |
pilne: some features can perhaps give you the same feeling but are nowhere close to what prolog offers | 01:57 | ||
01:57
Doc_Holliwood joined
01:58
Doc_Holliwould left
|
|||
AlexDaniel | btw I'm still not sure how this works: | 01:58 | |
m: say <aa foo a b bar rrr baz x y z> ~~ (**, ‘foo’, **, ‘bar’, **, ‘baz’, **) | |||
camelia | True | ||
02:00
aborazmeh joined,
aborazmeh left,
aborazmeh joined,
Doc_Holliwould joined
|
|||
pilne | fair! and thank you, seeing as prolog can be implimented in javascript, i'm.... sure that with grammers/macros it could be implimented in raku? | 02:00 | |
02:00
holli left
|
|||
pilne | i'm sure i could always look at metacpan.org/pod/AI::Prolog as well for inspiration! | 02:01 | |
(or cheat and use that with inline::perl5 :D ) | |||
02:03
holli joined,
Doc_Holliwood left
02:06
Doc_Holliwould left,
Doc_Holliwood joined
02:07
rbt left
02:08
rbt joined,
Doc_Holliwould joined,
molaf left
02:09
holli left
02:11
holli joined
02:12
Doc_Holliwood left
02:14
wamba joined,
Doc_Holliwould left
02:15
Doc_Holliwood joined
02:17
Doc_Holliwould joined,
rbt left,
holli left
02:20
Doc_Holliwood left,
holli joined
02:21
molaf joined
02:23
Doc_Holliwould left,
Doc_Holliwood joined
02:25
Doc_Holliwould joined
02:26
holli left
02:28
holli joined,
Doc_Holliwood left
02:31
aborazmeh left,
Doc_Holliwood joined,
Doc_Holliwould left
02:34
Doc_Holliwould joined,
holli left
02:36
holli joined
02:37
hungryd47 joined,
Doc_Holliwood left
02:38
hungrydonkey left
02:40
Doc_Holliwould left,
Doc_Holliwood joined
02:41
hungryd47 left
02:42
Doc_Holliwould joined
02:43
holli left
02:45
hungrydonkey joined,
holli joined,
Doc_Holliwood left
02:48
Doc_Holliwould left,
Doc_Holliwood joined
02:49
hungryd65 joined
02:50
abraxxa left,
hungrydonkey left,
Doc_Holliwould joined,
holli left
02:52
abraxxa joined
02:53
holli joined,
Doc_Holliwood left
02:54
ensamvarg joined
02:56
hungryd65 left,
Doc_Holliwould left,
Doc_Holliwood joined
02:58
Doc_Holliwould joined
02:59
holli left
03:01
holli joined
03:02
Doc_Holliwood left
03:05
Doc_Holliwood joined,
Doc_Holliwould left
03:07
Doc_Holliwould joined,
holli left
03:09
holli joined
03:10
Doc_Holliwood left
03:12
Doc_Holliwood joined
03:13
Doc_Holliwould left
03:15
Doc_Holliwould joined
03:16
holli left
03:18
holli joined,
Doc_Holliwood left
03:20
sena_kun joined,
thowe left,
thowe joined
03:21
Altai-man_ left,
Doc_Holliwould left
03:22
Doc_Holliwood joined
03:23
Doc_Holliwould joined
03:24
holli left
03:26
thowe left,
holli joined
03:27
Doc_Holliwood left
03:30
Doc_Holliwood joined,
Doc_Holliwould left
03:32
Doc_Holliwould joined,
holli left
03:34
holli joined
03:35
Doc_Holliwood left
03:38
Doc_Holliwould left,
Doc_Holliwood joined
03:40
Doc_Holliwould joined,
holli left
03:42
kst` joined
03:43
holli joined
03:44
Doc_Holliwood left
03:46
Doc_Holliwould left,
Doc_Holliwood joined
03:48
Doc_Holliwould joined
03:49
holli left
03:51
holli joined,
Doc_Holliwood left
03:54
Doc_Holliwould left
03:55
Doc_Holliwood joined
03:56
Doc_Holliwould joined
03:57
holli left
03:59
holli joined
04:00
Doc_Holliwood left
04:03
Doc_Holliwood joined,
Doc_Holliwould left
04:05
Doc_Holliwould joined,
holli left
04:08
holli joined,
Doc_Holliwood left
04:11
Doc_Holliwood joined,
Doc_Holliwould left
04:13
Doc_Holliwould joined
04:14
holli left
04:16
holli joined,
Doc_Holliwood left
04:19
Doc_Holliwould left
04:20
Doc_Holliwood joined
04:21
Doc_Holliwould joined
04:22
holli left
04:24
holli joined
04:25
Doc_Holliwood left
04:26
benkolera joined
04:27
Doc_Holliwould left,
Doc_Holliwood joined
04:29
Doc_Holliwould joined
04:30
holli left
04:32
holli joined
04:33
Doc_Holliwood left
04:35
Doc_Holliwould left
04:36
Doc_Holliwood joined
04:38
Doc_Holliwould joined,
holli left
04:41
Doc_Holliwood left
04:43
Doc_Holliwould left
04:54
molaf left
05:06
Redfoxmoon left,
Redfoxmoon joined
05:13
guifa joined
05:19
Altai-man_ joined
05:22
sena_kun left
|
|||
jdv79 | m: class A { has Str:D @.b; }; my %h = :b(1,2,3); A.new: |%h | 05:49 | |
camelia | Type check failed in assignment to @!b; expected Str:D but got List ($(1, 2, 3)) in block <unit> at <tmp> line 1 |
||
jdv79 | how does one do that then? | ||
05:53
guifa left
05:54
guifa joined
06:14
sarna joined
06:21
wamba left
06:26
hungrydonkey joined
06:49
ensamvarg left
07:12
TeamBlast left,
TeamBlast joined
07:20
sena_kun joined
07:21
Altai-man_ left
07:22
stoned75 joined
07:27
rindolf joined
07:30
AlexDaniel` joined
07:40
pecastro left
07:41
pecastro joined
|
|||
SmokeMachine | m: class A { has Str:D @.b; }; my %h = :b(Array[Str:D].new: 1,2,3); A.new: |%h | 07:51 | |
camelia | Type check failed in assignment to ; expected Str:D but got Int (1) in block <unit> at <tmp> line 1 |
||
SmokeMachine | m: class A { has Str:D @.b; }; my %h = :b(Array[Str:D].new: “1”,”2”,”3”); A.new: |%h | 07:53 | |
camelia | Type check failed in assignment to @!b; expected Str:D but got Array[Str:D] (Array[Str:D].new("1", "2", "3")) in block <unit> at <tmp> line 1 |
||
SmokeMachine | m: class A { has Str @.b; }; my %h = :b(Array[Str].new: “1”,”2”,”3”); A.new: |%h | 07:54 | |
camelia | Type check failed in assignment to @!b; expected Str but got Array[Str] (Array[Str].new("1", "2", "3")) in block <unit> at <tmp> line 1 |
||
07:56
wamba joined
|
|||
SmokeMachine | m: my Str @b = Array[Str].new: “1”,”2”,”3”; say @b | 07:57 | |
camelia | [1 2 3] | ||
08:01
sena_kun1 joined,
sena_kun left
08:05
ensamvarg joined
08:08
sena_kun1 left
08:21
NODE left,
kensanata joined
08:22
NODE joined
08:31
cpan-raku left,
cpan-raku joined,
cpan-raku left,
cpan-raku joined
08:40
sarna left
08:51
dakkar joined
08:54
sarna joined
08:57
veesh_ joined,
veesh left,
veesh_ is now known as veesh
09:13
chloekek joined
09:31
wamba left
09:39
sena_kun joined,
sena_kun left
09:41
kensanata left
10:07
daxim left
10:10
vike joined
10:22
Black_Ribbon left
10:25
stoned75 left,
daxim joined
11:02
natrys joined
11:03
Ven`` joined
11:25
lichtkind joined
11:30
NODE left
11:32
NODE joined
11:39
sarna left
|
|||
Kaiepi | m: say Map.new: gather { take foo => 1 } | 11:39 | |
camelia | Unexpected named argument 'foo' passed in block <unit> at <tmp> line 1 |
||
Kaiepi | m: say Map.new: gather { take (foo => 1) } | ||
camelia | Map.new((foo => 1)) | ||
Kaiepi | oh | 11:40 | |
m: say Map.new: gather { take 'foo', 1 } | |||
camelia | Map.new((foo => 1)) | ||
Kaiepi | m: my % is Map = gather { take 'foo', 1 } | ||
camelia | Odd number of elements found where hash initializer expected: Only saw: $("foo", 1) in block <unit> at <tmp> line 1 |
||
Kaiepi | m: say my % is Map = gather { take 'foo', 1 } | ||
camelia | Odd number of elements found where hash initializer expected: Only saw: $("foo", 1) in block <unit> at <tmp> line 1 |
||
Kaiepi | m: say my % is Map = gather { take (foo => 1) } | 11:41 | |
camelia | Map.new((foo => 1)) | ||
Kaiepi | weird | ||
11:41
sarna joined
|
|||
lizmat | m: take :foo | 11:43 | |
camelia | Unexpected named argument 'foo' passed in block <unit> at <tmp> line 1 |
||
lizmat | m: my %h = (1,2) | 11:44 | |
camelia | ( no output ) | ||
lizmat | m: my %h = $(1,2) | ||
camelia | ( no output ) | ||
lizmat | m: my %h = $(1,2); dd %h | ||
camelia | Hash %h = {"1" => 2} | ||
lizmat | hmmm | ||
m: my %h = ((1,2)) | |||
camelia | ( no output ) | ||
lizmat | I guess single arg rule at play | ||
Kaiepi | m: use nqp; nqp::p6bindattrinvres(nqp::create(List), List, '$!reified', nqp::list(1)).VAR.^name.say | 11:47 | |
camelia | List | ||
lizmat | you told it to create one... | 11:48 | |
Kaiepi | ik, i thought p6bindattrinvres did something or other with containers | ||
11:52
hungryd87 joined
11:54
hungrydonkey left
12:17
abraxxa left
12:31
aborazmeh joined,
aborazmeh left,
aborazmeh joined
12:37
dansolo42 joined,
wamba joined
12:38
hungrydonkey joined
12:39
rbt joined
12:40
hungryd87 left
12:46
kensanata joined
12:52
dansolo42 left,
dansolo42 joined
12:57
Guest16 joined
13:03
molaf joined
13:06
xi joined
13:07
dansolo42 left,
dansolo42 joined
13:08
aborazmeh left
13:29
sena_kun joined,
sena_kun left
13:41
sena_kun joined
13:47
gordonfish left
13:50
caterfxo joined
14:00
eythian joined,
eythian left,
eythian joined
14:17
kensanata left
14:18
Guest16 left
14:37
caterfxo left
14:39
caterfxo joined
14:41
gordonfish joined
14:47
xelxebar left
14:51
daemon joined,
daemon left,
daemon joined
|
|||
Kaiepi | m: class Foo does Associative { method new(|args) { say 'new: ', args; self.bless }; method STORE(|args) { say 'STORE: ', args; self } }; my %foo is Foo = :1a; %foo = :2b; | 15:11 | |
camelia | new: \() STORE: \(:a(1), :INITIALIZE) STORE: \(:b(2)) |
||
Kaiepi | m: class Foo does Associative { method new(|args) { say 'new: ', args; self.bless }; method STORE(|args) { say 'STORE: ', args; self } }; my %foo is Foo = :1a; %foo = :2b :DECONT; | ||
camelia | new: \() STORE: \(:a(1), :INITIALIZE) STORE: \(:b(2)) |
||
Kaiepi | when do the :DECONT variations of STORE get called? | 15:12 | |
or is it just an internal thing | |||
15:18
wildtrees joined
15:19
Altai-man_ joined,
wildtrees left
15:20
wildtrees joined
15:21
pmurias joined
15:22
sena_kun left
15:24
wamba left
15:35
wildtrees left
15:36
wildtrees joined
15:42
wamba joined
15:44
caterfxo left
16:03
regreg joined
16:06
kensanata joined
16:07
Ven`` left
16:21
regreg left
16:23
chloekek left
16:31
bronco_creek joined
16:33
ZZZzz joined
16:34
ZZZzz left
|
|||
bronco_creek | Hello raku folks. I have a few lines of code that demonstrate a raku behavior that I don't understand. Is there a way to paste them here so that they will be evaluated? Someone here might be able to explain to me what's happening. | 16:36 | |
AlexDaniel | bronco_creek: try gist.github.com/ | ||
bronco_creek | Thanks AlexDaniel. I will do that. | 16:37 | |
16:55
regreg joined
|
|||
bronco_creek | I'd appreciate it if someone could have a look at my short gist at gist.github.com/bronco-creek/dbd1b...35737c389d When I assign variables to values in a hash, they work as expected. When I push hashes into an array, it seems like the variables are bound rather than assigned. | 17:05 | |
17:07
lichtkind left
17:09
TreyHarris joined
|
|||
Altai-man_ | bronco_creek, your %coords hash is not copied to an array, so when you change values in the hash, when you refer to it from the array it is changed as well. | 17:13 | |
or, hmmmm | 17:16 | ||
never mind that. :S | |||
tobs | m: my $x = 10; my %h = 'x', $x; say %h; $x = 12; say %h | 17:18 | |
camelia | {x => 10} {x => 10} |
||
tobs | so the 'x' key definitely gets its own container in the hash | ||
m: my $x = 10; my %h = 'x', $x; my @space; say %h; @space.push(%h); $x = 12; %h = 'x', $x; say %h; @space.push(%h); say @space | 17:20 | ||
camelia | {x => 10} {x => 12} [{x => 12} {x => 12}] |
||
17:20
sena_kun joined
|
|||
tobs | m: my $x = 10; my %h = 'x', $x; my @space; @space.push(%h); $x = 12; %h = 'x', $x; @space.push(%h); say @space[0].WHICH eq @space[1].WHICH | 17:20 | |
camelia | True | ||
sena_kun | bisectable6, my @space; my %coords = 'x', 1234, 'y', 1234; @space.push(%coords); say @space[0]; my %coords = 'x', 42, 'y', 42; @space.push(%coords); .say for @space; | 17:21 | |
bisectable6 | sena_kun, Bisecting by output (old=2015.12 new=509a7f6) because on both starting points the exit code is 0 | ||
sena_kun, bisect log: gist.github.com/a0172cc2339b72985c...b13f871580 | |||
sena_kun, (2016-04-05) github.com/rakudo/rakudo/commit/6a...822dac090b | |||
17:22
Altai-man_ left
|
|||
tobs | sena_kun: bogus result :/ | 17:22 | |
bisectable6: my $x = 10; my %h = 'x', $x; my @space; @space.push(%h); $x = 12; %h = 'x', $x; @space.push(%h); say @space[0].WHICH eq @space[1].WHICH | |||
bisectable6 | tobs, On both starting points (old=2015.12 new=509a7f6) the exit code is 0 and the output is identical as well | ||
tobs, Output on both points: «True» | |||
sena_kun | even if you declare a new %coords, it's still the same | ||
17:23
vike left
|
|||
bronco_creek | I hope someone can summarize if/when they understand this. I'm afraid I have no experience with the bisect tool you are using. | 17:25 | |
17:27
imcsk8 joined
17:28
dakkar_ joined
17:32
dakkar left
17:35
ensamvarg left,
caterfxo joined
|
|||
Kaiepi | m: my $foo = 1; my @foo = {:$foo}; say @foo; $foo = 2; say @foo | 17:37 | |
camelia | [foo => 1] [foo => 1] |
||
Kaiepi | m: my $foo = 1; my @foo; @foo.push: {:$foo}; say @foo; $foo = 2; say @foo | ||
camelia | [{foo => 1}] [{foo => 1}] |
||
Kaiepi | m: my $foo = 1; my @foo; @foo.push: {foo => $foo}; say @foo; $foo = 2; say @foo | 17:38 | |
camelia | [{foo => 1}] [{foo => 1}] |
||
Kaiepi | m: my $foo = 1; my @foo; @foo.push: my % = :$foo; say @foo; $foo = 2; say @foo | ||
camelia | [{foo => 1}] [{foo => 1}] |
||
Kaiepi | m: my $foo = 1; my @foo; @foo.push: my % = :$foo; say @foo; $foo = 2; @foo.push: my % = :$foo; say @foo | ||
camelia | [{foo => 1}] [{foo => 1} {foo => 2}] |
17:39 | |
17:39
stoned75 joined,
thundergnat joined
|
|||
Kaiepi | m: my $foo = 1; my @foo; @foo.push: my % = 'foo', $foo; say @foo; $foo = 2; @foo.push: my % = 'foo', $foo; say @foo | 17:39 | |
camelia | [{foo => 1}] [{foo => 1} {foo => 2}] |
||
Kaiepi | ohh wait i think i see what's going on | 17:40 | |
thundergnat | The problem is you are pushing the containers onto the array, not the values | ||
m: my %h = :10x; say %h; my @a; @a.push: %h; say @a; %h<x> = 5; @a.push: %h; say @a; | |||
camelia | {x => 10} [{x => 10}] [{x => 5} {x => 5}] |
||
thundergnat | contrast with | ||
m: my %h = :10x; say %h; my @a; @a.push: %h.deepmap: *.clone; say @a; %h<x> = 5; @a.push: %h.deepmap: *.clone; say @a; | 17:41 | ||
camelia | {x => 10} [{x => 10}] [{x => 10} {x => 5}] |
||
Kaiepi | yeah, i missed that the hash was being reused | ||
one way you can fix it is to change the second assignment to %coords to a bind instead | 17:42 | ||
thundergnat | Or do a deep clone like I showed above | ||
17:42
thundergnat left
17:43
lichtkind joined
|
|||
bronco_creek | Thanks tobs, sena_kun, Kaiepi, thundergnat. I need to study your examples more. | 17:48 | |
17:55
dakkar_ left
17:58
mowcat joined
|
|||
bronco_creek | Deep clone is a new concept to me, but looks workable in the context where I hit this problem. I'm mapping one (large but finite )space to another, so I need to populate the mapping iteratively. | 17:59 | |
17:59
chloekek joined
|
|||
bronco_creek | Thanks again, thundergnat. | 18:00 | |
timotimo | MasterDuke: could try breakpointing the functions and seeing what kinds of strings it's asking for | ||
18:01
sftp joined
18:02
vike joined
18:03
hungrydonkey left
18:11
kensanata left
|
|||
tobs | m: my $x = 10; my %h = 'x', $x; my @space; @space.push(%h<>); $x = 12; %h = 'x', $x; @space.push(%h<>); say @space | 18:16 | |
camelia | [{x => 12} {x => 12}] | ||
jnthn | m: my $x = 10; my %h = 'x', $x; my @space; @space.push({%h}); $x = 12; %h = 'x', $x; @space.push({%h}); say @space | 18:21 | |
camelia | [{x => 10} {x => 12}] | ||
jnthn | That's probably the most compact way to get the copy into a new hash | ||
sena_kun | jnthn, why it doesn't work when you declare a new hash? | 18:23 | |
I mean... | |||
m: my @space; my %coords = 'x', 1234, 'y', 1234; @space.push(%coords); say @space[0]; my %coords = 'x', 42, 'y', 42; @space.push(%coords); .say for @space; | |||
camelia | Potential difficulties: Redeclaration of symbol '%coords' at <tmp>:1 ------> 3push(%coords); say @space[0]; my %coords7⏏5 = 'x', 42, 'y', 42; @space.push(%coords {x => 1234, y => 1234} {x => 42, y => 42} {x => 42, y => 42… |
||
sena_kun | you decalre %coords twice, it should be different, no? | ||
18:24
sauvin left
|
|||
jnthn | The point of the redeclaration warning is that you're not declaring something new. | 18:27 | |
sena_kun | m: my $a; my $a; | 18:28 | |
camelia | Potential difficulties: Redeclaration of symbol '$a' at <tmp>:1 ------> 3my $a; my $a7⏏5; |
||
jnthn | There's only one $a there. Same with the hash. | ||
sena_kun *sounds of world crashing* | |||
bronco_creek | Thanks jnthn. I'm counting on learning Raku to keep me socially isolated ;-) Nice to see a supportive community here. | 18:32 | |
timotimo | MFW you try to socially isolate yourself by learning a seemingly excentric programming language, and make some of the best friends. oops! | 18:34 | |
jast | damn, that's rough | 18:35 | |
hope you bounced back from that | |||
timotimo | i may never recover | 18:36 | |
bronco_creek | I'm fine, BTW. Just old, vulnerable and cautious. I did some work in perl6 several years ago. The community still looks like the great place i remember. | 18:39 | |
colomon | I’ve run into something confusing with multi sub MAIN. example code: gist.github.com/colomon/148775fd20...b56f185d29 | 18:40 | |
If I invoke the program with just one file argument, the split version is called — even though the I-thought-mandatory split argument isn’t set? | 18:41 | ||
[Coke] | colomon: :$split! ? | 18:43 | |
colomon | [Coke]++ # that’s it! | ||
dunno why I was forgetting that | |||
18:44
regreg_ joined
18:46
regreg left
|
|||
MasterDuke | timotimo: good thinking. 4.8 million calls each looking for `&postfix:<++>` and `&infix:«<»` | 18:50 | |
18:51
regreg_ is now known as regreg
18:57
wamba left
|
|||
pilne | i love the community around raku, it's my "relaxing/grounding" kinda space despite the fact i'm constantly poking around at other languages | 18:59 | |
like, i'm stupidly fascinated by prolog/logtalk/mercury/mini kanren stuff right now. | |||
and i'm happier than a swine in slops that there's a perl prolog interpreter on cpan that looks like a great place for me to start looking into bringing something useful over to raku, while also satisfying my quirky likes! | 19:00 | ||
19:01
patrickb joined
19:09
Itaipu left
|
|||
uzl[m] | So how do I set an environment variable for a module? I'm talking specifically about this (github.com/perl6/Pod-To-HTML#debugging). | 19:11 | |
19:12
Itaipu joined
|
|||
moritz | you don't set them for a module, but for a process | 19:15 | |
P6DOC_DEBUG=1 perl6 yourscript | |||
P6DOC_DEBUG=1 perl6 --doc=html file.pod | 19:16 | ||
19:18
Itaipu_ joined
|
|||
uzl[m] | moritz: I was trying with `P6DOC_DEBUG perl6 yourscript` ;-). Thanks! | 19:18 | |
19:18
Itaipu left
19:19
Altai-man_ joined
19:21
PavelB joined,
sena_kun left
|
|||
wildtrees | for getting DBIish to work with postgres, do I need some c libraries or something? any idea what they would be called on ubuntu? | 19:24 | |
19:24
maggotbrain joined
|
|||
Altai-man_ | wildtrees, postgresql-dev I think | 19:25 | |
name of the package, I mean | |||
oops, maybe `libpq-dev` | 19:26 | ||
19:33
Black_Ribbon joined
|
|||
wildtrees | Altai-man_, I did: sudo apt-get install postgresql-server-dev-all and it worked | 19:39 | |
19:59
autarch joined
20:08
stoned75 left
20:10
chloekek left
20:11
rbt left,
chloekek joined,
stoned75 joined,
rbt joined
|
|||
Geth | doc/any-minmax-by: f3af1a04f8 | (Stoned Elipot)++ | doc/Type/Any.pod6 Explicitly mention min/max/minmax()'s :by argument |
20:41 | |
doc: stoned++ created pull request #3269: Explicitly mention min/max/minmax()'s :by argument |
20:42 | ||
20:54
NODE left
20:55
NODE joined,
chloekek left
20:56
xelxebar joined
21:20
sena_kun joined
21:22
Altai-man_ left
21:26
natrys left
21:30
mowcat left
|
|||
MasterDuke | timotimo: it doesn't seem to happen if i just put a loop() in a | 21:36 | |
oops. '-e' was the end there | |||
21:41
PavelB left
21:44
[Sno] left
21:46
[Sno] joined
21:47
mowcat joined
21:53
rindolf left
21:54
wamba joined
22:05
Doc_Holliwood joined
|
|||
uzl[m] | .seen jmerelo | 22:07 | |
tellable6 | uzl[m], I saw jmerelo 2020-02-26T20:04:44Z in #raku-dev: <jmerelo> tbrowder: that would be OK, I think. | ||
22:07
hungrydonkey joined
|
|||
uzl[m] | .tell jmerelo: Could you take a look at this "feature" branch (github.com/uzluisf/Pod-To-HTML/tre...r-changes) for Pod::To::HTML? BTW, is there any reason why the `pod2html` and `node2*` subroutines are exported? | 22:13 | |
tellable6 | uzl[m], I'll pass your message to jmerelo | ||
22:23
__jrjsmrtn__ joined,
_jrjsmrtn left
22:26
SQuoll left,
SQuoll joined
22:41
stoned75 left
22:48
stoned75 joined
23:03
oneeggeach joined
|
|||
timotimo | MasterDuke: huh, but those aren't dynamic variables? | 23:14 | |
MasterDuke | correct, they are not | 23:15 | |
timotimo | well, that's a little odd. | ||
you could try calling MVM_dump_bytecode(tc) when stopped at one of these | |||
23:16
oneeggeach left
|
|||
MasterDuke | btw, i'm in the middle of creating a new rakudo issue about it. have you seen my recent experimentation in #whateverable? | 23:16 | |
23:18
Actualey` joined
|
|||
timotimo | i have not | 23:19 | |
23:19
Altai-man_ joined
|
|||
MasterDuke | committable6: 9658dd9~2,9658dd9~1,9658dd9 class FOO { our proto sub foo($) {*}; multi sub foo(Int $n) { my @a = ^$n; my $b; loop (my $i = 0; $i < $n; $i++) { $b = @a[$i] }; return $b }; multi sub foo(Str $s) { return foo($s.Int) } }; say FOO::foo(1_000_000); say now - INIT now | 23:20 | |
committable6 | MasterDuke, ¦9658dd9~2: «9999991.3731685» ¦9658dd9~1: «Cannot test this commit (Commit exists, but an executable could not be built for it)» ¦9658dd9: «9999992.3190604» | ||
23:20
Altai-man_ left,
Altai-man_ joined
|
|||
kybr | how do i look up the :2years syntax used in this example: say Date.new('2015-12-24').later(:2years); | 23:21 | |
timotimo | interesting | ||
kybr: that's "colon pair syntax" | |||
23:21
sena_kun left
|
|||
kybr | thanks! | 23:21 | |
timotimo | MasterDuke: that commit is the one from july 2017? | 23:22 | |
MasterDuke | yep | ||
timotimo | well, that looks like a big change in moar | 23:23 | |
23:23
[Coke]_ joined
23:25
PotatoGim left,
[Coke] left,
Manifest0 left
23:26
Manifest0 joined,
woolfy joined,
PotatoGim joined
23:28
mojca joined
|
|||
MasterDuke | yeah, i'm kind of surprised it wasn't noticed before | 23:29 | |
timotimo | we should revert moar, nqp, and rakudo to 2017 and start over | ||
MasterDuke | timotimo: gist.github.com/MasterDuke17/ece19...26da661c75 | 23:31 | |
timotimo | oh wait that's getlexstatic | 23:32 | |
... why the heck did i think it was looking up dynamic variables | |||
i think i derped that on reading | 23:33 | ||
normally spesh would be able to turn those lookups into wval instructions | |||
oh, there's still speshresolve calls there, so this is an unspeshed frame | |||
can you let it run a few thousand times and look again? | |||
i mean let the loop run, so spesh can collect the data and optimize that frame? | 23:34 | ||
MasterDuke | that loop had been running for a whle | 23:35 | |
i have a 7.9gb log file with 167279995 lines of bytecode. pretty sure what i gisted was from the end of the file | |||
23:37
epony left
|
|||
MasterDuke | timotimo: i added: `char *n = MVM_string_utf8_encode_C_string(tc, name); if (strcmp(n, "&postfix:<++>") == 0) { fprintf(stderr, "found %s\n", n); MVM_dump_bytecode(tc); }` to the top of MVM_frame_find_lexical_by_name | 23:37 | |
23:48
epony joined
|
|||
Geth | doc: tinmarino++ created pull request #3270: Object: Inheritance: Add parent direct call with $obj.Parent::method |
23:49 | |
timotimo | oh dan | 23:53 | |
dang | |||
23:53
cpan-raku left,
cpan-raku joined,
cpan-raku left,
cpan-raku joined
|
|||
timotimo | and the code is even already inside a function of its own | 23:54 | |
MasterDuke | ? |