Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2014-03-03

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

All times shown according to UTC.

Time Nick Message
00:19 diakopter left #moarvm
01:31 colomon joined #moarvm
02:14 JimmyZ joined #moarvm
04:09 jnap joined #moarvm
05:07 dalek MoarVM: 26e596f | larry++ | src/strings/ops.c:
05:07 dalek MoarVM: only fetch char once for built-in cclasses
05:07 dalek MoarVM:
05:07 dalek MoarVM: Many of the cases fell through and refetched the character at an
05:07 dalek MoarVM: offset into the string.  (Worst case, \w would do 7 fetches and 6
05:07 dalek MoarVM: table lookups on any CJK character!) Now we just fetch once into the
05:07 dalek MoarVM: cp var, and call the property lookup function directly.  (Having cp
05:07 dalek MoarVM: handy also allows us to short-circuit the ASCII lookups and avoid
05:07 dalek MoarVM: the Unicode tables entirely in the common case.)
05:07 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/26e596f1f0
05:09 jnap joined #moarvm
05:15 TimToady that last change actually makes the spectest run slightly faster, seems
05:45 dalek MoarVM: a4a76ed | larry++ | src/strings/ops.c:
05:45 dalek MoarVM: check Lo before Ll, Lu, Lt, and Lm
05:45 dalek MoarVM:
05:45 dalek MoarVM: (We already handle ASCII separately, and there are a lot of CJK chars.)
05:45 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/a4a76edd70
05:46 TimToady we really oughta just be able to check L, but that doesn't work for some reason
05:48 JimmyZ TimToady++
05:49 TimToady figured you might like that one :)
05:49 JimmyZ yeah
05:50 TimToady there are a lot of CJK characters, and a lot of Chinese characters like you :)
05:52 JimmyZ In php, I use https://github.com/moriyoshi/libmbfl
05:52 JimmyZ :P
05:53 JimmyZ s/I/we/
06:08 dalek MoarVM: bc6cd39 | larry++ | src/strings/unicode_ops.c:
06:08 dalek MoarVM: add routine to get non-boolean uniprops
06:08 dalek MoarVM:
06:08 dalek MoarVM: (No idea how to hook this in yet, but it'd be nice to be able to look
06:08 dalek MoarVM: up the numeric value of a character, for instance.)
06:08 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/bc6cd39690
06:09 TimToady need a way to look up names too
06:22 TimToady prolly shoulda put that into a branch, oh well
06:57 dalek MoarVM: 8c10875 | larry++ | src/strings/unicode_ops.c:
06:57 dalek MoarVM: service function to fetch character name
06:57 dalek MoarVM:
06:57 dalek MoarVM: (Nobody calls it yet, so no severe need for a branch.  What, me lazy?)
06:57 dalek MoarVM: Also, delete dup of previous function I should've put in a branch.  :)
06:57 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/8c10875102
06:59 TimToady I guess there wasn't a dup, so never mind that line...
07:22 TimToady I don't suppose there's a howto on adding opcodes, or more importantly, a hownotto...
07:29 TimToady I guess the most important rule is "Don't make jnthn cry." :)
07:50 moritz the most important rule is "don't cause an op renumbering", 'cause that requires a rebootstrap
07:53 TimToady what about renaming an existing op without renumbering?  hasuniprop should really be named getuniprop, because the binary properties automatically return 0 or 1, but generalizing it to getuniprop can return things like numeric value as well
07:55 TimToady actually, I take that back--obviously something in the spectests is assuming that will return only 0 or 1 :)
07:58 TimToady I'd need a new opcode for the char name anyway
07:59 FROGGS joined #moarvm
08:35 FROGGS TimToady: renaming should be okay, because the compiled stage0 in nqp does not know about the op names
08:36 FROGGS and in theory you can renumber all ops that were added after the last time somebody made a fresh stage0
08:36 FROGGS and you can renumber ops that are not used by stage0 obviously
08:36 FROGGS but I think there is no need to reorder anything
09:12 jnthn oplist has a rules list at the top :)
09:12 nwc10 presumably if the spectest is relying on something, it's always possible to move the goalposts, er, change the spec
09:15 jnthn But adding an op is really just editing that file, running perl6 tools/update_ops.p6 or so, and then adding it in the right place in interp.c.
09:15 jnthn (the first just updates the auto-gen'd, too-boring-to-do-by-hand, op metadata)
09:19 jnthn bbl &
09:51 timotimo good catch for the unicode improvements!
10:13 odc joined #moarvm
12:21 JimmyZ Good evening
12:24 colomon joined #moarvm
12:28 FROGGS hi JimmyZ
12:41 JimmyZ Hello FROGGS
12:44 masak 你好JimmyZ
13:04 JimmyZ 下午好 麦高
13:06 masak :)
13:06 masak JimmyZ: 其实,我的妻子刚刚叫我“卡尔”。
13:07 masak 很容易。
13:39 TimToady joined #moarvm
13:57 camelia joined #moarvm
14:08 colomon joined #moarvm
14:34 JimmyZ 卡尔,晚上好
14:36 JimmyZ oh there is  masak-masak game
15:24 masak yep.
15:24 masak unless that's all blog spammers.
17:41 TimToady okay, so now I've gotta figure out how to call my spiffy new opcodes from nqp and/or perl6-m
17:41 TimToady any hints?
17:42 TimToady doubtless this has been explained here on this channel to other people before, but I confess I tuned that part out :)
17:42 * TimToady goes to search the logs
17:44 timotimo so you added it to the interp.c?
17:44 TimToady yes, and it compiles
17:44 timotimo you'll have to find MASTOperations.nqp or something similar
17:45 timotimo nqp/src/vm/moar/QAST/QASTOperationsMAST.nqp
17:45 TimToady I've been looking at that file and wondering how much I can cargo cult
17:45 timotimo the mapping of "nqp::function" to "moarvm bytecode" is there
17:45 timotimo i've cargo culted most of it so far :P
17:45 timotimo but by now i'm able to explain things
17:45 TimToady do I have to register the nqp names someplace else?
17:46 timotimo i don't think so
17:46 TimToady okay, then I can probably figure it out :)
17:46 TimToady thanks
18:01 TimToady > say nqp::getuniname(0x1f4a9)
18:01 TimToady PILE OF POO
18:01 TimToady \o/
18:01 TimToady > say nqp::getuniname(0x4e05)
18:01 TimToady Segmentation fault
18:02 TimToady /o\
18:02 TimToady is probably null, needs to return name at beginning of span, '<CJK UNIFIED IDEOGRAPH>' in this case
18:04 TimToady a pity that C doesn't seem to like an initializer that shares constant strings amoung different entries
18:08 TimToady actually, the real spans are fine, it's just the ones that are faked with NULL pointers
18:09 TimToady how to get those to share the constant strings...
18:10 TimToady it's not like initializers in C are executable code...
18:12 tgt joined #moarvm
18:13 TimToady or is the C compiler smart enough to consolidate idential constant strings?
18:14 TimToady *tical
18:17 TimToady no, it is not--at least mine isn't
18:21 TimToady grr, src/strings/unicode.c:14520:14: error: initializer element is not constant
18:21 TimToady src/strings/unicode.c:14520:14: error: (near initialization for ‘codepoint_names[13401]’)
18:22 TimToady despite having declared it as const char *cjk = "<CJK IDEOGRAPH>";
18:23 TimToady const char const *cjk doesn't help either
18:23 timotimo could have negative numbers instead of NULL :P
18:23 TimToady I'm sure C will just love that
18:23 timotimo surely will! :)
18:24 TimToady if it wasn't going to get stuffed into a readonly segment (potentially), I could doctor the array after the facct
18:25 timotimo and you can't figure out the absolute addresses properly without doing the whole linking yourself or something like that :|
18:25 TimToady I need a try in C that will catch a SIGSEGV
18:26 timotimo and you can't do the checking yourself?
18:27 TimToady if I want to cheat and change the NULL to the earlier valid pointer, it might fail
18:27 TimToady I suppose I could take the const off the table and see what happens :)
18:27 timotimo everything will be 100x slower
18:27 TimToady yeah
18:31 TimToady well, for now I'll just assume it's an uncommon operation to look for the name of a spanned character, and just look for the previous entry somehow
18:45 TimToady and I'll throw the name into the table occasionally to prevent backscanning hundreds of entries
18:45 FROGGS joined #moarvm
18:48 FROGGS wow, what do my tired eyes read in the backlog?
18:48 FROGGS TimToady++
19:19 jnap joined #moarvm
21:26 dalek MoarVM: 54d4d4b | larry++ | / (10 files):
21:26 dalek MoarVM: introduce getuniname and getuniprop opcodes
21:26 dalek MoarVM:
21:26 dalek MoarVM: Also tweak support routines for robustness and efficiency.  In support
21:26 dalek MoarVM: of fast(ish) name lookup in spanned areas will NULL names, we introduce
21:26 dalek MoarVM: the name into the table every 25 entries maximum to avoid long backscans,
21:26 dalek MoarVM: without using up much more memory.
21:26 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/54d4d4bb1b
21:28 [Coke] are these opcodes going to be exposed to nqp?
21:30 TimToady shortly
21:30 TimToady got stuck headless, recompiling
21:30 [Coke] gentle reminder to add them to docs/*
21:41 masak not "headless"; you always have a HEAD in Git. but it can be "detached", like Nearly Headless Nick. ;)
21:42 FROGGS Sir Nickolas if you please :o)
21:43 tadzik :D
21:43 masak :P
23:24 colomon joined #moarvm
23:27 dalek joined #moarvm
23:56 tgt joined #moarvm

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