Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2017-03-11

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

All times shown according to UTC.

Time Nick Message
00:40 Ven joined #moarvm
02:25 Ven joined #moarvm
02:49 ilbot3 joined #moarvm
02:49 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
03:32 zakharyas joined #moarvm
03:57 Ven joined #moarvm
04:41 Ven joined #moarvm
05:25 Ven joined #moarvm
08:26 Ven joined #moarvm
08:42 Ven joined #moarvm
09:18 samcv jnthn, i think we need an indexic some way to index a string case insensitively
09:18 samcv not totally sure how it does it now but i'm pretty sure it uses index with uc and lc things? not 100% sure
09:27 Ven joined #moarvm
09:42 Ven joined #moarvm
10:41 IRCFrEAK joined #moarvm
10:45 IRCFrEAK joined #moarvm
11:02 Ven joined #moarvm
11:10 domidumont joined #moarvm
11:18 jnthn samcv: Not sure off hand either, but sounds like something we'd reasonably want, yeah
11:18 samcv yeah
11:18 jnthn Particularly if we implement optimized /:i foo/ where we just scan for foo
11:18 samcv was suprised it didn't exist
11:18 samcv and it seems to search really oddly now or something
11:19 samcv https://github.com/perl6/nqp/blob/master/src/QRegex/NFA.nqp#L252-L258 like this, and then uh. not sure what happens after this
11:19 samcv but am i right it's having uppercase and lowercase alternates
11:19 samcv and does it run index for all alternates? how do we even implement character clases?
11:20 domidumont joined #moarvm
11:22 Ven joined #moarvm
11:25 jnthn Declarative regex constructs are both compiled into VM ops and have an NFA produced which is evaluated by MVM_nfa_run or some such
11:25 jnthn The NFA being used for LTM purposes
11:26 samcv LTM?
11:26 jnthn And yeah, the code you linked is presuming that for x..y, lc(x)..lc(y) and uc(x)..uc(y) will be sensible ranges
11:26 jnthn Longest Token Matching
11:26 samcv oh yes
11:26 samcv yeah. i thought that looked uh. kind of ugly
11:26 samcv and they could be totally off
11:27 samcv and include loads of unwanted characters
11:27 jnthn Perhaps, do you have a concrete case where they are? :)
11:27 jnthn I can totally believe they exist, just didn't see one
11:27 samcv yeah
11:27 jnthn Oh, also
11:27 jnthn The thing you're looking at is the NFA compiler
11:27 jnthn Not the regex compiler
11:27 jnthn So this is the part making the NFA
11:28 samcv m: say abs('a'.uc - 'a'.lc)
11:28 camelia rakudo-moar f190f2: OUTPUT: «Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏A' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
11:28 samcv m: say abs('a'.uc.ord - 'a'.lc.ord)
11:28 camelia rakudo-moar f190f2: OUTPUT: «32␤»
11:28 samcv yeah i get that part jnthn
11:29 jnthn But char classes turn into various node types depending what is in them
11:29 jnthn So <[abc]> becomes iirc an enumcharlist
11:29 samcv kk
11:29 jnthn While <[a..z]> becomes a charrange
11:29 jnthn And <[a..z-_]> would iirc become an alt on a charrange and an enumcharlist
11:30 jnthn *of a
11:30 jnthn --target=ast will reveal all
11:31 jnthn But yeah, for :i <[a..z]> then it's producing the equivalent of <[a..z]> | <[A..Z]>
11:31 jnthn Which is obviusly correct for this case :)
11:31 jnthn But foo..bar where lc(foo)..lc(bar) and uc(foo)..uc(bar) don't make sense would be an issue
11:32 jnthn (We don't end up with a..A)
11:32 jnthn (or z..A)
11:32 samcv yeah gotta see if there's any cases where it could screw things up
11:34 samcv m: 'a'.ord.uc.say
11:34 camelia rakudo-moar f190f2: OUTPUT: «97␤»
11:34 samcv that. is wrong
11:34 samcv m: 'a'.ord.uc.WHAT.say
11:34 camelia rakudo-moar f190f2: OUTPUT: «(Str)␤»
11:34 samcv hmm oh i guess. i can see why that happens
11:34 samcv cause Cool
11:35 jnthn aye
11:36 jnthn Though then the interesting question becomes what alternatives we have :)
11:36 samcv jnthn, ok i'm finding loads that span at least 100
11:37 samcv jnthn, see #perl6dev
11:37 jnthn I can't understand what you're checking there?
11:38 samcv things with over 100 cp different between uppercase and lotwercase
11:38 samcv is this a problem? idk. maybe not a problem
11:38 samcv i have not decided
11:38 jnthn I don't know that's a problem per se
11:39 samcv i mean is that what the programmer expects? maybe
11:39 jnthn I think the problem is more like, what happens if we have foo..bar and uc(foo)..uc(bar) or lc(foo)..lc(bar) don't form valid ranges
11:39 samcv would be interested. cause they have to start with a lower cp right
11:40 jnthn Or more practically, do their exist alphabets in Unicode where if I wrote the equivalent of A..Z, then uc(A)..uc(Z) and lc(A)..lc(Z) are something crazy
11:41 samcv ok there's a lot
11:41 samcv like 'µ'
11:41 jnthn But yeah, the trouble I guess is that .. is defiend in terms of a codepoint range, when what in many cases people *mean* is "the lowercase letters of script X"
11:41 samcv 200 codpoints
11:41 samcv yeah that seems more useful
11:42 Ven joined #moarvm
11:42 jnthn And I think we give them a way to write such things?
11:43 jnthn I guess char ranges to specify alphabets kinda come from an over-simplified view of the world that worked in ASCII :)
11:44 samcv heh
11:48 jnthn I do seriously wonder what, if anything, we can do about it, though.
11:48 jnthn I mean, I don't know we can reasonably infer alphabets that people meant...
11:48 samcv of course not
11:48 jnthn And it's not clear there's a fc-based solution
11:48 jnthn Though maybe there is :)
11:49 samcv possible
11:49 jnthn Though given fc can produce multiple codepoints that would also become very...interesting.
11:49 samcv yeah
11:49 jnthn Oh, this bring up that classic German sharp s in a case-insensitive regex, don't it... o.O
11:49 samcv maybe best to just leave it as
11:50 jnthn Maybe, though if there is an obviously right-in-more-cases answer that isn't nuts to implement/explain then I'm good with that also :)
11:51 samcv yea. there are more important things though. like case insensitive index or something
11:52 samcv also NFA and some of the grammar stuff is pretty complex. i wish i magically understood it all
11:55 jnthn Yeah, that was one of the areas of Rakudo that took me longest to get into
11:56 dogbert17 m: say expmod(1, -1, 1)
11:56 camelia rakudo-moar f190f2: OUTPUT: «(timeout)»
11:57 jnthn Hm, thought that got fixed yesterday...
11:57 dogbert17 well it works locally
11:57 dogbert17 m: say 'Hi'
11:57 camelia rakudo-moar f190f2: OUTPUT: «Hi␤»
11:58 dogbert17 locally I have 'This is Rakudo version 2017.02-232-g1e246665c built on MoarVM version 2017.02-38-g58457845'
11:59 jnthn Oh, maybe the bot got stuck 'cus of the recent submodule switcheroo
11:59 samcv yeah i think it did
12:00 samcv i think people who don't have seperate dinrectiories for moarvm and nqp and rakudo are getting it
12:00 jnthn I forget who runs camelia
12:00 dogbert17 .botsnack
12:00 yoleaux2 :D
12:00 synopsebot6 om nom nom
12:01 dogbert17 moritz?
12:01 jnthn Or maybe nine
12:01 Ven joined #moarvm
12:02 dogbert17 does any of you have a recent perl on your local machines
12:03 samcv me
12:03 dogbert17 if so could you try this: 'say expmod(3, -1, 3)'
12:03 samcv perl5?
12:03 dogbert17 perl6 :)
12:03 samcv ok
12:03 samcv i have both
12:03 samcv uh oh
12:04 samcv it just. doesn't do anything
12:04 samcv and hangs sorta
12:04 dogbert17 yeah, it seems as if https://github.com/libtom/libtommath/issues/67 is inclomplete
12:05 samcv what version are we using for moarvm?
12:05 dogbert17 'expmod(1, -1, 1)' works
12:05 samcv i have 1.0 installed on my computer and i think i'm using the local version
12:07 samcv let me try with the moarvm provided libs
12:07 dogbert17 cool
12:08 samcv uhm still hanging
12:09 dogbert17 expmod(3, -1, 3)  ?
12:10 samcv hold on i purged libtommath folder and then had it pull it in again just to double check
12:10 samcv yeah still hang
12:11 dogbert17 expmod(1, -1, 1) should work though
12:11 samcv yeah that works
12:11 samcv was it broken before?
12:11 dogbert17 yes
12:13 MasterDuke i get the same thing, works with 1, hangs with 3
12:13 dogbert17 the libtommatch patch above only seem to fix the case when the last parameter to p6 expmod is 1
12:19 * dogbert17 wonders if it's time to look at some C code
12:21 Ven joined #moarvm
12:42 Ven joined #moarvm
13:01 Ven joined #moarvm
13:21 Ven joined #moarvm
13:36 moritz I'm cleaning out some stuff now and triggering a rebuild of rakudo-moar for camelia
13:41 moritz m: say 42
13:41 camelia rakudo-moar 1e2466: OUTPUT: «42␤»
13:41 Ven joined #moarvm
14:01 Ven joined #moarvm
14:21 Ven joined #moarvm
14:38 agentzh joined #moarvm
14:41 Ven joined #moarvm
15:01 Ven joined #moarvm
15:21 Ven joined #moarvm
15:30 dogbert17 m: say expmod(1, -1, 1)
15:30 camelia rakudo-moar 1e2466: OUTPUT: «0␤»
15:31 dogbert17 cool
15:31 dogbert17 m: say expmod(42, -1, 7)
15:31 camelia rakudo-moar 1e2466: OUTPUT: «(timeout)»
15:41 Ven joined #moarvm
15:44 timotimo i'm wondering what i'd best change about the gdb plugin to make it less unbearably slow
15:44 timotimo because ... god damn, it's so fucking slow
15:48 timotimo probably ought to profile it
15:49 timotimo and figure out the exact semantics of running C code from the target binary while the whole thing is stopped
15:49 timotimo maybe introduce a few helper functions in moar that do all their stuff on the stack rather than touching global program state like malloc would
15:50 dogbert17 sounds cool
15:50 timotimo oh, if you're into that kind of stuff, you could do it instead of me :D :D
15:51 dogbert17 ha :) trying to look into libtommath atm ...
15:52 * dogbert17 which might turn out to be a fiasco, we'll see
15:52 timotimo oh, that's brave
15:52 timotimo well, at least all the big int algorithms are described in perhaps excruciating detail in many many papers from the early 80s
15:53 MasterDuke some of you people better versed in C and signed vs unsigned number representations might have better luck than me with https://github.com/MoarVM/MoarVM/issues/513
15:54 dogbert17 one way to fix our problem is to always use 'mp_invmod_slow'. The name however makes me suspect we'll suffer a performance loss by doing so
15:54 timotimo um
15:54 timotimo are you trying to fix the bug that's already fixed?
15:55 timotimo or is the fix i committed somehow not good enough?
15:55 dogbert17 m: say expmod(42, -1, 7)
15:55 camelia rakudo-moar 28a48e: OUTPUT: «(timeout)»
15:55 dogbert17 it's good but there are some cases it does not catch
15:55 timotimo oh
15:57 dogbert17 seems to me that if the second param is negative, the third odd and at the same time evenly divisable with the first the call will habn
15:57 dogbert17 s/habn/hang/
15:59 dogbert17 so expmod(42, -1, 5) will work but expmod(42, -1, 7) or expmod(42, -1, 21) or expmod(42, -1, 3) will not
16:01 timotimo now to have some fun trying to make gdb auto load my gdb-python-script ...
16:02 Ven joined #moarvm
16:02 dogbert17 m: say say 42 <</>> (3,5,7,21)
16:02 camelia rakudo-moar 28a48e: OUTPUT: «(14 8.4 6 2)␤True␤»
16:04 timotimo ugh, i remember now why gdb's python support is so utterly atrocious
16:06 timotimo it won't give you tracebacks or anything like that when you get an exception inside your script
16:06 timotimo set python print-stack
16:06 timotimo By default, GDB will print only the message component of a Python exception when an error occurs in a Python script. This can be controlled using set python print-stack: if full, then full Python stack printing is enabled; if none, then Python stack and message printing is disabled; if message, the default, only the message component of the error is printed.
16:06 timotimo jesus thank god holy fuck why is this not the default
17:11 agentzh joined #moarvm
18:02 agentzh joined #moarvm
20:08 Ven joined #moarvm
21:07 Ven joined #moarvm
21:09 Ven joined #moarvm
22:54 agentzh joined #moarvm

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