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() | 04:52 | |
lizmat | Files=1204, Tests=67328, 226 wallclock secs (13.64 usr 5.04 sys + 1383.26 cusr 140.07 csys = 1542.01 CPU) | 06:15 | |
[Tux] | 4.168. All inline perl5 still busted | 07:36 | |
must run | |||
samcv | japhb, what do you mean by that | 07:41 | |
oh | |||
m: "blah????".uniprops('East_Asian_Width').say | 07:42 | ||
camelia | (Na Na Na Na W)? | ||
samcv | so i would test for .starts-with('W') to test if it is wide | 07:43 | |
since on a future version it *could* change to saying "Wide" instead of W. just to keep it future thinking | |||
but there's Neutral, Ambiguous, Halfwidth, Wide, Fullwidth and Narrow | |||
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') | 07:44 | ||
AlexDaniel | uhhhhhhhhā¦ reading www.evanmiller.org/why-im-learning-perl-6.html I got an ideaā¦ | 08:26 | |
m: say (ā\x2695\xFE0Fa\x1F468\x200Dā ~ ā\x2695\xFE0Fa\x1F468\x200Dā).chars | 08:27 | ||
camelia | 5? | ||
AlexDaniel | m: say (ā\x2695\xFE0Fa\x1F468\x200Dā x 2).chars | ||
camelia | 6? | ||
AlexDaniel | this does not look right, right? | ||
what we have here is āman health workerā ZWJ sequence composed when two strings are concatenated | 08:28 | ||
and āaā character there for fun | |||
for clarity rather | |||
so it's ā[second half of emoji]a[first half]ā x 2 | 08:29 | ||
and so ā[second half]a[first half][second half]a[first half]ā vs ā[second half]a[emoji]a[first half]ā, right? | 08:30 | ||
samcv: do you know anything about this ?? Or am I understand something incorrectly here? | |||
like, maybe we already have a ticket for this | 08:31 | ||
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Ā» | ||
AlexDaniel | ah, correct ZWJ behavior seems to be rather new, so yeah | 08:34 | |
j: my $x = ā\x2695\xFE0Fa\x1F468\x200Dā; say ($x ~ $x).chars; say ($x x 2).chars | |||
camelia | 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ā¦ | ||
AlexDaniel | samcv: do I need to submit a ticket for this? | ||
m: my $x = ā\x[2695]\x[FE0F]a\x[1F468]\x[200D]ā; say ($x ~ $x).chars; say ($x x 2).chars | 08:39 | ||
camelia | 5?6? | ||
AlexDaniel | hm, this should be well-known because it's also broken for combining characters | 08:40 | |
like | 08:41 | ||
m: my $x = ā\x[0305]aā; say ($x ~ $x).chars; say ($x x 2).chars | |||
camelia | 3?4? | ||
Geth | rakudo/nom: 1d06770ba2 | (Elizabeth Mattijsen)++ | 2 files Revert "Revert "Make R:I:ReifiedArray take the descriptor seperately"" This reverts commit 640641876c713aaa52c3c1147d63b83ebdd0f467. Actually, we *do* need to make Array.Slip return containers. So we *do* need ReifiedArray to take the descriptor seperately. |
08:49 | |
rakudo/nom: 50d38a1f36 | (Elizabeth Mattijsen)++ | src/Perl6/Actions.nqp Revert "begin_time_lexical_fixup for constants" This reverts commit 15debeecdeff48d70951081676ef270115795930. Until this no longer breaks Inline::Perl5, it feels safe to revert this for the time being. |
08:53 | ||
lizmat | .tell nine this unbroke Inline::Perl5 for me github.com/rakudo/rakudo/commit/50d38a1f36 | 08:54 | |
yoleaux | lizmat: I'll pass your message to nine. | ||
|Tux| | This is Rakudo version 2017.07-73-g50d38a1f3 built on MoarVM version 2017.07-15-g0729f841 | 09:13 | |
csv-ip5xs 2.474 | |||
test 12.129 | |||
test-t 4.025 - 4.042 | |||
csv-parser 11.690 | |||
as you can see, that indeed restored Inline::Perl5 functionality | |||
Error encoding UTF-8 string: could not encode codepoint 1903979 (0x1D0D6B), codepoint out of bounds. Cannot encode higher than 1114111 (0x10FFFF) | 09:14 | ||
samcv, do you want me to test that daily? | 09:15 | ||
samcv | the UTF-8 thing? uh. jnthn is a better person to ask on that one | 09:21 | |
travis-ci | Rakudo build failed. Elizabeth Mattijsen 'Revert "Revert "Make R:I:ReifiedArray take the descriptor seperately"" | 09:31 | |
travis-ci.org/rakudo/rakudo/builds/257636788 github.com/rakudo/rakudo/compare/9...06770ba2a2 | |||
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. | ||
AlexDaniel | anyway, I submitted it as RT #131801 | 10:36 | |
synopsebot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=131801 | ||
Geth | rakudo/nom: ccaa0665ad | (Elizabeth Mattijsen)++ | src/core/Array.pm Fix all issues with nulls in slipped Arrays - we should return containers, not just values, because params can be rw - the special case of |@a in parameters, now also fixed This uses FLATTENABLE_LIST, which predates the GLR. Rather than investigating whether we could get rid of that in favour of a more general Slippy solution, I opted for making Array.FLATTENABLE_LIST just work, at least for now. |
10:46 | |
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 | 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?? | ||
lizmat | should give: Int @a = 42, Array @a = [666, 42, 1] after this commit | ||
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 | Int @a = 42?Array @a = [666, 42, 1] | ||
lizmat | wee! :-) | 10:56 | |
Geth | rakudo/nom: e0d108bfc8 | (Elizabeth Mattijsen)++ | src/core/Rakudo/Iterator.pm Retire R:I.ReifiedListWithDefault - we don't need it anymore |
11:11 | |
dogbert17 | spectest failure in t/spec/S04-declarations/constant.t | 12:01 | |
lizmat reverted the PR for those tests | 12:06 | ||
but Geth seems not well | 12:07 | ||
perhaps because it is Geth_ now ? | |||
timotimo | we have both | ||
lizmat | ah, but Geth doesn't seem to have any special status atm | 12:11 | |
fwiw, /me just pushed github.com/rakudo/rakudo/commit/8f...f7522aa50d | 12:12 | ||
timotimo | geth just reported commits i made in moarvm, just a minute late | 12:15 | |
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 github.com/rakudo/rakudo/commit/50d38a1f36 | ||
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 | |
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 | |||
AlexDaniel | m: say 42 | 12:32 | |
camelia | Cannot allocate memory | ||
nine | And camelia's rebuild eats some resource, too | ||
AlexDaniel | ah, that's why camelia was a bit slā¦ | ||
m: say 42 | |||
camelia | Cannot allocate memory | ||
nine | camelia is building both MoarVM and JVM backends at the same time right now | 12:33 | |
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 | |
but this of course depends on how long this is going to last | |||
nine | m: say 42 | 12:35 | |
camelia | 42? | ||
nine | already over | ||
AlexDaniel | \o/ | ||
nine | Apparently geth just doesn't notice when it lost the IRC connection | 12:37 | |
AlexDaniel | oh, yea, quite possible | 12:38 | |
Geth | perl6-lwp-simple: 1feee277cc | (Zoffix Znet)++ (committed using GitHub Web editor) | lib/LWP/Simple.pm Update version in sauce Fixes #18 |
13:19 | |
perl6-lwp-simple: 0fb0ad116c | (Zoffix Znet)++ (committed using GitHub Web editor) | META6.json Bump version |
|||
rakudo/nom: 5d89cef9f5 | (Elizabeth Mattijsen)++ | 4 files Simplify the .Seq coercer, because we can |
13:59 | ||
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:45 | |
nine | ugexe: sorry for lack of any more reaction to your pull requests. I got bogged down by work | 15:52 | |
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. | ||
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") } }) | ||
camelia | 1?1?1?1?1?1?1?1?1?1?1?1?1?1?1?1?1?1?1?1? | ||
ugexe | if i run that a few times sometimes it has 1 *and* 2s | 15:57 | |
shouldnt it always be 1? | |||
Zoffix | It is, if you merge the two .protects. | 16:01 | |
jnthn | Why should it? | ||
Two or more threads can both see it doesn't exist, then they re-complete for the lock after | |||
*compete | |||
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` ? | ||
jnthn | You can't rely on a situation you checked under lock still being true after you release the lock | 16:04 | |
And various other permutations | |||
So yeah, you'd have to re-check after | |||
ugexe | github.com/rakudo/rakudo/blob/nom/...ry.pm#L184 | ||
+ L196 | 16:05 | ||
Zoffix | hehe | ||
ugexe | that could be fine, its just where i picked up the idea | ||
jnthn | It depends if anything will be upset if the work is done twice | 16:07 | |
And if the results produced each time will be equivalent | |||
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:08 | |
wow that came out weird | 16:09 | ||
jnthn | I..uh...parse fail... :P | ||
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... | ||
jnthn | And that your own lock/unlock will run in order, of course | ||
Presuming that you do them in two separate protects? | 16:11 | ||
ugexe | correct | ||
jnthn | I figure it could be N in that N is the number of threads | ||
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 | ||
Each one after it has released the lock will then join the queue (at the back) for having it again | |||
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 | ||
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. | ||
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 | ||
jnthn | In which case, no, the lock/unlock imply memory barriers | ||
Which force consistency between CPU caches | |||
ugexe | ah | ||
jnthn | You can get into lots of trouble like this in lock-free algos, when compilers/CPUs re-order instructions. | 16:17 | |
But locks barrier, otherwise things would be a lot too surprising :) | |||
(Also the lock data structure itself needs the barrier.) | 16:18 | ||
ugexe | m: my %c; %c<x> = sub foo(|) { 1 }; sub bar(|) { 2 }; cas(%c<x>, &bar); say %c<x>; # comedy option | 16:24 | |
camelia | 2? | ||
Zoffix | cas ticket: rt.perl.org/Ticket/Display.html?id...et-history | 16:31 | |
Geth | rakudo/moar-frame-extras: 4561c2696c | (Jonathan Worthington)++ | 2 files Follow MoarVM frame changes. |
17:01 | |
AlexDaniel | toolforger++ not all hope is lost :) | 18:06 | |
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:01 | |
Geth | roast: 8d3ebb42b4 | (David Warring)++ | S03-operators/buf.t add a Buf subbuf-rw fetch test |
19:38 | |
Zoffix | dogbert17: Prey sucks :( | 23:29 | |
Just got stuck at the very beginning; couldn't find where to go. Then rage quitted | 23:31 | ||
too late to refund or I would've | |||
Zoffix tries to get one anyway | 23:34 | ||
llfourn | lizmat: thanks for noticing my commit broke ip5. I didn't have ip5 installed where I was running spectests :\ | 23:51 |