Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-09-28

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 diakopter well, the initial announcement about something like that was actually an April Fool's Joke
00:00 blez äha
00:00 diakopter but parrot does strive to host other "dynamic" languages
00:01 cognominal joined #perl6
00:02 blez but does it compile? I mean to native binary format
00:02 blez exe/elf/dwarf
00:02 diakopter does it compile what?
00:03 diakopter I mean, does what compile what
00:03 blez parrot
00:03 blez does it compile perl to binary
00:03 blez perl code*
00:03 diakopter not that can be used without parrot, if that's what you're asking
00:04 blez aha
00:04 cognominal about the reddit thread: chromatic is to Perl what Daniel Eran Dilger is to Apple. Read it if you want to be a true believer not if you want a balanced option
00:04 japhb Perl 6 can be compiled down (using different VMs) to several things.  Parrot's furthest compile is to PBC (Parrot Byte Code), which can then be packaged into a "fakecutable", but IIRC that still needs access to the full Parrot libraries
00:05 blez "fakecutable" lol
00:07 japhb It looks like a native executable, it acts like a native executable, but its (mostly) not a native exectuable.  :-)
00:08 blez ye, like the python2exe thing
00:08 blez does parrot have JIT?
00:08 diakopter unfortunately no
00:09 diakopter niecza does, via mono
00:09 blez aha
00:09 blez does perl have JIT implementation? except the mono one
00:09 diakopter not yet
00:10 blez I wonder why JS have, but not perl or python
00:10 blez (and I guess, ruby)
00:10 diakopter vastly different numbers of willing/able developers
00:10 japhb Python has a JIT implementation.  In fact, it has a framework for writting JIT compilers.
00:11 japhb er writing
00:11 blez psyco or what was its name?
00:11 pmichaud diakopter: I don't think that qrpa grows without bound as a ring buffer.
00:11 phenny pmichaud: 27 Sep 23:58Z <diakopter> tell pmichaud when used as a queue (push/shift or unshift/pop), afaict qrpa's storage will grow without bounds as time goes on. I recommend converting it to a ring buffer..
00:11 sorear because jit benefits JS but does not benefit Perl
00:11 japhb blez, PyPy
00:11 diakopter pmichaud: that's not what I said? :P
00:11 pmichaud sorr, I mean as a queue
00:12 pmichaud *sorry
00:12 sorear perl to native code compilers have been written several times, never have they worked well enough to be adopted widely
00:12 diakopter ah
00:12 sorear rurban: ping
00:12 pmichaud diakopter: consider 'push'
00:13 diakopter oh, I guess I forgot it would reset upon resizing up
00:13 pmichaud correct.
00:13 pmichaud (you said it more elegantly than what I was coming up with :)
00:13 pmichaud but yes, anything that causes the buffer to resize also reclaims space
00:15 blez sorear why doesn't perl benefit from JIT?
00:17 sorear blez: polymorphism, allomorphism, and weak typing
00:19 diakopter however, if someone were to write in the primitive/strongly-typed subset of Perl 6 without using tricky control flow, it theoretically could
00:19 shachaf sorear: Aren't those exactly the sorts of thing that a tracing JIT can help with?
00:19 diakopter you know, for most microbenchmarks and shootout games :)
00:20 * shachaf isn't sure what allomorphism is.
00:21 popl shachaf: http://search.cpan.org/~ovid/Sub-Si​gnatures-0.21/lib/Sub/Signatures.pm # search for "Allomorphism, despite"
00:21 popl Er, definition is actually given in the paragraph above it.
00:22 japhb blez, shachaf: Part of the problem is that writing a really effective JIT is *hard*, ideally done by a team working full time on it.  We don't have anyone who can work full time on it, let alone a team.  And a really good JIT is hard enough to do that occasional coding by a loose-knit band of (even very good) programmers isn't enough.
00:22 popl Ther eare probably better definitions. It's not a CS term but I think someone stole the nomenclature and repurposed it.
00:23 shachaf japhb: That's not the same as saying that Perl wouldn't benefit from it. :-)
00:23 japhb Lest you doubt the above: Look at how long it took Mozilla, Google, Microsoft, Sun, IBM, ... to do it, even throwing some REALLY bright guys at it.
00:23 shachaf (Wasn't LuaJIT pretty much done by one person?)
00:23 blez (yes)
00:23 japhb shachaf, You'll note I never claimed that it *couldn't* help Perl.
00:23 blez japhb why no one have ported perl/python to V8?
00:23 blez V8 is not exactly a JIT
00:23 japhb Perl can be compiled to v8 now.  It's an incomplete implementation though.
00:24 blez aha
00:24 shachaf japhb: I just came in in the middle of the conversation.
00:24 japhb shachaf, LuaJIT was indeed written by one person, who is a master of his craft, working full time on just that, and over the course of *years* of continuous effort.
00:24 japhb shachaf, No worries.  I didn't take offense.  :-)
00:25 blez I don't think writting JIT is _that_ hard
00:25 japhb Also, Lua is a much smaller language than Perl.
00:26 japhb blez, I didn't say writing any JIT is really hard -- Parrot had one in the old days -- rather that writing a really GOOD one is really hard.
00:26 blez good optimizations are hard, yes
00:27 blez also the GC does the slowing down most of the times, not the JIT
00:27 japhb blez, It's more than that.  A really efficient JIT requires a much wider set of skills and knowledge than most people realize.
00:27 blez that's why mono switched to newer gc
00:27 pmichaud moritz, masak, jnthn (and others):  we have a regression issue we need to resolve
00:28 blez dunno, I've done a simple jit, and I think it can be written by one man
00:28 blez if he knows some math too
00:28 blez (graphs, register coloring and etc)
00:29 pmichaud apparently all output to stdout/tty in Parrot was unbufferred prior to 4.8.0.  Starting with Parrot 4.8.0, Parrot is using line bufferring for stdout.  How much of a regression issue is this for us?
00:29 japhb blez, Not necessarily so.  Witness several iterations of Safari's and Firefox's JS engines that realized that to give a JIT the breathing room it needs, your default *interpreter* has to be really fast.  You'll note LuaJIT starts off with a wicked fast interpreter, even without the JIT.
00:29 blez it starts with interpreting, then jits?
00:30 japhb I don't mean to give the impression that it's impossible to do well by one man (LuaJIT is of course direct proof that it can), but that it's a lot harder than people think.
00:30 diakopter japhb++
00:31 benabik joined #perl6
00:31 blez yep, it's quite hard
00:31 _jaldhar_ joined #perl6
00:31 japhb blez, If I recall correctly, it looks for hotspots first -- you don't want to waste the heavy overhead of the JIT compile on something that only gets run once, or rarely enough not to matter in the big scheme of things (especially if a fast interpreter will take less total time than JIT + native exec)
00:32 blez interpreting is used for fast startup
00:32 blez but I'd compile method by method
00:32 blez which is fast too
00:32 japhb Also, you want to have gathered enough information about the runtime behavior of the code that you can determine the expected faster ordering of the code (which if branch gets the fall through, which types should be assumed and which should have checks, etc.)
00:32 japhb Yeah, the most common types I've seen are full-method, trace, and loop.
00:33 japhb But I am not an expert; there are most likely more out there I haven't studied.
00:34 blez http://stackoverflow.com/questions/​9607928/simple-bytecode-translator that was interesting
00:34 blez there are 4-5 types, trace jits are very hard to implement
00:34 shachaf edwardk was working on an amd64->amd64 tracing JIT.
00:35 japhb I remember one of the Firefox guys saying approximately "When we stay on trace, we have the fastest code.  Unfortunately, we keep falling off trace."
00:36 blez nothing can be faster than V8
00:36 blez dunno about CLR vs V8 :)
00:37 japhb blez, depending on the benchmark you choose, the winner varies.  V8 is indeed massively faster than the competition -- at the benchmarks it is optimized for.  ;-)
00:37 blez yep
00:38 blez but they directly compile the AST to x86 code
00:38 blez no bytecode
00:38 sorear shachaf: since writing jits is hard work, I think the burden of proof is on you to show that it would actually work.
00:39 sorear shachaf: what I have seen in my experience with niecza leads me to believe that the benefit of a JIT for Perl (6) would be marginal at best in typical cases
00:39 japhb blez, Remember that a fast approach/algorithm and a fast *implementation* are not the same.  The devil is ... well, you know the rest.
00:40 japhb (Not that I think the Google guys are falling down on the job, they're not.  But Firefox's original TraceMonkey was a perfect example of something that "should have" been whomping fast, but turned out not to be.)
00:43 japhb To something someone said earlier: Yes, the GC is *at least* as important as the JIT to overall performance.  The LuaJIT author is rewriting its GC from scratch yet again because it's now the limit to the VM's overall performance.  Google and IBM have also done a lot of research in this area.
00:43 blez well, Lars Bak did the V8, he's the best at this
00:43 japhb "There ain't no such thing as the fastest code."
00:43 shachaf sorear: I'm not making any claims in particular, only asking. :-)
00:48 Targen joined #perl6
00:49 _jaldhar_ joined #perl6
00:49 japhb Oh, to people interested in GC designs, I highly recommend _The Garbage Collection Handbook: The Art of Automatic Memory Management_, by Richard Jones, Antony Hosking, and Eliot Moss.  It's a good (and current) survey book with a LOT to think about.
00:52 anuby joined #perl6
01:05 kid51_ joined #perl6
01:12 hypolin joined #perl6
01:30 iemelianov joined #perl6
01:37 bruges joined #perl6
01:54 fgomez joined #perl6
01:55 thou joined #perl6
02:02 gootle joined #perl6
02:05 Circlepuller joined #perl6
02:21 stopbit joined #perl6
02:47 DarthGandalf joined #perl6
02:49 orafu joined #perl6
02:53 leprevost joined #perl6
02:56 leprevost_ joined #perl6
02:56 cognominal joined #perl6
02:56 leprevost__ joined #perl6
03:06 sirrober1 joined #perl6
03:06 cognominal joined #perl6
03:18 am0c joined #perl6
03:28 fgomez joined #perl6
03:49 cognominal joined #perl6
03:55 anuby_ joined #perl6
04:00 MikeFair_ joined #perl6
04:37 telex joined #perl6
04:51 cognominal joined #perl6
04:55 thou joined #perl6
05:12 ServerSage joined #perl6
05:22 moritz \o
05:26 thou joined #perl6
05:27 sorear o/
05:33 Targen joined #perl6
05:36 grondilu joined #perl6
05:37 grondilu How do I define how a class behaves in boolean context?
05:38 sorear define the Bool() method.
05:38 grondilu oh yeah.  Silly of me.
05:40 GlitchMr joined #perl6
05:56 birdwindupbird joined #perl6
05:59 cognominal joined #perl6
06:01 thou joined #perl6
06:04 pmichaud https://gist.github.com/3798179  # comments welcomed.  I'm going to bed now but will read scrollback in the morning when I awaken.
06:13 wtw joined #perl6
06:19 taniavs666 joined #perl6
06:21 fgomez joined #perl6
06:41 kaleem joined #perl6
06:41 birdwindupbird joined #perl6
06:41 GlitchMr joined #perl6
06:41 mars__ joined #perl6
06:45 fhelmberger joined #perl6
06:50 taniavs666 joined #perl6
07:02 flightrecorder joined #perl6
07:03 mucker joined #perl6
07:03 FROGGS joined #perl6
07:04 FROGGS guten morgen ;o)
07:06 sorear buena día
07:09 kresike joined #perl6
07:10 kresike good morning all you happy perl6 people
07:21 sorear o/
07:29 jlaire joined #perl6
07:30 kresike hello sorear o/
07:33 tadzik good morning #perl6
07:33 tadzik so, Packt is said to give everyone one free ebook to download. Anything by them worth looking at?
07:33 Psyche^ joined #perl6
07:35 kresike hello tadzik o/
07:38 fgomez joined #perl6
07:39 Su-Shee tadzik: what's "Packt"?
07:39 Su-Shee good morning everyone
07:40 tadzik Su-Shee: http://www.packtpub.com/
07:42 kresike hello Su-Shee o/
08:11 daxim joined #perl6
08:14 am0c joined #perl6
08:21 fgomez joined #perl6
08:25 Chillance joined #perl6
08:28 Moukeddar joined #perl6
08:30 Moukeddar joined #perl6
08:31 Moukeddar joined #perl6
08:33 cognominal joined #perl6
08:54 tty2 joined #perl6
08:55 tty2 left #perl6
09:13 wamba joined #perl6
09:18 gairola joined #perl6
09:23 cognominal joined #perl6
09:42 cognominal joined #perl6
09:42 kst joined #perl6
10:04 leont joined #perl6
10:27 daniel-s joined #perl6
10:32 Chillance joined #perl6
10:41 felher pmichaud: fwiw: i added a comment with my problem to your gist. Hope that helps.
10:41 * felher is afk for a while.
10:48 taniavs666 joined #perl6
11:06 Su-Shee_ joined #perl6
11:13 preflex joined #perl6
11:19 mucker joined #perl6
11:36 kurahaupo joined #perl6
11:46 GlitchMr joined #perl6
12:00 crab2313 joined #perl6
12:13 chinaxing joined #perl6
12:14 cibs joined #perl6
12:17 masak 'llo, #perl6
12:19 moritz \o masak
12:20 mtk joined #perl6
12:20 felher o/ masak
12:21 masak pmichaud: re regression issue. I don't know how big it is. do you have a piece of golf'd Perl 6 code handy whose behavior has changed as a result of this?
12:23 pmichaud masak:
12:23 pmichaud print "Enter a number: ";
12:23 pmichaud my $number = $*IN.get;
12:24 sirrober1 hallo
12:24 masak sirrober1! \o/
12:24 sirrober1 heh
12:24 masak pmichaud: ah, I see it now.
12:24 masak pmichaud: in what direction did it change?
12:24 pmichaud previously, that would display "Enter a number" prior to waiting for input.
12:25 masak pmichaud: do we even spec manual flushing of $*OUT?
12:25 grondilu joined #perl6
12:25 pmichaud now, the user experience is that the program waits for input, then displays "Enter a number: " on the next output.
12:25 masak right.
12:25 grondilu trying LWP::Simple, I get a "could not parse headers"
12:26 masak pmichaud: well, to start with the obvious: I like the pre-regression behavior better ;)
12:26 pmichaud masak: the pre-regression behavior is also the p5 behavior
12:26 masak oh, ok.
12:26 pmichaud as well as the behavior for most unix standard input/standard output programs (e.g., in C)
12:26 masak I can't think of a use case where the current behavior is desired.
12:26 masak is &prompt affected?
12:28 pmichaud it was, but moritz++ added a patch that flushes stdoutput prior to the input
12:28 pmichaud (which fixes the special case of prompt, but not the general case above)
12:29 pmichaud i.e., I see the prompt fix as a bandaid and not the true fix.
12:29 masak *nod*
12:30 pmichaud I'm fairly certain we want to come around to a p5-like and c-like behavior; the immediate question is "how do we get there from here?"
12:30 * moritz thought it was only an oddity of his new machine at $work that prompt needed a flush
12:30 masak assuming we would want to fix this before releasing Star, (a) what'd we need to do? (b) how much would it delay the release?
12:30 pmichaud well, that's what I'm trying to explore (more)
12:32 pmichaud I _think_ if we "just" configure rakudo so that $*OUT starts out unbuffered (which apparently is how Parrot was prior to 4.8.0), then we avoid most if not all of the user-facing regression.
12:32 pmichaud that would be option (a) in my note above
12:33 pmichaud I haven't had time to test what sort of buffering Parrot was using for filehandles other than stdout, though, to see if that changed in 4.8.0
12:34 pmichaud if all filehandles were effectively unbuffered prior to 4.8.0, but are now buffered, we'd probably want to address that also.
12:36 taniavs666 joined #perl6
12:36 pmichaud I know that the correct behavior is for filehandles to be buffered (line buffered for interactive devices, fully buffered otherwise) -- it's just the sudden semantic change we have to manage.
12:36 pmichaud *correct eventual behavior
12:38 [Coke] phenny: tell pmichaud that another option to his gist is to not release star this month.
12:38 phenny [Coke]: I'll pass that on when pmichaud is around.
12:39 [Coke] oh, he's stnding right over there. whoops.
12:39 pmichaud [Coke]: yeah, that's an option as well.  Another option is to accept the regression.
12:39 phenny pmichaud: 12:38Z <[Coke]> tell pmichaud that another option to his gist is to not release star this month.
12:42 pmichaud and, we still have the reported regression that some users have to send EOF prior to having any terminal input accepted.
12:42 pmichaud although I haven't seen that one golfed yet, nor have I been able to duplicate it in any of my environments.
12:44 [Coke] pmichaud: yah, that's happening for me on my mactop
12:46 moritz it happens on at least two of my machines
12:46 pmichaud I could use a code example to test.
12:47 moritz say get
12:47 moritz enter a line, press enter, don't press ctrl+D
12:47 pmichaud and just to verify, that used to work in 2012.08 but no longer works in 2012.09 ?
12:49 moritz I've just tested it on Perl-14-g7d6aa02, and it didn't work there
12:49 moritz no idea when it stopped working though
12:49 moritz and if it worked in 2012.08
12:50 pmichaud I want to make sure it's not just an instance of RT #112716... i.e., that it's actually a regression and not a bug.
12:50 pmichaud I mean that it's actually a regression and not a long-standing bug.
12:50 moritz I can kick off a build of 2012.08, but it'll take quite a bit of time
12:50 pmichaud if it's a regression, we need to address it for the 2012.09 release; if it's a long-standing bug, we need to address it, but it's not a release blocker.
12:51 sirrobert r: use JSON::Tiny; my $json = ' {"a":1}'; say from-json($json); say from-json($json.trim);
12:51 p6eval rakudo 9af8f2: OUTPUT«===SORRY!===␤Could not find JSON::Tiny in any of: /home/p6eval/.perl6/lib, /home/p6eval/nom-inst/lib/parrot/​4.8.0-devel/languages/perl6/lib␤»
12:51 sirrobert oh =)
12:52 sirrobert well, moritz:  fyi, JSON::Tiny breaks with preceeding whitespace =)
12:52 moritz star: use JSON::Tiny; my $json = ' {"a":1}'; say from-json($json); say from-json($json.trim);
12:52 p6eval star 2012.07: OUTPUT«Any()␤("a" => 1).hash␤»
12:52 sirrobert I can put a ticket in
12:52 felher pmichaud: about the EOF. The example i added to your gist is pretty golfed down. Or is this not the problem you were talking about?
12:52 pmichaud felher: I didn't see the updated gist -- looking.
12:52 moritz sirrobert: please do
12:52 felher also, i tested it with 2012.08 and 2012.08 seems to work nice.
12:53 pmichaud felher: it would help to know the os there
12:53 pmichaud and yes, that example is _exactly_ what I needed, thanks.
12:53 felher pmichaud: sorry. gentoo linux :)
12:53 birdwindupbird joined #perl6
12:54 pmichaud felher: for me that's just a little bizarre, since the example works fine for me in both 2012.08 and 2012.09
12:54 sirrobert moritz: done
12:54 pmichaud and I can't imagine that gentoo is too different from kubuntu in this area.  :-?
12:55 pmichaud let me fire up my windows instances and see if I see the regression there.
12:55 felher pmichaud: well, my other machine is gentoo-linux too, but i don't see that problem there :)
12:56 pmichaud do you access both systems in the same way -- e.g., both via ssh, or ... ?
12:56 [Coke] pretty sure jnthn reported this on his windows build, also.
12:56 felher pmichaud: one ssh (the one that doesn't work), the other local machine. :)
12:57 pmichaud felher: could you try ssh into your local machine and see if works there?
12:57 felher pmichaud: sure thing :)
12:59 felher pmichaud: works. Doesn't seem to be a ssh-problem. Also, perl5 and parrot readline without going through perl6 work just fine. I tested it when i first encountered the problem.
12:59 pmichaud felher: yeah, that's really odd-ish, since afaik rakudo just goes through parrot readline to do stuff.
13:00 pmichaud at the moment it's hard for me to troubleshoot because I haven't been able to reproduce
13:01 pmichaud I haven't been able to reproduce in my windows environment because I can't get a rakudo build because of windows backslash pathnames  :-( :-(
13:02 pmichaud (I have to figure out the correct syntax to use for --with-parrot=... from the windows command line)
13:04 felher pmichaud: yeah, np :) I just tested: after removing >>$!PIO.encoding($bin ?? 'binary' !! PARROT_ENCODING($encoding));<< from src/core/IO.pm in method open it works on the ssh-machine. So i have a working rakudo to play with. I'm not sure why this solved the problem, though.
13:05 felher pmichaud: also, the patched rakudo doesn't give the curious output when running the readline-script from the gist
13:06 pmichaud felher: that looks like an important clue as well.
13:06 pmichaud I'm guessing the encoding line is new to 2012.09 also.
13:06 pmichaud *sigh*
13:07 moritz the changelog should tell you when we added binary IO
13:09 thou joined #perl6
13:10 pmichaud looks like it was 3 months ago
13:11 jlaire joined #perl6
13:11 pmichaud so that's not it.
13:11 pmichaud at least, not directly.
13:12 pmichaud (it could be related to a change in how Parrot responds to the "encoding" method for Handle PMCs)
13:12 pmichaud I'm afk for a few mins
13:13 jnthn evenin'
13:13 dalek roast: 386f6d7 | jonathan++ | S02-names-vars/signature.t:
13:13 dalek roast: Correct signature/declaration binding tests.
13:13 dalek roast:
13:13 dalek roast: A declarator is needed to cause actual binding.
13:13 dalek roast: review: https://github.com/perl6/roast/commit/386f6d7448
13:13 felher o/ jnthn
13:13 masak jnthn! \o/
13:13 jnthn masak! \o/
13:13 jnthn My talk is given \o/
13:13 tadzik \o/
13:13 sirrobert =)
13:14 dalek rakudo/nom: 031a497 | jonathan++ | src/core/traits.pm:
13:14 dalek rakudo/nom: Ensure &trait_mod:<is>.onlystar == True.
13:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/031a49747d
13:14 dalek rakudo/nom: fdf347b | jonathan++ | src/Perl6/World.pm:
13:14 dalek rakudo/nom: Scatter some native types in Perl6::World.
13:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/fdf347ba4b
13:14 dalek rakudo/nom: 14f0230 | jonathan++ | src/ (3 files):
13:14 dalek rakudo/nom: Implement binding with declarators.
13:14 dalek rakudo/nom:
13:14 dalek rakudo/nom: This gets things like 'my (:$a, :$b) := foo()' style things working.
13:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/14f02309ca
13:14 dalek rakudo/nom: 6f71e7e | jonathan++ | t/spectest.data:
13:14 dalek rakudo/nom: Run S02-names-vars/signature.t.
13:14 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6f71e7e8dc
13:14 masak jnthn: dude, did you write commits during the talk?
13:14 jnthn during other people's talks
13:14 jnthn Also
13:14 tadzik hey, get a 5-minute rest, you don't have to start coding immediately after :P
13:14 jnthn it missed two :/
13:15 jnthn I also implemented hides trait and "is hidden"
13:15 tadzik +dalek | rakudo/nom: Implement 'is hidden' and 'hides'.
13:15 * tadzik hides
13:15 tadzik H A H A H A
13:15 * tadzik is hidden
13:15 jnthn :P
13:15 tadzik I got that built-in :P
13:15 bluescreen10 joined #perl6
13:16 leprevost joined #perl6
13:16 tadzik but in Perl 6 I can hide my parents, cute :)
13:16 tadzik class A hides Your_kids, hides Your_wife {}
13:17 jnthn no comma needed :)
13:17 Su-Shee wrong semantics. you'll need a hide_from method on yourself which takes an object ;)
13:18 tadzik does the spec say if settings should use this in any case?
13:19 dayangkun joined #perl6
13:20 jnthn tadzik: What? is hidden?
13:20 jnthn I doubt it as then you can't subclass and defer to it
13:21 masak phenny: "离开"?
13:21 phenny masak: "Leave" (zh-CN to en, translate.google.com)
13:21 benabik joined #perl6
13:30 pmichaud grrrrr, the "say get" example works on my windows system.
13:30 pmichaud so, I don't yet have a way to reproduce the bug :-(
13:31 pmichaud I bet it "works" for me because I'm using gcc (and thus glibc)
13:34 pmichaud okay, I wonder if it's gnu-readline related.
13:37 jnthn pmichaud: The debugger is where I've seen it go wrong.
13:37 jnthn pmichaud: I put https://github.com/jnthn/rakudo-debugger/com​mit/ae2dde5dacdef39e3d53ab519da1ea0cef16a978 in to be able to demo stuff
13:37 felher pmichaud: if i find some time tonight i might be able to get you a linux-container on my server and ssh-access to it so you can experiment there.
13:37 pmichaud jnthn: the debugger appears to be working for me too.
13:38 jnthn pmichaud: Including single-stepping?
13:38 pmichaud jnthn: afaict, yes.
13:38 jnthn pmichaud: Wait, are you trying a version without my patch?
13:38 pmichaud yes.
13:38 xinming joined #perl6
13:39 felher pmichaud: if you want to, of course.
13:39 jnthn pmichaud: hmmm
13:39 pmichaud jnthn: I was able to single-step a 4-line program using the 2012.09 candidate star tarball
13:39 jnthn pmichaud: Try also the debugger REPL
13:40 pmichaud jnthn: your patch also leads me to believe the problem is readline-related.
13:40 pmichaud s/is/may be/
13:40 pmichaud jnthn: I did have a problem with second and subsequent lines in the REPL, yes.
13:40 jnthn pmichaud: I think so
13:41 jnthn pmichaud: ah, ok. Then at least you can reproduce one of the things
13:41 pmichaud although the first line entered in the debugger REPL worked fine for me.
13:41 jnthn ok, and the second line did weird things and you needing to hit Ctrl+Z or so?
13:41 jnthn Yeah, second line for me also.
13:41 jnthn It's odd
13:41 rurban blez: parrot had a compilation option to jit or output native machine code. It was removed a few years ago.
13:41 pmichaud it's hard for me to determine if the debugger is working, though, because the ansi escape sequences make it really hard to read
13:42 rurban blez: perl5 compilation to V8 is done in perlito.
13:42 pmichaud rurban: nobody was able to maintain the jit, so it was disabled/removed.
13:42 pmichaud rurban: oh, I see, you were responding to someone else.  never mind.  :-)
13:43 rurban yes, just reading the backlog...
13:43 rurban about STDOUT readline buffering. I think my fix is right.
13:43 pmichaud rurban: afaict, your fix causes STDOUT to be flushed when any filehandle uses readline
13:44 taniavs666 joined #perl6
13:44 rurban we have a read_buffer and a write_buffer. if the write_buffer is empty, which it is in the STDOUT case it needs to be flushed manually. The rest is handled by the new buffering logic.
13:45 pmichaud okay, none of that made sense to me.  :-)
13:45 rurban if any fh uses readline, io_sync_buffers_for_read works
13:46 rurban ditto io_sync_buffers_for_write() with write handles
13:47 rurban It was just STDOUT which fell though. whiteknight needs to think of the case reading from another FH
13:47 rurban But the buffering logic was rewritten and lacks some tests, yes.
13:47 pmichaud I'm sure whatever you're saying is correct at some level; the terms don't match my understanding of what they normally mean in a unix or stdio world.
13:48 pmichaud i.e., how does one "flush an empty buffer"?
13:48 TimToady I first noticed the ^D problem a few weeks ago writing the http://rosettacode.org/wik​i/Pig_the_dice_game#Perl_6 program
13:48 rurban its a NOP
13:48 TimToady it still requires ^D on my system
13:48 pmichaud TimToady: os?
13:48 TimToady though the prompt shows up now
13:48 TimToady Ubuntu
13:48 rurban But I have no idea about ^D and corner cases.
13:48 kresike bye folks
13:49 jnthn Well, the problem I was seeing seems to be that it is expecting more input after I hit enter in some cases when doing prompt (or more generally $*IN.get)
13:49 jnthn And I have to do the ^d
13:49 rurban Interesting.
13:49 pmichaud we appear to have two problems that are conflated.
13:49 TimToady it acts like stdin isn't line buffered
13:49 sirrobert how do I do what I mean by:  my @abc=[1,2,3]; my ($a,$b,$c) = @abc;
13:49 sirrobert (I want $a to be 1, $b to be 2,...)
13:49 moritz sirrobert: my @abs = (1, 2, 3)
13:49 pmichaud TimToady: I'm running kubuntu, I'm wondering what is making your system not act line buffered when mine is acting line buffered
13:49 colomon joined #perl6
13:50 odoacre joined #perl6
13:50 kurahaupo rurban: ctrl-D sends the kernel's current line-buffer, excluding the ctrl-D itself. If the buffer is empty, the receiving program will get an empty read, which is interpreted as "end of file"
13:50 pmichaud TimToady: you also sound like you're on Rakudo head, yes?
13:50 moritz sirrobert: then you'll have three elements in @abc, not one
13:50 TimToady it's also 64-bit, if that's a difference
13:50 pmichaud yeah, I'm 64-bit also.
13:50 sirrobert moritz: thanks
13:50 TimToady yes, a day or so old
13:50 pmichaud anyway, there are two conflated issues here.
13:50 TimToady well, maybe 3 or 4
13:50 kurahaupo rurban: importantly, "end of file" is not a persistent state
13:50 rurban flushing STDOUT when any filehandle uses readline doesn't seem completely wrong to me. I am worried when the out fh is not flushed.
13:51 pmichaud one is that parrot used to act as though stdout was completely unbuffered, and now it's buffered and not tied to input handling
13:51 crab2313 joined #perl6
13:51 rurban oh, eof!
13:51 pmichaud rurban: it's not just .readline that is affected, but also .read
13:51 pmichaud test program coming up.
13:51 rurban well, that's all whiteknights domain.
13:52 felher i am off now until the evening/night. If you, pmichaud, want access to my server, let me know. I wanted to experiment with linux-containers for quite some time now anyway :)
13:52 pmichaud the other issue is that stdin is acting fully buffered on some systems instead of line buffered
13:52 rurban IMHO parrot should not do STDOUT and STDIN buffering. It might be too high-level for us.
13:53 pmichaud rurban: *C* does stdout and stdin buffering, it seems like Parrot ought to do the same.  More specifically, Parrot needs to be able to abstract away some of the interactive terminal issues, which is what it's failing to do now.
13:53 TimToady http://irclog.perlgeek.de/​perl6/2012-09-13#i_5984999 is where I first mentioned it
13:53 kurahaupo C's stdio offers 3 levels: unbuffered, line-buffered, and block-buffered.
13:53 rurban I see the problem
13:54 pmichaud TimToady: do you have any funky stty settings, ooc?
13:54 TimToady don't think so
13:54 pmichaud yeah, I'd be surprised if there were.  :)
13:54 rurban STD* buffering is always a problem, and only helps if we need to print a lot of text to STDOUT
13:54 rurban or STDERR
13:55 yarp joined #perl6
13:55 pmichaud STDERR should not be buffered.
13:55 rurban yep
13:55 rurban I wonder if STDERR is also buffered now
13:55 pmichaud that's on my list of things to check.
13:55 pmichaud (which keeps growing longer, sadly.)
13:56 rurban And I found some internal encoding bugs with utf8 vs utf16. Hairy stuff
13:57 rurban I'll be happy to pass the buffering problem to whiteknight.
13:59 stopbit joined #perl6
14:00 leont joined #perl6
14:00 jnthn pmichaud: Other option for the Star release may be to tie ourselves to a Parrot that ain't busted.
14:01 pmichaud jnthn: that means doing some reverts to Rakudo
14:01 jnthn pmichaud: aye
14:01 pmichaud and hopefully we don't have any NQP changes that rely on the newer Parrot
14:01 kurahaupo rurban: failing to block-buffer can result in order-of-magnitude slowdown in some environments. Line buffering is a hack to work nicely in an interactive situation.
14:01 jnthn pmichaud: not that I'm aware of
14:01 pmichaud (e.g., with QAST and the like)
14:04 benabik joined #perl6
14:04 dalek rakudo/nom: fea947c | jonathan++ | docs/ChangeLog:
14:04 dalek rakudo/nom: A couple of ChangeLog entries.
14:04 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/fea947c525
14:07 jnthn pmichaud: Anyway, it's a kinda last resort option...
14:07 pmichaud well, given the extensiveness of the regressions we're having to track down, it's becoming less last-resortish, I fear.
14:07 aramisf joined #perl6
14:07 jnthn pmichaud: *nod*
14:08 jnthn pmichaud: If you feel it's the best thing to do, then I'm +1.
14:09 benabik_ joined #perl6
14:09 pmichaud I suppose a quick test would be to see if NQP 2012.09 will even build using Parrot 4.7.0
14:10 * pmichaud tries that.
14:12 skids joined #perl6
14:12 moritz fwiw my build of 2012.08 completed. The 'say get' example works fine on it
14:13 pmichaud moritz++  # useful clue, thanks.
14:16 Khisanth joined #perl6
14:17 pmichaud nqp builds and passes tests using 4.7.0
14:17 pmichaud now let's see if I can build a rakudo from that nqp
14:20 GlitchMr n:
14:20 GlitchMr n: # i just want << and >>
14:20 p6eval niecza v22-6-g9e5350d:  ( no output )
14:21 GlitchMr n: print 42# i just want << and >>
14:21 p6eval niecza v22-6-g9e5350d: OUTPUT«42»
14:21 pmichaud compiling rakudo --without-readline doesn't cause the 'say get' bug to show up on my system.
14:26 brrt joined #perl6
14:26 pmichaud stderr in 4.8.0 appears to be properly unbuffered, so at least that's right.  :)
14:30 mucker joined #perl6
14:33 pmichaud looks as though rakudo 2012.09 builds fine using parrot 4.7.0 and runs all spectests with the exception of IO-Socket-INET.t
14:34 PacoAir joined #perl6
14:34 pmichaud so, if we revert the socket and/or spectest changes since 2012.08, we could likely do a 2012.09.1 release based on 4.7.0
14:35 pmichaud taking a break here for a bit.
14:53 dalek nqp: 29b1d0c | jonathan++ | src/QRegex/P5Regex/Actions.nqp:
14:53 dalek nqp: Toss qalt_nfas from P5Regex.
14:53 dalek nqp:
14:53 dalek nqp: Alternations are always sequential.
14:53 dalek nqp: review: https://github.com/perl6/nqp/commit/29b1d0c52e
14:53 dalek nqp: 7033a27 | jonathan++ | src/QRegex/P5Regex/ (2 files):
14:53 dalek nqp: Basic positional capture support.
14:53 dalek nqp:
14:53 dalek nqp: Seems to get the numbering done the p5 way, at least for basic cases.
14:53 dalek nqp: review: https://github.com/perl6/nqp/commit/7033a27fbb
14:53 dalek nqp: 6c47c7b | jonathan++ | t/p5regex/ (2 files):
14:53 dalek nqp: Some basic p5regex capture tests.
14:53 dalek nqp: review: https://github.com/perl6/nqp/commit/6c47c7bb22
14:55 xinming joined #perl6
14:56 benabik joined #perl6
15:00 benabik_ joined #perl6
15:04 nyuszika7h joined #perl6
15:20 jnthn 'night, #perl6
15:20 tokuhiro_ joined #perl6
16:05 thou joined #perl6
16:09 Targen joined #perl6
16:09 mars__ joined #perl6
16:10 thou joined #perl6
16:12 preflex_ joined #perl6
16:14 GlitchMr std: print $$;
16:14 p6eval std 77327a4: OUTPUT«[31m===[0mSORRY![31m===[0m�Unsupported use of $; variable; in Perl 6 please use real multidimensional hashes at /tmp/M48rAzPGc3 line 1:�------> [32mprint $$;[33m�[31m<EOL>[0m�Parse failed�FAILED 00:00 42m�»
16:14 GlitchMr Uhmmm...
16:14 GlitchMr Shouldn't it see $$ variable instead of $;?
16:16 Chillance joined #perl6
16:16 moritz std: my $a; $$a
16:16 p6eval std 77327a4: OUTPUT«ok 00:00 42m␤»
16:16 GlitchMr I know about that
16:16 * moritz too
16:16 GlitchMr But perhaps those errors should mention $$ if it looks like process-ID variable.
16:17 GlitchMr So, if unsupported use of variable will happen, but character before that variable is $, it's actually process ID
16:21 moritz I agree that warning about $$ would be better, if it's not too much effort
16:21 moritz though $$; is clearly the longer token than $$
16:25 GlitchMr Perhaps $$ should be allowed to only have certain characters after it
16:25 GlitchMr The characters that would make sense
16:25 GlitchMr So $$; won't find $; variable
16:26 GlitchMr In Perl 5, $$; is $$ variable. If you want to dereference $; variable, you have to use explicit ${$;}
16:26 GlitchMr That makes sense
16:27 GlitchMr (actually, if you want to dereference any non-dollar-underscore variable)
16:27 moritz eval: my $a = \1; say $$a
16:27 buubot_backup moritz: ERROR: Can't call method "say" without a package or object reference at (eval 20) line 1.
16:27 moritz eval: my $a = \1; $$a
16:27 buubot_backup moritz: 1
16:28 GlitchMr well, ok, $a, $b, @ARGV counts
16:28 GlitchMr well, any punctuation variable
16:28 GlitchMr $_ doesn't count in that because it's \w
16:28 GlitchMr Except I think that Perl 6 should allow $$!
16:29 moritz why?
16:29 GlitchMr And most importantly, it should allow things like $$.hi
16:29 moritz why?
16:30 moritz if you way $! for $.hi, the $ already implies item context
16:30 moritz if your code is so insane to need *two* .item calls, you should fix your code instead of trying to tweak the language
16:31 pmichaud (2012.09 star release)   at the moment, I'm leaning towards putting nqp and rakudo back onto the 4.6.0 parrot release, reverting the socket changes as needed in Rakudo to make that happen.
16:31 pmichaud that seems to be the path of least difficulty for now.
16:32 moritz +1
16:32 masak +1
16:32 masak pmichaud: are you going to write to parrot-dev about it, too?
16:33 masak hm, maybe you've already done that. haven't checked...
16:33 GlitchMr +1.000000000000001
16:33 pmichaud haven't written parrot-dev about it, no
16:33 pmichaud I can write parrot-dev about it, yes.  Unfortunately, I'm not quite sure what to write, since I can't seem to duplicate the input blocker on any of my systems
16:34 moritz first do the release, then we can figure out what to say to the parrot folks
16:34 flussence :q
16:34 * hugme hugs flussence, good vi(m) user!
16:34 flussence whoops :)
16:35 GlitchMr Wrong program ;-)
16:35 flussence .oO( I wonder if I can get tmux to recognise that... )
16:35 GlitchMr But IRC with vi like typing could be fun
16:35 GlitchMr You could bounce in IRC using % key
16:35 moritz flussence: to ignore it? or to quite tmux?
16:36 flussence : instead of ^B
16:36 moritz if you never want to use vim inside of tmux, that might work
16:40 flussence it seems to work, but I'm too lazy to define sensible keybindings to keep it :)
16:48 masak I've seen this Apple Maps-related autopun "walks into a bar" snowclone twice from seemingly different Twitter sources at this point: http://twitter.com/dwlz/status/250669009803018241
16:49 GlitchMr oops, I accidentally ate lost of memory by running memory wasteful code. I through I was running it on my machine
16:49 GlitchMr ok, closed
16:49 GlitchMr sorry
16:50 GlitchMr I had to use 'kill -9'
16:50 stepnem joined #perl6
16:51 moritz did somebody work on an ORM for rakudo?
16:52 GlitchMr I've worked, but I stopped
16:53 moritz masak: A man using Apple Maps walks into a bar. Now his head hurt.
16:53 masak a bit of a non sequitur, and also not new ;)
16:53 moritz not surprised, it's a bit obvious
16:54 masak I bet jnthn's DrunkenGymnast has a hurting head from walking into a bar as well :P
16:55 thou joined #perl6
16:58 kst joined #perl6
17:05 grondilu joined #perl6
17:07 grondilu p6: my Buf $a .= new: 65; my Buf $b; say $a ~ $b;
17:07 p6eval niecza v22-6-g9e5350d: OUTPUT«Unhandled exception: Cannot call new; none of these signatures match:␤    Mu, *%_␤  at /tmp/OzAN99LLoA line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4199 (module-CORE @ …
17:07 p6eval ..rakudo fea947: OUTPUT«Cannot use a Buf as a string, but you called the Str method on it␤  in method Str at src/gen/CORE.setting:6991␤  in method Stringy at src/gen/CORE.setting:776␤  in sub infix:<~> at src/gen/CORE.setting:1076␤  in block  at /tmp/ToHztv4FxA:1␤␤»
17:07 preflex_ joined #perl6
17:08 GlitchMr Isn't "Buf" in "my" only assertion?
17:08 grondilu p6: my Buf $a .= new: 65; my Buf $b .= new: 66; say $a ~ $b;
17:08 p6eval rakudo fea947: OUTPUT«Buf:0x<41 42>␤»
17:08 p6eval ..niecza v22-6-g9e5350d: OUTPUT«Unhandled exception: Cannot call new; none of these signatures match:␤    Mu, *%_␤  at /tmp/RajyC6GCcn line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4199 (module-CORE @ …
17:08 GlitchMr But I guess it should work in this case for DWIM
17:08 moritz and what should it do?
17:09 GlitchMr http://perlcabal.org/syn/S12.html#line_65
17:09 GlitchMr That
17:09 grondilu I was expecting the concatenation to occur even if one of the buffer is not defined.
17:09 moritz grondilu: and what should that do?
17:10 grondilu Isn't a non-defined buffer considered to be a zero-length buffer?
17:10 moritz is it?
17:10 GlitchMr It should do anything because PHP either does something nonsensical or crashes fatally.
17:10 GlitchMr But we aren't PHP.
17:10 moritz grondilu: I genuinely don't know, which is why I'm asking
17:10 grondilu lol
17:11 moritz grondilu: I don't think the spec says anything about Buf type objects
17:11 grondilu r: my Str $a; say $a ~ "foo"
17:11 p6eval rakudo fea947: OUTPUT«use of uninitialized value of type Str in string context  in block  at /tmp/B7GO05HL_3:1␤␤foo␤»
17:11 colomon Can you concat Bufs?
17:12 erkan joined #perl6
17:12 erkan joined #perl6
17:12 grondilu colomon: sure, it does make sense, doesn't it?
17:12 moritz they'd be pretty useless if you couldn't do anything with them, no?
17:13 colomon You can only concat (in the infix:<~> sense) things which are stringy or can be cast to stringy, right?  Are Bufs stringy?
17:13 grondilu well, I saw above that with string, concatenation with non defined values are not allowed.  So I guess it should be forbidden with buffers too.
17:14 skids IMO Buf ~ Buf should be kosher, but not between Buf and Str without explcit encoding.
17:15 colomon interesting, concatenation in S03 just says "infix:<~>, string/buffer concatenation"
17:16 grondilu Well, if you don't allow "~" with buffers, it's gonna be tricky to do concatenate buffers :/
17:16 colomon so maybe Buf ~ Buf should be kosher?  S02 makes it pretty clear Str ~ Buf is a no-no.
17:17 grondilu "kosher"?
17:17 pmichaud since Buf does Positional, one could concatenate Bufs the way one concatenates arrays (whatever that ends up being)
17:17 colomon grondilu: p6 has a LOT of operators.  creating a specific Buf concatenate operator would be par for the course.  (And indeed, I wouldn't be surprised if it already existed and I don't know about it.)
17:17 colomon grondilu: http://www.thefreedictionary.com/kosher 2a
17:18 grondilu r: say Buf.new(65) ~ Buf.new(66) # buffer concatenation does work already
17:18 p6eval rakudo fea947: OUTPUT«Buf:0x<41 42>␤»
17:18 * skids wishes that 0x<NN NN NN> worked as a literal frequently.
17:19 pmichaud anyone know why rule-in-class-Str.t is listed twice in t/spectest.data ?
17:19 MayDaniel joined #perl6
17:19 colomon pmichaud: to get extra test passes attributed to Rakudo?  ;)
17:19 pmichaud colomon: actually, it cases the harness to carp and stop.
17:20 colomon pmichaud: git blame?
17:20 pmichaud looks like jnthn
17:21 colomon got to be an oversight, I'd think.
17:21 moritz oversight
17:21 pmichaud moritz++ added it on 09-15, jnthn added a second copy on 09-26
17:21 pmichaud okay, fixing.
17:24 pmichaud I'm currently planning on releasing 2012.09.1 based on nom's HEAD (rather than as a branch of the 2012.09 release), any objections or comments?
17:25 pmichaud this also will have the effect of including features added since 2012.09 in the release.
17:26 kst joined #perl6
17:27 fglock_ joined #perl6
17:28 moritz why?
17:28 Targen joined #perl6
17:29 pmichaud (1) that's the approach we used for 2012.04.1    (2) it helps us maintain consistency among the releases
17:29 pmichaud my plan is to put nom and rakudo development mainline back onto the 4.6.0 parrot until all of the io issues can be fixed
17:31 colomon pmichaud++
17:31 pmichaud s/nom and rakudo/nqp and rakudo/
17:31 kaare__ joined #perl6
17:38 leprevost joined #perl6
17:41 sorear good * #perl6
17:46 sjohnson word up!
17:48 pmichaud I can either revert the tests in S32-io/IO-Socket-INET.*  to have their Parrot 4.6.0 semantics, or I can leave them alone and remove them from spectest.data for the time being.
17:49 moritz we have modules that depend on the current behavior, I think
17:49 [Coke] I would remove them from spectest.data for now.
17:49 pmichaud well then we're screwed.
17:49 pmichaud I can't get the current behavior from a 4.6.0 parrot, I don't think.
17:50 moritz (I could be wrong)
17:50 pmichaud which modules, ooc?
17:51 moritz LWP::Simple, maybe some IRC bots
17:52 pmichaud then we either have to revert those back to 2012.08, or we have to figure out how to live with parrot 4.8.0
17:52 dalek Perlito: e8d8c18 | (Flavio S. Glock)++ | / (2 files):
17:52 dalek Perlito: Perlito5 - js3 - fix isa(), can(), for
17:52 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/e8d8c183f3
17:55 pmichaud fwiw, though, I think my initial tests of 2012.09 star showed that LWP::Simple wasn't passing its tests anyway.
17:55 pmichaud so we might need to roll it back to the 2012.08 version anyway.
17:55 moritz oh
17:55 moritz yes
17:57 sorear can't we modify io::socket::inet to flush after operations?
17:57 moritz sorear: the socket related changes are mostly unrelated to the readline stuff
17:58 moritz sorear: what changed there is that .recv(Int) used to treated the integer as a number of bytes (but retured Str), and now it's a number of codepoints
17:58 moritz s/treated/treat/
18:01 pmichaud so, since lwp wasn't working with 2012.09 anyway, my current best guess is to continue moving back to 4.6.0 parrot, comment out the IO-Socket-INET.t test from spectest.data (at least for the release), and release Star 2012.09 using the 2012.08 version of lwp-simple
18:02 moritz +1
18:02 pmichaud (assuming it works)
18:02 pmichaud but right this moment I need lunch first, so I'm doing that :)
18:05 erkan joined #perl6
18:05 erkan joined #perl6
18:07 spider-mario joined #perl6
18:14 kst joined #perl6
18:30 leont joined #perl6
18:31 benabik joined #perl6
18:31 oi joined #perl6
18:36 psch joined #perl6
18:50 cognominal joined #perl6
18:54 dalek Perlito: 4a4bd38 | (Flavio S. Glock)++ | / (3 files):
18:54 dalek Perlito: Perlito5 - new table CORE_OVERRIDABLE
18:54 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/4a4bd38300
19:04 thou joined #perl6
19:05 birdwindupbird joined #perl6
19:24 dalek rakudo/nom: 2d0e2de | pmichaud++ | t/spectest.data:
19:24 dalek rakudo/nom: Remove extra copy of integration/rule-in-class-Str.t added by 19d7cd2b9a.
19:24 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/2d0e2dec93
19:25 rurban I've implemented now the parrot multi-byte variants for bit_ops strings
19:26 rurban unspec'd are the conversion rules for different encodings, so I came up with some "good" rules
19:26 pmichaud I just want to have the codepoint values anded/ored
19:27 rurban band_s_s utf8:"bla" ucs2:"foo"
19:27 rurban I rather want to convert utf8 to ucs2 before doing arith with them. or just the raw bytes?
19:28 pmichaud right, it should give back a string with codepoints   0x62 & 0x66, 0x6c & 0x6f, 0x61 & 0x6f
19:28 shachaf Why are you using UCS2 instead of UTF-16?
19:28 pmichaud we definitely don't want the raw bytes.. for a raw byte encoding one would first transcode the strings to fixed8 or something
19:28 rurban and for utf8, shouldnt it be downconverted to latin1 if possible?
19:29 pmichaud parrot has gone back-and-forth about whether it should automatically down-convert strings... I don't remember what the last decision was.
19:29 rurban I have now internal non-exiting latin1, and ucs2 converters
19:29 sorear should use ucs4, not utf16
19:30 sorear logically, at least
19:30 rurban It was a TODO in the code, but I'm not sure if it makes sense at all.
19:30 rurban ucs2 and ucs4 yes, utf8 and utf16 not
19:30 FROGGS joined #perl6
19:30 flightrecorder joined #perl6
19:35 fgomez joined #perl6
19:36 sirrobert joined #perl6
19:38 sirrobert r: sub f { return { foo => 'a', bar => -> { return 'baz' }(), }, }; say f;
19:38 p6eval rakudo fea947: OUTPUT«baz␤»
19:38 sirrobert r: sub f { return { foo => 'a', bar => -> { 'baz' }(), }, }; say f;
19:38 p6eval rakudo fea947: OUTPUT«("foo" => "a", "bar" => "baz").hash␤»
19:39 sirrobert that seems a little weird to me (that the arrow-block return breaks context)
19:39 moritz which context is broken where?
19:40 sirrobert maybe I misunderstood what *should* happen, but the return value of the ->{} block was given for the whole thing
19:40 moritz yes, because blocks are transparent to return
19:40 moritz return always actions on routines
19:40 sirrobert so is The Right Thing to use implicit return?
19:40 moritz yes
19:40 moritz explicit return from a block would be 'leave', but I guess that rakudo doesn't implement that yet
19:41 sirrobert is there a synonym for "return" that I could use? =)
19:41 sirrobert inside blocks
19:41 moritz r: say (-> { leave 5 }).()
19:41 sirrobert well, a near-synonym I mean
19:41 p6eval rakudo fea947: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&leave' called (line 1)␤»
19:41 moritz n: say (-> { leave 5 }).()
19:41 p6eval niecza v22-6-g9e5350d: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared routine:â�¤      'leave' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1437 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) â�¤  at /hom…
19:41 moritz huh, doesn't seem so popular :-)
19:41 sirrobert heh
19:41 moritz but leave should work, afaict
19:41 GlitchMr return 2 times following value Mu;
19:41 sirrobert r: sub f { return { foo => 'a', bar => -> { leave 'baz' }(), }, }; say f;
19:41 p6eval rakudo fea947: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&leave' called (line 1)␤»
19:42 preflex joined #perl6
19:42 moritz where "should work" means "according to the spec", not by current implementations
19:42 sirrobert fair enough
19:42 sirrobert ok, thanks-- didn't know that about return =)
19:43 moritz note that that's very handy for dispatchers
19:43 sirrobert oh yeah:  so that means that ->{} blocks are not Routine objects?
19:43 moritz correct
19:43 sirrobert they are what?  Code?
19:43 sirrobert or Block?
19:43 moritz r: say (-> { }).WHAT
19:43 p6eval rakudo fea947: OUTPUT«Block()␤»
19:43 sirrobert right =)
19:43 moritz r: say Block.^mro
19:43 p6eval rakudo fea947: OUTPUT«Block() Code() Any() Mu()␤»
19:43 sirrobert cool, thanks
19:43 moritz r: say Sub.^mro
19:43 p6eval rakudo fea947: OUTPUT«Sub() Routine() Block() Code() Any() Mu()␤»
19:43 sirrobert that's interesting
19:44 sirrobert so a Sub could use "leave" as well (according to spec)
19:44 sirrobert ?
19:44 moritz yes
19:44 moritz http://doc.perl6.org/images/type-graph-Code.svg
19:44 sirrobert ok, good to know
19:44 leont left #perl6
19:44 sirrobert is there something I could read about why it's especially good for dispatchers?
19:44 sirrobert I mean, I could figure out a few things, but if there's some developed thought on it =)
19:45 moritz recently for a p5 work project I wanted to implement a text menu
19:45 moritz something along the lines   menu 'a' => &add_stuff, d => &delete_stuff, l => &list_stuff
19:45 sirrobert nod
19:46 moritz and the existing code used   my $in = get(); if $in eq 'a' { add_stuff() } ...
19:46 moritz and some of that returned from the outer routine
19:46 moritz ie
19:46 sirrobert ahhh, cool
19:46 moritz if $in eq '-' { return SPECIAL_VALUE }
19:46 moritz now, that thing is sadly written in Perl 5, not Perl 6
19:47 sirrobert the dispatcher can off-load it's own return to domain-specific blocks within
19:47 moritz in Perl 6 I'd have no trouble returing from the outer routine
19:47 sirrobert nod
19:47 moritz in Perl 5, there's no sane way to do that, since all callbacks are normal, anonymous subs
19:48 sirrobert yeah, I can see what you mean
19:48 moritz in the end I did a very nasty hack: http://www.perlmonks.org/?node_id=995995
19:49 moritz (it being perl, there's always a hack possible; needless to say that Perl 6 makes the hack obsolete :-)
19:50 sirrobert clever hack =)
19:50 sirrobert It's gotten hard for me to read p5 (even after 10 years doing it)
19:51 moritz it's gotten hard for me to write p5 without noting all those places where Perl 6 features would so much help me :-)
19:51 moritz besides the obvious ones, I really love :$foo for passing named arguments
19:52 * masak too
19:52 moritz needing to write   foo => $foo  in p5 feels so repetitive and ugly
19:52 sirrobert heh nod
19:52 masak I'm all for extending the :$foo syntax as far as we possibly can.
19:52 masak :$!foo was a good idea.
19:52 masak maybe :$<foo> would be, too.
19:52 moritz I think :.foo doesn't work yet either
19:53 masak ooh, it totally should.
19:53 moritz nr: $_ = 'bar'; say (:.foo).perl
19:53 p6eval niecza v22-6-g9e5350d: OUTPUT«[31m===[0mSORRY![31m===[0m��Bogus statement at /tmp/E0e7liA2_6 line 1:�------> [32m$_ = 'bar'; say ([33m�[31m:.foo).perl[0m��Parse failed��»
19:53 p6eval ..rakudo fea947: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 2, near ":.foo).per"␤»
19:54 sirrobert how do I get the last element of an array?
19:54 moritz .[*-1]
19:54 sirrobert thanks
19:54 GlitchMr .new is so repeative ugly... what about .n instead? (not really serious)
19:55 * moritz wonders if we can abuse the R meta operator for indexing from the back, written as @array.R[0]; # last element
19:55 pmichaud ick
19:56 pmichaud that reads like Array.R.[0] to me :-)
19:56 moritz pmichaud: I wasn't entirely serious with that last one
19:56 moritz though :.method was something I've wanted once or twice
19:56 moritz std: :.method
19:56 p6eval std 77327a4: OUTPUT«[31m===[0mSORRY![31m===[0m�Bogus statement at /tmp/RfLXU7KekY line 1:�------> [32m<BOL>[33m�[31m:.method[0m�Parse failed�FAILED 00:00 42m�»
19:58 zby_home_ joined #perl6
19:58 raiph joined #perl6
20:00 Targen_ joined #perl6
20:03 sirrobert r: my %h = { a => [[1,2],[3,4]] }; for %h<a> -> $b { say $b.perl; };
20:03 p6eval rakudo fea947: OUTPUT«[[1, 2], [3, 4]]␤»
20:04 sirrobert What's the appropriate way to loop through the elements of %h<a> here?
20:04 moritz r: my %h = { a => [[1,2],[3,4]] }; for %h<a>.list -> $b { say $b.perl; }
20:04 p6eval rakudo fea947: OUTPUT«[1, 2]␤[3, 4]␤»
20:04 sirrobert context is everything
20:04 sirrobert I keep forgetting I can recast
20:05 moritz the first few paragraphs of http://doc.perl6.org/type/List might be helpful
20:05 sirrobert thanks
20:15 benabik joined #perl6
20:17 revdiablo joined #perl6
20:22 raiph hi all
20:23 sorear hello raiph
20:27 raiph hey sorear
20:47 flussence question! (@hugearray X~ ', ') is lazy, is there an easy way to keep it that way and omit the trailing comma?
20:48 pmichaud you mean you want a comma concatenated to all of the elements of @hugearray except the last?
20:50 flussence the thing I'm going for is I want to print a long list formatted like that, but without waiting for join() to finish first
20:50 rurban pmichaud: my rurban/bitwise_uni-gh848 branch implements now some bit_ops encoding conversions
20:51 pmichaud rurban: cool, I'll take a look later when I get through some of the other issues
20:51 sorear flussence: my @temp := (', ' X~ @hugearray); @temp[0] .= substr(2)
20:51 rurban It's not perfect yet with ucs4
20:51 sorear not quite the same, but should be usable
20:51 flussence hadn't thought of prepending, that works for me :)
20:53 dalek nqp: f12484a | pmichaud++ | / (2 files):
20:53 dalek nqp: Back PARROT_REVISION down to 4.4.0, bump VERSION to 2012.09.1
20:53 dalek nqp: review: https://github.com/perl6/nqp/commit/f12484a8f9
20:56 rurban Did step back to 4.4.0 work?
20:56 rurban the step back...
20:57 pmichaud well, we lose some of the socket improvements from 4.8.0, but better than than regress on all interactive i/o
20:57 pmichaud *better that
20:57 sirrobert is there a better way to do this:
20:57 sirrobert r: my $a = [[1,2],[3,4]]; my @firsts; for $a.list -> $b { @firsts.push: $b[0]; }; say @firsts;
20:57 p6eval rakudo 2d0e2d: OUTPUT«1 3␤»
20:57 sirrobert I want to get the first element of each array in an array of them.
20:58 pmichaud $a>>.[0]  might work with the latest spec changes, but probably isn't implemented in rakudo yet
20:59 sirrobert doesn't work currently (but doesn't break)
20:59 pmichaud r: my $a = [[1,2],[3,4]];  say $a.map( *.[0] ).perl
20:59 p6eval rakudo 2d0e2d: OUTPUT«(1, 3).list␤»
20:59 sirrobert ahh map
20:59 pmichaud that looks like it works
20:59 sirrobert thanks
20:59 sirrobert I knew my version was clunky, but had a hard time streamlining
21:01 sorear $a[*;0] should work per spec, I think
21:01 sorear but nobody implements S09 that well
21:02 sirrobert What does the ; mean in this case?
21:02 pmichaud sorear: I think that might work only for declared dimensions.  But I still haven't assimilated all of S09 yet.
21:02 sirrobert as in a 2d array?
21:02 sirrobert ok
21:02 flussence r: my @hugearray := ^1_000_000; my @temp := (', ' X @hugearray).Array; @temp.shift; say @temp[^10].perl
21:02 p6eval rakudo 2d0e2d: OUTPUT«(0, ", ", 1, ", ", 2, ", ", 3, ", ", 4, ", ")␤»
21:02 flussence not as nice, but the other way didn't work...
21:06 kurahaupo joined #perl6
21:09 Moukeddar joined #perl6
21:10 dalek rakudo/nom: acf8f17 | pmichaud++ | / (3 files):
21:10 dalek rakudo/nom: Bump NQP revision to 2012.09.1, restore IO::Socket::INET to use older Parrot interface, disable IO::Socket::INET tests in spectest.
21:10 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/acf8f17054
21:10 dalek rakudo/nom: 5c5b15b | pmichaud++ | / (2 files):
21:10 dalek rakudo/nom: Revert a bit more of 71fc9c to get sockets to work as they did in 2012.08.
21:10 dalek rakudo/nom: This also causes S32-io/IO-Socket-INET.t to start passing again.
21:10 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5c5b15bf0e
21:10 dalek rakudo/nom: 81cd16f | pmichaud++ | docs/ChangeLog:
21:10 dalek rakudo/nom: Update ChangeLog for 2012.09.1.
21:10 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/81cd16f0bf
21:10 Moukeddar left #perl6
21:15 dalek Perlito: 4bb1644 | (Flavio S. Glock)++ | / (2 files):
21:15 dalek Perlito: Perlito5 - js3 - replace assign() in runtime
21:15 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/4bb1644b73
21:21 dalek rakudo/nom: cbe6eea | pmichaud++ | docs/announce/2012.09.1:
21:21 dalek rakudo/nom: Add announcement for 2012.09.1 .
21:21 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/cbe6eeaebc
21:22 dalek rakudo/nom: 5f876d7 | pmichaud++ | docs/release_guide.pod:
21:22 dalek rakudo/nom: Update release_guide.pod with 2012.09.1 release.
21:22 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5f876d79aa
21:28 dalek rakudo/nom: 7d227de | pmichaud++ | VERSION:
21:28 dalek rakudo/nom: [release] bump VERSION
21:28 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/7d227de7cc
21:31 sirrobert can a role define it's own postfixes?
21:31 sirrobert method postfix<->, for example?
21:33 pmichaud postfix is currently defined as an operator (sub), not a method.
21:34 sirrobert ok, so to do stuff like + or - on DateTime objects, I would define a new multi method postfix:<+> (DateTime $a, DateTime $b) {...} type of deal?
21:34 sirrobert err multi sub
21:35 sirrobert I guess multi sub infix:<+>
21:36 sirrobert nice, that worked
21:36 sirrobert thanks, pm
21:36 sirrobert Doing some Date::Manip type stuff.
21:37 sirrobert ok, later p6; have a good weekend =)
21:47 psch joined #perl6
21:49 pmichaud okay, I've created a 2012.09.1 release for rakudo and nqp.  Any testing people can do on the release would be helpful -- especially those folks that have had trouble with reading standard input.
21:49 pmichaud Note that it may be necessary to eliminate/remove copies of Parrot 4.8.0 to make sure you get a version of Parrot earlier than that.
21:49 pmichaud I'll work on creating a new 2012.09 star tarball tonight/tomorrow morning, with a planned release tomorrow sometime
21:53 felher pmichaud: what is it that i should test? up-to-date git?
21:56 thou joined #perl6
21:57 cognominal joined #perl6
21:59 Su-Shee_ joined #perl6
22:00 skids joined #perl6
22:01 felher \o/ newest git checkout doesn't have the 'say $*IN.get();' Problem anymore.
22:02 cognominal joined #perl6
22:03 felher pmichaud++
22:46 pmichaud felher: what version of parrot, ooc?
22:46 pmichaud (./perl6 --version will tell parrot version :)
22:50 felher ./perl6 --version gives me: This is perl6 version 2012.08-119-g0973612 built on parrot 4.7.0 revision RELEASE_4_7_0-165-g29796c6
22:50 felher @ pmichaud
22:53 whiteknight joined #perl6
23:00 bluescreen100 joined #perl6
23:18 daniel-s joined #perl6
23:34 pmichaud felher: thanks.  I suspect if you try running rakudo with parrot 4.8.0 the problem reappears.
23:35 felher pmichaud: should i try? And if so, whats the easiest way to do so?
23:36 pmichaud felher: it's up to you if you want to try -- easiest is     perl Configure.pl --gen-parrot=RELEASE_4_8_0
23:37 felher pmichaud: thnx :)
23:46 benabik joined #perl6
23:47 felher pmichaud: yeah, you were right. On updating to 480 it breaks again. :)
23:50 pmichaud okay, good to know.
23:51 pmichaud if you have time, perhaps also try
23:51 pmichaud perl Configure.pl --gen-parrot=master
23:51 pmichaud that will try the parrot bleeding edge, which as of a few minutes ago has a patch or two to address the problem
23:52 pmichaud (maybe address the problem :)
23:57 tokuhir__ joined #perl6
23:59 johnjohn101 joined #perl6

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

Perl 6 | Reference Documentation | Rakudo