Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2014-04-03

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

All times shown according to UTC.

Time Nick Message
01:26 FROGGS_ joined #moarvm
01:32 benabik joined #moarvm
06:41 FROGGS_ joined #moarvm
07:07 hoelzro joined #moarvm
07:10 zakharyas joined #moarvm
07:16 rurban joined #moarvm
07:23 brrt joined #moarvm
09:26 FROGGS joined #moarvm
09:50 timotimo jnthn: should i add code to decrement the usage counters from the facts database to MVM_manipulate_del_ins?
09:51 timotimo and the same in reverse for insert_ins?
09:54 timotimo i think that'd be necessary to remove the wval lookup for the type we compare to in an istype
09:54 timotimo otherwise i can just manually decrement in optimize_istype
09:58 timotimo hm, will nqp::istype sometimes require the instance to be inspected rather than the type itself being enough?
09:58 timotimo i'll probably have to check what exactly the type of the to-check-against thing is and only allow "simple" things to have the specialization to be applied to them
10:05 timotimo hm, istype_cache_only unfortunately doesn't give different results for "no cache found" vs "this is definitely not of that type"
12:21 dalek MoarVM/execname: bcc2cf4 | (Tobias Leich)++ | / (10 files):
12:21 dalek MoarVM/execname: implement op execname which returns ARGV[0]
12:21 dalek MoarVM/execname:
12:21 dalek MoarVM/execname: This will only get useful when we provide a proper binary for nqp-m and perl6-m
12:21 dalek MoarVM/execname: review: https://github.com/MoarVM/MoarVM/commit/bcc2cf46e0
12:50 nwc10 FROGGS: "you" might be wanting to extend the implementation of that with the code from Perl 5 which figures out absolute path on a bunch of OSes
12:50 nwc10 but that's a nice-to-have
12:59 FROGGS nwc10: question is: does moarvm run on these OSes? because I don't wanna implement broken stuff for OSes that I cannot test on
13:00 nwc10 linux, yes
13:00 nwc10 FreeBSD, last I checked, yes
13:00 lizmat maybe just leave a comment to check the Perl 5 source when needed ?
13:00 nwc10 Solaris, I think so
13:00 nwc10 OS X, yes
13:00 FROGGS okay, I have most of them in virtual boxes...
13:11 LLamaRider joined #moarvm
13:21 nwc10 I think that the "bigger" problem is that as soon as someone tries to package MoarVM for Debian they are going to hit portability problems
13:21 nwc10 right now, I think that it only runs on "both kinds of architecture"
13:21 nwc10 x86 *and x86_64
13:21 nwc10 it should (at least) run on all little endian.
13:21 nwc10 and hopefully not much work to get big endian too
13:24 xiaomiao all two users will appreciate the effort ;)
13:25 * xiaomiao hasn't hasn't seen any requests for any perl6-related stuff outside of both x86 flavours
13:25 nwc10 all two users on what?
13:25 nwc10 aha yes.
13:25 nwc10 >2 million Raspberry Pis shipped.
13:26 nwc10 aynway, point is that it likely won't get packaged for Debian if it's less portable than Parrot
13:26 xiaomiao on Gentoo I'm aware of at least one user of rakudo
13:26 xiaomiao so I guess there's not much demand yet
13:27 nwc10 not yet. No star release yet for a backend with supported concurrency
13:27 nwc10 and Perl 5 is still faster
13:27 nwc10 and no, we're not going to slow down Perl 5 to help :-)
13:27 xiaomiao herp :)
13:28 xiaomiao just saying, I've not noticed any actual usage, so portability doesn't even seem to be an urgent problem
13:28 nwc10 yes, agree with where you're coming from
13:28 nwc10 but I think it's kind of a bootstrapping problem
13:28 nwc10 my hunch is that there won't be packages until portability is better
13:28 nwc10 and without packages, there won't be (as) many users
13:30 xiaomiao hehe
13:30 xiaomiao well, I've been keeping things up to date on gentoo ... even if I don't have a use for perl6 yet
13:31 nwc10 that's useful. thanks for doing that
13:32 xiaomiao I collect weird languages ... j, opendylan, perl6 ...
13:33 xiaomiao in terms of "being good upstream" the perl6 crowd is pretty much a rolemodel, with working tarballs 'n stuff
13:59 jnap joined #moarvm
14:04 FROGGS nwc10: back to execname: the goal *is* to return an absolut path so I will steal from P5, though, we need a real nqp/perl6 binary first instead of a shell sript
14:04 FROGGS script*
14:05 nwc10 I don't know how to do it on Win32, but I think that something in win32/*.c does
14:06 FROGGS and this binary would it make easier to run things in gdb
14:41 camelia joined #moarvm
14:57 btyler joined #moarvm
15:40 jnap1 joined #moarvm
16:13 jnap joined #moarvm
16:57 timotimo great
16:58 timotimo now i implemented actually turning the istype into a set and it giveo Type check failed in binding; expected 'Int' but got 'Int'
16:59 jnthn You probably want to turn it into a const_i64
17:11 timotimo ah
17:11 timotimo that kinda makes sense :)
17:11 jnthn timotimo: Just done some sketching of a lex => loc algo.
17:11 jnthn I *think* I can do it in one trip down the tree.
17:12 jnthn Collecting info down, lowering/flattening on way up.
17:12 jnthn With careful unioning.
17:12 timotimo that sounds nice :)
17:13 jnthn Well, ideas usually do, but I need to code it to see if it will be nice.
17:13 jnthn I think I'll take dinner, and then see what energy I have :)
17:13 jnthn (Slept badly last night, then taught all day, so may be zombie after dinner.)
17:14 jnthn timotimo: About your sp_get_arg_o crash: you mighta been missing validation of register type compat.
17:14 jnthn timotimo: That is, you can only sp_get_arg_o if the callsite says you're being passed an o
17:15 jnthn The required args code carefully checks for that.
17:15 jnthn i need to look more carefully at what you ended up with to see if that's the issue, but it may be.
17:16 jnthn Anyway, I haz an appetite so I'm gonna go eat :)
17:16 jnthn bbia
17:16 jnthn b
17:44 timotimo i thought i put checking code in there, too?
17:44 timotimo but maybe i need to add + req_max to i in there each time, too
17:44 timotimo that'd make sense
17:46 timotimo wow, i am dumb
17:46 timotimo actually, no, that was correct
17:46 timotimo well, half of it
17:51 dalek MoarVM/spesh: 92b30f6 | (Timo Paulssen)++ | src/spesh/args.c:
17:51 dalek MoarVM/spesh: these indices were off-by-req_max.
17:51 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/92b30f6c78
17:51 dalek MoarVM/spesh: e2c08e8 | (Timo Paulssen)++ | src/spesh/optimize.c:
17:51 dalek MoarVM/spesh: staticify istype for a spesh-time-known value or type
17:51 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/e2c08e8785
18:10 nwc10 zombie jnthn needs offal? A particular sort of offal? From long pigs? :-)
18:18 jnap joined #moarvm
18:51 rurban_ joined #moarvm
18:54 jnthn Well, the pig I just ate was pretty good... :)
18:59 btyler joined #moarvm
19:03 timotimo jnthn: what would introducing the fact that we know the literal value of a register to the fact database look like?
19:03 timotimo would i have to box an int for that?
19:04 jnthn wtf
19:04 jnthn no!
19:04 timotimo well, it has a slot for a MVMObject *
19:05 jnthn You just an a .i64 slot to the union.
19:05 timotimo and a flag to say "it's an i64"?
19:05 jnthn No
19:05 jnthn You don't need it.
19:05 timotimo oh, duh
19:05 timotimo the register is typed
19:05 jnthn You already know the types of all the...right :)
19:05 jnthn And the bytecode was validated
19:05 timotimo i'm not a smart man all the time
19:05 jnthn Well, my "wtf" was more a "argh no" ;)
19:06 timotimo it's all right :)
19:06 jnthn Because if the specializer allocates we're...in trouble.
19:06 jnthn (Does a GC allocation, that is.)
19:06 jnthn I was just seeing the bugs already :)
19:06 timotimo fair enough :)
19:18 * jnthn makes branch, opens Optimizer.nqp
19:19 timotimo jnthn: do you think collapsing cascading sets would be worth anything yet?
19:19 timotimo as in: you turn some deconts into sets, but could just as well just re-name registers instead
19:19 FROGGS hmmmm, looks like I have an nqp-m ELF binary now...
19:19 timotimo oooh!
19:19 timotimo a fakecutable?
19:19 FROGGS no, not very faky
19:20 timotimo well, i think that's the name for it, though?
19:20 jnthn timotimo: I'd pondered that.
19:20 jnthn timotimo: I think you can prove it's OK off usage counts but I was worried about BB spanning.
19:20 FROGGS what is moarvm's binary?
19:20 jnthn timotimo: That is, I couldn't convince myself the naive thing was safe.
19:22 timotimo ah, ok
19:22 timotimo i thought that's what SSA is for :P
19:22 FROGGS timotimo: I took MoarVM's main.c, hardcoded the args we put in the nqp-m.sh, and compiled it to nqp-m ELF
19:23 timotimo ah
19:23 timotimo that's cute
19:23 jnthn timotimo: Yeah. I think it *is* safe, something bothered me.
19:23 FROGGS so we can properly get its executable name (and then its absolute path), and it is easier to run using gdb or valgrind
19:23 jnthn timotimo: I was probably just tired.
19:24 jnthn timotimo: 'cus I can't think of it now.
19:24 timotimo oke :)
19:25 timotimo FROGGS: next step would be to link the .moarvm files it needs into the binary itself :)
19:25 FROGGS timotimo: hmmm
19:25 FROGGS :o)
19:26 FROGGS would be nice to include the modules... but, well, not now :o)
19:26 benabik If you want to rename/remove registers, I _think_ you still need def-use information in SSA.  It’s just that the def-use links are very simply.
19:26 timotimo mhm
19:26 * benabik is currently taking a compiler optimization course.
19:27 jnthn benabik: Well, there's one def :)
19:27 jnthn timotimo: Oh! I remembered it.
19:28 jnthn timotimo: It was de-opt I was concerned about.
19:28 timotimo oh?
19:28 timotimo because we deopt right in the middle of code, yes?
19:28 jnthn Well, we can know the risk points.
19:29 benabik jnthn: Like I said: simple.  :-)  But uses can be in any block the def dominates, so you still ned to have it.
19:29 jnthn Basically, anything invokey.
19:29 jnthn benabik: Aye, agree.
19:29 timotimo an opt for later, then
19:30 * benabik tried to implement a simple copy propigation step in a toy compiler, found it was more complex than expected.
19:31 benabik (Not too bad, but that wasn’t the assignment anyway.)
19:38 dalek MoarVM/spesh: 4f4c34f | (Timo Paulssen)++ | src/spesh/ (2 files):
19:38 dalek MoarVM/spesh: introduce the known value of istype result to facts database
19:38 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/4f4c34f7de
19:38 timotimo now we just need to use that in "if" :P
19:44 timotimo do i have to do some kind of check for the "get" op to figure out what the types of the source and destination registers are?
19:47 jnthn Which get op?
19:47 timotimo er, set
19:47 jnthn oh
19:48 jnthn Here's set's definition:
19:48 timotimo i would think i'd have to, unless i can just assign the complete union with =
19:48 jnthn set                 w(`1) r(`1)
19:48 timotimo the backtick means "anything"?
19:48 jnthn `1 means a generic type arg
19:48 timotimo or rather: the same thing twice
19:48 jnthn Right.
19:49 jnthn set is always between two registers of the ame type
19:49 timotimo ah, excellent
19:49 jnthn And the validator ensures it.
19:49 dalek MoarVM/spesh: 385649a | (Timo Paulssen)++ | src/spesh/optimize.c:
19:49 dalek MoarVM/spesh: fix compilation
19:49 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/385649a147
19:50 japhb_ joined #moarvm
19:50 dalek MoarVM/spesh: f5dd758 | (Timo Paulssen)++ | src/spesh/optimize.c:
19:50 dalek MoarVM/spesh: propagate known type/value through set op.
19:50 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/f5dd7581cb
19:52 jnthn timotimo: uh...
19:52 jnthn timotimo: I thought I'd done that already...
19:52 timotimo oh?
19:52 timotimo ... maybe?
19:52 timotimo i can check
19:52 jnthn oh, I see
19:52 timotimo oh
19:53 jnthn well, see fact.s
19:53 timotimo yeah, in add_bb_facts
19:53 jnthn .c
19:53 timotimo i aint reading assem... oh :)
19:53 jnthn But yeah, we need to re-prop.
19:53 jnthn Because we figured out something new during optimize phase.
19:53 jnthn So it's ok
19:53 timotimo yes
19:53 timotimo but i can use copy_facts :)
19:53 timotimo oh, it really copies everything forever
19:54 timotimo should my code stay the same or copy the fact completely?
19:55 jnthn For set I think you can copy the log...or at least, if copy_facts in facts.c does
19:56 timotimo the log?
19:57 jnthn *lot
19:58 timotimo mhm
19:58 timotimo i'll change it later
20:06 timotimo i don't see a lot of output from my iffy-op-optimization attempts yet :\
20:07 timotimo (when compiling nqp and rakudo)
20:07 timotimo so far i only do if_i and unless_i, though
20:08 jnthn We're not yet going to be in a good place to take advantage yet of the istype thing.
20:08 jnthn I'll try and put in at the weekend the stuff to actually specialize on incoming types.
20:09 timotimo ah
20:09 timotimo yeah, that'd be important :)
20:09 jnthn Once we do *that*, Rakudo's bind lowering will then mean we can take advantage of istype elimination for the bind type checks.
20:09 timotimo should i try to build constant propagation for more ops? like lt/gt perhaps?
20:09 jnthn Only if you can test them.
20:09 timotimo test as in make test cases that show if it's correct?
20:09 jnthn Yeah
20:10 jnthn I'd rather we just do the if ones for now
20:10 timotimo fair enough
20:11 dalek MoarVM/spesh: 50bc7a7 | (Timo Paulssen)++ | src/spesh/optimize.c:
20:11 dalek MoarVM/spesh: if_i and unless_i for known values can be optimized
20:11 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/50bc7a71e1
20:13 jnthn timotimo: I think you should be able to try that one out with an "if 0 { } else { }" in NQP :)
20:14 timotimo i thought so, too
20:14 timotimo waiting on the spesh diff output now :)
20:17 timotimo oh, my test probably didn't succeed because it wasn't using native ints
20:17 timotimo and thus it would have used if_o rather than if_i
20:18 timotimo nqp also uses if_o in this piece of code i made
20:18 * timotimo tries sub foo(int $foo) instead
20:18 timotimo but i think that doesn't actually do anything in nqp?
20:20 timotimo const_i64 r0(1), liti64(0)
20:20 timotimo unless_i r0(1), BB(3)
20:20 timotimo could it be that const_i* doesn't get fact'd yet?
20:21 timotimo doesn't seem so, actually
20:21 timotimo that would go in facts.c, right?
20:23 jnthn right. :)
20:23 jnthn You'll be better at this than me soon :)
20:23 jnthn timotimo++ # diving into spesh
20:24 * timotimo is an excitement-driven developer
20:24 timotimo and you just gave me a pretty exciting toy to play with :)
20:26 benabik I’d probably dig into that, but this month is my area exams.  Maybe I’ll have some spare time when I’m off at my internship this summer.
20:27 jnthn benabik: Nice :)
20:27 jnthn benabik: Good luck with exams!
20:32 timotimo i'm turning the literals into facts now, but the iffy optimization doesn't kick in yet. hum.
20:32 timotimo haha
20:33 timotimo missing a break;
20:33 timotimo before a default: return :)
20:34 dalek MoarVM/spesh: dd32d69 | (Timo Paulssen)++ | src/spesh/optimize.c:
20:34 dalek MoarVM/spesh: bah, gimme a break;!
20:34 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/dd32d696dd
20:34 jnthn :D
20:34 dalek MoarVM/spesh: aafcaed | (Timo Paulssen)++ | src/spesh/facts.h:
20:34 dalek MoarVM/spesh: more known value type options
20:34 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/aafcaed353
20:34 dalek MoarVM/spesh: 47d5c64 | (Timo Paulssen)++ | src/spesh/facts.c:
20:34 dalek MoarVM/spesh: learn values from const_i* ops
20:34 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/47d5c642a0
20:35 timotimo oh, that segfaults now
20:35 jnthn heh, I was just "argh, analysis, why you think that can be lowered"
20:35 jnthn And then realized it had found an unreferenced var...
20:35 jnthn :)
20:36 timotimo um, yay?
20:38 dalek MoarVM/spesh: ca0a244 | (Timo Paulssen)++ | src/spesh/manipulate.c:
20:38 dalek MoarVM/spesh: BBs with no children could explode.
20:38 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/ca0a2446dc
20:38 jnthn Well, it means it wasn't wrong in that way.
20:38 timotimo turned an iffy op into a goto
20:38 timotimo MVMArray: Can't pop from an empty array
20:38 timotimo hooray :)
20:39 * timotimo hunts more and more problems
20:39 timotimo (that he himself created in the first place ... oh well)
20:43 timotimo i had the iffy thing backwards
20:45 timotimo given the output i just pasted in #perl6, it seems like there's a predecessor that doesn't get removed :\
20:45 timotimo oh, i have to go through *all* successors and remove the predecessor :)
20:45 timotimo wait, does that make sense?
20:46 dalek MoarVM/spesh: bb545cd | (Timo Paulssen)++ | src/spesh/optimize.c:
20:46 dalek MoarVM/spesh: the iffy optimization was exactly backwards
20:46 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/bb545cdc58
20:48 jnthn timotimo: Well, the stage at the end should do that.
20:48 jnthn timotimo: The final "kill dead bbs" one
20:48 jnthn As it iterates
20:49 timotimo oh
20:49 timotimo maybe that's missing ATM. i'll have a look soon-ish
20:49 timotimo but first:
20:49 timotimo late night tea
20:51 colomon joined #moarvm
20:55 timotimo will i be seeing lex2loc before you go to bed tonight? :)
21:16 jnthn mebbe
21:21 jnthn timotimo: Do you know if the regex optimizer calls back into the normal optimizer for blocks it finds?
21:24 * jnthn is guessing "no"...
21:28 timotimo i think so
21:29 timotimo er no
21:29 timotimo the other way around though :P
21:37 jnthn I've got something that gets through the build and passes many of the NQP tests
21:37 jnthn Something is a bit off as something is busted with string escapes
21:37 jnthn including interpolation
21:43 timotimo oh, that's interesting
21:43 jnthn Oh, I found it.
21:43 timotimo does it make a funny anectode? :)
21:43 timotimo anecdote*
21:44 jnthn No, it tells us that we really, really, should fix the optimizer to walk embedded blocks in regexes.
21:45 timotimo ah
21:45 timotimo yes, it really should.
21:45 timotimo i special-cased blocks-in-regexes for my lex2local search thingie
21:45 timotimo but that's not sane at all.
21:45 jnthn But I think I can work around it for now my poisoning the whole block var state stack.
21:45 timotimo but the optimizers will have to pass data back and forth
21:45 timotimo that's what i had implemented early on, yeah
21:45 jnthn Well, if you pass the optimizer instnace into the regex one then you'll be fine.
21:45 jnthn It should just call back into it later.
21:46 timotimo "found a regex? oh, i'll just forget about optimizing, then"
21:47 woolfy1 joined #moarvm
21:47 jnthn ok, now I'm down to 2 failing tests
21:47 timotimo in nqp?
21:47 timotimo that should be 0, though! :P
21:47 jnthn test files
21:47 jnthn yeah
21:47 timotimo mhm
21:48 * timotimo is playing violent vidya games and can't develop right now
22:03 timotimo enough of that for now
22:09 jnthn timotimo: OK, pushed my hacking.
22:10 timotimo cool
22:10 timotimo it's still at 2 failing test files?
22:10 jnthn No
22:11 jnthn It passes all NQP tests and builds a Rakudo that passes sanity tests.
22:11 timotimo yay!
22:11 timotimo i like the sound of that!
22:11 jnthn Feel free to spectest it.
23:10 colomon joined #moarvm
23:59 colomon joined #moarvm

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