Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-dev, 2016-06-26

| Channels | #perl6-dev index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 lizmat jnthn: re the usefulness of .cow:  if we just bind each element of an array to another, then changes propagate back
00:00 lizmat m: class Foo { has $.a is rw }; my @a = Foo.new(a => $++) xx 2; my @b; @b[$_] := @a[$_] for ^2; dd @a, @b; @a[0] = 42; dd @a,@b
00:00 camelia rakudo-moar d4a0e0: OUTPUT«Array @a = [Foo.new(a => 0), Foo.new(a => 1)]␤Array @b = [Foo.new(a => 0), Foo.new(a => 1)]␤Array @a = [42, Foo.new(a => 1)]␤Array @b = [42, Foo.new(a => 1)]␤»
00:00 lizmat if you however .cow the array, then the change does *not* propagate back:
00:01 lizmat m: class Foo { has $.a is rw }; my @a = Foo.new(a => $++) xx 2; my @b = @a.cow; dd @a, @b; @a[0] = 42; dd @a,@b
00:01 camelia rakudo-moar d4a0e0: OUTPUT«Array @a = [Foo.new(a => 0), Foo.new(a => 1)]␤Array @b = [Foo.new(a => 0), Foo.new(a => 1)]␤Array @a = [42, Foo.new(a => 1)]␤Array @b = [Foo.new(a => 0), Foo.new(a => 1)]␤»
00:01 lizmat m: class Foo { has $.a is rw }; my @a = Foo.new(a => $++) xx 2; my @b = @a.cow; dd @a, @b; @b[0] = 42; dd @a,@b
00:01 camelia rakudo-moar d4a0e0: OUTPUT«Array @a = [Foo.new(a => 0), Foo.new(a => 1)]␤Array @b = [Foo.new(a => 0), Foo.new(a => 1)]␤Array @a = [Foo.new(a => 0), Foo.new(a => 1)]␤Array @b = [42, Foo.new(a => 1)]␤»
00:01 lizmat however, the values *are* bound, because:
00:01 lizmat m: class Foo { has $.a is rw }; my @a = Foo.new(a => $++) xx 2; my @b = @a.cow; dd @a, @b; @b[0].a = 42; dd @a,@b
00:01 camelia rakudo-moar d4a0e0: OUTPUT«Array @a = [Foo.new(a => 0), Foo.new(a => 1)]␤Array @b = [Foo.new(a => 0), Foo.new(a => 1)]␤Array @a = [Foo.new(a => 42), Foo.new(a => 1)]␤Array @b = [Foo.new(a => 42), Foo.new(a => 1)]␤»
00:02 lizmat note that in this last case, @a[0] and @b[0] are still referring to the same object
00:03 lizmat m: class Foo { has $.a is rw }; my @a = Foo.new(a => $++) xx 2; my @b = @a.cow; dd @a, @b; @b[0].a = 42; say @a[0] === @b[0]
00:03 camelia rakudo-moar d4a0e0: OUTPUT«Array @a = [Foo.new(a => 0), Foo.new(a => 1)]␤Array @b = [Foo.new(a => 0), Foo.new(a => 1)]␤True␤»
00:42 lizmat m: my %h = a => 42; my $m = %h.Map; dd $m; %h<a>++; dd $m  # sigh, mutable .Map
00:42 camelia rakudo-moar d4a0e0: OUTPUT«Map $m = Map.new((:a(42)))␤Map $m = Map.new((:a(43)))␤»
01:31 pyrimidine moritz: I think irclog.perlgeek.de is down, not seeing archived logs anymore
01:31 dalek rakudo/nom: 9b6d0cc | lizmat++ | src/core/Hash.pm:
01:31 dalek rakudo/nom: Fix Hash.Map
01:31 dalek rakudo/nom:
01:31 dalek rakudo/nom: - handle case of completely empty Hash
01:31 dalek rakudo/nom: - add support for :view parameter
01:31 dalek rakudo/nom: - create actual cow copy otherwise
01:31 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/9b6d0cc414
01:32 pyrimidine yup: http://www.downforeveryoneorjustme.com/http://irclog.perlgeek.de
01:35 lizmat pyrimidine: it will be some hours before moritz wakes up
01:48 ilbot3 joined #perl6-dev
01:48 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today
01:52 pyrimidine lizmat: not a problem
02:38 awwaiid lizmat: so .cow is sort of shallow-cow?
02:40 lizmat not sure what you mean by shallow exactly in this context
02:40 lizmat instead of aliasing the container, the value in the container is aliased
02:40 lizmat so that the new container will retain the value if the original container is changed
02:43 awwaiid m: my @a = [[[1]]] ; my @b = @a.cow; dd @a, @b; @a[0][0][0] = 42; dd @a, @b
02:43 camelia rakudo-moar 9b6d0c: OUTPUT«Array @a = [1]␤Array @b = [1]␤Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
02:44 awwaiid hm
02:45 awwaiid m: my @a = [1, [2, [3]]] ; my @b = @a.cow; dd @a, @b; @a[1][1][0] = 42; dd @a, @b
02:45 camelia rakudo-moar 9b6d0c: OUTPUT«Array @a = [1, [2, [3]]]␤Array @b = [1, [2, [3]]]␤Array @a = [1, [2, [42]]]␤Array @b = [1, [2, [42]]]␤»
02:45 awwaiid it would be neat if .cow magically did deep deep cow
02:46 lizmat how would it know to go deeper ?
02:46 lizmat because the value is Iterable ?
02:46 awwaiid magic I guess
02:46 awwaiid sure, iterable sounds good :)
02:46 lizmat hmmm....
02:46 lizmat in any case, before I go on, I'd like to see what TimToady thinks of the idea
02:46 awwaiid maybe this could be a flag or property of any object
02:46 awwaiid ya
02:47 lizmat and whether we should have any syntactic suger
02:47 lizmat *sugar
02:47 awwaiid seems like a very interesting idea to explore in any case
02:47 skids joined #perl6-dev
02:47 lizmat this is basically also a result of TheDamian's functional programming course and a conversation I had with TimToady afterwards
02:48 awwaiid ah cool. I did a lot of OCaml with purely-functional datastructures, and behind the scenes COW is what made it realistic
02:49 awwaiid ocaml, iirc, has it baked in all the time. I guess like clojure does it -- extra layers of pointers all the time
02:53 awwaiid clojure uses COW functional data structures as a key part of its concurrency story
03:33 dalek roast: 0d86018 | LLFourn++ | S32-str/split.t:
03:33 dalek roast: Test for RT #128481
03:33 dalek roast: review: https://github.com/perl6/roast/commit/0d86018d74
03:40 dalek rakudo/nom: 9ee9693 | lizmat++ | src/core/BagHash.pm:
03:40 dalek rakudo/nom: Simplify BagHash.Bag
03:40 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/9ee96937ae
03:40 dalek rakudo/nom: ff63582 | lizmat++ | src/core/Capture.pm:
03:40 dalek rakudo/nom: Simplify Capture.hash
03:40 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ff63582693
03:40 dalek rakudo/nom: 8d5a9e4 | lizmat++ | src/core/CompUnit/Handle.pm:
03:40 dalek rakudo/nom: Simplify CompUnit::Handle.new|from-unit
03:40 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8d5a9e4ff7
03:40 dalek rakudo/nom: d78d8cd | lizmat++ | src/core/Enumeration.pm:
03:40 dalek rakudo/nom: Simplify ENUM_VALUES
03:40 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d78d8cdbfb
03:40 dalek rakudo/nom: 2b12326 | lizmat++ | src/core/HyperSeq.pm:
03:40 dalek rakudo/nom: Simplify HyperSeq.new
03:47 dalek rakudo/nom: d43036f | lizmat++ | src/core/HyperWorkBuffer.pm:
03:47 dalek rakudo/nom: Simplify HyperWorkBuffer.new
03:47 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d43036fa22
03:47 dalek rakudo/nom: 6018ccd | lizmat++ | src/core/IO/Special.pm:
03:47 dalek rakudo/nom: Simplift IO::Special.new
03:47 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6018ccd34e
03:47 dalek rakudo/nom: 4f3b650 | lizmat++ | src/core/Iterable.pm:
03:47 dalek rakudo/nom: Simplify Iterable.flat|lazy iterator.new
03:47 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/4f3b6505f2
03:47 dalek rakudo/nom: e2b90ab | lizmat++ | src/core/MixHash.pm:
03:47 dalek rakudo/nom: Simplify MixHash.Mix
03:47 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e2b90abaec
03:47 dalek rakudo/nom: cc6d2a3 | lizmat++ | src/core/Seq.pm:
03:47 dalek rakudo/nom: Simplify Seq.new
03:47 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/cc6d2a3397
03:47 dalek rakudo/nom: 6d824ec | lizmat++ | src/core/Str.pm:
03:49 lizmat all of these commits basically changed the same thing
03:50 lizmat It's spectest clean, but sometimes runs deep in the internals
03:50 lizmat in order for bisectable to be able to bisect any problems found, I did these all in separate commits
04:29 dalek rakudo/nom: a556a86 | lizmat++ | src/core/Attribute.pm:
04:29 dalek rakudo/nom: Streamline Attribute.get_value|set_value
04:29 dalek rakudo/nom:
04:29 dalek rakudo/nom: Not sure what the effect is, if any.  They *do* get called during
04:29 dalek rakudo/nom: module installation after setting compilation.
04:29 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a556a869ea
04:52 lizmat good night, #perl6-dev!
05:49 brrt joined #perl6-dev
06:09 brrt joined #perl6-dev
06:56 RabidGravy joined #perl6-dev
07:05 brrt joined #perl6-dev
07:08 psch alright, so, the patch method doesn't show up in qbidToCodeRef because it doesn't get a CodeRefAnnotation during jast2bc.JASTCompiler.compileMethod
07:08 psch and it doesn't get a CRA because it neither has a crCuid nor an outer
07:08 psch i *think* i probably have to add an outer, but i have no clue how i can find out which CR *is* the appropriate outer
07:08 psch because during COMP_MODE we never add a cuid
07:36 ilbot3 joined #perl6-dev
07:36 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today
07:51 Woodi m: my @a = [1, 2, 3]; my @b = @a.cow; @b[0] = 4; dd @b; dd @a
07:51 camelia rakudo-moar a556a8: OUTPUT«Array @b = [4, 2, 3]␤Array @a = [1, 2, 3]␤»
07:54 lizmat joined #perl6-dev
07:59 hankache joined #perl6-dev
08:32 [Tux] joined #perl6-dev
09:03 [Tux] This is Rakudo version 2016.06-46-ga556a86 built on MoarVM version 2016.06
09:03 [Tux] test            16.492
09:03 [Tux] test-t           9.864
09:03 [Tux] csv-parser      21.979
09:05 FROGGS joined #perl6-dev
09:21 brrt joined #perl6-dev
09:59 AlexDaniel joined #perl6-dev
11:40 bisectable joined #perl6-dev
11:46 bisectable joined #perl6-dev
13:06 dalek rakudo/nom: e071e40 | lizmat++ | src/core/Attribute.pm:
13:06 dalek rakudo/nom: More correct translation of given/when structure
13:06 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e071e40b37
13:25 psch alrighty then, lets see if carrying every single jclass compiled with one compiler instance gives me back the missing method
13:25 psch +along
13:32 hankache joined #perl6-dev
13:49 skids joined #perl6-dev
13:56 brrt joined #perl6-dev
14:18 psch well, apparently it kinda works
14:19 psch unfortunately the StaticCodeInfo of the CodeRef seems to get lost somewhere
14:19 psch which is kind of the same problem as before, only one goal post further... vOv
14:23 llfourn https://gist.github.com/LLFourn/135680d93ef10b76b0213386b49fa20e # backtrace on the segfaults I'm getting for anyone interested
14:25 timotimo llfourn: unfortunately that's utterly useless without the filename and line number
14:25 timotimo because every single REPR has a gc_mark function
14:25 timotimo though perhaps the right clue to behold is that frame_force_to_heap is in the backtrace; jnthn?
14:25 llfourn oh. Yeah I was never able to build with debug symbols on mac last time.
14:26 timotimo damn :(
14:26 * llfourn will attempt again
14:26 timotimo thanks
14:27 llfourn how to do again?
14:27 timotimo give moarvm's Configure.pl the --debug=3 flag
14:29 * psch now carries the CodeRefBuilder for each file around as well
14:29 psch hope that has the info for e.g. oLexStatic
14:29 psch ...although, probably not
14:29 timotimo psch: it's kind of amusing how you can tell by the cpu usage graphs on collect when you're working on rakudo-jvm :D
14:29 psch *but* it might have the info for building the stuff for oLexStatic etc...
14:30 psch timotimo: i'm glad i'm not compiling locally 'cause it would be lots too hot here then :)
14:30 timotimo :D
14:30 timotimo yeah
14:33 psch ohh, what's ram usage say?
14:33 psch for rakudo specifically
14:33 psch 'cause i have a feeling that'll increase a lot
14:33 psch i mean, during rakudo build
14:34 timotimo hardly noticable on the graph, as the machine has like 20 gigs
14:34 psch i mean, during CORE compilation i have to carry all JAST::Methods of all CompUnits around
14:34 timotimo llfourn: btw, gfldex isn't in this channel, so even though he's interested, he's not going to have seen that backtrace
14:35 psch but yeah, in the grand scheme of 20 gigs on a server that probably doesn't matter too much
14:35 psch ISTR we did have r-j compilation problems due to stack size in the past...
14:35 psch anyway, i'll take a break now 'cause everything's getting hairy again with the CodeRefBuilder stuff >_>
14:38 llfourn timotimo: thanks.
14:39 llfourn ek. after rebuilding with --debug=3 there seems to be less info -_-
14:39 timotimo that's fantastic!
14:40 llfourn looks like: #0  0x0000000100063cf4 in ?? () from /Users/llfourn/src/rakudo/install/lib/libmoar.dylib
14:40 timotimo that'd happen when going through the jit (or something) makes the stack unreadable to the debugger
14:40 timotimo you can try if it still happens with MVM_JIT_DISABLE=yes in your env
14:40 llfourn ah. thanks.
14:43 llfourn timotimo: updated gist - https://gist.github.com/LLFourn/135680d93ef10b76b0213386b49fa20e
14:43 llfourn but it's still empty :S
14:44 llfourn in terms of info with MVM_JIT_DISABLE
14:44 timotimo well, it's not necessarily the same crash
14:44 timotimo does file tell you something interesting about the dylib?
14:44 timotimo like "not stripped"?
14:44 llfourn how do I check?
14:44 timotimo "file" is a commandline program
14:45 llfourn /Users/llfourn/src/rakudo/install/lib/libmoar.dylib: Mach-O 64-bit dynamically linked shared library x86_64
14:45 timotimo hm
14:49 timotimo mine looks like this: perl6/install/lib/libmoar.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=092ad8a65bd5594c1e60c3e6ab1f34a216c519a6, not stripped
14:49 llfourn this is BSD file vs gnu I guess
14:50 timotimo *shrug*
14:50 timotimo also, i don't think BuildID is a thing on every linux distro
14:50 timotimo so probably also not on mac osx
14:50 llfourn I think "stripped" is a thing on BSD file though because it mentions it in the man page
14:54 stmuk I did wonder at one point if upstream file(1)s should recognise moar magic
14:54 stmuk maybe they do already
14:55 timotimo they probably don't yet
14:55 nine psch: CORE compilation won't be affected since it's a single CompUnit
14:56 Zoffix the `parse` stage went up from 54s to 83s when I switched my 4-core VM to 1 core
14:57 timotimo i wonder if the jvm switches GCs depending on whether or not multiple cores are available
14:58 Zoffix (I'm talking about moar FWIW)
14:58 timotimo oh
14:58 timotimo huh
14:58 Zoffix ¯\_(ツ)_/¯
15:00 stmuk https://gist.github.com/ilmari/2a23f96373163a1fa45b
15:01 stmuk ilmari: have you made any attempt to commit that upstream to GNU and any BSD projects?
15:02 gfldex joined #perl6-dev
15:02 timotimo i wonder if the format changed since then
15:02 stmuk not sure . I stuck in my /etc/magic and it seems to work
15:03 timotimo well, of course it seems to work
15:03 timotimo it just reads values from the first ~100 bytes
15:03 timotimo it can hardly crash :)
15:03 timotimo but the values could be wrong
15:04 stmuk thats what I meant
15:04 stmuk /opt/rakudo-star-2016.01/share/perl6/runtime/perl6.moarvm: MoarVM bytecode (version 5), 5 serialization contexts, 1 extension ops, 11 frames, 8 callsites, 199 strings, 1576 bytes serialized data (version 16), 3020 bytes bytecode, 492 bytes annotations
15:05 timotimo ah, ok :)
15:45 ilmari stmuk: nope
15:53 psch nine: it already is.  i have to keep track of all CUs compiled by a given instance of a HLL::Compiler to still reach the already-defined-but-later-lost method that refers to the inner CU
15:54 psch because that's a thing i noticed; we compile that method that later goes missing before we compile the inner CU
15:55 psch s:2nd/before/after/
15:55 psch err, there's no 1st vOv
16:05 ilmari stmuk: I tired to get the hll name, but I couldn't figure out a way to get the Nth string in the string heap
16:06 Zoffix left #perl6-dev
16:07 llfourn timotimo: \o/ I got debugging symbols to show up: https://gist.github.com/LLFourn/135680d93ef10b76b0213386b49fa20e
16:07 llfourn not with gdb but with lldb
17:04 b2gills Should IO::ArgFiles.eof() act per input file, or should it be for the entire list of input files ( fixing other problems with it currently )
17:15 Zoffix joined #perl6-dev
17:51 timotimo that looks very interesting, i'll have to look at it later today - i hope i'll make it
18:07 hankache_ joined #perl6-dev
18:29 skids joined #perl6-dev
21:18 Zoffix joined #perl6-dev

| Channels | #perl6-dev index | Today | | Search | Google Search | Plain-Text | summary