»ö« | perl6.org/ | nopaste: paste.lisp.org/new/perl6 | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend! Set by lichtkind on 5 March 2010. |
|||
00:02
Khisanth left
|
|||
colomon | rakudo: say NaN == NaN | 00:03 | |
p6eval | rakudo ab2322: OUTPUT«0» | ||
00:06
Khisanth joined
|
|||
colomon | rakudo: say NaN cmp NaN | 00:09 | |
lue | o hai again | 00:10 | |
p6eval | rakudo ab2322: OUTPUT«1» | ||
lue | not a number apparently is not not a number :) [according to NaN == NaN] | ||
rakudo: say NaN ~~ NaN # who knows? | 00:11 | ||
p6eval | rakudo ab2322: OUTPUT«1» | ||
diakopter | rakudo: say NaN - NaN | ||
p6eval | rakudo ab2322: OUTPUT«NaN» | ||
diakopter | rakudo: say NaN ** NaN | ||
p6eval | rakudo ab2322: OUTPUT«NaN» | ||
diakopter | rakudo: say NaN / 0 | ||
p6eval | rakudo ab2322: OUTPUT«Divide by zerocurrent instr.: 'infix:</>' pc 305405 (src/gen/core.pir:3048)» | ||
00:11
am0c left
|
|||
diakopter | rakudo: say 0 / NaN | 00:12 | |
p6eval | rakudo ab2322: OUTPUT«NaN» | ||
ash___ | rakudo: say NaN.abs | ||
p6eval | rakudo ab2322: OUTPUT«NaN» | ||
ash___ | rakudo: say (-Inf).abs | ||
p6eval | rakudo ab2322: OUTPUT«Inf» | ||
lue | colomon!: en.wikipedia.org/wiki/James_Anderso...rithmetics | 00:14 | |
explains why NaN == NaN fails | |||
rakudo: multi sub infix:</>($a, $b){if $b == 0 {say "Φ";}; else { say $a div $b;}; }; 3/7; 9/0; # transreal numbers! | 00:19 | ||
p6eval | rakudo ab2322: ( no output ) | ||
lue | ō.o | ||
arnsholt_ | rakudo: our multi sub infix:</>($a, $b){if $b == 0 {say "Φ";}; else { say $a div $b;}; }; 3/7; 9/0; # I think... | ||
p6eval | rakudo ab2322: ( no output ) | 00:20 | |
arnsholt_ | Or not. Oh well | ||
00:20
arnsholt_ is now known as arnsholt
|
|||
lue | maybe overload is broken/NYI ? | 00:21 | |
rakudo: say 1/0; say "I'm okay!" | 00:24 | ||
p6eval | rakudo ab2322: OUTPUT«InfI'm okay!» | ||
colomon | rakudo: multi sub infix:</>($a, $b){if $b == 0 {say "Φ";} else { say $a div $b;}; }; 3/7; 9/0; # transreal numbers! | 00:28 | |
p6eval | rakudo ab2322: ( no output ) | ||
colomon | :\ | ||
rakudo: multi sub infix:<//////>($a, $b){if $b == 0 {say "Φ";} else { say $a div $b;}; }; 3//////7; 9//////0; # transreal numbers! | 00:29 | ||
p6eval | rakudo ab2322: OUTPUT«0Φ» | ||
colomon | lue: my problem at the moment is that somehow Test.pm's is was getting NaN to equal NaN, but I broke it in my local copy, making zillions of tests fail. | 00:30 | |
lue | why would want it to equal itself? It's an error. | ||
colomon | yes, but you need to be able to check and see if that error happened. That's the point of the tests in question. | 00:31 | |
ash___ | rakudo: say 1/0 ; | ||
p6eval | rakudo ab2322: OUTPUT«Inf» | ||
ash___ | o.0 | ||
colomon | that's a Rat, btw. | ||
ash___ | I thought that was an error and NaN? | ||
colomon | nope. | 00:32 | |
lue | IEEE floating point arithmetic. | ||
rakudo: say 1/-0 | |||
p6eval | rakudo ab2322: OUTPUT«Inf» | ||
lue | rakudo: say -1/0 | ||
p6eval | rakudo ab2322: OUTPUT«-Inf» | ||
lue | -0 should have produced -Inf, IIRC | 00:33 | |
colomon | I don't think so, because -0 is an Int, and for Ints, -0 == 0 | ||
there's only one zero | 00:34 | ||
rakudo: say 1 / -(0.Num) | |||
p6eval | rakudo ab2322: OUTPUT«Divide by zerocurrent instr.: 'infix:</>' pc 305405 (src/gen/core.pir:3048)» | ||
colomon | rakudo: say 1 / (0.Num) | ||
p6eval | rakudo ab2322: OUTPUT«Divide by zerocurrent instr.: 'infix:</>' pc 305405 (src/gen/core.pir:3048)» | ||
colomon | rakudo: say 1.Num / (0.Num) | ||
p6eval | rakudo ab2322: OUTPUT«Divide by zerocurrent instr.: 'infix:</>' pc 305405 (src/gen/core.pir:3048)» | ||
lue | rakudo: say (3.5).WHAT | ||
p6eval | rakudo ab2322: OUTPUT«Rat()» | 00:35 | |
lue | Is Rat == Floating Point in perl6? | ||
00:36
hercynium joined
00:37
rgrau_ joined
|
|||
colomon | no, Rat is a rational number, int over int. | 00:40 | |
decimal numbers are now rational, not floating point. | |||
00:42
supernovus joined
|
|||
colomon | I see. | 00:43 | |
00:44
jql joined
|
|||
colomon | Problem is that Rakudo is broken.... or maybe I don't understand the comparison operators. | 00:44 | |
Ah, I don't understand the comparison operators. | |||
okay, this is an easy fix. | |||
ash___ | ? | 00:45 | |
colomon | I was thinking that infix:<eq> was equivalent to infix:<cmp> == 0 | ||
but it's not, it's infix:<leg> == 0 | |||
ash___ | eqv or eq? Isn't eq for strings? | 00:46 | |
colomon | ie infix:<eq> is string equality, not DWIM equality | ||
supernovus | I read in the backlogs that := is not going to be implemented any time soon. I would then recommend that the IO::Socket::INET module be rewritten to not use it. Many libraries such as HTTP::Daemon and SCGI depend on the IO::Socket::INET library which is included in the Core, but currently does not work due to the := not being implemented. | ||
lue | (with so many comparison operators, no other language compares) | ||
supernovus: who said that? | |||
colomon | I overloaded infix:<eq> to be use infix:<cmp> for numbers. that's what broke all the NaN tests. | 00:47 | |
because "NaN" does equal "NaN" | |||
even if NaN != NaN | |||
ash___ | ah | ||
NaN fails all numeric comparison tests | |||
supernovus | lue: Well, I haven't completely caught up yet, so I may be speaking out my arse, but you had asked about it and diakopter said it would take hundreds->thousands of hours to implement... | 00:48 | |
lue | I don't know much about the guts, but that seemed like a hyperbole to me. | 00:49 | |
For $a := $b, you just need to assign $a to $b's location. (masak pointed me to a blog post earlier today, it's in the backlogs and explains better than me) | 00:50 | ||
supernovus | The := thing is one of the few reasons left to stick with the 'alpha' branch. I will continue scouring the backlogs. :-) | 00:51 | |
ash___ | rakudo: my $a = 1; my $b = \$a; say $b # is that supposed to say capture? | ||
p6eval | rakudo ab2322: OUTPUT«Capture()<0x14d22b0>» | ||
ash___ | alpha: my $a = 1; my $b = \$a; say $b ; | ||
p6eval | alpha 30e0ed: OUTPUT«1» | ||
lue | rakudo: my $a = 1; my $b = \$a; $b = 2; say $a | 00:52 | |
p6eval | rakudo ab2322: OUTPUT«1» | ||
lue | rakudo: my $a = 1; my $b = \$a; $b = 2; say $a; say $b; | ||
p6eval | rakudo ab2322: OUTPUT«12» | ||
ash___ | rakudo: my $a = 1; my $b = \$a; $a = 2; say $a; say $b; | ||
p6eval | rakudo ab2322: OUTPUT«2Capture()<0x3f4e440>» | ||
colomon | I think there was definitely a misunderstanding on the complexity of implementing binding. | 00:53 | |
(in that discussion yesterday) | |||
00:53
[particle] left
|
|||
lue | AFAIK, it should be _that_ hard. | 00:54 | |
s/should/shouldn't/ | |||
supernovus | Well, I wish I knew more about the guts. I'm going to try to get some of my libraries like SCGI working on the new master, then I'll have to find out about adding them to proto. Oh well, I'm off to watch tonight's Doctor Who. Later! | ||
lue | me too. | 00:55 | |
supernovus: me too! afk | |||
(first me too about the guts, second about DW) | |||
00:55
supernovus left
|
|||
ash___ | this is kinda like := but not exactly: | 00:57 | |
rakudo: my $a = 1; my $b = \$a; $a = 2; say $a; say $b[0]; $a = 123 ~ "hello"; say $b[0]; | |||
p6eval | rakudo ab2322: OUTPUT«22123hello» | ||
ash___ | $b is a capture of $a, so updating $a updates $b | 00:58 | |
sorear | lue: If you think Rakudo is ever going to be faster than hand-optimized x86 code on qemu, you're crazy | ||
also I don't understand what your deal is with mactel | |||
00:58
[particle] joined
|
|||
sorear | incidentally, Rakudo already implements binding. | 01:01 | |
Just not the := syntax. | |||
ash___ | sorear: how? | ||
I know you can use a capture to get := like behavoiur | |||
sorear | rakudo: sub foo($x is rw, $y is rw) { say $x; $y = 2; say $x; }; my $z = 1; foo($z, $z); | 01:02 | |
p6eval | rakudo ab2322: OUTPUT«12» | ||
sorear | within the invocation, $x and $y are aliases | ||
ash___ | rakudo: my $x = 1; my $y = \$x; $y[0] = 123; say $x; | 01:03 | |
p6eval | rakudo ab2322: OUTPUT«123» | ||
ash___ | thats why that worked, the parameters are captures | ||
although, in alpha you didn't have to do [0] on the capture | 01:04 | ||
alpha: my $x = 0; my $y = \$x; $y = 123; say $x; | |||
p6eval | alpha 30e0ed: OUTPUT«0» | ||
ash___ | hmm | ||
alpha: my $x = 0; my $y = \$x; $x = 123; say $y; | 01:05 | ||
p6eval | alpha 30e0ed: OUTPUT«123» | ||
ash___ | maybe in alpha captures are only one directional | ||
sorear | What are you talking about? | 01:09 | |
ash___ | using the $y from "my $x = 0; my $y = \$x;" to update $x | 01:10 | |
sorear | This has nothing to do with binding. | ||
ash___ | I was just pointing out that captures function similar to bindings | 01:11 | |
sorear | A capture is just an array + hash | ||
You've discovered it's possible to update elements in arrays. | 01:12 | ||
ash___ | rakudo: my $x = 1; my $y = \$x; $y[0] = 123; say $x; # is almost the same functionality as $y := $x; $y = 123; | ||
p6eval | rakudo ab2322: OUTPUT«123» | ||
ash___ | with normal arrays and hashes you can't update the variable that assigned you the value, my $x = 0; @a[0] = $x; @a[0] = 123; doesn't make $x = 123; but you can do that with a capture | 01:14 | |
sorear | that's because your desugaring is wrong | 01:18 | |
my $x = 0; @a[0] := $x; $a[0] = 123 | 01:19 | ||
captures aren't like binding or a substitute for binding | |||
they are implemented using binding | |||
01:49
tylerni7 joined,
tylerni7 left,
tylerni7 joined
01:54
tylerni7 left,
tylerni7 joined,
tylerni7 left,
tylerni7 joined
|
|||
dalek | kudo: c52c61a | (Solomon Foster)++ | src/core/ (4 files): Add Numeric versions of the infix:<cmp> family of operators. Move the old infix:<cmp>(Num, Num) operator code to infix:xAB<=>xBB(Num, Num) and delete infix:<cmp>(Num, Num). Remove the Rat versions of infix:<cmp>. |
01:59 | |
kudo: 9427875 | (Solomon Foster)++ | tools/test_summary.pl: Change // to || to keep Perl 5.8 happy. |
|||
kudo: 85a7aa4 | (Solomon Foster)++ | src/core/Numeric.pm: Eliminate Numeric versions of eq, ne, lt, gt, le, and ge -- these should always be string comparisons. |
|||
02:00
Psyche^ joined
|
|||
pugssvn | r30593 | colomon++ | [t/spec] Fudge Complex Rcmp tests. Add Real tests for cmp, before, and after. Fix a couple of Complex-valued tests to use is_approx rather than is. | 02:02 | |
02:04
Patterner left,
Psyche^ is now known as Patterner
|
|||
lue | hello! | 02:04 | |
sorear: I don't appreciate that. Who says rakudo can't be faster? I will say again: emulation of a chip (esp. Intel emu. on PPC) is slow for me. | 02:07 | ||
My deal with mactel is that it's new, and uses Intel. | |||
02:07
chitragupt_1 joined,
gurjeet joined
02:10
chitragupt_1 left
|
|||
lue | (When the streets of #perl6 are busy, I ought to ask for details on := and why no-one's implemented yet.) | 02:10 | |
02:10
chitragupt_1 joined
|
|||
colomon | So, Dr. Who any good tonight? | 02:10 | |
lue | yes! The Weeping Angels. | 02:13 | |
(part 1 of 2) | |||
02:14
chitragupt_1 left
|
|||
lue | And according to the trailer for Part 2, time is going to disintegrate or something. | 02:15 | |
again. | |||
02:15
chitragupt_1 joined
|
|||
colomon | :) | 02:15 | |
02:16
chitragupt_1 left
|
|||
lue | seriously, it happened about 5 months ago (our time) with the last doctor! | 02:16 | |
02:17
chitragupt_1 joined
|
|||
lue | and it's not even the season finale, so what the heck is going to happen _*then*_ ? :) | 02:17 | |
colomon | surprised early season finale!! | 02:18 | |
lue | no, the episode with stonehe— *cough* a famous monument — hasn't happened yet. | ||
colomon | that's what they *want* you to think. | 02:21 | |
lue | are they saying a trailer for the stonehenge epsiode is an experiment by the BBC to extend DW's "flux time" beyond the series !? | 02:22 | |
s/are they/are you/ | |||
O.o run. | 02:23 | ||
colomon | rakudo: say sqrt(:x(10)) | 02:24 | |
p6eval | rakudo ab2322: OUTPUT«No applicable candidates found to dispatch to for 'sqrt'. Available candidates are::(Complex $x):(Any $x)current instr.: '_block14' pc 29 (EVAL_1:0)» | ||
lue is getting ready to dabble in 日本語 | 02:25 | ||
spinclad | diakopter: pong # finally unbacklogged | 02:27 | |
diakopter: i see the wonderful shiny closureness now in perlesque! \o/ diakopter++ perlesque++ | 02:28 | ||
lue | buubot: karma perlesque | 02:30 | |
buubot | lue: perlesque has karma of 1 | ||
02:31
circuitbreaker joined
|
|||
diakopter | spinclad: yeah :) | 02:34 | |
02:37
chitragupt_1 left
|
|||
sorear | phenny: tell moritz_ that I've decided I don't like the plan I had earlier for splitting the setting, so I have nothing more for topic/lexical-persistence | 02:40 | |
phenny | sorear: I'll pass that on when moritz_ is around. | ||
lue | does rakudo have an API or equivalent, for people wishing to muck about in its internals? | 02:42 | |
colomon | not as such. | 02:43 | |
sorear | it doesn't have a defined API but that shouldn't stop you | ||
colomon | I mean, generally you just muck about. | ||
sorear | with early-development software like rakudo, the API forms as we standardize mucking | 02:44 | |
the mucking comes first | |||
diakopter | dukeleto: I'll try to make the May 25 thing | ||
sorear | rakudo: say Perl6::Compiler.compile("2+2", target=>"pir"); | ||
p6eval | rakudo ab2322: OUTPUT«.HLL "perl6".namespace [].sub "_block59" :anon :subid("18_1273372087.95608") .param pmc param_72 :slurpy.annotate "line", 0 .const 'Sub' $P63 = "19_1273372087.95608"  capture_lex $P63.annotate "line", 1 get_hll_global $P61, "!UNIT_START" .const 'Sub' | ||
..$P63… | |||
lue | because I had a difficult time finding variable creation/initialization | ||
sorear | rakudo: my $a; my $b; pir::store_lex__vSP('$b', $a); $b = 1; say $a; | 02:46 | |
p6eval | rakudo ab2322: OUTPUT«1» | ||
sorear | rakudo: my $a; my $b; pir::store_lex__vSP('$b', $a); $a = 1; say $b; | ||
p6eval | rakudo ab2322: OUTPUT«1» | ||
diakopter | sorear: should I implement classes next? it's a very straightforward thing, much more so than getting closures right... since runsharp already does most of it for me. | 02:48 | |
sorear | diakopter: What would I know about priorities for an implementation of Perl 6 I haven't contributed to and don't use in an environment I don't run? | 02:51 | |
er | |||
implementation of NQP | |||
02:51
nihiliad joined
|
|||
sorear | oops. | 02:51 | |
02:52
JimmyZ joined
02:53
meppl joined
|
|||
diakopter | it's not really meant to implement NQP, though someone could use it for that | 02:53 | |
I intend it to be a target language for STD and viv | |||
so STD can translate itself to perlesque | |||
sorear | (and then we can rewrite viv in perl6?) | 02:54 | |
hmm. interesting concept | |||
NQP is currently an implementation-defined language; I wonder if we should work to draw NQP, Perlesque, NQ-NQP together | 02:55 | ||
diakopter | my other option for "what to do next" was "string eval" | ||
02:55
alester joined
|
|||
sorear | diakopter: How are you going to do that without STD? | 02:56 | |
diakopter | b/c I consider string-eval highly necessary for getting a Perl 6 compiler/JIT/runtime going in the perlesque edition of STD | ||
sorry, string eval of perlesque code | |||
(not full-blown Perl 6) | |||
I'm not using STD right now to parse perlesque code | 02:57 | ||
in case that wasn't clear | |||
who is working on NQ-NQP | 02:58 | ||
oh. | |||
03:05
nihiliad left
03:10
fridim joined
03:12
molaf joined
|
|||
diakopter | thoughts on implementing string eval: at each string-eval callsite in the user code, the emitted IL needs to contain a hardcoded string key that can be used to access a global dictionary/registry of compilation-context restorer callbacks. | 03:19 | |
hrm. that won't work for programs emitted to disk. instead of in-memory callbacks then, the eval function itself needs to be emitted to the IL, and the grammar needs to be refactored a bit to allow eval-mode parsing, such that ... | 03:23 | ||
the types stack and other various global parse state-keepers are programmatically reconstructable | 03:24 | ||
hrm. | |||
03:25
rv2733 joined
|
|||
diakopter | I'd better work on classes first and let that simmer (fester?) a while. | 03:25 | |
03:25
meppel joined
|
|||
TimToady | (it's essentially the same thing as YOU_ARE_HERE in the setting) | 03:25 | |
diakopter | TimToady alive | 03:26 | |
TimToady hides behind a cricket | |||
and continues backlogging | |||
diakopter | Times Square is so empty, even the cricket stands out | ||
actually though | 03:27 | ||
I was thinking of Perl 5-style string eval | |||
JavaScript-style string-eval would be much easier | |||
pugssvn | r30594 | lwall++ | [S02] dig out T Rex fossil found by sorear++ | 03:28 | |
03:28
meppl left
|
|||
diakopter | TimToady: perlesque passed man_or_boy | 03:29 | |
03:29
meppel is now known as meppl
|
|||
diakopter | man_vs_boyt? | 03:29 | |
er | |||
man_vs_bot? | |||
ER | |||
man_vs_boy? | |||
sorear: I'm curious how long it takes rakudo to run the man_or_boy.t at the 10 result level... would you mind running it? | 03:30 | ||
sorear | diakopter: rakudo doesn't have closures | ||
diakopter | but.. | ||
I thought it passed man_or_boy.t | 03:31 | ||
I'll look again | |||
it doesn't seem fudged | |||
oh, it's not pulled down to spectests | 03:32 | ||
sry | |||
03:33
BrowserUk joined
03:35
meppl left
|
|||
TimToady | rakudo: sub counter { my $x = 0; return { say $x++ } }; my $c1 = counter; my $c2 = counter; $c1(); $c1(); $c2(); $c2(); | 03:35 | |
p6eval | rakudo ab2322: OUTPUT«0123» | ||
TimToady | nope | ||
I find it rather amazing that we pass as many tests as we do without that... | 03:36 | ||
and given that STD uses bazillions of closures... | |||
well, the p5 translation of it does | 03:37 | ||
TimToady goes back to his cricket | |||
03:37
circuitbreaker left
|
|||
TimToady | alpha: sub counter { my $x = 0; return { say $x++ } }; my $c1 = counter; my $c2 = counter; $c1(); $c1(); $c2(); $c2(); | 03:38 | |
p6eval | alpha 30e0ed: OUTPUT«0101» | ||
TimToady | okay, just a regression | ||
diakopter | perlesque: sub A(int $k,Callable[:(-->int)] $x1,Callable[:(-->int)] $x2,Callable[:(-->int)] $x3,Callable[:(-->int)] $x4,Callable[:(-->int)] $x5-->int) {my Callable[:(-->int)] $B;$B=sub (-->int) {$k-=1;return A($k,$B,$x1,$x2,$x3,$x4)};if $k<=0 {return ($x4()+$x5())};return $B()};sub K(int $n-->Callable[:(-->int)]) {return sub (-->int) {return $n}};say(A(10,K(1),K(-1),K(-1),K(1),K(0))) | ||
p6eval | perlesque: OUTPUT«-67» | ||
diakopter | check it out :D /me boasts | ||
TimToady | where did you get that ugly Callable syntax :P | 03:39 | |
diakopter | I don't know. I almost scrapped the Callable[] and just went with :() | ||
TimToady | &:() wouldn't be too bad | 03:40 | |
&[] is taken though | |||
diakopter | &:() would certainly be better | ||
almost as clean as C#'s Func<TArg0, TArg1, ... , TReturn> | 03:41 | ||
sorear | How do you plan to compile Perl6 code which uses unsigged function arguments? | 03:42 | |
diakopter | the Perl 6 runtime will be verry different from the perlesque runtime | 03:43 | |
the Perl 6 code won't JIT nearly as directly to CIL | |||
it'll JIT to runtime calls | |||
even in perlesque, those subs aren't translated directly to CIL subs | 03:44 | ||
each is split into a Bind and Exec methods | |||
so the trampoline actually bounces | 03:45 | ||
CLR Perl 6 may well be just as function-call heavy as Parrot Perl 6 | 03:46 | ||
but it's the function calls and existence of native types in those function calls that'll be the huge efficiency difference, imhwt (in my humble wishful thinking) | 03:47 | ||
ash___ | so far, nq-nqp is very function-call oriented, but the llvm inlines a lot of them | ||
so when you turn on optimizations, + turns into an assembly add in most cases, which is nice | 03:48 | ||
diakopter | ash___: you're the eternity blogger? | ||
sorear | where's nqnqp? | ||
ash___ | huh? | ||
github | |||
03:48
chitragupt_1 joined
|
|||
diakopter | greaterthaninfinity.com/ | 03:49 | |
ash___ | yea | ||
thats mine | |||
diakopter | oh, infinity, not eternity ;) | ||
sorear | ash___: Why aren't you on planet6? | ||
diakopter | typo in the README: Not Quiet NQP-rx -> Not Quite NQP-rx | ||
03:50
chitragupt_1 left
|
|||
diakopter | configuratoins | 03:50 | |
ash___ | ssshh don't say it so loud | ||
diakopter | heh | ||
ash___ | sorear: i duno? | ||
plus, this was more a thought experiment than anything else | |||
03:50
envi^home joined
|
|||
sorear | diakopter: For fun, I ran man-or-boy.t on rakudo. | 03:51 | |
ash___ | i don't plan on stopping it, and now i get to work on parrot (as a GSoC) so maybe I can bring some of the llvm's optimizations to parrot to get rid of some method calls | ||
sorear | How long did it take? 0.3 s then "Maximum recursion depth exceeded" | ||
diakopter | oh; jnthn told me that can be disabled in parrot | ||
at the nqp level maybe | 03:52 | ||
after all, parrot uses heap frames like smalltalk & perl (& perlesque) | 03:53 | ||
03:53
meppl joined
|
|||
diakopter | sorear: the runsharp compiler is now fully exposed/available to/from perlesque code. observe: | 03:58 | |
perlesque: my AssemblyGen $ag = AssemblyGen.new('foo.exe'); my TypeGen $tg1 = ($ag.Public).Class("Class0"); | 04:00 | ||
p6eval | perlesque: ( no output ) | ||
diakopter | no output is good, there. | ||
fooey. I need a way to represent type literals... hack hack hack | 04:03 | ||
04:05
Targhan joined
04:14
BrowserUk left
04:15
JimmyZ left
|
|||
snarkyboojum | alpha runs man-or-boy.t for 5 seconds before 'maximum recursion depth exceeded' :) | 04:18 | |
diakopter | perlesque: my $ag = AssemblyGen.new('foo.exe'); my $tg1 = ($ag.Public).Class('Class0'); my $m1 = ($tg1.Public).Method(int, 'blah'); my $cg = $m1.AsCodeGen(); $cg.Return(4); $ag.Complete(); | ||
p6eval | perlesque: ( no output ) | 04:19 | |
dalek | meta: r255 | diakopter++ | trunk/Sprixel/ (4 files): [perlesque] enable type literals. I'll need casting/coercion to enable full |
||
04:27
molaf left
04:34
JimmyZ joined,
JimmyZ left
04:42
JimmyZ joined
|
|||
diakopter | perlesque: my $ag = AssemblyGen.new('foo.exe'); my $tg1 = ($ag.Public).Class('Foo'); my $m1 = (($tg1.Public).Override).Method(string, 'ToString'); my $cg = $m1.AsCodeGen(); my $o = List[Operand].new(); $o.Add(Exp.new(Operands::StringLiteral, 'blah blah')); $cg.Invoke(Console, 'WriteLine', $o.ToArray()); $cg.Return(Operands::StringLiteral.new('BLAH')); $ag.Complete(); my $foo = Activator.CreateInstance($tg1); say($foo) | 04:44 | |
p6eval | perlesque: OUTPUT«blah blahBLAH» | ||
diakopter | it 1. creates a new assembly named foo.exe 2. declares a class Foo a part of that assembly 3. overrides System::Object's ToString() method such that calling ToString() on a Foo object prints 'blah blah' and then returns 'BLAH' | 04:46 | |
4. Creates a Foo, and calls say() on it, which implicitly coerces it to string (calling the virtual override ToString()) | |||
tada. | |||
and I had to add only 2 magical special cases to runsharp :P | 04:47 | ||
snarkyboojum | I manage to get a segmentation fault if I bump up the recursion limit on parrot :) | 04:48 | |
but it runs man-or-boy.t further :P | |||
dalek | meta: r256 | diakopter++ | trunk/Sprixel/ (2 files): [perlesque] got class declaration working programmatically in user code, without ($ag.Public).Class('Foo'); my $m1 = (($tg1.Public).Override).Method(string, 'ToString'); my $cg = $m1.AsCodeGen(); my $o = List[Operand].new(); $o.Add(Exp.new(Operands::StringLiteral, 'blah blah')); $cg.Invoke(Console, 'WriteLine', $o.ToArray()); $cg.Return(Operands::StringLiteral.new('BLAH')); $ag.Complete(); my $foo = Activator.CreateInstance($tg1); say($foo) |
||
snarkyboojum | guess we're still a boy :) | 04:50 | |
diakopter | how long does it take to segv | 04:51 | |
snarkyboojum | it takes 13 seconds on my laptop | 04:52 | |
sorear | snarkyboojum: before or after 46422? | 04:53 | |
diakopter | perlesquel: . | ||
p6eval | perlesquel: OUTPUT«blah blahBLAHreal 0.18user 0.14sys 0.01» | ||
diakopter | perlesquel: . | ||
p6eval | perlesquel: OUTPUT«blah blahBLAHreal 0.17user 0.16sys 0.00» | ||
diakopter | ooo. I just realized that adds a 4th stage to the compilation chain | ||
1: Sprixel.exe 2: perlesque.exe (which it builds upon *every* invocation, including from p6eval), 3. the assembly created from p6eval input (emitted every time of course), and now 4. stage 3 can also emit assemblies. | 04:55 | ||
sidenote: the perlesquel p6eval target just invokes the last stage 3 emitted | |||
snarkyboojum | sorear: dies after "ok 4 - man-or-boy test for start value 3" - so something else might well be wrong | 04:57 | |
04:57
patspam joined
|
|||
diakopter | phenny: tell pmurias please backlog; all kinds of neat stuff there | 04:59 | |
phenny | diakopter: I'll pass that on when pmurias is around. | ||
05:03
Targhan left
05:07
patspam left
|
|||
snarkyboojum | sorear: what did you mean by before or after 46422? | 05:27 | |
05:30
JimmyZ left
05:31
finanalyst joined
|
|||
sorear | snarkyboojum: 46422, committed six hours ago and fixed a few minutes ago, contains a segfault bug, but it's only on a branch (I forgot this for a moment) | 05:40 | |
snarkyboojum | ah ok | 05:44 | |
05:54
JimmyZ joined
06:09
jonrafkind left
06:11
jonrafkind joined,
\shade\ is now known as fn
06:12
alester left
06:13
fn is now known as \shade\
06:19
kaare joined,
kaare is now known as Guest48518
06:22
Guest48518 left
06:28
jonrafkind left
|
|||
pugssvn | r30595 | colomon++ | [t/spec] Fix test and unfudge. | 06:49 | |
dalek | kudo: 118f4aa | (Solomon Foster)++ | src/core/ (5 files): Overhaul sqrt for Numeric / Real. |
06:51 | |
07:03
gfx joined
07:12
dolmen joined,
bakedb__ joined
07:35
swestres joined
07:42
finanalyst left
08:02
plobsing left
08:39
levengli joined
|
|||
levengli | anybody home now? | 08:39 | |
08:40
dual_ joined
|
|||
levengli | hi dual_ | 08:41 | |
08:41
dual left
08:42
isBEKaml joined,
levengli left
08:47
isBEKaml left
08:48
dual joined
08:49
dual_ left,
isBEKaml joined
08:51
Su-Shee joined
09:01
gfx left
|
|||
isBEKaml | rakudo: sub subbydo { my $temp=23; return { say $_ + $temp }; }; my $tt = subbydo; my $test1=$tt(23); say $test1; say $tt.WHAT; | 09:02 | |
p6eval | rakudo ab2322: OUTPUT«461Block()» | ||
isBEKaml | uhhh, it executed alright. Why is a $test1 shown as 1? | 09:04 | |
I thought it only contained a ref (kinda) to subbydo? | |||
moritz_ | guten Morgen | 09:05 | |
phenny | moritz_: 02:40Z <sorear> tell moritz_ that I've decided I don't like the plan I had earlier for splitting the setting, so I have nothing more for topic/lexical-persistence | ||
isBEKaml | guten morgen, moritz_ ! | ||
09:07
finanalyst joined
|
|||
isBEKaml | rakudo: sub subbydo { my $temp=23; return { say $_ + $temp }; }; my $tt = subbydo; my $test1=$tt(23); say $test1.WHAT; say $tt.WHAT; | 09:18 | |
p6eval | rakudo ab2322: OUTPUT«46Bool()Block()» | ||
isBEKaml | I don't understand why $test1 would type to a Bool()... :| | 09:19 | |
09:19
masak joined
|
|||
masak | oh hai, #perl6 | 09:19 | |
isBEKaml | masak: hi | ||
moritz_ | \o/ | 09:21 | |
perlgeek.de/blog-en/perl-6/list-cla....writeback 7 comments - it seems that actually asking the reader a question does encourage people to comment | |||
masak | there you go. | ||
[backlogging] diakopter has a screen-time limit? :) | 09:25 | ||
09:26
Heame joined
|
|||
isBEKaml | that was the return statement in the subbydo doing this.. jeez.. :( | 09:27 | |
rakudo: sub subbydo { my $temp=23;{ say $_ + $temp }; }; my $tt = subbydo; my $test1=$tt(23); say $test1.WHAT; say $tt.WHAT; | |||
p6eval | rakudo ab2322: OUTPUT«Use of uninitalized value in numeric context23invoke() not implemented in class 'Boolean'current instr.: '_block14' pc 29 (EVAL_1:0)» | ||
isBEKaml | rakudo: sub subbydo { my $temp=23;{ say $_ + $temp }; }; my $tt = subbydo; my $test1=$tt(23); | 09:28 | |
p6eval | rakudo ab2322: OUTPUT«Use of uninitalized value in numeric context23invoke() not implemented in class 'Boolean'current instr.: '_block14' pc 29 (EVAL_1:0)» | ||
09:29
Heame left
|
|||
isBEKaml | odd, I thought the return statement in the earlier subbydo made it Bool(). This error message seems to be very misleading. Can someone over here clarify? | 09:32 | |
moritz_ has no idea what's going on | 09:33 | ||
isBEKaml | moritz_: there are two subs. The only difference is, one has a return statement, the other doesn't. With return, it works. Without, the error message is as above. | 09:35 | |
moritz_ | yes; and I have no idea what's going on | 09:36 | |
opinion question: should ^@array actually re-dispatch to @array.keys instead of ^@array.elems ? | 09:37 | ||
I guess usually the former is meant | |||
isBEKaml | if at all, I think the error msg should be "invoke() not implemented in class '<whatever type here>'" I think it can't be Boolean... | ||
moritz_ | either way might be dangerous for custom array indexes | 09:38 | |
09:42
M_o_C joined
|
|||
masak | [backlog] yes, we perhaps should have a man_vs_bot test. :) | 09:51 | |
isBEKaml | moritz_: what would be the type of @array here? Any() ? If it contains only non-numeric elements, I think we shouldn't allow ^@array. ( I may be wrong here, though) | 09:53 | |
isBEKaml goes looking through backlogs for ^@ discussion | 09:55 | ||
masak | isBEKaml: prefix:<^> should numify its argument. | 10:02 | |
isBEKaml: more than a year ago, the spec was more complicated, and said that prefix:<^> on an array should give a list of 0..$n lists of indreasing $n. | 10:03 | ||
but that extra complexity was deemed unnecessary and a cause of bugs. | 10:04 | ||
so now it numifies instead, and there was much rejoicing. | |||
isBEKaml | masak: yes, that was why I thought we shouldn't allow ^@ on non numeric arrays. | 10:06 | |
masak | no, I think you misunderstand. | 10:07 | |
the length is always numeric, that's all that matters. | |||
both for the old semantics and the present one. | |||
let's say @a = <a b c>; old semantics: ^@a would give ([0], [0, 1], [0, 1, 2]) | 10:08 | ||
new semantics: ^@a gives (0, 1, 2) | |||
whether the array is 'non numeric' doesn't factor into it. | |||
isBEKaml | oh, I see.. I was confused over 0..^ @a. Sorry for the line noise. | 10:10 | |
masak | 0 ..^ @a works in the same way as given above. prefix:<^> is in every way sugar for 0..^ | 10:11 | |
isBEKaml | array.length. we could simply have $#array? | 10:12 | |
masak | er. | 10:13 | |
firstly, there's no @array.length. where did you get that? | |||
isBEKaml | I was referring to a semantic. I know there's no array.length. So it's 0 .. $#array ? | 10:14 | |
masak | secondly, the $#array syntax was ugly even for Perl 5. somewhere inside that twisted parser, there must be a rule saying that '#' doesn't indicate a comment if it comes directly after a '$'. | ||
oh, ok. | |||
for a while I thought you were suggesting we reintroduce $#array :) | |||
isBEKaml | I won't reintroduce. Unlearn and relearn's fine with me. :) | 10:15 | |
masak | yes, ^@a means 0..^@a means 0..(@a.elems-1) | ||
rakudo: my @a = <a b c d e>; say @a.elems; say @a.end | |||
p6eval | rakudo ab2322: OUTPUT«54» | ||
masak | I'd say $#a has been replaced by the slightly longer @a.end | 10:16 | |
isBEKaml | $# was easy to remember. # for count. :) | 10:17 | |
now we have a mnemonic for last element. @a.end! :) | |||
10:18
iblechbot joined
|
|||
masak | if '#' really meant count there, how come the number is one less than the count of the elements? :P | 10:19 | |
isBEKaml | array indexing! :D | ||
masak | yes, but set cardinalities aren't usually "zero-based" in the sense that they're off by one from the actual size. | 10:21 | |
isBEKaml | I was referring to the number and ids that we keep for items in day to day life. "Go over, meet the man in #5." | ||
masak | all I'm saying is I like @a.end much better. :) | ||
moritz_ | isBEKaml: @array would be positional | ||
isBEKaml | all I said it's a good mnemonic. :) | 10:22 | |
masak | the mnemonic being '# denotes count, so this is the *count* of the elements... minus one'. er. | 10:23 | |
isBEKaml | er, ppl remember stuff in different ways. room #5, counter #5 and so on. # is simply the last position in an array. remember how we had to grapple with list and scalar contexts in p5 ? assign a list to a scalar, you only get the last element. er, I just said @a.end is a much better mnemonic than $#a. | 10:26 | |
masak | good, good. :) | ||
we'll leave it at that. | |||
lunch & | 10:29 | ||
10:29
masak left
|
|||
isBEKaml | moritz_: we could just use @array.keys. opA(T) redispatch to opB(T.something), not opA(T.something). IOW, redispatch to do some other (possibly less costly) operation, never the same one. | 10:33 | |
in this case, both look similar. | |||
moritz_ | it's not about looks :-) | ||
isBEKaml | :) | ||
moritz_ | I just meant that ^@array could be made to mean @array.keys, not 0..^@array.elems | 10:34 | |
10:34
JimmyZ left
|
|||
moritz_ | but it's probably ETOOMUCHMAGIC | 10:34 | |
isBEKaml | good, good. you got my point. :) | ||
moritz_ | and we should educate people to use @array.keys in the first place, even if it's 4 strokes more | ||
10:35
EXCHIM joined
|
|||
isBEKaml | we probably should. it would also probbly mean saying, "there's one true way" when it's TMTOWDI | 10:37 | |
:) | |||
isBEKaml was thinking about a good practices doc as a spill over from java world. | 10:38 | ||
we could do the same, only in a slightly less intimidating way. :) | |||
rakudo: my @a=<1 2 3 4>; say 0..^ @a; | 10:43 | ||
p6eval | rakudo ab2322: OUTPUT«01» | ||
isBEKaml | rakudo: my @a=<1 2 3 4>; say 0..^@a; | 10:44 | |
p6eval | rakudo ab2322: OUTPUT«01» | ||
isBEKaml | alpha: my @a=<1 2 3 4>; say 0..^@a; | ||
p6eval | alpha 30e0ed: OUTPUT«0123» | ||
colomon | rakodu: my @a= 1 ... 4; | 10:49 | |
rakodu: my @a= 1 ... 4; say (^@a).perl | |||
rakudo: my @a= 1 ... 4; say (^@a).perl | 10:50 | ||
p6eval | rakudo ab2322: OUTPUT«0..^[1, 2, 3, 4]» | ||
colomon | too early | ||
alpha: my @a= 1 ... 4; say (^@a).perl | |||
p6eval | alpha 30e0ed: OUTPUT«0..^4» | ||
10:54
JimmyZ joined
|
|||
isBEKaml | alpha: sub subbydo { my $temp=23;{ say $_ + $temp }; }; my $tt = subbydo; my $test1=$tt(23); | 10:55 | |
p6eval | alpha 30e0ed: OUTPUT«Use of uninitialized value23invoke() not implemented in class 'Boolean'in Main (file <unknown>, line <unknown>)» | ||
JimmyZ | rakudo: my @array = 1, 3, 5; say +@array; | 10:56 | |
p6eval | rakudo ab2322: OUTPUT«3» | ||
JimmyZ | rakudo: my @array = 1, 3, 5; say @array.keys; | ||
p6eval | rakudo ab2322: OUTPUT«012» | ||
10:57
finanalyst left
|
|||
JimmyZ | rakudo: my @array; say ?@array; say +@array; | 10:57 | |
p6eval | rakudo ab2322: OUTPUT«00» | ||
JimmyZ | rakudo: my @array = 1; say ?@array; say +@array; | 10:58 | |
p6eval | rakudo ab2322: OUTPUT«11» | ||
JimmyZ | rakudo: my @array = 1,2 ; say ?@array; say +@array; | ||
p6eval | rakudo ab2322: OUTPUT«12» | ||
11:06
pmurias joined
11:07
JimmyZ left
11:18
JimmyZ joined
|
|||
colomon | > my @a= 1 ... 4; say (^@a).perl | 11:22 | |
0..^4 | |||
isBEKaml | colomon: \o/ | 11:26 | |
colomon++ | |||
11:27
wknight8111 joined
|
|||
isBEKaml | alpha: my @a= 1 ... 4; my @bb= (^@a); say @bb.perl; | 11:29 | |
p6eval | alpha 30e0ed: OUTPUT«[0, 1, 2, 3]» | ||
colomon | very easy fix | 11:32 | |
:) | 11:33 | ||
spectesting it right now. | |||
cognominal | when I read something like @opstack, I have a itch to add twigils for stack and queue roles as opposed to full aray roles... That would give @>stack and @<queue. But, chaplet of twigils in names will be a sure way to scare more people | 11:45 | |
11:45
JimmyZ left
|
|||
cognominal | On the other hand, I find @>op nicer than @opstack | 11:45 | |
anyway, anyone will be free to transmogrify Perl 6 if he has the proper skills. | 11:47 | ||
dalek | kudo: c18ef37 | (Solomon Foster)++ | src/core/Range.pm: Switch prefix:<^> to use +$max internally. |
12:00 | |
12:01
sundar joined
|
|||
sundar | what's the way to get the latest version of Synopses? | 12:02 | |
I remember someone saying the web version is usually outdated and it's better to pull it from some repository. | 12:03 | ||
colomon | Web version updates automatically. | ||
I see the page I have open was updated this morning. | |||
but it's worth checking that, because the automatic update was broken for a while earlier this year. | 12:04 | ||
sundar | colomon: oh ok, I now see that the page I'm looking at was updated yesterday evening. thanks. | 12:05 | |
colomon | the other way to get the latest is to pull them down from the subversion repo | ||
svn.pugscode.org/pugs | 12:06 | ||
lisppaste3 | sundar pasted "Why does the second \s take a + and not a * like the others? (from S05)" at paste.lisp.org/display/98993 | 12:07 | |
colomon | just guessing: because it's between two alphabetic characters. | 12:08 | |
sundar | colomon: Ok, I'll pull that now for offline reading pleasure. :) | ||
colomon | svn.pugscode.org/pugs/docs/Perl6/Spec is more specific; there is a lot of stuff in the old pugs repo. | 12:09 | |
12:11
JimmyZ joined
|
|||
sundar | colomon: thanks, that makes sense... TIL ws is another dwimmery in perl6. | 12:15 | |
pugssvn | r30596 | colomon++ | [t/spec] Refudge a tad, add a couple of tests to make sure prefix:<^> numifies its argument. | ||
colomon | mind you, I've never messed around with the :s modifier at all, so I might be completely wrong. :) | 12:16 | |
sundar | colomon: you were not. I found another part of the Syn where it says <.ws> is "\s+ if it's between two \w characters,", and "\s* otherwise". :) | 12:21 | |
12:26
fridim left
|
|||
JimmyZ | rakudo: my @a = 1, 2, 4; say (1...^@a).perl.say; | 12:33 | |
p6eval | rakudo ab2322: OUTPUT«(1)1» | ||
JimmyZ | rakudo: my @a = 1, 2, 4; (1..^@a).perl.say; | ||
p6eval | rakudo ab2322: OUTPUT«1..^[1, 2, 4]» | ||
12:36
rv2733 left
12:37
rv2733 joined
|
|||
colomon | JimmyZ: p6eval doesn't have the latest changes yet. | 12:37 | |
actually, it's two days behind at the moment. that's a sign of trouble. :( | 12:38 | ||
12:38
maspalio joined
|
|||
JimmyZ | Yeah | 12:39 | |
I am compiling by myself now. | 12:40 | ||
12:40
maspalio left
12:43
masak joined
|
|||
JimmyZ | alpha: my @a = 1, 2, 4; (1..^@a).perl.say | 12:45 | |
p6eval | alpha 30e0ed: OUTPUT«1..^[1, 2, 4]» | ||
JimmyZ | pugs: my @a = 1, 2, 4; (1..^@a).perl.say | 12:46 | |
p6eval | pugs: OUTPUT«(1, 2)» | ||
JimmyZ | alpha: my @a = 1, 2, 4; (^@a).perl.say | 12:47 | |
p6eval | alpha 30e0ed: OUTPUT«0..^3» | ||
JimmyZ | rakudo: my @a = 1, 2, 4; (^@a).perl.say | ||
p6eval | rakudo ab2322: OUTPUT«0..^[1, 2, 4]» | ||
JimmyZ | ./perl6 -e 'my @a = 1, 2, 4; (1..^@a).perl.say' | 12:48 | |
masak | cognominal: [backlog] adding twigils for stack and queue sounds like a good idea for a module. | ||
JimmyZ | 1..^[1, 2, 4] | ||
colomon | masak: o/ | 12:49 | |
masak | \o | ||
colomon | I'm hanging with my parents and hunting LHF. | 12:51 | |
32,000 passing tests is dangerously close. | |||
12:51
rgrau_ left
|
|||
masak cheers colomon on | 12:51 | ||
JimmyZ | colomon: Is the result right? | ||
masak | I'm drafting up the presentation I'll be giving in a week and some. | 12:52 | |
JimmyZ: no, but that bug was reported the other day. | |||
colomon | JimmyZ: (^@a).perl.say is for sure wrong, and I've already fixed it. | ||
(1..^@a).perl.say is a much trickier question | 12:53 | ||
JimmyZ | jimmy@ubuntu:~/rakudo$ ./perl6 -e 'my @a = 1, 2, 4; (1..^@a).perl.say' | ||
1..^[1, 2, 4] | |||
jimmy@ubuntu:~/rakudo$ ./perl6 -e 'my @a = 1, 2, 4; (^@a).perl.say' | |||
0..^3 | |||
colomon | right, that's the correct (fixed) behavior for (^@a).perl.say | ||
masak | why is it tricky? I guess it has to do with not being able to numify because of strings. | ||
colomon | masak: exactly. | ||
moritz_ | it probably deserves a special case | 12:54 | |
if $arg ~~ Positional { numifiy } | |||
masak | well, I don't think arrays should be whitelisted. | ||
colomon | with prefix:<^>, we know we want to numify | ||
masak | I think everything but scalar values should be blacklisted. | ||
moritz_ | rakudo: say (^'d').perl | ||
p6eval | rakudo ab2322: OUTPUT«0..^"d"» | ||
moritz_ | well | 12:55 | |
colomon | that's the old behavior, it's 0..0 now. | ||
moritz_ | one can always say that if one of the endpoints is ~~ Numeric, the other should be numified too | ||
masak | colomon: right, but the *reason* we know we want to numify has to be the same as the reason we know we want to numify 0..^@a | ||
moritz_ | rakudo: say (^'d').perl | ||
p6eval | rakudo c18ef3: OUTPUT«0..^0» | ||
moritz_ | colomon++ | ||
moritz_ will hold his Perl 6 talk tomorrow | 12:56 | ||
JimmyZ | rakudo: (^'d4').perl.say | ||
p6eval | rakudo c18ef3: OUTPUT«0..^0» | ||
JimmyZ | rakudo: (^'4d').perl.say | ||
p6eval | rakudo c18ef3: OUTPUT«0..^4» | ||
JimmyZ | rakudo: say 'd4' + 4 | 12:57 | |
p6eval | rakudo c18ef3: OUTPUT«4» | ||
colomon | moritz_: did you just rebuild p6eval, or did it do it on its own? | ||
afk | 12:58 | ||
moritz_ | colomon: I did | 12:59 | |
I guess the rebuild is now sufficiently sane that I can enable the cron job again | 13:00 | ||
I've now enabled it every other hour | |||
15 */2 * * * perl /home/p6eval/rebuild-rakudo.pl >> /home/p6eval/rakudo-buildlog 2>&1 | 13:02 | ||
13:08
sundar left
13:09
TiMBuS left
|
|||
colomon | cron++ | 13:20 | |
moritz_++ | |||
masak | p6eval++ | ||
dalek | kudo: ee6ec74 | (Solomon Foster)++ | src/core/Pair.pm: Add infix:<cmp> for pairs. |
13:21 | |
pugssvn | r30597 | colomon++ | [t/spec] Unfudge infix:<cmp> tests on pairs, also rewrite two of the tests so they parse correctly. | 13:22 | |
colomon | with that, I'm showing 31974 passing tests. | 13:23 | |
13:24
EXCHIM left
13:25
EXCHIM joined
13:29
M_o_C left
|
|||
JimmyZ | wow, will reach alpha | 13:33 | |
13:34
alester joined
|
|||
masak | ...but with different passing tests. | 13:35 | |
anyway, only 6 tests left to 32k ! | |||
moritz_ | 26 | 13:37 | |
if my subtraction cells haven't left me | |||
JimmyZ | rakudo: say 32731 - 31974 | 13:38 | |
p6eval | rakudo c18ef3: OUTPUT«757» | ||
moritz_ | rakudo: postfix:<k>($x) { 1000 * $k }; say 32\k - 31974 | ||
p6eval | rakudo c18ef3: OUTPUT«Confused at line 11, near "postfix:<k"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | ||
masak | er. that's a seven. right, 26. | ||
colomon | rakudo: postfix:<k>($x) { 1000 * $k }; say 32k - 31974 | 13:39 | |
p6eval | rakudo c18ef3: OUTPUT«Confused at line 11, near "postfix:<k"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | ||
moritz_ | rakudo: use MONKEY_TYPING; augment class Int { method k ($x) { 1000 * $k }}; say 32.k - 31974 | ||
p6eval | rakudo c18ef3: OUTPUT«Symbol '$k' not predeclared in kcurrent instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)» | ||
moritz_ | rakudo: use MONKEY_TYPING; augment class Int { method k ($x) { 1000 * $x }}; say 32.k - 31974 | ||
p6eval | rakudo c18ef3: OUTPUT«Method 'k' not found for invocant of class 'Integer'current instr.: '_block14' pc 29 (EVAL_1:0)» | ||
moritz_ weeps | |||
masak | \k | ||
rakudo: postfix:<k>($x) { 1000 * $x }; say 32\k - 31974 | 13:40 | ||
p6eval | rakudo c18ef3: OUTPUT«Confused at line 11, near "postfix:<k"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | ||
masak | rakudo: sub postfix:<k>($x) { 1000 * $x }; say 32\k - 31974 | ||
p6eval | rakudo c18ef3: OUTPUT«26» | ||
colomon | masak++ | ||
JimmyZ | rakudo: sub postfix:<k>($x) { 1000 * $x }; say 32k - 31974 | 13:41 | |
p6eval | rakudo c18ef3: OUTPUT«26» | ||
masak | oh, even that. | ||
JimmyZ | alpha: sub postfix:<k>($x) { 1000 * $x }; say 32k - 31974 | 13:42 | |
13:42
rurban joined
|
|||
p6eval | alpha 30e0ed: OUTPUT«26» | 13:42 | |
JimmyZ | alpha: sub postfix:<k>($x) { 1000 * $x }; say 32\k - 31974 | 13:43 | |
p6eval | alpha 30e0ed: OUTPUT«Confused at line 10, near "\\k - 31974"in Main (file <unknown>, line <unknown>)» | ||
13:48
Su-Shee left
|
|||
moritz_ | std: sub postfix:<k>($x) { }; 32k | 13:50 | |
p6eval | std 30597: OUTPUT«ok 00:01 116m» | ||
moritz_ | std: sub postfix:<k>($x) { }; 32\k | ||
p6eval | std 30597: OUTPUT«ok 00:01 114m» | ||
masak | std: sub postfix:<k>($x) { }; 32kk | ||
p6eval | std 30597: OUTPUT«ok 00:01 114m» | ||
JimmyZ | rakudo: sub postfix:<k>($x) { 1000 * $x }; say 32kk - 31974 | 13:51 | |
p6eval | rakudo c18ef3: OUTPUT«31968026» | ||
JimmyZ | rakudo: sub postfix:<k>($x) { 1000 * $x }; say 32\k\k - 31974 | ||
p6eval | rakudo c18ef3: OUTPUT«31968026» | ||
JimmyZ | rakudo: sub postfix:<k>($x) { 1000 * $x }; say 32\kk - 31974 | ||
p6eval | rakudo c18ef3: OUTPUT«31968026» | ||
13:55
slavik1 left
13:59
hercynium left,
slavik joined
14:00
ReiniUrban joined
|
|||
moritz_ | www.perlmonks.org/?node_id=839112 couldn't resist :-) | 14:01 | |
14:01
rurban left,
ReiniUrban is now known as rurban,
rurban left
|
|||
slavik | moritz_: NICE!!!! | 14:02 | |
moritz_: that should be in the book :) | |||
also, what does the 1_000 exactly mean? why not 1000 instead? | |||
moritz_ | it's the same | ||
slavik | oh | ||
moritz_ | rakudo: say 1_000_000 | 14:03 | |
p6eval | rakudo c18ef3: OUTPUT«1000000» | ||
moritz_ | works the same way in perl 5 too | ||
buubot: eval: 1_024 | |||
buubot | moritz_: 1024 | ||
slavik | _ is like a comma? (period in europe) | ||
masak | moritz_++ | ||
moritz_ | yes | ||
slavik | good point | ||
moritz_++ | |||
moritz_ | slavik: but you can use it at any position in a number | ||
rakudo: say 10_24 | 14:04 | ||
p6eval | rakudo c18ef3: OUTPUT«1024» | ||
slavik | I see, so it's only visual? | ||
moritz_ | some cultures like to group their numbers in pairs | ||
right | |||
slavik | ok, cool | ||
so technically, Perl6 has some features that Java7 was supposed to have ... | 14:05 | ||
masak | the Chinese tend -- at some level anyway -- to group in fours. | ||
JimmyZ: am I right? | |||
moritz_ | anyway, I'm fine with allowing _ at arbitrary positions | ||
rakudo: say 1__3 | |||
p6eval | rakudo c18ef3: OUTPUT«Confused at line 11, near "say 1__3"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | ||
moritz_ | std: 1__3 | 14:06 | |
p6eval | std 30597: OUTPUT«===SORRY!===Whitespace is required between alphanumeric tokens at /tmp/zrIsnxD0WC line 1:------> 1⏏__3Two terms in a row at /tmp/zrIsnxD0WC line 1:------> 1⏏__3 expecting any of: POST bracketed infix infix or | ||
..meta-i… | |||
slavik | rakudo say 1_3 | ||
JimmyZ | masak: I can't follow you | ||
slavik | rakudo: say 1_3 | ||
p6eval | rakudo c18ef3: OUTPUT«13» | ||
moritz_ | rakudo: say 12_ | ||
p6eval | rakudo c18ef3: OUTPUT«Confused at line 11, near "say 12_"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | ||
slavik | I guess with two _, it thinks there is meaning to it | ||
rakudo: say _12 | |||
p6eval | rakudo c18ef3: OUTPUT«Could not find sub &_12current instr.: '_block14' pc 29 (EVAL_1:0)» | ||
slavik | right, because it's not a number ... | 14:07 | |
is it possible with Perl6 to have your own context definitions? | |||
moritz_ | yes | 14:08 | |
slavik | something like: my $feet = context<feet>(convert(30.48cm)) or something ... | ||
moritz_ | for example striing context consists only of a method call | ||
to .Str or .Stringy | |||
masak | JimmyZ: I mean that 万 is a 'unit', sort of one level above 10. | 14:09 | |
slavik | 100? | ||
moritz_ | so you can define a prefix:<imperial> that calls the .Imperial method | ||
and define that method in all number types that present a value + unit | |||
masak | slavik: no, I don't mean like that. we tend to organize things in 10^3 units. | ||
slavik: the Chinese (and the Koreans, and perhaps the Japanese too) tend to go with 10^4. | 14:10 | ||
slavik | moritz_: or have all objects inherit an interface of measurement? | ||
masak: ahh, I see | |||
moritz_ | slavik: likely s/inherit an interface/"do" a role/ | ||
but of course inheritance would work too | |||
masak | so the Chinese don't think of the population of China as being 1.4 * 10^9, but instead 14 * 10^8. | ||
TimToady | yes, the Japanese also | 14:11 | |
moritz_ | which is just as correct :-) | ||
masak | aye, but a funny shift of perspective. | ||
I like the pause that both westerners and easterners have to take when converting :) | 14:12 | ||
JimmyZ | masak: yes, but it's old, now most I saw is three , not four. | ||
masak | JimmyZ: how would you think about the population of China? | ||
moritz_ | "big" *SCNR* | ||
masak | JimmyZ: 1.4 * 10^9 or 14 * 10^8? | ||
JimmyZ | well, we say 14亿 | 14:13 | |
masak | I rest my case. | ||
slavik | moritz_: right ... | 14:14 | |
pugssvn | r30598 | colomon++ | [t/spec] Unfudge tests. | 14:16 | |
colomon | 31980 passing tests | ||
JimmyZ | masak: actually, we use three or four, depends on the fields. | 14:17 | |
masak | oh, ok. science does 3 more? | ||
JimmyZ | yeah | ||
usually advanced field | 14:18 | ||
masak | makes cultural sense, methinks. | ||
TimToady | interestingly, ancient Greek had the concept of "myriad", which was 10,000 | ||
and "myriads of myriads" | 14:19 | ||
dalek | kudo: e113d85 | (Solomon Foster)++ | src/core/Array.pm: Add proto for unshift so we can use named args. |
||
moritz_ wonders what kind of numbers the greeks measured in "myriads of myriads" | |||
JimmyZ | masak: you're right. | ||
moritz_ | in great britain the scientists mostly use the SI system too | 14:20 | |
TimToady | moritz_: in general, they preferred geometry :) | ||
masak | moritz_: probably most often "I've told you myriads of myriads of times not to exaggerate!" :P | ||
moritz_ | :-) | ||
14:21
alester left
14:22
am0c joined
|
|||
masak | this list might be of interest to someone: gist.github.com/395182 | 14:22 | |
it's of the 185 t/spec files that Rakudo's t/spectest.data doesn't mention. | |||
moritz_ | which tools/update_passing_test_data.pl processes | 14:23 | |
masak | o rly? I figured some tool would do that :) | ||
moritz_ | masak++ #made me look at a particular test file | 14:25 | |
pugssvn | r30599 | moritz++ | [t/spec] delete a test file that consistet of four tests; two of them bogus, two already present elsewhere | 14:26 | |
moritz_ | ... which I now deleted :-) | ||
masak | \o/ | ||
moritz_ | does EnumMap preserve key ordering? | 14:27 | |
masak | don't think so. | ||
if a file comes out as 'some tests passed' by this tool, can there still be reasons not to add it to t/spectest.data? | |||
moritz_ | sure | 14:28 | |
for example rakudo passes some tests in temp.t | |||
but it doesn't implement 'temp' at all | |||
=> no point in adding it | |||
masak | ah. | ||
let.t is the same, but it also runs all tests! o.O | 14:29 | ||
time to write more tests. :) | |||
pugssvn | r30600 | moritz++ | [t/spec] correct some enum tests that relied on hash key order | 14:33 | |
r30601 | moritz++ | [t/spec] fix a syntax error | 14:34 | ||
r30602 | moritz++ | [t/spec] fudge undefined-types.t for Rakudo | 14:36 | ||
r30603 | moritz++ | [t/spec] unfudges for rakudo, found by autounfudge | 14:38 | ||
14:38
alester joined
|
|||
moritz_ | uhm | 14:40 | |
t/spec/S05-match/make.t | |||
isBEKaml | perlmonks.org is down? | ||
moritz_ | that looks bogus | ||
isBEKaml | I can't connect to it.. :( | ||
moritz_ | "4" ~~ / (\d) { make $0.sqrt } Remainder /; | ||
ok($/); | |||
I'd say that the regex doesn't match | 14:41 | ||
and that $/ is false even though make() was called | |||
correct? | |||
isBEKaml: wouldn't be the first time | |||
... but works for me | |||
isBEKaml | hmm, I just wanted to view the page you linked to... | 14:42 | |
dalek | kudo: 73a3d3e | moritz++ | t/spectest.data: [t/spec] run another test file |
||
isBEKaml | now I can see it.. repeated attempts. :( | ||
pugssvn | r30604 | moritz++ | [t/spec] correct make.t - a $/ of a failed match is False, even if make() was called | 14:43 | |
isBEKaml | rakudo: say 1_00_000; | 14:45 | |
p6eval | rakudo e113d8: OUTPUT«100000» | ||
isBEKaml | rakudo: say 1_00_000 + 20_00_000; | ||
p6eval | rakudo e113d8: OUTPUT«2100000» | ||
isBEKaml | exactly like p5 ;) | ||
moritz_ | std: my @a; / ||@a / | ||
p6eval | std 30599: OUTPUT«ok 00:01 113m» | 14:46 | |
pugssvn | r30605 | moritz++ | [t/spec] fudge sequential-alternation.t for rakudo | 14:47 | |
moritz_ | rakudo: multi a($a) { 1 }; multi a(:$a) { 2 }; say a(:a) | 14:49 | |
p6eval | rakudo e113d8: OUTPUT«2» | ||
JimmyZ | rakudo: say 1_0000 | ||
p6eval | rakudo e113d8: OUTPUT«10000» | ||
moritz_ | rakudo: multi a($a) { 1 }; multi a(:$a) { 2 }; multi a(:$a, :$b); say a(:a) | ||
JimmyZ | rakudo: say 1,0000 | ||
p6eval | rakudo e113d8: OUTPUT«Malformed multi at line 11, near "a(:$a, :$b"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | ||
rakudo e113d8: OUTPUT«10» | |||
JimmyZ | rakudo: say 10,000 | ||
moritz_ | rakudo: multi a($a) { 1 }; multi a(:$a) { 2 }; multi a(:$a, :$b) { 3 } say a(:a) | ||
p6eval | rakudo e113d8: OUTPUT«100» | ||
rakudo e113d8: OUTPUT«Confused at line 11, near "multi a(:$"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | |||
moritz_ | rakudo: multi a($a) { 1 }; multi a(:$a) { 2 }; multi a(:$a, :$b) { 3 }; say a(:a) | ||
p6eval | rakudo e113d8: OUTPUT«Ambiguous dispatch to multi 'a'. Ambiguous candidates had signatures::(Any :a($a)):(Any :a($a), Any :b($b))current instr.: '_block14' pc 29 (EVAL_1:0)» | ||
JimmyZ | rakudo: say 10,000 | ||
p6eval | rakudo e113d8: OUTPUT«100» | ||
JimmyZ | pugs: say 10,000 | 14:50 | |
p6eval | pugs: OUTPUT«100» | ||
14:50
alester left
|
|||
moritz_ | I guess this should not be ambigious, right? | 14:50 | |
t/spec/S06-multi/positional-vs-named.t | |||
JimmyZ | pugs: print 1,2 | 14:51 | |
p6eval | pugs: OUTPUT«12» | ||
JimmyZ | pugs: say 1,2 | ||
p6eval | pugs: OUTPUT«12» | ||
JimmyZ | rakudo: say '000' | ||
p6eval | rakudo e113d8: OUTPUT«000» | ||
JimmyZ | rakudo: say 10,'000' | ||
p6eval | rakudo e113d8: OUTPUT«10000» | ||
JimmyZ | rakudo: say 10,+'000' | 14:52 | |
p6eval | rakudo e113d8: OUTPUT«100» | ||
ash___ | rakudo: say 10_000 | ||
moritz_ | rakudo: eval 'augment class Int { }' | ||
p6eval | rakudo e113d8: OUTPUT«10000» | 14:53 | |
rakudo e113d8: ( no output ) | |||
ash___ | moritz_: shouldn't that complain about use MONKEY_TYPING? | ||
moritz_ | ash___: yes, but the eval() is silent :-) | ||
ash___ | ah | ||
moritz_ | rakudo: use MONKEY_TYPING; { class Foo { }; augment class Foo { } } | 14:54 | |
p6eval | rakudo e113d8: ( no output ) | ||
moritz_ incredibly stupid | |||
pugssvn | r30606 | moritz++ | [t/spec] fudge augment-supersede.t | 14:55 | |
moritz_ | I was wondering why stuff didn't work in a test file, but worked here on evalbot | ||
I forgot to save the file. | |||
JimmyZ | rakudo: eval ' class Foo{ }; augment class Foo { method Str() { 'hi'; }; say ~Foo' | ||
p6eval | rakudo e113d8: OUTPUT«Confused at line 11, near "eval ' cla"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | ||
JimmyZ | rakudo: eval 'class Foo{ }; augment class Foo { method Str() { 'hi'; }; say ~Foo' | ||
p6eval | rakudo e113d8: OUTPUT«Confused at line 11, near "eval 'clas"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | ||
ash___ | I love when I do that, I switch to my terminal, hit make, run my program and the new change isn't working for some reason.... | ||
silly save button | |||
14:56
Coleoid joined
|
|||
moritz_ | JimmyZ: can't use 'hi' inside a single-quoted string | 14:56 | |
ash___ | rakudo: eval ' class Foo{ }; augment class Foo { method Str() { \'hi\'; }; say ~Foo' | 14:57 | |
p6eval | rakudo e113d8: ( no output ) | ||
JimmyZ | rakudo: eval "use MONKEY_TYPING; class Foo{ }; augment class Foo { method Str() { 'hi'; } } ; say ~Foo" | 14:58 | |
p6eval | rakudo e113d8: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespaceUseless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespaceNull PMC access in get_string()current instr.: '_block14' | ||
..pc 29… | |||
JimmyZ | rakudo: use MONKEY_TYPING; class Foo{ }; augment class Foo { method Str() { 'hi'; } } ; say ~Foo | ||
p6eval | rakudo e113d8: OUTPUT«Foo()» | ||
JimmyZ | rakudo: use MONKEY_TYPING; class Foo{ }; augment class Foo { method Str() { 'hi'; } } ; say ~Foo.new | ||
p6eval | rakudo e113d8: OUTPUT«hi» | 14:59 | |
JimmyZ | rakudo: class Foo { method Str() { 'hi'; } } ; say ~Foo | ||
p6eval | rakudo e113d8: OUTPUT«Foo()» | ||
JimmyZ | rakudo: eval "use MONKEY_TYPING; class Foo{ }; augment class Foo { our method Str() { 'hi'; } } ; say ~Foo.new" | 15:00 | |
p6eval | rakudo e113d8: OUTPUT«Could not find sub 20_1273416224.9741current instr.: '' pc -1 ((unknown file):-1)» | ||
colomon | what does S& mean? | ||
like an all junction, but not threaded? | |||
moritz_ | yes | 15:01 | |
JimmyZ | rakudo: eval "use MONKEY_TYPING; class Foo{ }; augment class Foo { method Str() { 'hi'; } } ; say ~Foo.new" | ||
colomon | junctions don't thread now, do they? | ||
p6eval | rakudo e113d8: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespaceUseless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespaceNull PMC access in get_string()current instr.: '_block14' | ||
..pc 29… | |||
moritz_ | colomon: nope, they don't | ||
pugssvn | r30607 | moritz++ | [t/spec] correct S12-class/literal.t | ||
colomon | we're skipping 55 tests in rx.t because we don't implement S&. | 15:02 | |
JimmyZ | rakudo: eval "class Foo { our method Str() { 'hi'; } } ; say ~Foo.new" | ||
p6eval | rakudo e113d8: OUTPUT«Could not find sub 19_1273416350.42779current instr.: '' pc -1 ((unknown file):-1)» | ||
moritz_ | colomon: I'm fine with replacing that by a simpler construct | ||
colomon | oh? | ||
moritz_ | colomon: like 'and' or '&&' if applicable | ||
(watch the precedence) | |||
colomon | the tests are like this: | 15:03 | |
moritz_ | S05-* is not about testing S&. It's about testing regexes | ||
colomon | ok eval(q{{ 'abcZ' ~~ /abc\Z/ }}) ~~ Failure S& /reserved/, 'retired metachars (\Z)'; | ||
I admit I don't really understand the logic. | |||
moritz_ | the return value of the eval should be a failure, and match /reserved/ | ||
colomon | (I was just thinking of implementing Sop which just does op....) | ||
JimmyZ | Could not find sub 19_1273416350.42779? what's that? | ||
moritz_ | a LTA error message | 15:04 | |
std: print $*OUT: "foo" | |||
p6eval | std 30606: OUTPUT«ok 00:01 113m» | ||
masak | rakudo: {nextsame}() | 15:05 | |
moritz_ would gladly throw that syntactic form over board | |||
p6eval | rakudo e113d8: OUTPUT«Null PMC access in clone()current instr.: '&nextsame' pc 18507 (src/builtins/assign.pir:78)» | ||
JimmyZ | seems that augment can't in eval | ||
masak | moritz_: that use case for that syntactic form is basically the only argument I see for defending it ;P | ||
moritz_ | masak: it's only worth defending for Perl 5 convenience, IMHO | 15:06 | |
masak | perhaps, but even that is not something to be thrown overboard lightly. | 15:07 | |
moritz_ | not? :-) | ||
pugssvn | r30608 | moritz++ | [t/spec] more Rakudo unfudges found by autounfudge | 15:08 | |
colomon | moritz_++ | 15:10 | |
masak | no. all other things being equal, I see it as a strength being able to answer affirmatively to the question 'can you still do "print $FILE 1, 2, 3" in Perl 6?', albeit with the slight caveat that we made the syntax more consistent. | ||
colomon | doing it the scientific way, instead of just looking manually for LHF... | ||
masak | because there are some things we value more than backwards compatibility, such as the never-two-terms-in-a-row rule. | 15:11 | |
dalek | kudo: ad46ef8 | moritz++ | t/spectest.data: run two more test files |
||
JimmyZ | LTA ? Less Than Awesome? | ||
colomon | moritz_: to put it a different way: can you see any reason why those tests need S& instead of just &? | ||
JimmyZ: yes | |||
JimmyZ | colomon: thanks | 15:12 | |
moritz_ | colomon: the scientific (and automated) way has a drawback - it discouraged me from manually looking at test files, which is often also needed | ||
colomon | sure, most of my bumps have involved simple patches to Rakudo. | ||
moritz_ | colomon: the idea was that the regex match is only carried out when the eval failed... | 15:13 | |
colomon: but since a non-Exception return value won't cause an error, I don't think it *needs* to be S& | |||
moritz_ wonders if the S meta op could just set a $*DO_IT_SEQUENTIALLY variable | 15:14 | ||
colomon | moritz_: that's how I'd been thinking about S. | ||
moritz_ | and if that is set, the autotreading and hyper dispatcher will do it sequentially | ||
which is currently a no-op, because it is sequentially anyway :-) | |||
colomon: so +1 from me to implementing S | 15:15 | ||
colomon | my only hesitation is that sometimes S means "short-circuit" instead, if I understand the spec correctly. And that's completely different from sequential, and I have no idea how to handle it. | 15:16 | |
btw, how many tests did you win back with those two additional files? | 15:17 | ||
15:17
rgrau_ joined
|
|||
colomon | (first stab at implementing Sop now compiling) | 15:20 | |
arnsholt | colomon: Sequential evaluation for | and & would essentially be short-circuit semantics | ||
Or at least, that's how I understand it | 15:21 | ||
colomon | do we have tests for this? if no, can we come up with them? | 15:22 | |
arnsholt | I don't know if there are any tests, but I suppose the examples from S03 are a place to start | 15:23 | |
colomon | rakudo; say 2 orelse 4 | 15:24 | |
rakudo: say 2 orelse 4 | |||
p6eval | rakudo e113d8: OUTPUT«Confused at line 11, near "say 2 orel"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | ||
15:26
dual left
|
|||
ash___ | std: say 2 orelse 4 | 15:26 | |
p6eval | std 30606: OUTPUT«ok 00:01 110m» | ||
ash___ | do the values in the settings belong to any package? GLOBAL maybe? | 15:28 | |
colomon | S03-operators/also.t | ||
masak | ash___: CORE | 15:30 | |
ash___ | thanks masak | ||
diakopter | moritz_: did you see perlesque passed man_or_boy? | 15:31 | |
masak | S02 has the details. | ||
colomon | ooooo, except for 3 S& 4 S& 5, we pass all the S& tests in also.t | ||
I'm going to add that test file and spectest | |||
isBEKaml | what are the flags that can be passed with --trace to perl6? | 15:34 | |
the running.pod doesn't flesh them out... | |||
I just passed numbers and it's dumping the whole trace.. er, it's still doing it.. :| | 15:35 | ||
pmurias | diakopter: hi | 15:36 | |
phenny | pmurias: 04:59Z <diakopter> tell pmurias please backlog; all kinds of neat stuff there | ||
15:36
JimmyZ left
|
|||
diakopter | pmurias: hi | 15:36 | |
15:38
s1n left,
gurjeet left
15:39
lichtkind joined,
gurjeet joined
|
|||
isBEKaml | Specifically, what do those numbers stand for? perl6 --trace={0,1,4} -e "say 'hi';" | 15:39 | |
pmurias | diakopter: you intend to also class declaration with class Foo {...} not only through runsharp method calls? | 15:40 | |
diakopter | yes :) | ||
today | |||
pmurias | good | ||
diakopter | type literals are cool, too | 15:41 | |
you saw the man_or_boy.t results? | |||
pmurias | type literals? | 15:42 | |
diakopter | perlesque: say(int) | ||
p6eval | perlesque: OUTPUT«System.Int32» | ||
lichtkind | mas | 15:43 | |
masak: hej | |||
masak | o/ | ||
lichtkind | :) | ||
pmurias | t/man_or_boy.t should print out -67 | ||
diakopter | yes | 15:44 | |
oh, I neglected to add TAP stuff | 15:45 | ||
15:45
isBEKaml left
|
|||
pmurias | does visual studio support TAP integration or does it need the test results in a different format? | 15:46 | |
diakopter | no idea | ||
I commit to svn, then update from linux VM and test from mono | |||
then fix bugs then commit again | |||
pmurias | i see | 15:47 | |
masak | lichtkind: I saw your post: use.perl.org/~perl6doc/journal/40348 | ||
lichtkind | masak: and? | 15:48 | |
diakopter | I've gotten quite good at printf debugging, since I can't really step through or set breakpoints in generated code | ||
pmurias | should i fix the man_or_boy.t? | ||
diakopter | I can | ||
masak | lichtkind: I really hope someone starts such a project. whether from a clean slate or from November doesn't matter that much to me. November has been useful in other ways already. | ||
15:49
finanalyst joined
|
|||
pmurias | fixing | 15:49 | |
masak | there is still potential to be explored in the area of Perl 6 wiki software, it's just that currently that niche isn't filled with any person with tuits. | ||
lichtkind | masak: do you agree that the retrieving DBI data and buitlding html sites is the easy part? | 15:52 | |
masak | in the sense that it's just a SMOP, yes. | 15:53 | |
lichtkind | insider answer :) | ||
dalek | meta: r257 | pawelmurias++ | trunk/Sprixel/t/man_or_boy.t: man or boy test produces TAP |
15:54 | |
masak | my answer was meant to be read as something akin to this argument: blog.bitquabit.com/2009/07/01/one-w...cker-news/ | ||
i.e. some things look trivially easy, but the actual complexity has been invested into making the thing easy to use. | 15:55 | ||
it might be the lack of something like that which makes SocialText near unusable. | |||
similarly, the RT interface for constructing queries by shunting ANDs and ORs around in a formula tree structure -- obviously designed by a programmer -- is cute in theory, but bafflingly useless in practice. | 15:56 | ||
16:00
[mark] joined
16:05
[mark] left
|
|||
colomon | 32005 passing tests! | 16:07 | |
16:07
molaf joined
|
|||
masak | \o/ | 16:07 | |
colomon++ | |||
pugssvn | r30609 | colomon++ | [t/spec] Fudge for Rakudo. | ||
dalek | kudo: 27e05a8 | (Solomon Foster)++ | (3 files): Add dead simple preliminary implementation of Sop, and turn on the only test we were able to find for it. |
16:08 | |
slavik | out of how many? | ||
colomon | 39026 that tools/test_summary.pl knows about | 16:12 | |
slavik | so roughly 80% | ||
but not 100% of the spec has tests, right? | 16:13 | ||
colomon | surely not | ||
slavik | how much of spec has tests? best guesstimate :) | 16:14 | |
colomon | I've got not a clue. | ||
ash___ | slavik: you have to consider parts of the spec aren't fully written to, like S15 through S20 are rough drafts | 16:15 | |
colomon | speaking of which, moritz_++, I think your next LHF challenge should be to write tests for the S metaop. :) | 16:16 | |
ash___ | really i'd say about 14 through 31 are rough drafts and most of those don't have tests, they might have some, but not many | ||
diakopter | pmurias: I overrode your changes; man_or_boy does 1..17 now | 16:17 | |
colomon | heh, none of those S& tests in rx.t actually work. but I've switched them all to todos instead of skips. | ||
ash___ | plus, one of the biggest challenges (that would be awesome to achieve) is to have rakudo run STD.pm6 that would be great | ||
slavik | ash___: good point | 16:18 | |
dalek | meta: r258 | diakopter++ | trunk/Sprixel/ (3 files): [perlesque] loop form of man_or_boy.t, to test 1..17 starting values |
||
pugssvn | r30610 | colomon++ | [t/spec] Move 55 "skip" tests to "todo". | ||
pmurias | diakopter: np | ||
16:18
stepnem joined
|
|||
masak now has a project called 'failure' :) github.com/masak/failure | 16:19 | ||
it's Perl 5, though. | |||
diakopter | masak: lol | ||
masak | now I just need to name a project 'disaster' :P | ||
diakopter | boondoggle | 16:20 | |
deathmarch | |||
masak | dancing class & | ||
16:20
masak left
16:23
Ky6uk joined
16:24
patrickas joined
16:28
Ky6uk left
16:31
EXCHIM left
|
|||
moritz_ | last test run: 31998 | 16:34 | |
passing | |||
16:36
literal left
|
|||
patrickas | moritz_, I always wondered about how many tests does/did Pugs pass and what is the intersection of passing tests between rakudo and Pugs? Is such info easy to get ? | 16:36 | |
phenny | patrickas: 08 May 11:35Z <masak> tell patrickas that the logotype/logo_32x32.png idea sounds good. | ||
16:37
literal joined
|
|||
moritz_ | patrickas: not sure where such info could be found... apart from running the tests yourself | 16:37 | |
arnsholt | Pugs probably passed more tests back in the day too | 16:38 | |
moritz_ | ... when it tracked the spec :-) | ||
arnsholt | Yeah | ||
patrickas | oh... I was kinda hoping rakudo would be passing more tests than Pugs by now | 16:39 | |
moritz_ | I'm pretty sure it does | 16:41 | |
rakudo: /<[-]>/ | 16:42 | ||
p6eval | rakudo e113d8: OUTPUT«Obsolete use of hyphen in enumerated character class;in Perl 6 please use .. instead at line 11, near "]>/"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | ||
diakopter | moritz_: numbers: pugs.blogs.com/pugs/2008/07/pugshs-is-back.html | 16:43 | |
moritz_ | diakopter: thanks | 16:44 | |
rakudo: say 'ab' ~~ /<after a>b/ | 16:45 | ||
p6eval | rakudo 27e05a: OUTPUT«Method 'after' not found for invocant of class 'Regex;Cursor'current instr.: '_block48' pc 317 (EVAL_1:128)» | ||
moritz_ | rakudo: say 'ab' ~~ /<?after a>b/ | 16:46 | |
p6eval | rakudo 27e05a: OUTPUT«Method 'after' not found for invocant of class 'Regex;Cursor'current instr.: '_block48' pc 317 (EVAL_1:128)» | ||
moritz_ | rakudo: say 'ab' ~~ /<?before a>b/ | ||
p6eval | rakudo 27e05a: OUTPUT«» | ||
moritz_ | rakudo: /\A/ | 16:47 | |
p6eval | rakudo 27e05a: OUTPUT«Obsolete use of \A as beginning-of-string matcher;in Perl 6 please use ^ instead at line 11, near "/"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | ||
moritz_ | rakudo: say eval('/\A/') | 16:48 | |
p6eval | rakudo 27e05a: OUTPUT«» | 16:49 | |
diakopter | how many tests in the entire test suite currently? | ||
moritz_ | TimToady: t/spec/S05-mass/rx.t seems to assume that a failed eval *returns* a Failure object - is that correct? | ||
diakopter: about 40k | |||
diakopter | so rakudo fails 8K tests. | 16:50 | |
is it possible to estimate how many of those 8K tests are of a generated nature? | |||
moritz_ | that number sounds deceptively low | ||
diakopter: not many... about 2k or so probably p5 regex tests borrowed from the p5 test suite | 16:51 | ||
diakopter | (that is, how many of those 8K tests appeared after that pugs blog entry) | ||
moritz_ | that's not the same question :-) | ||
diakopter | it's fairly close | ||
I mean, both of those conditions | 16:52 | ||
well really, just how many appeared after that pugs blog entry, sorry | |||
using the generated/imported condition as an estimate if necessary | |||
16:52
patrickas left
|
|||
moritz_ | about 20k new tests, of which probably 16k to 18k are not individually hand-written | 16:53 | |
diakopter | ok. assume 4K handwritten. | ||
seems high | |||
I'll assume 2K | |||
moritz_ | well, I've put a lot of effort into it; so has KyleHa++ | 16:54 | |
diakopter | yes. | ||
oh, I guess 4K is reasonable given some of those are loop-y tests | |||
16:55
patrickas joined
16:57
Intensity joined
|
|||
diakopter | ok, pugs failed 2K/19K tests in July 2008, and today rakudo fails 8K/40K tests (of which 17K (21K minus 4K handwritten/new/passing) are 1. both passing and 2. generated/imported), which leaves 8K out of the July 2008 19K that Rakudo isn't passing | 16:59 | |
oops, numbers fail. trying again. | 17:00 | ||
moritz_ would try to argue otherwise | |||
if pugs passed most of the new/generated tests, minus the 4k new ones | |||
it would pass all but 6k total | 17:01 | ||
which would be 36k | |||
assuming it did similar spec changes tracking as rakudo does | |||
diakopter | why would it pass the new/generated tests but not the 4k handwritten ones? | ||
moritz_ | because the generated ones can be made to pass with rather little effort | 17:02 | |
diakopter | true; good point. | ||
moritz_ | so, did we learn anything of value from our little number experiments? | 17:03 | |
that pugs was really awesome while it was being actively developed? I guess we knew that before :-) | 17:04 | ||
that rakudo still has a long way to go? we knew that too | |||
diakopter | no; those weren't my points/intents | ||
I don't know. I guess I just don't like all those generated tests, b/c they seem to inflate the numbers, regardless of implementation/comparisons | 17:05 | ||
moritz_ | I also think they should be somehow reduced | 17:06 | |
diakopter | maybe I could grow to like them someday | ||
moritz_ | yet I do see some value; the number of should-be-covered cases does increase quadratically with the number of supported numeric types | ||
17:07
am0c left
|
|||
moritz_ | rakudo: say (+<Int Num Rat Complex Real Numeric>)**2 | 17:07 | |
p6eval | rakudo 27e05a: OUTPUT«36» | ||
diakopter | yeah. maybe most of the non-edge/corner crosses could be moved to a "stresstest" target | 17:08 | |
or something. | 17:09 | ||
moritz_ | not sure; I'll think more about it | ||
afk& | |||
colomon | my basic theory on the numeric tests is to decrease the number of values tested while increasing the number of combinations.... | 17:10 | |
afk & mother's day dinner | |||
diakopter | to clarify/revise my statement, instead of "inflate the numbers", I think more importantly they drown/crowd out the visibility of failing tests that are perhaps much more essential (such as closures, e.g.) | 17:15 | |
diakopter shuts up and goes back to Visual Studio to finish implementing class declarations in perlesque | 17:16 | ||
17:17
snarkyboojum left
|
|||
patrickas learned that pugs is even awesomer that he though it was! | 17:18 | ||
audrey++ i guess | |||
17:20
cxreg joined
17:21
am0c joined
|
|||
slavik | pugs is awesome ... but I wonder how close it is to rakudo in terms of features | 17:28 | |
is there a perl5 implementation on parrot? | 17:30 | ||
17:31
M_o_C joined
|
|||
diakopter | slavik: no one is working on one, afaik. | 17:36 | |
slavik | I have rakudo on my system | 17:38 | |
but Data::Dumper cannot be found ... | |||
slava@dogbert:~/src/rakudo/rakudo-2010.03$ ./perl6 -e 'use Data::Dumper; my @a = 1..5; say Dumper @a;' | 17:39 | ||
Unable to find module 'Data::Dumper'. | |||
current instr.: 'perl6;Perl6;Module;Loader;need' pc 33942 (src/gen/role_pm.pir:0) | |||
slava@dogbert:~/src/rakudo/rakudo-2010.03$ echo $PERL6LIB | |||
.::/home/slava/src/rakudo/rakudo-2010.03/parrot/runtime/parrot/library/ | |||
slava@dogbert:~/src/rakudo/rakudo-2010.03$ | |||
diakopter | oh; you'd need sorear's edition for that, I think. | ||
slavik | :( | ||
where is that? | |||
17:39
envi^home left
|
|||
diakopter | maybe his github? | 17:39 | |
I don't know | |||
I just know he got a lot of Perl 5 integration (not *implementation*) done for parrot/rakudo | 17:40 | ||
slavik | but the Data/Dumper.pir is there ... | 17:41 | |
diakopter | ohhh | ||
I have no idea. | |||
I don't use rakudo | |||
slavik | diakopter: what do you use? | ||
perlesque? | |||
diakopter | I don't *use* anything; I'm developing perlesque | ||
slavik | :( | 17:42 | |
diakopter | but I do weird-stress rakudo here on #perl6 via p6eval fairly often | ||
slavik | k | ||
diakopter | and std. | 17:47 | |
pmurias | diakopter: how is the implementation of classes going? ;) | 17:48 | |
diakopter | got them parsing | 17:49 | |
working on vivifying/emitting | |||
pmurias | vivifying? | ||
diakopter | yeah, the types have to become live during the parse | 17:50 | |
as RunSharp.TypeGen that is | 17:51 | ||
which derives System.Type | |||
pmurias: oh yeah; by "today" I meant "my today" which means by 12 hours from now :D | 17:52 | ||
pmurias | ah | ||
diakopter | so, your tomorrow :) | ||
17:56
plobsing joined
17:58
kaare joined,
kaare is now known as Guest86603
18:01
Guest86603 left
|
|||
diakopter | oh, and, I get lexical & anonymous classes for free. | 18:01 | |
bonus. | |||
well, lexical in the sense its initialization block (and contained methods) close over all their outer lexical scopes, but non anonymous ones will still be globally available after declaration. a minor nit. | 18:03 | ||
"minor nit" is repetitively redundant | 18:04 | ||
pmurias | class Foo {my $bar=4;method foo {return $bar}}? | 18:05 | |
diakopter | yeah, and my $baz = 'hi'; class Foo {my $bar=4;method foo {return $bar ~ $baz}} | 18:06 | |
so if an anonymous class is declared in a routine/block that runs more than once, each time it runs, it'll create a new anonymous class with its own "private static" variables such as $bar , above | 18:08 | ||
behavior of a named class whose initializer runs more than is undefined for now... | |||
more than *once | |||
that'll allow for parametric class generation, methinks | 18:09 | ||
18:11
iblechbot left
|
|||
diakopter | rakudo: class Foo {my $bar=4;method foo {return $bar}; method baz {$bar=7}}; my Foo $f.=new; say $f.foo; $f.baz; say $f.foo | 18:12 | |
p6eval | rakudo 27e05a: OUTPUT«47» | ||
18:12
gurjeet left
|
|||
diakopter | rakudo: class Foo {my $bar=4;method foo {return $bar}; method baz {$bar=7}}; my Foo $f.=new; say $f.foo; $f.baz; say $f.foo; $f.=new; say $f.foo; my Foo $g.=new; say $g.foo | 18:13 | |
p6eval | rakudo 27e05a: OUTPUT«4777» | ||
diakopter | yeah, that's the behavior of rakudo | ||
alpha: class Foo {my $bar=4;method foo {return $bar}; method baz {$bar=7}}; my Foo $f.=new; say $f.foo; $f.baz; say $f.foo; $f.=new; say $f.foo; my Foo $g.=new; say $g.foo | 18:14 | ||
p6eval | alpha 30e0ed: OUTPUT«4777» | ||
diakopter | <whew> | ||
locals in the class block are private static | |||
pugs: class Foo {my $bar=4;method foo {return $bar}; method baz {$bar=7}}; my Foo $f.=new; say $f.foo; $f.baz; say $f.foo; $f.=new; say $f.foo; my Foo $g.=new; say $g.foo | 18:15 | ||
p6eval | pugs: OUTPUT«777» | ||
diakopter | weird | ||
$bar was never set to 4 | |||
pugs: class Foo {my $bar=4; say($bar); method foo {return $bar}; method baz {$bar=7}}; my Foo $f.=new; say $f.foo; $f.baz; say $f.foo; $f.=new; say $f.foo; my Foo $g.=new; say $g.foo | |||
p6eval | pugs: OUTPUT«4777» | ||
diakopter | weird. | 18:16 | |
diakopter will drop the issue | |||
mimicing rakudo is plenty at this point | 18:17 | ||
18:18
^aristotle joined
|
|||
^aristotle | alpha: my @a = <<a b c>>; my %h; %h{@a} | 18:19 | |
p6eval | alpha 30e0ed: ( no output ) | ||
^aristotle | alpha: my @a = <<a b c>>; my %h; %h{@a}.join(" ") | ||
p6eval | alpha 30e0ed: OUTPUT«Use of uninitialized valueUse of uninitialized valueUse of uninitialized value» | ||
^aristotle | alpha: my @a = <<a b c>>; my %h; %h{@a}.join(" ").say | ||
p6eval | alpha 30e0ed: OUTPUT«Use of uninitialized valueUse of uninitialized valueUse of uninitialized value » | ||
^aristotle | alpha: my @a = <<a b c>>; my %h; [=] (%h{@a},1); %h{@a}.join(" ") | 18:20 | |
p6eval | alpha 30e0ed: OUTPUT«Syntax error at line 10, near "[=] (%h{@a"in Main (file <unknown>, line <unknown>)» | ||
^aristotle | alpha: my @a = <<a b c>>; my %h; [=] %h{@a}; %h{@a}.join(" ") | ||
p6eval | alpha 30e0ed: OUTPUT«Syntax error at line 10, near "[=] %h{@a}"in Main (file <unknown>, line <unknown>)» | ||
18:20
M_o_C left
18:24
^aristotle left
|
|||
lue | hello! | 18:29 | |
diakopter | lue: hi | ||
18:29
snarkyboojum joined
|
|||
diakopter | perlesque: class Foo { method bar (--> str) { return 'hiyo' } }; say(4); | 18:30 | |
p6eval | perlesque: OUTPUT«4» | ||
diakopter | heh. it doesn't actually do anything yet :) | ||
just recognizes the syntax | |||
dalek | meta: r259 | diakopter++ | trunk/Sprixel/ (4 files): [perlesque] parsing class declarations & their methods; parameterized the sub |
18:32 | |
diakopter | perlesque: class Foo { method bar (--> str) { return 'hiyo' }; say('declared Foo') }; say(4); | 18:34 | |
p6eval | perlesque: OUTPUT«declared Foo4» | ||
dalek | meta: r260 | diakopter++ | trunk/Sprixel/src/Perlesque/Declarations.cs: [perlesque] make class declaration block a lexical scope |
18:36 | |
lue | I still wish there were some sort of resource where you could learn about rakudo's guts, the bits with nqp and pir. | 18:38 | |
diakopter | pmurias: see that last diff if you're curious about how to make a block a lexical scope. it's a two-line change | ||
lue | (and I don't wish to keep badgering people; learning everything that way takes forever :D) | ||
arnsholt | lue: I think the best way ATM to learn NQP and PIR is simply to do something with them | 18:41 | |
The PIR docs are decent (the PDDs are quite useful), and NQP is pretty much a thin layer on top of PIR | |||
lue | just some fun programming exercises? | 18:42 | |
arnsholt | And if there's anything you need to know, src/NQP/Grammar.pm in nqp-rx is pretty comprehensible | ||
Whatever is the best way you learn programming languages pretty much | |||
lue | I delved into PIR a while ago, not that hard. What I wish existed were Rakudo's "API" or equivalent. | ||
Ah well, time to find my pith helmet :) | |||
arnsholt | I've got my Prolog on Parrot project, which I've learnt quite a bit from already | ||
lue | I can't find src/NQP/Grammar.pm :/ | 18:46 | |
diakopter | in the rakudo sources | 18:47 | |
er | |||
snarkyboojum | parrot src somewhere probably? | ||
diakopter | github.com/perl6/nqp-rx/blob/master...Grammar.pm | ||
lue | not in [rakudo]/src or [rakudo]/parrot/src (can't find the NQP folder) | ||
colomon | NQP is in Parrot, not Rakudo | ||
diakopter | lue: it's in nqp-rx sources | 18:48 | |
moritz_ | only a compiled version of nqp-rx is shipped with parrot | ||
diakopter | see the link above... | ||
lue | ok. I ought to download it then :) | ||
snarkyboojum | ah ok :) | ||
lue | (nqp-rx) | ||
diakopter | anyone here know about parrot's inheriting-hashes? | 18:51 | |
18:51
M_o_C joined
|
|||
patrickas | moritz_: are you still updating the proto web manually or is it ina cron already ? | 18:51 | |
moritz_ | patrickas: cron job | ||
patrickas | and does the cron automatically pulls the latest update script from github ? | 18:52 | |
moritz_ | it should, yes | ||
patrickas | ok ... I guess I have to be a bit more careful when pushing :-) | 18:53 | |
moritz_ | btw the "has tests" detection is broken | ||
json has tests | |||
patrickas | that's masak's work :-) | 18:54 | |
sorear | slavik: You need to write use Data::Dumper:from<perl5>; | ||
slavik: different languages have disjoint module namespaces | |||
moritz_ | in fact it thinks that no project has tests at all | ||
patrickas | or lack of ... actually I don't see anything in the code related to it... I guess he just added the pngs and relied on me to add the code. I'll do that next... | ||
snarkyboojum | footer on proto.perl6.org looks a bit funny left aligned and outside the 700px column | 18:55 | |
sorear | slavik: there are two projects to support "perl5" as a Parrot language. PONIE, a port of the P5 compiler to generate Parrot code (is dead, needs >5 man-years to revive), and blizkost (autothunks Parrot calls into libperl.so, mostly works) | 18:56 | |
slavik | sorear: blizkost makes use of parrot can call arbitrary C libraries thingy? | 18:57 | |
snarkyboojum | perhaps put it in a footer div which is styled similarly to head (in terms of width margin etc?) | 18:58 | |
moritz_ | snarkyboojum: code is in the proto repo in web/index.tmpl | ||
snarkyboojum | moritz_: aye :) | ||
slavik | jnthn: blizkost ... близкость? | 18:59 | |
or sorear | |||
lue should peek in docs/ once in a while *cough* | 19:07 | ||
19:09
dual joined
|
|||
sorear | slavik: no. blizkost is a Parrot-API extension; it does not use the FFI | 19:13 | |
slavik | what does FFI stand for? | ||
sorear | foreign function interface | ||
aka "parrot can call arbitrary C libraries thingy" | |||
slavik | also, does blizkost come from the slavic word to mean nearby? | ||
I see | 19:14 | ||
moritz_ | yes | ||
slavik | :) | ||
finally, my russian is worth some random trivia | |||
:P | |||
sorear | jnthn speaks Slovak | 19:15 | |
I don't | |||
slavik | :( | 19:17 | |
moritz_ | I think it says as much in the README | ||
slavik | moritz_: bah at you and reading READMEs :P | 19:18 | |
sorear | in any event, you don't need Data::Dumper in Perl6 | 19:19 | |
the functionality is built in | |||
slavik | .WHAT? | ||
or .perl? | |||
sorear | rakudo: say %*ENV.perl | ||
p6eval | rakudo 27e05a: OUTPUT«Method 'key' not found for invocant of class 'String'current instr.: 'perl6;EnumMap;_block21197' pc 504340 (src/gen/core.pir:76818)» | ||
sorear | rakudo: say Cool.^methods.perl | ||
moritz_ | :-) | ||
p6eval | rakudo 27e05a: OUTPUT«[{ ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... }, { ... | ||
..}, { … | |||
moritz_ | well, it doesn't handle routines yes | ||
rakudo: say [{a => 2}, 4].perl | |||
p6eval | rakudo 27e05a: OUTPUT«[{"a" => 2}, 4]» | ||
sorear | neither does Data::Dumper, really | ||
sorear ponders writing a rakudo decompiler | 19:20 | ||
moritz_ | just store a pointer to the original source code | ||
slavik | since all code get's compiled to pir/pbc ... what would happen if you compile language1 on parrot and use a decompiler for language2 on the bytecode? | 19:21 | |
would be interesting methinks | 19:22 | ||
instance language translation | |||
19:22
jonrafkind joined
|
|||
sorear | language translation at the semantic level is a lot easier than you might think | 19:22 | |
slavik | you mean source to source? | ||
sorear | I mean source to source-that-runs-the-same | 19:23 | |
most of the complexity in a program like p2c is involved in preserving formatting and comments | |||
slavik | ahh | 19:24 | |
sorear: formatting and comments aside, compiling wins the optimizations from the compiler, so you can compile/decompile to see how to better write code or something | 19:25 | ||
19:27
M_o_C left
|
|||
arnsholt | slavik: I think applying a decompiler to a different language would result in weird stuff | 19:31 | |
In the best case just a lot of inline PIR | |||
lue | erm,.... YOU_ARE_HERE is seemingly useless. | 19:32 | |
arnsholt | From my understanding, it isn't | 19:33 | |
It's where user code is inserted to be run | |||
sorear | YOU_ARE_HERE is very black magic | ||
it's what makes the setting work | |||
in topic/lexical-persistence, it's also what makes the REPL wor | 19:34 | ||
k | |||
lue | ok. | 19:36 | |
19:37
ash___ left
|
|||
lue | YOU_ARE_HERE.pm containing the line YOU_ARE_HERE; must be deep magic indeed :) | 19:37 | |
sorear | if you get rid of that line, the stage 2 compiler will be non-functional | ||
resuming lexical scopes across compiler runs is very tricky | 19:38 | ||
arnsholt | I think jnthn claimed responsibility for YOU_ARE_HERE | ||
lue | rakudo: YOU_ARE_HERE; # just curious | 19:39 | |
p6eval | rakudo 27e05a: ( no output ) | ||
diakopter | rakudo: say YOU_ARE_HERE; | ||
p6eval | rakudo 27e05a: OUTPUT«Null PMC access in type()current instr.: '_block14' pc 29 (EVAL_1:0)» | ||
diakopter | rakudo: say YOU_ARE_HERE.WHAT; | ||
p6eval | rakudo 27e05a: OUTPUT«Null PMC access in find_method('WHAT')current instr.: '_block14' pc 29 (EVAL_1:0)» | ||
sorear | rakudo: say 2+2; YOU_ARE_HERE; | ||
p6eval | rakudo 27e05a: OUTPUT«4» | ||
sorear | rakudo: YOU_ARE_HERE; say 2+2; | 19:40 | |
p6eval | rakudo 27e05a: OUTPUT«4» | ||
sorear | rakudo: say $x; my $x; YOU_ARE_HERE; | ||
p6eval | rakudo 27e05a: OUTPUT«Any()» | ||
sorear | see? magic. | ||
slavik | is @*IN all the input lines? | ||
sorear | I've tied the lexical scope in a knot | ||
diakopter | rakudo: say .lines | 19:41 | |
p6eval | rakudo 27e05a: OUTPUT«Method 'lines' not found for invocant of class ''current instr.: '_block14' pc 29 (EVAL_1:0)» | ||
diakopter | rakudo: say lines | ||
p6eval | rakudo 27e05a: OUTPUT«No applicable candidates found to dispatch to for 'lines'. Available candidates are::(IO $filehandle, Any :bin($bin) = { ... }, Any :enc($enc) = { ... }, Any :nl($nl) = { ... }, Any :chomp($chomp) = { ... }):(Str $filename, Any $limit = { ... })current instr.: '_block14' | ||
..pc 29 … | |||
19:41
Patterner left
|
|||
sorear | it's considerably more awesome in lexical-persistence though ;) | 19:41 | |
lue | rakudo: say @*IN | ||
p6eval | rakudo 27e05a: ( no output ) | ||
sorear attempts to get people to try it | 19:44 | ||
19:46
kensanata joined
19:48
alester joined
|
|||
lue | wait, there's a fail command? | 19:49 | |
colomon | lue: not only that, but for a while there it didn't work. ;) | 19:51 | |
mantovani | guys can I ask something here ? | ||
19:51
Psyche^ joined,
Psyche^ is now known as Patterner
|
|||
colomon | mantovani: yes. | 19:52 | |
mantovani | all right. | ||
19:52
finanalyst left
|
|||
mantovani | I tryng solve some problems and when the number is very big I have "inf" | 19:52 | |
19:52
finanalyst joined
|
|||
mantovani | paste.scsys.co.uk/43329?tx=on&w...Format+it! | 19:53 | |
can I do something like big int | 19:54 | ||
colomon | mantovani: that's perl 5, there is a separate channel for that, #perl | ||
but isn't it just | |||
use BigInt; | |||
? | |||
in 5.10, I mean. | |||
mantovani | I can't | ||
lue | colomon: the irony :) | ||
colomon | I've not done that in a long time, but I believe it's something like that. | ||
mantovani | if I do the result is very diferent | ||
I did, bigint and bitnum(bignum lock my pc) | 19:55 | ||
ok I'll try #perl5 | |||
thanks | |||
lue | just #perl ought to work. | ||
lue gets a warm feeling as he finds src/builtins/assign.pir . Hope still exists for := | 19:56 | ||
sorear | := cannot be implemented there | 19:57 | |
:= must be a parser special | |||
colomon feels like he should know a shortcut for that equation, but nothing is coming to mind.... | |||
lue | I know. My current goal is to find variable initilization. | ||
sorear | the implementation is trivial if TimToady would just get back to me on what it means | ||
19:57
alester left
|
|||
sorear | colomon: that's the closed form of the fibonnaci sequence | 19:58 | |
colomon | sorear++ | ||
sorear | it can be reexpressed in a purely integer form using the LDU decomposition of the generating matrix | ||
however, I forget the form | 19:59 | ||
20:04
justatheory joined
|
|||
lue | how does trace work in Rakudo, if it even works yet? | 20:09 | |
20:13
justatheory left
|
|||
sorear | --trace is a PCT argument | 20:14 | |
it gets parsed and then fed into Parrot as trace flags | |||
lue | ah. | ||
finanalyst | rakudo: my regex an { <digit>+ }; my $x='qw=345 er=12'; $x ~~ m/<an>/ | 20:20 | |
p6eval | rakudo 27e05a: OUTPUT«Method 'an' not found for invocant of class 'Regex;Cursor'current instr.: '_block70' pc 668 (EVAL_1:241)» | ||
finanalyst | alpha: my regex an { <digit>+ }; my $x='qw=345 er=12'; $x ~~ m/<an>/ | ||
p6eval | alpha 30e0ed: OUTPUT«Unable to find regex 'an'in regex » | ||
finanalyst | std: my regex an { <digit>+ }; my $x='qw=345 er=12'; say ?($x ~~ m/<an>/) | 20:21 | |
p6eval | std 30610: OUTPUT«ok 00:01 115m» | ||
pmurias | diakopter: do you think writing a "fake" replacement for the part of runsharp that Sprixel uses so that it generates C# would be hard? | 20:22 | |
finanalyst | rakudo: my regex an { <digit>+ }; my $x='qw=345 er=12'; say ?($x ~~ m/<an>/) | ||
p6eval | rakudo 27e05a: OUTPUT«Method 'an' not found for invocant of class 'Regex;Cursor'current instr.: '_block70' pc 690 (EVAL_1:243)» | ||
sorear | finanalyst: it's spelled <&an> for "my" regices | ||
diakopter | pmurias: explain more? | ||
pmurias gathers his words | 20:23 | ||
finanalyst | rakudo: my regex an { <digit>+ }; my $x='qw=345 er=12'; say ?($x ~~ m/<&an>/) | 20:24 | |
p6eval | rakudo 27e05a: OUTPUT«Confused at line 11, near "say ?($x ~"current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)» | ||
lue | rakudo: my regex xyzzy { <digit>+ }; my $x='qw=345 er=12'; say $x ~~ m/<xyzzy>/ | 20:25 | |
p6eval | rakudo 27e05a: OUTPUT«Method 'xyzzy' not found for invocant of class 'Regex;Cursor'current instr.: '_block70' pc 679 (EVAL_1:22420114)» | ||
pmurias | diakopter: how hard would it be to write a version of runsharp that produces C#/something human readable as it's output would be | ||
diakopter | very hard. it would be much easier to write a decompiler | ||
sorear | what does runsharp produce currently? | 20:26 | |
pmurias | like c.Try(); being implemented like method Try {$.code .= 'try {'} | ||
diakopter | it builds a stream of CIL | ||
but it is designed to emit to a stack-based assembly language | |||
which C# is definitely not | 20:27 | ||
pmurias: I do have the benefit of using Reflector on windows... | |||
pmurias: do you have a windows installation anywhere? Reflector is free | |||
20:28
alester joined
|
|||
diakopter | pmurias: otoh I could spend some time trying to get [some version of] Reflector to work in mono | 20:28 | |
(on linux) | |||
20:30
molaf left
|
|||
diakopter | probably the best thing to do is spend some time trying to get Reflector, since it already has an excellent decompiler | 20:30 | |
runsharp is quite an achievement; there's no way perlesque could have progressed so quickly [even close] without it. | 20:33 | ||
pmurias | generating C# would have worked | 20:35 | |
diakopter | no | ||
well in the mono case, yes, now it would have, since mono has string-eval for C# | 20:36 | ||
but that's quite recent | |||
.NET doesn't have that | |||
it needs runtime codegen and loading of those types/routines in the same environment | |||
which runsharp provides | 20:37 | ||
theoretically though, on .NET it could emit the C# and call out to the Microsoft csc.exe compiler, and then load the resulting .dll or .exe ... but that would be very tricky to get right | 20:39 | ||
arnsholt | Sounds a bit like implementing "eval" in C | 20:40 | |
diakopter | right. | ||
20:40
pmurias left
20:42
pmurias joined
|
|||
diakopter | pmurias: (see the backlog) | 20:44 | |
pmurias | looking... | 20:48 | |
dalek | meta: r261 | diakopter++ | trunk/Sprixel/src/ (3 files): [perlesque] a bit of incremental progress on classes. |
20:50 | |
diakopter | sorear: the author of runsharp is a Stefan | ||
moritz_ | it's quite a common name $here :-) | 20:55 | |
20:56
finanalyst left
|
|||
moritz_ | rakudo: sub a(@a, @b) { say @a === @b }; my @r = 1, 2, 3; a(@r, @r) | 20:57 | |
p6eval | rakudo 27e05a: OUTPUT«1» | ||
moritz_ | rakudo: sub a(@a, @b) { say @a === @b }; my @r = 1, 2, 3; a(@r, (1, 2, 3)) | 20:58 | |
p6eval | rakudo 27e05a: OUTPUT«0» | ||
moritz_ | rakudo: say 1/2 === 1/2 | 20:59 | |
p6eval | rakudo 27e05a: OUTPUT«0» | ||
moritz_ | I guess that should be True, no? | ||
if Rat is a value type | |||
21:01
orafu left,
orafu joined
21:02
alester left
21:04
vdo joined
|
|||
moritz_ | rakudo: say (1, 2, '3') eqv (1, 2, '3') | 21:06 | |
p6eval | rakudo 27e05a: OUTPUT«1» | ||
moritz_ | rakudo: say (1, 2, '3') eqv (1, 2, 3) | ||
p6eval | rakudo 27e05a: OUTPUT«0» | ||
21:07
alester joined
21:08
pmurias left,
dolmen left
21:16
skangas left
21:24
dolmen joined
|
|||
snarkyboojum | moritz_: proto.per6.org has gone from 141 HTML validation errors to 0 :) | 21:25 | |
lue | I'm going afk for a bit, and leaving you a blog post, IIUC: rdstar.wordpress.com/ | 21:32 | |
21:33
dolmen left
21:41
plobsing left
21:42
meppl left
21:50
alester left
|
|||
diakopter | rakudo: class Foo {...}; class Foo {...} | 21:51 | |
p6eval | rakudo 27e05a: ( no output ) | ||
diakopter | std: class Foo {...}; class Foo {...} | ||
p6eval | std 30610: OUTPUT«ok 00:01 110m» | ||
diakopter | "unnecessary re-pre-declaration ..." | 21:56 | |
:) | |||
sorear | shrug, it's useful in autogenerated code | ||
diakopter | looks like perlesque will need to require full predeclaration of classes | 21:58 | |
(including fields & method signatures) | |||
since it's truly single-pass | |||
21:58
bakedb__ left
|
|||
diakopter | so, I can just co-opt class predeclaration like so: | 21:59 | |
21:59
jjore left
|
|||
diakopter | class Foo {...; has str $str1; has List[PrototypeChain[string,P6object]] $chain; method (str $first, Foo $another_foo) {...} }; | 22:01 | |
or whatever the member syntax is | |||
:) | |||
(haven't gotten to those yet; I'm still on methods) | |||
22:07
kensanata left
|
|||
diakopter | std: class Foo {...; has Str $str1; has Int $chain; method (Str $first, Foo $another_foo) {...} }; | 22:07 | |
p6eval | std 30610: OUTPUT«ok 00:01 112m» | ||
diakopter | I'm not certain whether this will be a problem | ||
(requiring full predeclaration) | 22:08 | ||
22:11
lichtkind left
|
|||
diakopter looks around for TimToady | 22:12 | ||
22:14
jjore joined
|
|||
diakopter | obviously compilers targeting perlesque would need to be more-than-one-pass | 22:16 | |
snarkyboojum | patrickas: just noticed, something about the styling of the dl and children is causing the height of the content div to be computed incorrectly | 22:17 | |
22:17
PacoLinux left
|
|||
diakopter | rakudo: class Foo {...; has Str $str1; has Int $chain; method (Str $first, Foo $another_foo) {...} }; say Foo.new | 22:18 | |
p6eval | rakudo 27e05a: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expectedcurrent instr.: 'perl6;Failure;new' pc 15527 (src/builtins/Seq.pir:77)» | ||
diakopter | interesting | ||
rakudo: class Foo {...; has Str $str1; has Int $chain; method new (Str $first, Foo $another_foo) {...} }; say Foo.new | |||
p6eval | rakudo 27e05a: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expectedcurrent instr.: 'perl6;Failure;new' pc 15527 (src/builtins/Seq.pir:77)» | ||
diakopter | rakudo: class Foo {...; has Str $str1; has Int $chain; method bar (Str $first, Foo $another_foo) {...} }; say Foo.new | ||
p6eval | rakudo 27e05a: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expectedcurrent instr.: 'perl6;Failure;new' pc 15527 (src/builtins/Seq.pir:77)» | ||
snarkyboojum | patrickas: i.e. box model height is computed to be 260px roughly - makes putting divs with margins and padding after the content div problematic | 22:19 | |
22:20
jjore left
|
|||
snarkyboojum | patrickas: anyway - don't know how to "fix" it, or even if it makes sense to :) | 22:20 | |
patrickas | strange! | 22:23 | |
snarkyboojum: are you trying to fix the footer ? | |||
snarkyboojum | patrickas: nope - was going to put a footer div in there below the content one, but I've noticed you've put the paragraph in the content div | ||
patrickas: just mentioning the issue I see with the page | 22:24 | ||
patrickas | Oh ok ...well if it is not affecting anything specific I guess no need to spend much time on it :-) | 22:25 | |
snarkyboojum | patrickas: it has to do with the dl, dt, dd CSS - if that's ripped out then the height for the content div is computed correctly - but don't know enough to fix it | ||
patrickas: yeah - thought I'd mention it anyway | |||
patrickas: site validates now too o/ | 22:26 | ||
patrickas | I saw that thanks :-) | ||
snarkyboojum | patrickas: the link on the tests badge is currently broken too btw | 22:27 | |
patrickas | how are you calculating the heights ? is it a cross browser issue ? | ||
I have no idea what the link is supposed to point to .... | 22:28 | ||
snarkyboojum | patrickas: just looking at the computed height in firefox and chrome | 22:29 | |
patrickas: using firebug/chrome dev tools etc | |||
22:42
ethel left
22:44
hercynium joined
|
|||
jnthn | rakudo: class Foo { ...; has $.x; } | 22:49 | |
p6eval | rakudo 27e05a: ( no output ) | ||
jnthn | rakudo: class Foo { ...; has $.x; }; Foo.new | ||
p6eval | rakudo 27e05a: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expectedcurrent instr.: 'perl6;Failure;new' pc 15527 (src/builtins/Seq.pir:77)» | ||
jnthn | Heh. I guess the ... gets take to mean the whole lot is a stub. D'oh. | 22:50 | |
diakopter | I think that's what it's supposed to do...? | ||
jnthn | diakopter: And ignore the rest of the declaration silently? | ||
That feels a tad wrong. | |||
diakopter | that's what I presumed from my reading of S12 | 22:51 | |
jnthn | We do need a better error for when you stub a class that never finishes getting defined. | ||
Heh. Maybe I read S12 and implemented what it said then. ;-) | |||
22:52
patrickas left
|
|||
diakopter | If the class body begins with a statement whose main operator is a single prefix:<...> (yada) listop, the class name is introduced without a definition, and a second declaration of that class in the same scope does not complain about redefinition. | 22:52 | |
jnthn | oh, cool | ||
Not a bug \o/ | |||
diakopter | therefore, I can co-opt it to allow full predeclaration of attribute/method sigs | 22:53 | |
since it seems perlesque will need to require it. | |||
which is fine for me... STD's translation of itself isn't going to be generating classes... | |||
I mean. | 22:54 | ||
STD won't need to generate perlesque classes to translate itself | |||
jnthn | oh noes...my flight is delayed to 2am | 22:56 | |
diakopter | eww | ||
jnthn | I already did a 5 hour bus journey to get to an airport that's not in the ash cloud so I can fly home. :-) | 22:57 | |
22:58
plobsing joined
23:08
jjore joined
23:17
jjore left
23:18
circuitbreaker joined,
mariano joined
|
|||
diakopter | jnthn: in your experience programming in general, if a routine is written as recursive, is it usually a static routine, or are recursive instance routines just as common? | 23:19 | |
sorear: u2 | |||
well, anyone | |||
but hilite you | |||
arnsholt | A recursive instance is no problem | 23:21 | |
A tree-traversal method for example, should be an instance method on the tree | |||
diakopter | my question is whether to make instance methods also trampolined. since a "method" can't be returned as a closure in perlesque, I guess it doesn't make sense to do it. | ||
arnsholt: well, my interviewers at a certain large software company would disagree with you... they seemed obsessed with rewriting recursive algorithms as iterative ones | 23:22 | ||
arnsholt | Well, some problems are best expressed iteratively | ||
And others recursively | |||
23:23
jjore joined
|
|||
arnsholt | Also, IME some people are a bit allergic to recursion | 23:23 | |
diakopter | these were tree-traversal algorithms, mostly. | ||
arnsholt | In that case, was there a good rationale? | 23:24 | |
diakopter | it was an interview question | ||
arnsholt | Ah, right | ||
diakopter | so there's no rationale | ||
:) | |||
arnsholt | 'Cause IIRC you'd have to maintain an explicit stack to transform non-tail recursion into iteration | 23:25 | |
diakopter | right | ||
"don't use the language's callstack, maintain your own" | |||
arnsholt | In which case you'd probably be better of with the OS/VM stack I think | ||
diakopter | sure, but they're too limited for some applications. | 23:26 | |
arnsholt | True, true | ||
diakopter | in any case, Perl 6 routines will be expressed as perlesque closures anyway, not methods, so it doesn't matter.. | 23:27 | |
jnthn | diakopter: I think many of the ones I write don't use instance data. Actually I find C# shoehorns me into things being methods when actually I just want subrutines. | ||
diakopter | well yeah | ||
jnthn | So it's hard to say in that sense. | ||
I often find myself having a public method that does some prep for the recursion and then calls some over thing that's private and recurses (so the fact it's implemented recursively isn't part of the interface). | 23:28 | ||
diakopter | I was worried about potentially overflowing the CLR stack in perlesque code, but it can't happen in the 5th stage (Perl 6) now that I've thought through it. | ||
jnthn | Not that that's especially relevant to the question though... | 23:29 | |
23:29
rgrau_ left
|
|||
jnthn | Probably fairest to say is that I do have some that rely on instance data, but most don't. | 23:29 | |
diakopter | ... and if a perlesque method needs to get recursive, it can be rewritten as a recursive sub, so it'll be trampolined, if there's any danger of hitting stack limits. | 23:30 | |
ok. I'm satisfied that methods don't need to be trampolined, for my purposes. | 23:31 | ||
they can always be in the future. | |||
phenny: tell pmurias it's going to be another few days to finish classes/methods. They're somewhat more complex than I initially thought. But it's all worked out in my head now, so I'm quite certain I can finish them soon. | 23:32 | ||
phenny | diakopter: I'll pass that on when pmurias is around. | ||
23:44
lestrrat is now known as lest_away
|
|||
dalek | meta: r262 | diakopter++ | trunk/Sprixel/ (4 files): [perlesque] a bit more progress |
23:46 | |
23:49
bluescreen joined
23:50
bluescreen is now known as Guest2257
23:53
mariano left,
Guest2257 left
23:54
Guest2257 joined
|