Camelia, the Perl 6 bug

IRC log for #parrot, 2012-08-25

Parrot | source cross referenced

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

All times shown according to UTC.

Time Nick Message
00:50 kid51 joined #parrot
00:54 MikeFair hello whiteknight
00:54 whiteknight hello MikeFair
00:55 MikeFair whiteknight: Are you the one who is doing Winxed and working on the debugging stuff?
00:55 whiteknight I'm one of them, yes
00:56 MikeFair I was wondering if there was a way to encapsulate the compilation and execution into an XML fragment
00:58 MikeFair it's kind of just a thought forming in my brain at the moment but for some reason I keep drawing parallels to parrot and byte code execution and network packets and network debugging...
00:58 MikeFair have you ever seen the output of WireShark?
00:58 MikeFair Or some related tool that is showing the higher level protocol built up from the network packets?
00:59 whiteknight yes, I use wireshark pretty frequently
01:00 MikeFair I only bring it up because it seems the process of disassembling network protocols seems to be similar to multiple languages running over the byte codes
01:01 MikeFair it's like Parrot is a CPU, that is receiving messages over the network from the compiler tools
01:01 whiteknight i can sort of see that. It's certainly not something I've thought about before
01:01 MikeFair Yeah neither had I
01:01 whiteknight but it's in my brain now.
01:01 MikeFair It just kind of showed up one day as I was thinking about the nature of how Parrot is always passing the frame full of registers around
01:01 MikeFair hehe :)
01:02 MikeFair Which then led me to the concept of network encapsulation and the various layers there
01:03 MikeFair So then I saw this XML fragment <HLL lang="perl6"> print "Hello World\n"<ASNTree>....<NPQ>...<PBC>...<x8​6>....</x86></PBC></NPQ></ASNTree></HLL>
01:04 MikeFair Or something like that
01:05 MikeFair I don't understand the particular internals, but it seems that there's layered system that could be captured in the process very much like a networking stack
01:06 MikeFair At the time I was investigating a lot of erlang and ZeroMQ, so I envisioned each piece of the compilation stack as a separate service sending and receiving messages from the other pieces/layers
01:07 MikeFair It became more of a compilation service, rather than a compilation process
01:07 MikeFair err service chain
01:07 whiteknight sounds like an interesting tool for some uses. Seems like it would not be performance-friendly in the general case
01:09 MikeFair Well ZeroMQ has a zero copy, in process, message passing mechanism that is designed to be very performant, it seems to me at least as performant as the existing stuff (passing a pointer)
01:09 dalek parrot/leto/get_pointer: 1c498be | dukeleto++ | / (3 files):
01:09 dalek parrot/leto/get_pointer: Fix get_pointer for Integer and Float and add a currently failing test
01:09 dalek parrot/leto/get_pointer: review: https://github.com/parrot/parrot/commit/1c498bee46
01:09 MikeFair whiteknight: I mean I don't want to say that it would be performant, but it just seemed that it was the right way to pass a shared memory pointer between separate processing libraries
01:10 MikeFair Where does the peformance come from today?
01:10 whiteknight well, I don't want to pretend Parrot has great performance right now
01:10 whiteknight but we definitely don't want to do anything to make it worse
01:10 MikeFair I gues I should also say that this was a reporting/debugging/output format, not an internal memory model
01:11 * MikeFair nods.
01:11 MikeFair If I'm understanding the Parrot execution engine right, there's this array of memory pages that hold the registers and register types
01:12 MikeFair I'm assuming that almost 100% of the time, that's never more than one page
01:12 MikeFair Then there's a pointer to this page that gets passed around to all the subs
01:13 MikeFair This is a mental model, I haven't looked at the code
01:13 whiteknight yeah, that's close enough. We've got an object called a CallContext which holds the register set as a heap-alloced array
01:13 MikeFair (s/array/linked list/)
01:13 whiteknight CallContexts are linked together in sort of a linked list or tree
01:16 MikeFair Then I envisiond that each thread would have its own CallContext list/tree
01:16 whiteknight yes
01:17 MikeFair So where I started my thing was CallContext ~~ Ethernet Frame
01:17 MikeFair err not frame, payload
01:18 MikeFair anyway, I guess that's not so relevant right now
01:18 * MikeFair is still grokking the world
01:19 MikeFair Because there's two distinct parts, the data registers and the code
01:19 MikeFair So I understand the CallContext piece, but I don't quite get the code part of it
01:20 MikeFair I submit 'print "hello world\n";' in 'perl6'
01:20 MikeFair Then calls up models Perl6/Grammar.pm and Perl6/Actions.pm which begin to work on my text
01:21 MikeFair (In NPQ land)
01:22 MikeFair joined #parrot
01:22 * MikeFair wonders what he missed.
01:24 whiteknight what do you mean?
01:24 MikeFair Sorry, the IRC client just went non-responsive for a bit then I saw the disconnect
01:25 MikeFair i'm seeking to wrap my brain around I get from 'print "hello world\n";' to something coming up on my terminal
01:26 MikeFair Where in memory do the subs and modules get stored
01:27 MikeFair I'm looking see if my ideas arond seeing it as a chain of messages going through the layers is a good mental model for itall (and hopefully to be turned into a performant execution paradigm)
01:28 MikeFair I think if the layers could separated then it'd be easier to inspect/debug/work with etc.
01:29 MikeFair If the layers model even applies, I think it does
01:29 MikeFair HLL is the top layer, ASN the next layer, not sure what goes here? winxed/NPQ/PASM..., then PBC, then hardware architecture
01:30 whiteknight We've got a big memory block containing the bytecode. Subroutines are just offsets into the bytecode block
01:30 MikeFair I can see how the CallContext can be passed around simply and easily by passing the pointer around
01:32 MikeFair So the PBC gets generated how, I mean that code has to come from something that thinks in a higher order from that
01:33 MikeFair is that the ASN
01:33 MikeFair or is there something between the ASN and the byte code
01:33 MikeFair Err AST -- Abstract Syntax Tree
01:34 whiteknight depends where you're coming from
01:34 MikeFair Or is the AST an older thing that I learned about years ago
01:34 whiteknight PIR code is assembly-like, we parse it with flex/bison to an internal tree and serialize that to bytecode
01:34 whiteknight Something like Perl6 is much more complicated than that
01:35 MikeFair So while each sub will only have one place that created it, there are many sources that can add byte codes into that memory block?
01:36 MikeFair Or does it all go through PIR at some point?
01:39 MikeFair Or asked another way, could the compiler and execution chain be represented by a series of commands separated by pipes on the command line?  (for an individual HLL expression)
01:49 whiteknight it all goes through PIR at one point. Once the bytecode is built, it's read-only
01:49 whiteknight so after the compiler releases it, it's static
01:49 whiteknight we don't enforce that formally, yet, but that's the case
01:52 kid51_ joined #parrot
02:11 MikeFair cool
02:14 MikeFair So there could be a memory blocked that stored the PIR with pointers to the Bytecode offsets?
02:15 MikeFair Or in my layered model <pir>command<pbc>bytecodes</pbc></pir>
02:15 whiteknight Yeah, I don't see why not
02:16 kid51 joined #parrot
02:16 MikeFair I'm just seeing this as one big code expansion tree, where each level is a different language
02:16 schmoo joined #parrot
02:17 whiteknight okay, I guess here's the first question I have: What's the big benefit of this format?
02:17 whiteknight What problem do you have in mind that this will solve?
02:18 MikeFair Debugging, inspection, navigation of the active code
02:18 whiteknight Okay, well we have pointers and annotations in the bytecode that point back to information about the original source
02:18 whiteknight filename, line number, etc
02:18 whiteknight and then a debugger can lookup that file, read out that line and have that information there
02:18 kid51_ joined #parrot
02:19 MikeFair whiteknight: But what about run-time generated code
02:19 whiteknight like the intermediate formats?
02:19 MikeFair whiteknight: that then gets evaluated
02:19 whiteknight okay, I see what you're saying
02:19 MikeFair whiteknight: no more like I have a sub that generates code at runtime which then gets compiled and executed
02:19 MikeFair right
02:19 whiteknight ah, okay
02:20 MikeFair Remote debugging
02:20 MikeFair where I don't have the source
02:21 MikeFair Well I guess that wouldn't really apply, because the source would be on the executed system I'm inspecting
02:25 MikeFair But the idea is that I could connect to the parrot executable and inspect the world of it
02:25 MikeFair through a DOM representation
02:26 MikeFair I imagine the DOM represenation would be created by the debugger itself, but it would do it by walking the internal data structures
02:26 MikeFair You could then use a tool like wireShark to watch the exeution in a similar way you watch network packets in WireShark
02:27 MikeFair Each session would be a single HLL expression
02:29 MikeFair The metaphor still needs to be adjusted a bit I think, I think the layers model captures the multiple possible source languages
02:30 MikeFair I was considering the case where I have some Perl code that generates javaScript (or some DSL) that it then usese the toolchain to compile and execute
02:32 MikeFair If the inspection tool generated a DOM tree then I could navigate the level I needed.... For instance, in the case of the DSL, I might actually be debugging my Grammar, not the DSL itself
02:32 MikeFair Grammar/Actions -- the PIR being generated
02:34 whiteknight I think there is a gem of an idea here, I'm going to need some time to think it over
02:34 * MikeFair nods.
02:34 MikeFair Certainly
02:34 whiteknight Anyway, It's passed my bedtime already.
02:35 whiteknight We can definitely talk later
02:35 MikeFair I'm glad to hear that i'm not totally bonkers with this in concept
02:35 MikeFair :)
02:35 whiteknight :)
02:35 whiteknight goodnight
02:35 MikeFair whiteknight: Thanks so much for taking the time to hear it
02:35 MikeFair goodnight
04:28 Util joined #parrot
04:29 pmichaud joined #parrot
04:29 PerlJam joined #parrot
04:30 p6eval joined #parrot
04:31 Coke joined #parrot
05:18 MikeFair joined #parrot
05:18 MikeFair joined #parrot
06:05 fperrad joined #parrot
06:19 tadzik joined #parrot
08:18 Psyche^ joined #parrot
10:49 whiteknight joined #parrot
10:57 whiteknight good morning, #parrot
11:43 lucian joined #parrot
11:49 moritz good morning whiteknight, *
11:53 whiteknight hello moritz
12:09 JimmyZ joined #parrot
12:13 whiteknight no dalek today?
12:14 whiteknight moritz: I just pushed a few commits that, I think, fix some socket issues
12:14 whiteknight I'm not sure if they fix the issues Rakudo has been seeing
12:14 whiteknight but I am making progress
12:23 JimmyZ whiteknight++
12:48 moritz whiteknight: I can't build that branch (nopste forthcoming)
12:48 whiteknight blah
12:49 moritz whiteknight: http://perlpunks.de/paste/show/5038c9b9.4945.27a
12:52 whiteknight weird
12:54 moritz that was after make -j5, and then a serial 'make' after that
12:55 moritz now trying after cleaning out and without any parallelity
12:57 JimmyZ hmm, builds here
12:58 JimmyZ with make -j4
12:58 moritz huh, worked fine on second attempt (without any -j option)
13:02 ambs joined #parrot
13:03 ambs Probably I should ask on #perl6 on the other server I can't remember the name, but probably you can answer me. Is there a Perl 6 Pod formatter out there in Perl 6?
13:03 moritz ambs: yes.   perl6 --doc $file  prints out the documentation in text format, with --doc=HTML and Pod::To::HTML installed you can get HTML out
13:04 ambs moritz: thank you (trying to get the releance on this grant proposal http://news.perlfoundation.org/2012/0​8/2012q3-grant-proposal-improve.html
13:07 moritz ambs: I'm having trouble myself figuring that out, which is why I haven't commented yet
13:08 ambs :)
13:08 moritz I think it's a worthy goal, but so far this project has been very decoupled from the Perl 6 community
13:08 ambs this seems a Perl 5 module. I would prefer to see the effort writing a Perl 6 module :-|
13:08 moritz the only communication so far was through the blog post and the grant proposal
13:09 ambs right.
13:11 ambs thank you :)
13:28 moritz whiteknight: all rakudo socket tests pass now. Running a full spectest run now
13:28 moritz a more thorough test would be to also run the LWP::Simple test suite, for example
13:34 JimmyZ nice
13:39 whiteknight moritz: All of them? That's...surprising
13:39 whiteknight considering I fixed what I thought was an unrelated problem
13:40 whiteknight but yes, I would definitely want to see the output of LWP::Simple's test suite
13:40 moritz whiteknight: that's with the patch that sets .encoding('utf8') on the handle
13:40 whiteknight moritz: okay
13:40 moritz I'm doing a 'panda install LWP::Simple' now (which also runs the test suite), but slow machine is slow :(
13:41 moritz and I run a spectest in parallel
13:41 moritz load average of 5.03 on 2 cores
13:42 whiteknight yeouch
13:42 moritz \o/ all LWP::Simple tests pass
13:43 JimmyZ \o/
13:44 whiteknight okay, that's all the validation I need
13:44 kid51 joined #parrot
13:47 moritz now testing HTTP::Client
13:50 moritz that one fails its tests with 'Connection refused'
13:50 moritz I'll try on another machine to see if it passes on master
13:53 moritz but of course that other machine doesn't have panda installed yet *sigh*
14:11 whiteknight okay, that's someplace to start
14:11 whiteknight thanks moritz++
15:13 moritz fails their test on master too
15:15 JimmyZ time to merge io_cleanup1?
15:39 JimmyZ joined #parrot
15:50 contingencyplan joined #parrot
17:21 schmoo joined #parrot
18:35 lucian joined #parrot
18:45 sivoais joined #parrot
21:22 bubaflub joined #parrot
22:11 dalek joined #parrot
23:08 lucian joined #parrot

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

Parrot | source cross referenced