Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2017-07-12

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
01:49 ilbot3 joined #moarvm
01:49 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
02:20 colomon joined #moarvm
03:16 vendethiel joined #moarvm
03:43 AlexDaniel joined #moarvm
05:48 Geth_ ¦ MoarVM: 9531ccc915 | (Samantha McVey)++ | 3 files
05:48 Geth_ ¦ MoarVM: Use normalize_should_break to decide if concat needs normalization
05:48 Geth_ ¦ MoarVM:
05:48 Geth_ ¦ MoarVM: This greatly increases the speed of normalization in many cases when
05:48 Geth_ ¦ MoarVM: using non-ASCII characters.
05:48 Geth_ ¦ MoarVM:
05:48 Geth_ ¦ MoarVM: We rename should_break to normalize_should_break and save a lot of
05:48 Geth_ ¦ MoarVM: non-needed normalization, only renormalizing when the normalized form
05:48 Geth_ ¦ MoarVM: would actually be different.
05:48 Geth_ ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/9531ccc915
06:05 brrt joined #moarvm
06:20 Geth_ ¦ MoarVM/even-moar-jit: 6854e97ffd | (Bart Wiegmans)++ | 4 files
06:20 Geth_ ¦ MoarVM/even-moar-jit: A real parser for s-expressions
06:20 Geth_ ¦ MoarVM/even-moar-jit:
06:20 Geth_ ¦ MoarVM/even-moar-jit: With a tokenizer, lookahead, and recursive descent, alright.  Also,
06:20 Geth_ ¦ MoarVM/even-moar-jit: supports strings, which I think can be pretty useful, and is
06:20 Geth_ ¦ MoarVM/even-moar-jit: considerably more flexible as to what is or is not a 'word'.
06:20 Geth_ ¦ MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/6854e97ffd
06:20 Geth_ ¦ MoarVM/even-moar-jit: 6a3471a348 | (Bart Wiegmans)++ | 5 files
06:20 Geth_ ¦ MoarVM/even-moar-jit: Flatten LABEL nodes
06:20 Geth_ ¦ MoarVM/even-moar-jit:
06:21 Geth_ ¦ MoarVM/even-moar-jit: We used to have the labels wrap a const, but that's really redundant,
06:21 Geth_ ¦ MoarVM/even-moar-jit: as the label can't be anything but a constant itself. So instead lets
06:21 Geth_ ¦ MoarVM/even-moar-jit: use the label as the const.
06:21 Geth_ ¦ MoarVM/even-moar-jit: review: https://github.com/MoarVM/MoarVM/commit/6a3471a348
06:53 domidumont joined #moarvm
06:55 domidumont joined #moarvm
07:10 domidumont joined #moarvm
07:12 brrt joined #moarvm
07:20 brrt joined #moarvm
07:47 zakharyas joined #moarvm
07:53 brrt 'optimistic' store insertion is finicky, it seems..
08:14 samcv brrt, so i'm exploring ways to not have to renormalize an entire string just when concatting it
08:14 samcv so. what i will need to do though is dealloc the last grapheme/first grapheme on string a or string b
08:15 brrt ohai samcv
08:15 brrt allow me to help
08:15 samcv so i want to know if there's anything special i should know in addition to what you would do with C
08:15 brrt okay, ehm, let me think
08:16 samcv well i guess i don't need to dealloc it. though i'd like to know how to do that too. but. i need to make a new string which contains the data of first and second strings except not the end or begining of one of them
08:16 samcv and it was my impression when you concat things, you create a new string with two strands. string a and string b
08:16 brrt that's usually what happens, yes
08:16 samcv ok
08:16 samcv so that is simple. but i am going to make a new string that contains part of each string
08:17 samcv idk is there anything special i should know about
08:19 brrt i'm actually not super familiar with the layout of MVM strings
08:19 samcv ok well. they're just int arrays
08:19 brrt uhuh
08:19 samcv as far as we care at this moment
08:19 samcv so i just need to make sure that the GC will know that i'm only using a certain section of that string
08:19 brrt if allcoated via malloc, you can 'dealloc' with realloc, just with a smalle rnumber
08:19 brrt aha
08:19 brrt why?
08:20 samcv my $a = "blah"; my $b = 'stuff'; my $c = $a ~ $b; so ok we end up having to change the normalization
08:20 samcv hypothetically. so i end up wanting 'bla' + X + 'tuff'
08:21 samcv so i make a new MVM string and set the data to point to the right point and set the grapheme count properly etc
08:21 samcv i know how to do that
08:21 timotimo when you call realloc on a piece of memory and you only reduce it by a little bit, usually the allocator decides to just do nothing
08:21 samcv timotimo, well i just want to not mess with $a and $b
08:21 timotimo don't forget that you're not allowed to share buffers between MVMStrings
08:21 samcv until it get's GC'd
08:21 timotimo yeah
08:21 samcv i can't share the buffer?
08:23 samcv that doesn't make sense from what i'm reading here in concat
08:23 samcv or is it because the strands literally point to the *same* string
08:24 brrt yeah, i'm not sure either. i thought that's what the whole strands thing did
08:24 samcv also is there not some fancy hing i can do to share the buffers?
08:25 samcv so that the gc knows that x1-x3 memory address go to string $a and x1-x2 goes to string $c
08:25 samcv or can we not do that
08:25 samcv because i really want to do that
08:25 timotimo that only works for reference-counted or otherwise gc-managed things
08:25 samcv i mean if the GC kept track properly it should be possible
08:25 samcv hm
08:25 timotimo i don't think strands are gc-managed, though?
08:26 samcv i mean strands are made up of strings
08:26 samcv literally the same strings that it started with
08:26 samcv in simple cases
08:27 brrt i think i'm confused, in geneal
08:27 brrt *general
08:27 brrt anyway
08:27 brrt you'd never 'dealloc' the memory, you'd just use a smaller portion of it
08:27 samcv yes exactly
08:27 samcv ignore the part about deallocing
08:28 samcv yes i use a smaller portion of it
08:28 timotimo oh, strands do point at other MVMString objects
08:28 timotimo that'd be fine, then
08:28 samcv yes
08:28 samcv but. i want to use part of another string
08:28 brrt a substring
08:28 brrt yes
08:28 timotimo i had a very bad night with not actually sleep :<
08:29 samcv and i'm just concerned about what happens to make sure that if string $a gets gc'd that i don't get things exploding
08:29 samcv since string $c contains a substring of it
08:29 brrt well as long as you point to the full collectable...
08:29 samcv though tbh it would be fine to waste one or 4 bytes of space in most cases
08:30 samcv in almost all cases the substring will be almost the whole string
08:30 samcv so i suppose it would be ok if it kept around that extra stuff
08:30 timotimo we might want a little heuristic so we don't make strands if the full buffer itself would take up less space than building a strands array would
08:31 samcv well yes
09:10 robertle joined #moarvm
09:38 domidumont joined #moarvm
09:56 domidumont1 joined #moarvm
10:32 samcv ok so guys https://github.com/MoarVM/MoarVM/compare/master...samcv:concat-magic?expand=1#diff-0cb6ca157d7b79b7d7e5ace869130f8cR558
10:32 samcv this is my 1/2 actual code and the ending is pseudocode for what i want to do
10:33 samcv for now going to only cover the case where we have two non-synthetics
10:33 samcv maybe jnthn can help out since he knows strands better than me
10:34 timotimo newstring = a[0..*-2] ~ r_string ~ b[1..*-1];  ... this is not C %)
10:35 samcv i said it was half pseudocode
10:35 timotimo ah
10:35 timotimo sorry, i somehow read about half of that text
10:35 timotimo don't allow me to operate a motorized vehicle today
10:35 samcv i mean there i just need to compose a string that is all but the last cp of string a + the new chr + all but the first char of string b
10:36 samcv otherwise the code is functional
10:36 timotimo so you'd create a new MVMString for the in-between grapheme, and a three strands containing MVMString that has n-1 from the first string, the new chr, and all but the first ... yeah
10:37 brrt yes. it is quite clever
10:38 brrt the only thing i'm not sure about is how you'd actually 'do'  the substringing
10:38 samcv yes
10:38 samcv well i can make a new string that's the same but has slightly different offsets
10:38 samcv though i don't know how the gc knows about strings. when does it learn of them?
10:39 samcv i mean if the gc thinks strand a of the new string is the SAME as string a from the concat we will be okay
10:39 brrt i see what you mean
10:39 brrt and sadly, i don't know how to resolve that
10:40 samcv you guys know better about how gc works than i do
10:42 brrt well, to be fair, the bus-factor on our GC is about a single jtnhtn
10:42 brrt jnthn
10:43 samcv what if jnthn gets GC'd :(
10:43 samcv can we call it the GC factor? :P
10:43 samcv heh
10:44 timotimo sorry, what is the question now?
10:45 timotimo a strand holds on to a full MVMString but it also holds an individual start and length field
10:45 timotimo that's how you get a substring from another string
10:45 brrt so
10:45 brrt if you can help samcv do that, then we're done for today
10:45 samcv ah so strands already do what i want timotimo ?
10:45 timotimo now if you have a 500 megabytes long string and you take a 10 character substring and it ends up as a strand, you'll keep the 500 megabytes alive through your tiny substring
10:45 timotimo does that give you a better feel for the thing?
10:45 samcv yeah that won't happen though
10:45 samcv but i see your point
10:46 samcv but yeah that's what i want :)
10:46 samcv will start at single character and then once that's confirmed working will work on making it longer based on how much is needed for the specific string
10:46 samcv to be renormalized or whatever
10:47 timotimo don't forget to have MVMROOT everywhere
10:54 samcv yep
10:54 samcv well i must sleep now :)
10:55 samcv thx for the info timotimo
10:55 timotimo i hope you sleep better than i didn't
10:55 samcv and if jnthn gets around please message me useful tips so i get it when i wake up :)
10:55 samcv i hope i don't as bad as you did
10:59 samcv Zzzz night o/
11:21 Geth_ ¦ MoarVM: bfaeb405d4 | (Samantha McVey)++ | 3 files
11:21 Geth_ ¦ MoarVM: Rename should_break to MVM_unicode_normalize_should_break
11:21 Geth_ ¦ MoarVM:
11:21 Geth_ ¦ MoarVM: @zhuomingliang++
11:21 Geth_ ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/bfaeb405d4
11:21 samcv ok now i'm really really going to bed ;)
11:43 brrt yes!
11:44 brrt what is it with moarvm developers and sleep
11:46 AlexDaniel joined #moarvm
11:54 nwc10 seems to be a known failure mode of humans.
12:05 brrt1 joined #moarvm
12:13 domidumont joined #moarvm
12:22 robertle_ joined #moarvm
12:23 domidumont1 joined #moarvm
12:27 Ven joined #moarvm
12:27 domidumont joined #moarvm
12:59 domidumont1 joined #moarvm
13:12 * jnthn is back
13:12 jnthn Glad to report I didn't get GC'd :)
13:15 jnthn samcv: You can safely do something like allocate a new strand string, make the first strand a substring of the first string, the third strand a substring of the second string, and then allocate another string for the second strand with the twiddled bits in it. That'd work, you just need to MVMROOT things you'll talk about after allocating the strand and new middle string
13:18 colomon joined #moarvm
14:24 Geth_ ¦ MoarVM: a3a58c82dd | (Jonathan Worthington)++ | src/core/continuation.c
14:24 Geth_ ¦ MoarVM: Clear cached dynamics when taking continuation.
14:24 Geth_ ¦ MoarVM:
14:24 Geth_ ¦ MoarVM: They may be from frames that are no longer visible at the location
14:24 Geth_ ¦ MoarVM: that the continuation will be invoked. Fixes problems with $*THREAD
14:24 Geth_ ¦ MoarVM: being outdated after an `await` in Perl 6.d.PREVIEW.
14:24 Geth_ ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/a3a58c82dd
14:31 dogbert17 jnthn, https://github.com/MoarVM/MoarVM/issues/612 might be of interest wrt to your current spesh work
14:38 jnthn Hm, doubt it's on the path my current work would touch#
14:39 jnthn But given designing/implementing the type planner isn't really something to do on an afternoon after returning from vacation, will take a look at it now :)
14:40 dogbert17 :)
14:40 dogbert17 hope you had a nice vacation
14:41 jnthn Yeah, we made a short trip to Olomouc, which turns out to be a very pleasant city.
14:42 jnthn It's most famous for having a very smell kind of cheese. :)
14:42 jnthn *smelly
14:47 jnthn Gee, this bug doesn't golf terribly far
14:49 AlexDaniel joined #moarvm
15:05 Geth_ ¦ MoarVM: 1fe53f6d7d | (Jonathan Worthington)++ | src/core/args.c
15:05 Geth_ ¦ MoarVM: Missing MVMROOT during an allocation.
15:05 Geth_ ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/1fe53f6d7d
15:05 jnthn I found that, but sadly it ain't The Bug we're hutning
15:06 jnthn *hunting
15:06 brrt joined #moarvm
15:07 dogbert17 jnthn++, you probably solved some other reported bugs with that fix :)
15:11 jnthn MVMCallCapture sure has its share of historical cruft
15:14 brrt \o/
15:15 brrt i need some thinking assistance today
15:15 jnthn o/ brrt
15:17 Geth_ ¦ MoarVM: 352d42c40b | (Jonathan Worthington)++ | src/6model/reprs/MVMCallCapture.h
15:17 Geth_ ¦ MoarVM: Remove a flag option that is no longer mentioned.
15:17 Geth_ ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/352d42c40b
15:17 Geth_ ¦ MoarVM: 5dc3389fea | (Jonathan Worthington)++ | 2 files
15:17 Geth_ ¦ MoarVM: Remove never-assinged use_mode_frame field.
15:17 Geth_ ¦ MoarVM:
15:17 Geth_ ¦ MoarVM: A leftover from when the call capture has a use mode other than the
15:17 Geth_ ¦ MoarVM: one where a copy of the args was taken for safety reasons.
15:17 Geth_ ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/5dc3389fea
15:20 brrt \o jnthn
15:20 brrt the thinking assistance that is required
15:20 brrt i have decided to move towards 'optimistic' store insertion
15:21 brrt roughly, i currently immediately issue a STORE node for every generated value
15:21 brrt that's easy and correct
15:23 nine But generates lots of unnecessary STOREs?
15:28 brrt yes
15:28 brrt now, i want to move to a scheme in which we only insert them when required
15:28 brrt (currently, at the end of every basic block)
15:29 brrt but even that isn't necessary if we start to handle multiple basic blocks, although that is some way off
15:29 nine Well, one step at a time
15:30 Geth_ ¦ MoarVM: 2f9be082a3 | (Jonathan Worthington)++ | 4 files
15:30 Geth_ ¦ MoarVM: Remove now-unused cur_usecapture per thread.
15:30 Geth_ ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/2f9be082a3
15:31 brrt indeed
15:31 brrt but on the other hand, as long as we still issue a store after every computed value...
15:31 brrt well, all the other optimizations we might do are not very sensible then
15:32 brrt now, as to 'where am i'
15:32 brrt the basic objective is to have a 'flush' function, which makes the in-memory state compatible with what the interpreter expects
15:33 Geth_ ¦ MoarVM: 8aa657d60a | (Jonathan Worthington)++ | 3 files
15:33 Geth_ ¦ MoarVM: Eliminate mode flag from CallCapture.
15:33 Geth_ ¦ MoarVM:
15:33 Geth_ ¦ MoarVM: They are all save-mode now.
15:33 Geth_ ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/8aa657d60a
15:33 brrt that's a repurposing of the existing 'flush' function, which makes sure that nodes defined previously are no longer seen as available because control flow might be interupted
15:36 jnthn Sorry, bit headachey (probably tired from travel), gonna have to go rest some
15:36 jnthn bbiab
15:41 dogbert17 jnthn: rest well
15:44 brrt rest well yes
15:44 brrt continuing: so the way to do that, is to keep track of which node last computed a value, and wrap that with a STORE
15:48 brrt well, that's where i am, but...
15:48 brrt i'm already wrapping some nodes with a store
16:03 * timotimo rested up some
17:24 domidumont joined #moarvm
18:17 TimToady joined #moarvm
18:46 zakharyas joined #moarvm
19:08 colomon joined #moarvm
19:36 brrt joined #moarvm
19:49 AlexDaniel joined #moarvm
20:09 samcv good *
20:14 brrt ohai
20:14 brrt okay, 9 hours is reasonable for sleep
20:34 samcv good hi
20:34 jnthn o/ samcv
20:35 samcv hi jnthn :)
20:35 samcv jnthn, where should i look to see how i make strands a substring of another? do i want to look at .substr ?
20:35 jnthn Yeah, see .substr
20:35 jnthn Or just read the MVMStrand or whatever it is data structure
20:36 samcv ok :)
20:36 samcv yay!
20:36 jnthn https://github.com/MoarVM/MoarVM/blob/master/src/6model/reprs/MVMString.h#L53
20:36 samcv sexy
20:36 jnthn start and end you set to indicate the regions
20:37 jnthn repetitions isn't useful for what you're doing, I susepct, but it's the thing that lets us attempt to support the Perl 6 x operator efficiently
20:37 samcv attempt heh
20:38 jnthn Well, in the best case it saves us allocating memory for the repetitions, an in the worst case it just puts off when we have to
20:38 jnthn *and
21:25 samcv jnthn, ok so i have it almost done. but i'm not sure how to deal with copy_strands
21:25 samcv so i want to copy the strands and then afterward i need to edit the strands i guess right?
21:25 samcv so that they refer to a different section of the string
21:26 timotimo you should be able to construct the strands array from scratch, too
21:30 jnthn samcv: that's only relevant if your input is a strand string itself
21:30 samcv yep i know
21:30 jnthn samcv: We don't do tree-like structures
21:31 jnthn We only allow a single "level" of strands
21:31 samcv ok so uh
21:31 samcv well yeah i know it's not a tree
21:31 samcv it copies the strands
21:31 jnthn So if you have one string coming in with strands, you'd use copy_strands to stick those strands into the result
21:31 jnthn It's really just a wrapper around memcpy that does size calcs :)
21:32 samcv https://github.com/MoarVM/MoarVM/compare/master...samcv:concat-magic?expand=1#diff-0cb6ca157d7b79b7d7e5ace869130f8cR455
21:32 samcv if you want to see what i have so far
21:32 samcv jnthn, well yes i know that
21:32 samcv so then i just need to go to the last strand of string a and change the length of the cp's
21:32 jnthn OK, I'm not sure what more there is to know :)
21:32 jnthn Ah, right
21:32 jnthn Yes, you'd do that after the copy :)
21:32 samcv check out what i have so far
21:36 timotimo i didn't realize we don't tree it up in there
21:36 samcv probably nicer to just do a small amount of copying i'd think
21:36 samcv to keep things simple since we're just copying the metadata
21:36 jnthn Hm, would renormalized_section that is passed to strand_renormalize_part not need to be &renormalized_section so it can be updated?
21:37 samcv MVMString *result, *renormalized_section;
21:37 samcv hm
21:37 samcv it might
21:37 jnthn I think around line 551 after copy_strands, you just want to take the final strand and tweak its .end though
21:37 jnthn using consumed_a
21:37 jnthn And similar around 540
21:38 samcv ok tweak them instead of originally setting them different
21:38 samcv that could be cleaner
21:38 jnthn Yeah, you can tweak it because after the copy you're tweaking "your" things
21:38 samcv maybe make a function that tweaks them?
21:38 jnthn And so not violating the immutability
21:39 jnthn I dunno if a function is worth it 'cus the tweaks are different?
21:39 samcv we will see
21:39 jnthn It's last strand last char in one case, and first strand first char in the other
21:39 jnthn Which doesn't feel like it leaves a lot to factor out :)
21:40 timotimo still wondering if i'll ever get in-situ storage for strings and/or mvmarrays working
21:43 colomon_ joined #moarvm
21:44 * jnthn suspects he should got and rest so he stands a chance of getting anything working tomorrow. :)
21:44 * lizmat feels likewise
21:49 jnthn 'night o/
21:52 samcv jnthn, nothing bad happens if i go over max strands y/n
22:18 samcv yay lots of segfaults :)
22:32 d4l3k_ joined #moarvm
22:35 arnsholt joined #moarvm
22:35 nwc10 joined #moarvm

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary