Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6-dev, 2017-07-26

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

All times shown according to UTC.

Time Nick Message
01:53 ilbot3 joined #perl6-dev
01:53 Topic for #perl6-dev is now Perl 6 language and compiler development 2.0 | Logs at http://irclog.perlgeek.de/perl6-dev/today | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
02:17 geekosaur joined #perl6-dev
02:19 moritz_ joined #perl6-dev
03:05 AlexDani` joined #perl6-dev
03:27 AlexDani` joined #perl6-dev
03:54 pharv joined #perl6-dev
04:52 japhb What would be the fastest way to determine the total Unicode width of all graphemes in a string?  (By which I mean correctly accounting for fullwidth graphemes).  Extra points if you can find a more efficient way to also ignore zero-width ANSI sequences than just doing a prepass with e.g. Terminal::ANSIColor::colorstrip()
05:30 astj joined #perl6-dev
05:44 AlexDani` joined #perl6-dev
06:03 astj joined #perl6-dev
06:15 lizmat Files=1204, Tests=67328, 226 wallclock secs (13.64 usr  5.04 sys + 1383.26 cusr 140.07 csys = 1542.01 CPU)
06:28 Ven joined #perl6-dev
06:39 AlexDani` joined #perl6-dev
06:53 Ven_ joined #perl6-dev
07:36 [Tux] 4.168. All inline perl5 still busted
07:36 [Tux] must run
07:41 samcv japhb, what do you mean by that
07:41 samcv oh
07:42 samcv m: "blah????".uniprops('East_Asian_Width').say
07:42 camelia rakudo-moar 9c0d40: OUTPUT: «(Na Na Na Na W)?»
07:43 samcv so i would test for .starts-with('W') to test if it is wide
07:43 samcv since on a future version it *could* change to saying "Wide" instead of W. just to keep it future thinking
07:43 samcv but there's Neutral, Ambiguous, Halfwidth, Wide, Fullwidth and Narrow
07:44 samcv japhb, so all of those are the same in single character form as in long form so just check the first letter. Except Narrow is Na in short form. so i'd check .starts-with('Na')
08:26 AlexDaniel uhhhhhhhh… reading http://www.evanmiller.org/why-im-learning-perl-6.html I got an idea…
08:27 AlexDaniel m: say (“\x2695\xFE0Fa\x1F468\x200D” ~ “\x2695\xFE0Fa\x1F468\x200D”).chars
08:27 camelia rakudo-moar 9c0d40: OUTPUT: «5?»
08:27 AlexDaniel m: say (“\x2695\xFE0Fa\x1F468\x200D” x 2).chars
08:27 camelia rakudo-moar 9c0d40: OUTPUT: «6?»
08:27 AlexDaniel this does not look right, right?
08:28 AlexDaniel what we have here is “man health worker” ZWJ sequence composed when two strings are concatenated
08:28 AlexDaniel and “a” character there for fun
08:28 AlexDaniel for clarity rather
08:29 AlexDaniel so it's “[second half of emoji]a[first half]” x 2
08:30 AlexDaniel and so “[second half]a[first half][second half]a[first half]” vs “[second half]a[emoji]a[first half]”, right?
08:30 AlexDaniel samcv: do you know anything about this ?? Or am I understand something incorrectly here?
08:31 AlexDaniel like, maybe we already have a ticket for this
08:33 AlexDaniel c: 2017.06,2017.07,HEAD my $x = “\x2695\xFE0Fa\x1F468\x200D”; say ($x ~ $x).chars; say ($x x 2).chars
08:33 committable6 AlexDaniel, ¦2017.06: «6?6» ¦2017.07,HEAD(9c0d40a): «5?6»
08:34 AlexDaniel ah, correct ZWJ behavior seems to be rather new, so yeah
08:34 AlexDaniel j: my $x = “\x2695\xFE0Fa\x1F468\x200D”; say ($x ~ $x).chars; say ($x x 2).chars
08:34 camelia rakudo-jvm 9c0d40: OUTPUT: «java.nio.file.NoSuchFileException: /nqp/lib/Perl6/BOOTSTRAP.jar?  in <anon> (gen/jvm/ModuleLoader.nqp:92)?  in load_module (gen/jvm/ModuleLoader.nqp:79)?  in <anon> (gen/jvm/CORE.setting)?  in <anon> (gen/jvm/ModuleLoader.nqp:257)?  in load_sett…»
08:34 AlexDaniel samcv: do I need to submit a ticket for this?
08:39 AlexDaniel m: my $x = “\x[2695]\x[FE0F]a\x[1F468]\x[200D]”; say ($x ~ $x).chars; say ($x x 2).chars
08:39 camelia rakudo-moar 9c0d40: OUTPUT: «5?6?»
08:40 AlexDaniel hm, this should be well-known because it's also broken for combining characters
08:41 brrt joined #perl6-dev
08:41 AlexDaniel like
08:41 AlexDaniel m: my $x = “\x[0305]a”; say ($x ~ $x).chars; say ($x x 2).chars
08:41 camelia rakudo-moar 9c0d40: OUTPUT: «3?4?»
08:47 brrt left #perl6-dev
08:49 Geth ¦ rakudo/nom: 1d06770ba2 | (Elizabeth Mattijsen)++ | 2 files
08:49 Geth ¦ rakudo/nom: Revert "Revert "Make R:I:ReifiedArray take the descriptor seperately""
08:49 Geth ¦ rakudo/nom:
08:49 Geth ¦ rakudo/nom: This reverts commit 640641876c713aaa52c3c1147d63b83ebdd0f467.
08:49 Geth ¦ rakudo/nom:
08:49 Geth ¦ rakudo/nom: Actually, we *do* need to make Array.Slip return containers.  So we
08:49 Geth ¦ rakudo/nom: *do* need ReifiedArray to take the descriptor seperately.
08:49 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/1d06770ba2
08:53 Geth ¦ rakudo/nom: 50d38a1f36 | (Elizabeth Mattijsen)++ | src/Perl6/Actions.nqp
08:53 Geth ¦ rakudo/nom: Revert "begin_time_lexical_fixup for constants"
08:53 Geth ¦ rakudo/nom:
08:53 Geth ¦ rakudo/nom: This reverts commit 15debeecdeff48d70951081676ef270115795930.
08:53 Geth ¦ rakudo/nom:
08:53 Geth ¦ rakudo/nom: Until this no longer breaks Inline::Perl5, it feels safe to revert
08:53 Geth ¦ rakudo/nom: this for the time being.
08:53 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/50d38a1f36
08:54 lizmat .tell nine this unbroke Inline::Perl5 for me https://github.com/rakudo/rakudo/commit/50d38a1f36
08:54 yoleaux lizmat: I'll pass your message to nine.
08:59 robertle joined #perl6-dev
09:13 |Tux| This is Rakudo version 2017.07-73-g50d38a1f3 built on MoarVM version 2017.07-15-g0729f841
09:13 |Tux| csv-ip5xs        2.474
09:13 |Tux| test            12.129
09:13 |Tux| test-t           4.025 - 4.042
09:13 |Tux| csv-parser      11.690
09:13 |Tux| as you can see, that indeed restored Inline::Perl5 functionality
09:14 |Tux| Error encoding UTF-8 string: could not encode codepoint 1903979 (0x1D0D6B), codepoint out of bounds. Cannot encode higher than 1114111 (0x10FFFF)
09:15 |Tux| samcv, do you want me to test that daily?
09:21 evalable6 joined #perl6-dev
09:21 samcv the UTF-8 thing? uh. jnthn is a better person to ask on that one
09:24 bisectable6 joined #perl6-dev
09:24 unicodable6 joined #perl6-dev
09:28 camelia joined #perl6-dev
09:31 travis-ci joined #perl6-dev
09:31 travis-ci Rakudo build failed. Elizabeth Mattijsen 'Revert "Revert "Make R:I:ReifiedArray take the descriptor seperately""
09:31 travis-ci https://travis-ci.org/rakudo/rakudo/builds/257636788 https://github.com/rakudo/rakudo/compare/9c0d40aba093...1d06770ba2a2
09:31 travis-ci left #perl6-dev
09:31 buggable [travis build above] ? All failures are due to timeout (0), missing build log (0), GitHub connectivity (0), or failed make test (1). Across all jobs, only t/04-nativecall/21-callback-other-thread.t test file failed.
10:11 AlexDani` joined #perl6-dev
10:36 AlexDaniel anyway, I submitted it as RT #131801
10:36 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=131801
10:46 Geth ¦ rakudo/nom: ccaa0665ad | (Elizabeth Mattijsen)++ | src/core/Array.pm
10:46 Geth ¦ rakudo/nom: Fix all issues with nulls in slipped Arrays
10:46 Geth ¦ rakudo/nom:
10:46 Geth ¦ rakudo/nom: - we should return containers, not just values, because params can be rw
10:46 Geth ¦ rakudo/nom: - the special case of |@a in parameters, now also fixed
10:46 Geth ¦ rakudo/nom:   This uses FLATTENABLE_LIST, which predates the GLR.  Rather than
10:46 Geth ¦ rakudo/nom:   investigating whether we could get rid of that in favour of a more
10:46 Geth ¦ rakudo/nom:   general Slippy solution, I opted for making Array.FLATTENABLE_LIST
10:46 Geth ¦ rakudo/nom:   just work, at least for now.
10:46 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ccaa0665ad
10:51 lizmat m: my @a is default(42); @a[2] = 1; sub a(\a,\b,\c) { a = 666; dd b }; a |@a; dd @a
10:51 camelia rakudo-moar 50d38a: OUTPUT: «Type check failed in binding to parameter 'a'; expected Any but got Mu (Mu)?  in sub a at <tmp> line 1?  in block <unit> at <tmp> line 1??»
10:51 lizmat should give: Int @a = 42, Array @a = [666, 42, 1] after this commit
10:53 AlexDaniel e: my @a is default(42); @a[2] = 1; sub a(\a,\b,\c) { a = 666; dd b }; a |@a; dd @a
10:53 evalable6 AlexDaniel, rakudo-moar ccaa0665a: OUTPUT: «Int @a = 42?Array @a = [666, 42, 1]»
10:56 lizmat wee!  :-)
10:57 ZofBot joined #perl6-dev
11:11 Geth ¦ rakudo/nom: e0d108bfc8 | (Elizabeth Mattijsen)++ | src/core/Rakudo/Iterator.pm
11:11 Geth ¦ rakudo/nom: Retire R:I.ReifiedListWithDefault
11:11 Geth ¦ rakudo/nom:
11:11 Geth ¦ rakudo/nom: - we don't need it anymore
11:11 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e0d108bfc8
12:01 dogbert17 spectest failure in t/spec/S04-declarations/constant.t
12:06 * lizmat reverted the PR for those tests
12:07 lizmat but Geth seems not well
12:07 lizmat perhaps because it is Geth_ now ?
12:07 timotimo we have both
12:11 lizmat ah, but Geth doesn't seem to have any special status atm
12:12 lizmat fwiw, /me just pushed https://github.com/rakudo/rakudo/commit/8f73d77b0361f7522aa50d
12:15 timotimo geth just reported commits i made in moarvm, just a minute late
12:28 nine Could be that geth is a little resource starved right now. We had some serious issues at work right in the morning, so of course the file system on my desktop decided to have some issues. Could fix them but a couple minutes later, the whole system crashed and the file system was broken beyond repair.
12:28 yoleaux 08:54Z <lizmat> nine: this unbroke Inline::Perl5 for me https://github.com/rakudo/rakudo/commit/50d38a1f36
12:29 nine So, I had to restore from the week old backup. Not great, but ok. But of course the file system where the backup is on threw some errors at me, too.
12:29 nine So now I'm restoring from the offsite backup which is on the server camelia and geth are on. I'm compressing the data with xz -9 -e to speed up the transfer and using -T0 so xz will gobble 10 Gigs of RAM and all the CPU it can get to speed up compression
12:32 AlexDaniel m: say 42
12:32 camelia rakudo-moar : OUTPUT: «Cannot allocate memory»
12:32 nine And camelia's rebuild eats some resource, too
12:32 AlexDaniel ah, that's why camelia was a bit sl…
12:32 AlexDaniel m: say 42
12:32 camelia rakudo-moar : OUTPUT: «Cannot allocate memory»
12:33 nine camelia is building both MoarVM and JVM backends at the same time right now
12:34 AlexDaniel nine: well, evalable6 automatically answers m: messages if camelia is not on the channel, so in some cases it may be better to have no camelia on the channel than broken camelia online :)
12:34 AlexDaniel but this of course depends on how long this is going to last
12:35 nine m: say 42
12:35 camelia rakudo-moar 8f73d7: OUTPUT: «42?»
12:35 nine already over
12:35 AlexDaniel \o/
12:37 Geth joined #perl6-dev
12:37 nine Apparently geth just doesn't notice when it lost the IRC connection
12:38 AlexDaniel oh, yea, quite possible
12:52 lucasb joined #perl6-dev
13:19 Geth ¦ perl6-lwp-simple: 1feee277cc | (Zoffix Znet)++ (committed using GitHub Web editor) | lib/LWP/Simple.pm
13:19 Geth ¦ perl6-lwp-simple: Update version in sauce
13:19 Geth ¦ perl6-lwp-simple:
13:19 Geth ¦ perl6-lwp-simple: Fixes  #18
13:19 Geth ¦ perl6-lwp-simple: review: https://github.com/perl6/perl6-lwp-simple/commit/1feee277cc
13:19 Geth ¦ perl6-lwp-simple: 0fb0ad116c | (Zoffix Znet)++ (committed using GitHub Web editor) | META6.json
13:19 Geth ¦ perl6-lwp-simple: Bump version
13:19 Geth ¦ perl6-lwp-simple: review: https://github.com/perl6/perl6-lwp-simple/commit/0fb0ad116c
13:59 Geth ¦ rakudo/nom: 5d89cef9f5 | (Elizabeth Mattijsen)++ | 4 files
13:59 Geth ¦ rakudo/nom: Simplify the .Seq coercer, because we can
13:59 Geth ¦ rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5d89cef9f5
14:03 AlexDaniel joined #perl6-dev
14:57 astj joined #perl6-dev
15:32 nebuchadnezzar joined #perl6-dev
15:45 ugexe is there any way to use a hash in a thread-safe manor that does not require locking it on reads (only writes)? it would be nice if something like Lock.new.protect({}) had something that allowed shared access to a specific block only
15:52 nine ugexe: sorry for lack of any more reaction to your pull requests. I got bogged down by work
15:54 ugexe no hurry, i'm still feeling the bigger one out
15:54 japhb samcv: What I meant by my late-night question is that I'm looking for *total* width of the string as it would appear in a monospace but Unicode-correct font.  For your blah<penguin> example, I'm looking for the answer 6, since the penguin is wide and would take up two cells.
15:56 japhb And I'm looking to do that operation very quickly, since I need to do it a LOT for word wrapping and terminal UI layout -- the former working with "words" of non-whitespace, the latter needing to know how far to advance the cursor after every single character.
15:56 ugexe m: my %c; my $lock = Lock.new; sub foo($a) { $lock.protect({ return %c{$a} if %c{$a}:exists }); $lock.protect({ return %c{$a} += 1 }); }; await Promise.allof((^10).map: { start { say foo("xxx"); say foo("xxx") } })
15:56 camelia rakudo-moar 5d89ce: OUTPUT: «1?1?1?1?1?1?1?1?1?1?1?1?1?1?1?1?1?1?1?1?»
15:57 ugexe if i run that a few times sometimes it has 1 *and* 2s
15:57 ugexe shouldnt it always be 1?
16:01 Zoffix It is, if you merge the two .protects.
16:01 jnthn Why should it?
16:01 jnthn Two or more threads can both see it doesn't exist, then they re-complete for the lock after
16:01 jnthn *compete
16:03 jnthn In fact that's highly likely to happen, in that if two threads queue for the lock to check if it exists, the second in the queue will probably out of fairness get it before the first gets it again
16:03 ugexe so to do this without locking any code that may exist between the two protects it should use `%c{$a} //= %c{$a} + 1` ?
16:04 jnthn You can't rely on a situation you checked under lock still being true after you release the lock
16:04 jnthn And various other permutations
16:04 jnthn So yeah, you'd have to re-check after
16:04 ugexe https://github.com/rakudo/rakudo/blob/nom/src/core/CompUnit/PrecompilationRepository.pm#L184
16:05 ugexe + L196
16:05 Zoffix hehe
16:05 ugexe that could be fine, its just where i picked up the idea
16:07 jnthn It depends if anything will be upset if the work is done twice
16:07 jnthn And if the results produced each time will be equivalent
16:08 ugexe but there is no issue where it could be trying to read and write that has at the same time such that the data read would not match the state before *or* after the write finishes?
16:09 ugexe wow that came out weird
16:09 jnthn I..uh...parse fail... :P
16:10 jnthn The only thing you can be sure about is that only one thing can hold the lock at a time
16:10 ugexe if %c{$a} == 1, and then %c{$a}++, is it possible that reading %c{$a} could see neither 1 nor 2? in my concurrency book this was more clear with an illustration...
16:10 jnthn And that your own lock/unlock will run in order, of course
16:11 jnthn Presuming that you do them in two separate protects?
16:11 ugexe correct
16:11 jnthn I figure it could be N in that N is the number of threads
16:12 jnthn Imagine that all the threads enter the sub and all request the lock. They are give it in order. They all see it's == 1 so don't return.
16:12 jnthn Each one after it has released the lock will then join the queue (at the back) for having it again
16:13 jnthn Then they all would run %c{$a}++ when they get the lock
16:13 ugexe er im not explaining it properly... probably thinking too low level that this isnt an issue. pretend %c{$a} = 1 starts writing some huge amount of data to the variable while at the same time a read of %c{$a} occurs. does it see this half-written data, the original value, or the final value that is being written
16:15 jnthn If they can happen at the same time, then there's no locking?
16:15 nine ugexe: PrecompilationRepository gets away with that because loading a precomp file twice won't be an issue. It just a bit of wasted effort.
16:16 jnthn Or are you saying if one thing does $lock.protect: { ...loads of changes on %c.. } and another does $lock.protect: { ...reads %c... }, can the second ever see an incomplete state?
16:16 ugexe jnthn: yeah that
16:16 jnthn In which case, no, the lock/unlock imply memory barriers
16:16 jnthn Which force consistency between CPU caches
16:16 ugexe ah
16:17 jnthn You can get into lots of trouble like this in lock-free algos, when compilers/CPUs re-order instructions.
16:17 jnthn But locks barrier, otherwise things would be a lot too surprising :)
16:18 jnthn (Also the lock data structure itself needs the barrier.)
16:24 ugexe m: my %c; %c<x> = sub foo(|) { 1 }; sub bar(|) { 2 }; cas(%c<x>, &bar); say %c<x>; # comedy option
16:24 camelia rakudo-moar 5d89ce: OUTPUT: «2?»
16:26 robertle joined #perl6-dev
16:31 Zoffix cas ticket: https://rt.perl.org/Ticket/Display.html?id=130417#ticket-history
16:59 Ven joined #perl6-dev
17:01 Geth ¦ rakudo/moar-frame-extras: 4561c2696c | (Jonathan Worthington)++ | 2 files
17:01 Geth ¦ rakudo/moar-frame-extras: Follow MoarVM frame changes.
17:01 Geth ¦ rakudo/moar-frame-extras: review: https://github.com/rakudo/rakudo/commit/4561c2696c
17:22 Ven joined #perl6-dev
18:06 AlexDaniel toolforger++ not all hope is lost :)
18:19 FROGGS joined #perl6-dev
19:01 nine WTF? Now that I've restored my system from the slow offsite backup via internet, my local backup file system suddenly decided to be perfectly fine?!
19:38 Geth ¦ roast: 8d3ebb42b4 | (David Warring)++ | S03-operators/buf.t
19:38 Geth ¦ roast: add a Buf subbuf-rw fetch test
19:38 Geth ¦ roast: review: https://github.com/perl6/roast/commit/8d3ebb42b4
21:50 pharv_ joined #perl6-dev
22:46 AlexDani` joined #perl6-dev
23:29 Zoffix dogbert17: Prey sucks :(
23:31 Zoffix Just got stuck at the very beginning; couldn't find where to go. Then rage quitted
23:31 Zoffix too late to refund or I would've
23:34 * Zoffix tries to get one anyway
23:51 llfourn lizmat: thanks for noticing my commit broke ip5. I didn't have ip5 installed where I was running spectests :\
23:59 sivoais joined #perl6-dev

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