Camelia, the Perl 6 bug

IRC log for #moarvm, 2013-09-27

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

All times shown according to UTC.

Time Nick Message
01:23 TimToady hmm, num80's?
01:56 FROGGS_ joined #moarvm
02:23 diakopter num80's?
02:59 diakopter oh, now I get it
03:04 tokuhirom joined #moarvm
04:55 dalek MoarVM: 43d5666 | jimmy++ | src/io/procops.c:
04:55 dalek MoarVM: small fix to MVM_proc_clargs
04:55 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/43d566621b
06:06 foo_bar_baz joined #moarvm
08:05 cognominal joined #moarvm
08:53 FROGGS joined #moarvm
10:21 jnap joined #moarvm
11:16 dalek MoarVM: 90336d8 | (Gerhard R)++ | src/core/interp.c:
11:16 dalek MoarVM: Fix getwhere
11:16 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/90336d819a
11:18 jnap joined #moarvm
11:29 dalek MoarVM/ctypes3: 763b768 | (Gerhard R)++ | src/native/CArray.c:
11:29 dalek MoarVM/ctypes3: Small fix for CArray
11:29 dalek MoarVM/ctypes3: review: https://github.com/MoarVM/MoarVM/commit/763b7685e3
11:29 dalek MoarVM/ctypes3: f82e61a | (Gerhard R)++ | src/native/ (3 files):
11:29 dalek MoarVM/ctypes3: Implement CStruct
11:29 dalek MoarVM/ctypes3: review: https://github.com/MoarVM/MoarVM/commit/f82e61a6d2
11:29 dalek MoarVM/ctypes3: a835227 | (Gerhard R)++ | src/native/ops.c:
11:29 dalek MoarVM/ctypes3: Implement coffsetof
11:29 dalek MoarVM/ctypes3: review: https://github.com/MoarVM/MoarVM/commit/a835227594
11:29 dalek MoarVM/ctypes3: e30ea8d | (Gerhard R)++ | src/core/interp.c:
11:29 dalek MoarVM/ctypes3: Fix getwhere
11:29 dalek MoarVM/ctypes3: review: https://github.com/MoarVM/MoarVM/commit/e30ea8d890
11:29 not_gerd joined #moarvm
11:29 not_gerd o/
11:30 not_gerd poking vm internals from userspace: https://gist.github.com/gerdr/c59d0365251bdec34fa6
11:31 JimmyZ \o
11:32 JimmyZ not_gerd: awesome!
11:33 not_gerd not sure how useful this will be, but definitely -Ofun
11:36 JimmyZ not_gerd: I think something like instrument for MoarVM written by NQP/Perl6 will be useful?
11:36 JimmyZ Just my guess though
11:46 JimmyZ not_gerd++, it really -Ofun
11:59 not_gerd and of course it's totally safe and has zero potential for abuse ;)
12:02 JimmyZ I like it
12:08 JimmyZ MVM_native_ptrcast is what I wanted before :P
12:38 dalek MoarVM: 65abf9b | (Gerhard R)++ | Configure.pl:
12:38 dalek MoarVM: Quote config args with spaces
12:38 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/65abf9befb
12:39 not_gerd bye, #moarvm
12:40 not_gerd left #moarvm
13:04 jnap joined #moarvm
13:08 odc joined #moarvm
14:12 diakopter pretty cool reading: http://spin.atomicobject.com/​2013/09/26/ruby-2-1-preview/
14:18 JimmyZ we already has that GC?
14:20 FROGGS yeah
14:20 FROGGS I wanna see such a blog post for MoarVM too :o)
14:27 diakopter cool reading not just for the gc
14:27 FROGGS true
14:28 FROGGS even for us humans :o)
14:33 diakopter TimToady: local monkey parching ^
14:34 diakopter oh, also in the article ;)
14:37 TimToady yes, I know about the egregious hack to make lexical scopes seem to work :)
14:38 TimToady if that's what you're referring to; haven't read the article
14:38 TimToady having not yet backlogged even...
14:39 diakopter good luck with the chinese text in #perk6
14:41 cognominal joined #moarvm
14:43 TimToady that shouldn't be much of a problem for me, given I have a program that does LTM and vocab lookup for Chinese that usually gives me the gist of it
14:44 diakopter can you hook it into moritz weeblog
14:47 TimToady google translate would be more appropriate for that, since my approach still requires you to understand the various particles and syntax
14:48 TimToady it's very raw, and intended for someone who is actually interested in learning chinese
14:49 diakopter hm
14:52 jnap1 joined #moarvm
15:12 jnap joined #moarvm
15:17 FROGGS joined #moarvm
15:34 benabik joined #moarvm
16:31 not_gerd joined #moarvm
16:31 not_gerd o/
16:32 not_gerd jnthn: I need a variant of assign that doesn't decontainerize its argument
16:32 not_gerd is that something generally useful or should I add a ctypes specific op?
16:35 jnthn Sounds very odd to me.
16:36 not_gerd if I want to store the address of a CInt in a CPtr and it does a DECONT, it tries to store a P6int instead of the CInt
16:37 not_gerd I could add assignnodecont or something for my specific use case
16:37 not_gerd the question is, do we ever want to store the container object itself in another container?
16:38 not_gerd s/and it does/and if it does/
16:42 jnthn Sounds more like you want binding rather than assignment...
16:43 jnthn We only do the double-container thing in one place in Rakudo: .VAR
16:44 not_gerd as I have it right now, conceptionally it should be assignment
16:44 diakopter not_gerd: hi :)
16:44 not_gerd all scalar C types (CInt, CUint,...) are containers
16:45 jnthn o.O
16:45 not_gerd so a typed C pointer ends up as a container containing another container
16:45 not_gerd diakopter: hi
16:46 jnthn Maybe there's a good reason for those to be containers but my gut reaction is "that sounds really wrong"...
16:47 diakopter jnthn: not_gerd may be using the word "container" differently than how you're accustomed
16:47 jnthn diakopter: Maybe, but probably not if we're talking about decont and assign.
16:47 not_gerd well, 6model objects that implement ContainerSpec
16:48 jnthn I'm vaguely confused how porting the stuff we need for NativeCall has ended up with something completely unrecognizable to me.
16:48 not_gerd NativeCall isn't my main motivation
16:49 not_gerd it might or might not end up being used for that (or being scrapped altogether)
16:50 diakopter jnthn: it's like exploratory surgery :)
16:50 diakopter could be dangerous. could be amazingly informative or helpful.
16:50 not_gerd diakopter: did you see https://gist.github.com/gerdr/c59d0365251bdec34fa6
16:50 timotimo explosive surgery? =O
16:51 not_gerd I've got the dangerous part covered ;)
16:51 diakopter not_gerd: no  but I saw the other one with the for loop
16:51 not_gerd I'm reading from the Collectable object header by (ab)using nqp::where
16:52 diakopter jnthn will love that :)
16:52 diakopter you should probably reassure jnthn that this would almost certainly be in an extension...
16:53 not_gerd it it's user-exposed at all
16:53 diakopter well if it's opcode-exposed it's user-exposed
16:53 diakopter unless you want to create security fence circles and trust levels like in .NET
16:54 not_gerd just make the verifier choke on it if no magic bit is set somehow
16:54 diakopter jnthn: not_gerd should probably reassure you this would be in a separate repo/extension :)
16:54 diakopter yeah
16:55 TimToady the closer we get to C, the more we need C-style lvalues as a concept; how this works out for safety is interesting, but we do need to address the issue from a semantic point of view
16:56 TimToady aside: the C programmer in me really hates to see := used to copy native values that are not pointers :)
16:57 timotimo because that's totally what := does in C, right? :P
16:57 not_gerd as I have it now, containers correspond to pointer indirection, with the first level hidden from the user
16:58 diakopter not_gerd: I mean, maybe the JIT thread uses this as part of its representation or some intermediate form
16:58 diakopter and the JIT thread is the only one that can use the extension.. ?
16:58 diakopter who knows
16:58 jnthn A C struct with a native int in just has the int sat there in memory. As an l-value, what you're really doing is talking about a pointer to that field.
16:59 TimToady right, but our type system doesn't know about that yet, afaik
16:59 FROGGS joined #moarvm
16:59 not_gerd jnthn: correct
16:59 not_gerd I assumed this was similar to how you wanted to do native attributes
16:59 FROGGS o/
16:59 not_gerd of course I might ahve misunderstood
16:59 jnthn nqp::assign_i(nqp::getattrptr_i($struct, StructType, '$!foo'), 42)
17:00 jnthn Is the kinda thing I'd expect it to "naively" compile down to
17:00 jnthn Which the optimizer can spot and say
17:00 jnthn nqp::bindattr_i($struct, StructType, '$!foo', 42)
17:00 diakopter yes, yes, yes. :)
17:00 jnthn In the simple cases
17:00 * TimToady wants to be able to += an int attribute with an rw accessor
17:01 jnthn TimToady: Yes, that's also right in this problem space.
17:01 not_gerd my C types correspond to whatever gets returned by nqp::getattrptr_i($struct, StructType, '$!foo')
17:01 TimToady having been told about 15 minutes ago that: Cannot create rw-accessors for natively typed attribute '$!tie'
17:01 diakopter well I think now we're talking about where to place the model of the lowest levels.. whether it should be representable in bytecode
17:02 diakopter because teh optimizer will have to model it somehow
17:02 TimToady and if we get too close to C, will it be impossible to run on the JVM :)
17:02 diakopter nah it has Unsafe that can do anything
17:02 diakopter which we already use, afaik, for something there
17:03 diakopter it has equivalent offsetof and sizeof
17:03 diakopter and unsafe casting
17:03 diakopter and un-GC malloc
17:04 TimToady but really, a pointer is just an unboxed container...
17:04 jnthn not_gerd: OK, then I kinda see where it's going, but I don't think it wants doing with a REPR explosion.
17:04 diakopter right, like I said you can do the whole thing with extensie p6opaques
17:04 jnthn not_gerd: I mean, there's one P6int REPR which we compose to different sized types
17:04 diakopter extensive
17:05 not_gerd jnthn: well, I first had a single CScalar REPR that ended up with its own private vtable
17:05 diakopter but then again, you can implement all teh other reprs with extensive p6opaques
17:05 not_gerd I did not much like the result
17:05 not_gerd is there any harm in such a REPR explosion?
17:06 jnthn Well, thing is, in Perl 6 people will probably write stuff like
17:06 jnthn er, do write stuff like
17:06 TimToady .oO( has ptr[ptr[int]] $!intref; )
17:06 jnthn class Foo is repr('CStruct') {
17:06 diakopter heh.
17:06 jnthn has int32 $.foo;
17:06 jnthn }
17:07 diakopter reprs need to enforce preventing that...
17:07 jnthn There's a Perl 6 int32 type there, which has the P6int REPR
17:07 jnthn Which is just fine.
17:07 jnthn The REPR of a reference to a native field is not equal to the REPR of the inlined value, is all I'm saying.
17:08 jnthn s/field/attribute/ # hm, am I speaking C for Perl 6 :)
17:08 not_gerd actually, it's called member in C ;)
17:08 diakopter C# then :D
17:08 * jnthn has to remember not to call fields attributes in C# 'cus attributes are something else and it confuses the heck out of everybody :)
17:09 diakopter attributes are more like naively implemented perl6 attributes
17:09 TimToady paraphrase: ptr[Foo] not commensurate with ptr[int32]
17:09 TimToady even if they happen to be the same address
17:10 diakopter jnthn: I would think that if it has a different containerspec and data layout, it needs its own repr?
17:11 jnthn diakopter: containerspec hangs off STable (and is per type), and a REPR can be type generic also
17:11 not_gerd well, ContainerSpec, REPR and StorageSpec are all orthogonal to some degree
17:11 jnthn Yes.
17:12 jnthn Just as VMArray can happily be an array of objects, or an array of num32, or an array of uint8
17:12 diakopter r: my int0 $oops
17:13 diakopter TimToady: at some point the number of bits in our native ints will be too laborious to type... :)
17:13 diakopter so maybe should use the log2...
17:13 TimToady doesn't work for num80 :)
17:14 TimToady and there are always aliases :)
17:14 diakopter 2 bits, 4 bits, 6 bits, a dollar
17:14 not_gerd also, there are to different ways to arrive at a num128
17:14 diakopter a ten o' clock scholar
17:14 not_gerd real IEEE quad precision and fake one via two double-precision values
17:15 not_gerd LLVM calls these fp128 and ppc_fp128
17:15 TimToady not_gerd: sure, but an implementation would generally prefer one or the other
17:16 TimToady and Perl really only means "you may use 128 bits to store this"
17:16 TimToady unless we get serious about guaranteeing ieee semantics
17:18 TimToady if so, num128 is the real one, and fake128 or so is the fake one :)
17:18 TimToady but I'm not sure we're that serious
17:19 TimToady doubtless pragmas will happen
17:19 diakopter pragmae?
17:20 TimToady the default type system should try to hide most of the madness, but make it possible to get to the madness somehow...
17:20 * TimToady wonders when C will get a double double double type...
17:21 not_gerd oO( use cthulhu )
17:21 jnthn btw, will try and sort out the outer stuffs in Moar this weekend.
17:21 jnthn Provided I can concentrate enough.
17:22 * jnthn woke up with a bad headache this morning :/
17:22 TimToady and we aren't helping... :)
17:22 jnthn After that, I guess serialization is the main bootstrap blocker.
17:23 jnthn Though diakopter++ did a lot of the work on that already :)
17:44 dalek MoarVM/ctypes3: d356986 | (Gerhard R)++ | / (8 files):
17:44 dalek MoarVM/ctypes3: Implement CPtr and add assignnodecont (for now)
17:44 dalek MoarVM/ctypes3: review: https://github.com/MoarVM/MoarVM/commit/d35698642f
18:11 TimToady r/j seems to be testing out fine on my supercomputer at home; the ulimits are the same as host06, same arch, only difference is host06 is running 3.5.0-17-generic, while mine is running 3.8.0-19-generic
18:11 diakopter jnthn: at this rate, the entirey of Perl 6, including the entire runtime and all user code, could be compiled into this nqp-with-c-power lingo
18:11 TimToady so maybe something in the earlier kernel?
18:12 diakopter r/j?
18:12 diakopter oh.
18:12 diakopter haha.
18:12 TimToady ww
18:12 diakopter [Coke] I assume
18:13 FROGGS TimToady: I can force a spectest abort when I have a virtualbox vm running on my machine
18:13 diakopter which java do you have? host06 is ultra-latest
18:13 TimToady whatever openjdk supplies on Ubuntu
18:14 diakopter ewww
18:14 TimToady ewww, but it works better :)
18:14 diakopter mwilson@host06:~$ java -version
18:14 diakopter java version "1.7.0_40"
18:14 diakopter Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
18:14 diakopter Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
18:14 diakopter true... it's possible we uncovered a bug in the jvm..
18:14 diakopter not likely, but...
18:15 FROGGS java -version
18:15 FROGGS java version "1.7.0_25"
18:15 FROGGS OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.13.04.2)
18:15 FROGGS OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
18:16 diakopter jnthn: at this rate, the entirey of Perl 6, including the entire runtime and all user code, could be compiled into this nqp-with-c-power lingo... and perhaps even a very small subset of that, at that.
18:17 diakopter ... and if much of *that* can compile to C, it can be optimized ahead-of-time by real optimizers...
18:17 diakopter .oO( oh wait, much of it is already in C.. ) ;)
18:17 TimToady yeah, was gonna say, then it'll almost run as fast as it does now :)
18:19 TimToady next project, the kernel...
18:22 benabik C double double double is probably spelled `long long double`
18:24 arnsholt Is that different from a long double double? =)
18:27 benabik I would want to make long double a float128, and double double be the silly PPC thing.  So a long double double would be two float 128s?
18:27 benabik ;-)
18:27 diakopter long double double double long double long double double long doublde
18:27 diakopter long double double double long double long double double long double
18:28 BinGOs shouting lager lager lager
18:34 FROGGS BinGOs++ # Underworld
18:39 nwc10 IIRC it got really quite fun on sparc linux, with compiler flags for how big you want your long double to be
18:46 * TimToady orders a short long double with extra sugar
18:50 diakopter on the rocks
18:59 TimToady and char it a little while it's on the grill
19:19 dalek MoarVM/ctypes3: 9c89456 | (Gerhard R)++ | src/native/CStruct.c:
19:19 dalek MoarVM/ctypes3: Small CStruct fix
19:19 dalek MoarVM/ctypes3: review: https://github.com/MoarVM/MoarVM/commit/9c89456093
19:19 dalek MoarVM/ctypes3: 8aa254c | (Gerhard R)++ | src/native/ (3 files):
19:19 dalek MoarVM/ctypes3: Implement CUnion
19:19 dalek MoarVM/ctypes3: review: https://github.com/MoarVM/MoarVM/commit/8aa254c016
19:25 grondilu joined #moarvm
19:55 not_gerd bye, #moarvm
19:56 not_gerd left #moarvm
20:29 FROGGS joined #moarvm
21:51 moritz joined #moarvm
21:54 _ilbot joined #moarvm
21:54 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
22:10 _ilbot joined #moarvm
22:10 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
22:14 diakopter jnthn: ping
22:27 jnthn diakopter: pong
22:31 diakopter jnthn: hi
22:31 jnthn hej
22:31 diakopter jnthn: so, I'm trying to think of a pathalogical test case that would allocate short-lived objects to try to force a GC run in the face of that optimization we discussed
22:32 diakopter jnthn: oh btw
22:32 jnthn diakopter: Hm, I wasn't thinking we'd be doing that any time soon...
22:33 diakopter oh; I thought it was a simple thing to try
22:34 jnthn Well, can try it I guess...
22:34 jnthn I'm just rather wary of donig too many clever things until Rakudo is running/spectesting
22:34 jnthn As it just gives more to debug on the way there...
22:35 diakopter yes, without a way to easily turn it off anyway
22:35 jnthn Of course, trying it in a branch hurts nothing, and tells us the actual complexity it causes (which I don't feel I can guess accurately)
22:38 diakopter you know
22:38 diakopter even more tricky
22:39 diakopter if the assign ref macro is placing the first escaping ref of an object into an object which also hasn't been flagged yet... it doesn't have to flag it!
22:39 jnthn yeah but when the outer one gets flagged...
22:39 diakopter oh yeah. :)
22:39 jnthn :)
22:40 jnthn I already pondered that one while we were discussing it :)
22:40 jnthn btw, made a start locally on working towards killing prior_invocation
22:41 jnthn With luck I can pull it off this weekend
22:46 benabik joined #moarvm
22:47 diakopter jnthn: kewl :)
22:52 diakopter jnthn: 'course, if it simply recursively marks using some variant of the gc_mark thing... ;)
23:20 BenGoldberg joined #moarvm
23:56 foo_bar_baz joined #moarvm

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