»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
TimToady just finished herbsutter.com/welcome-to-the-jungle/ which is a good exposition of why many of the less obvious design decisions of Perl 6 matter, and why we still need to keep designing with clean specification of data relationships while not making assumptions about how those relationships must be processed 00:10
00:12 fridim_ left
TimToady I think overall we've done pretty well in future-proofing Perl 6, but we'd like to do better than just survive the future; we'd like to prosper in it 00:12
case in point: we'd like a recursive definition of @hamming to be able to figure out it is tightly coupled to itself that it needs strict laziness, while other sequence generators with looser dependencies may be worked ahead in batches; this will in the future directly influence the mapping of subtasks to processing units and pipelines 00:18
one thing glossed over in the article is latency; we may need to work out ways of specifying maximum desired latency so that the compiler maps a particular computation to the GPU rather than the cloud 00:19
TimToady waves hands, but doubtless there are PhDs in the details of how that works 00:21
but there's something in there about knowing when someone downstream is waiting impatiently for your results, and when it's just "whenever convenient" 00:22
sort of inside-out throttling 00:23
but in the sense of stepping on the gas pedal, not the brakes
TimToady thinks of the growing plant in Colossal Cave bellowing "WATER!" 00:24
00:36 tokuhirom joined 00:38 Chillance left
houghton could someone help me get an example program running? 00:42
here's the code: github.com/dfhoughton/PerlSampler/...r/roles.p6 00:43
here's the error: Constraint type check failed for parameter '$amt'
basically, I say a parameter should be Numeric
I give it an integer
the type constraint fails
this same example ran when I first wrote it 00:44
so I'm thinking there's something I could swap in there for "Numeric" to make this work 00:45
I can do without the constraint altogether, but I wrote it to show some Java programmers that type constraint were possible in Perl 6, among other things
katernya I'm a homocore
lol @ juvenile jokes 00:46
houghton is there a line numer? 00:47
houghton eh, I just pulled Numeric out everywhere and I'm still getting a type constraint failure
in block <anon> at whatsnew/roles.p6:66 00:48
benabik houghton: The `where {$amt <= $!account }` is considered a type constraint, I think.
houghton also :1
ah
so that's it
benabik It's a subtype.
houghton so that was an expected failure, but I thought the CATCH block would silence it 00:49
benabik It might be a CONTROL exception instead... Not sure.
houghton going to try taking out the where bit to see what happens
sure enough, that was it 00:50
so shouldn't I be able to catch the exception and handle it without it's giving me line numbers and such?
benabik nom: sub foo( $x where { $_ > 0 } ) { say $x }; foo(1); 00:52
p6eval nom 580848: OUTPUT«1␤»
benabik nom: sub foo( $x where { $_ > 0 } ) { say $x }; foo(1); CONTROL { say 'hi' }
TimToady you have put a default {} around your say, or it doens't know it's caught it
p6eval nom 580848: OUTPUT«1␤»
benabik nom: sub foo( $x where { $_ > 0 } ) { say $x }; foo(0); CONTROL { say 'hi' }
p6eval nom 580848: OUTPUT«Constraint type check failed for parameter '$x'␤ in sub foo at /tmp/3zzB4g7I9w:1␤ in block <anon> at /tmp/3zzB4g7I9w:1␤␤»
TimToady houghton: it's the implicit succeed of a when/default that bypasses the rethrow logic 00:53
a CATCH catches it, but doesn't "handle" it without a case statement 00:54
houghton alright
thanks a lot
TimToady note that the default CATCH for a try includes a default {}
houghton where should I look for examples? 00:55
I can just grep for CATCH
00:56 samlh joined 00:57 thou left
houghton well, there isn't a lot of CATCHing going on in there 01:00
TimToady there's only one CATCH in your program, and that's the one that needs "default { say...}" 01:01
houghton well, CATCH { default { say 'oops! ...' } } did the trick 01:02
oh, I was grepping the perl 6 source
src/ and t/
TimToady in general we try to avoid throwing exceptions for normal processing, since they should be for, er, exceptions 01:03
houghton right
but Java programmers are used to a lot more exception handling; that was the intended audience for this snippet 01:04
TimToady for example, generally we'd put a multi to handle the unmatched constraint case
and we never use exceptions to terminate a loop; it just runs out of lazy list
houghton will have to learn some new tricks 01:05
TimToady basically, as I was saying above, there are various subtle design issues having to do with parallel processing, and exceptions tend to be de-emphasized for just that reason 01:06
the article I referenced indicates that some GPU architectures can't even do exceptions
houghton I started to read it but didn't get that far 01:08
that is interesting
TimToady yes, it is rather tl;dry-ish
well, gotta run
later &
houghton thanks for the help 01:09
01:11 scott__ joined, houghton left
[Coke] wonders what he contributed to this release other than "I'll do a release" ;) 01:13
sorear good * #perl6 01:20
katernya ruby gem hehe 01:26
01:28 ribayr left
colomon \o 01:30
01:32 ribayr joined, leprevost left 01:38 am0c joined, sisar joined
sorear sisar: hi! 01:40
sisar o/
sorear that name reminds me of en.wikipedia.org/wiki/SISAL 01:43
sisar hehe
print and say, how do they differ? #well apart from the obvious \n 01:45
sorear niecza: say 1..10 01:47
p6eval niecza v14-64-g8248afc: OUTPUT«1..10␤»
sorear niecza: print 1..10
p6eval niecza v14-64-g8248afc: OUTPUT«12345678910»
01:47 tokuhirom left
sorear "print" is designed to work with few suprises; it just puts its arguments in list context and prints all the values as strings 01:48
"say" is designed with much more DWIM, and objects can override say by defining a ".gist" method
niecza: print (1..10).gist
p6eval niecza v14-64-g8248afc: OUTPUT«1..10» 01:49
sisar trying out yesterday's quirk... 01:53
niecza: my %h; %h<wow>.print; 01:54
p6eval niecza v14-64-g8248afc: OUTPUT«Unhandled exception: Unable to resolve method print in class Any␤ at /tmp/wKSF3BqxbN line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3826 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3827 (module-CORE @ 65) ␤ at /home/…
sisar niecza: my %h; print %h<wow>;
p6eval niecza v14-64-g8248afc: OUTPUT«Use of uninitialized value in string context␤ at /home/p6eval/niecza/lib/CORE.setting line 1222 (warn @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 230 (Mu.Str @ 10) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/lib/CORE.settin…
sorear look up Cool is S02 01:55
this behavior is by design
sisar looks
02:07 am0c left
sisar sorear: i was hoping my name would remind you of Ceasar ;-) 02:22
*Caesar 02:23
02:26 thou joined 02:33 wolfman2000 joined 02:34 sisar left 02:38 whiteknight left
dalek ast: 221ae65 | coke++ | S (5 files):
pugs autounfudge
02:44
katernya i dont know if my feeble mind can handle perl6 02:49
sorear hugs katernya 03:00
03:14 am0c joined 03:17 Alias joined 03:21 aindilis joined 03:24 orafu left, orafu joined 03:27 ribayr left 03:31 ribayr joined 03:32 lestrrat left 03:33 lestrrat joined 03:35 ribayr left
lichtkind katernya: perl 6 is beginner and expert friendly 03:57
you can do a lot with little syntax rules
but have long journey to full mastership
like in all good martial arts
:)
03:58 lichtkind left
katernya that was .. helpful 04:14
can I write my perl 5 app to be compatible with perl6? 04:26
geekosaur perl 6 is syntactically ... distinct from perl 5 04:27
katernya in other words, no
and why would you want to
amirite 04:28
geekosaur embedding per 5 in perl 6 is supposed to be possible, and is in various states of functioning in rakudo and niecza
katernya that sounds less than desirable 04:29
i mean, a nice feature, but this is new code
geekosaur it's just that perl 6 is a continuation of perl ideas, less than of perl syntax, mainly because perl 5's syntax has some significant warts
katernya nod 04:31
I am just wondering if i can interface to postgresql 04:32
geekosaur hrm
geekosaur wonders if any rakudo experts are around... 04:33
katernya so far all i've found is a reference to a "parrot interface to libpq" 04:34
trac.parrot.org/parrot/browser/trun...ary/Pg.pir
benabik The best best for Rakudo at the moment is probably NativeCall to the original pg library.
Interacting with raw Parrot objects is... tricky at the moment. 04:35
katernya i don't fully understand how it all fits together, or why there would be a parrot interface to libpq 04:36
how is XS done in perl 6?
geekosaur there is no single standard; perl 6 allows, and has, multiple implementations 04:38
sorear The big problem with XS is that it exposes a lot of Perl 5's implementation technology
katernya yeah, it had problems, sure
sorear Perl 6 is following a path of implementation diversity, which contraindicates that approach
geekosaur rakudo uses parrot's native-call interfaces. niecza can use anything the CLR can use, I believe, which should mean "anything" but may require some extra setup
sorear For binding to C libraries, we're generally going for more of a FFI-like approach 04:39
katernya so now there are even more ways to do it?
what is FFI?
04:40 benabik left
geekosaur "foreign function interface", specifically the standard LibFFI 04:40
sourceware.org/libffi/
katernya I suppose I don't need to use postgresql at all 04:41
geekosaur more and more stuff is going that way, which means more and more stuff is becoming "plug and play"
katernya i might choose the path of least resistance 04:43
sorear geekosaur: I don't think "FFI" means "LibFFI clone" 04:44
geekosaur: I'm thinking especially of the Haskell FFI. Doesn't that predate LibFFI?
geekosaur GHC uses libffi 04:45
the FFI *spec* predates libffi, but isn't a binary level specification, just a language-level extension 04:46
and one that kinda goes out of its way not to say anything useful about how you actually use any of the information, which has led to much annoyance as ghc has altered its implementation :) 04:50
(multiple times)
sorear geekosaur: I'm not talking about a specification 04:52
geekosaur: I'm talking about a general Way of Doing Things
Visual Basic has had a "FFI" by another name for ages, and I can't imagine it was the first 04:53
geekosaur haskell's ffi is too simple to qualify even as that, though
as specified, at least
sorear you write a declaration that gives a function name, a dll name, and argument and return types
with all the needed ByRef annotations 04:54
katernya do i have to build my own perl 05:05
sorry, ignore me
05:10 Jerkwad left 05:11 birdwindupbird joined 05:22 benabik joined 05:24 kaleem joined 05:33 preflex left 05:35 preflex joined 05:54 NamelessTee joined 05:55 skids left 06:05 thou left
moritz masak++ # rakudo release 06:21
dalek p: 9843c1d | moritz++ | tools/build/PARROT_REVISION:
bump parrot revision to something after the cont_reuse merge
06:23
kudo/nom: 546343d | moritz++ | src/binder/multidispatch.c:
Merge remote branch 'origin/cont_reuse' into nom
06:24
kudo/nom: ad349d5 | moritz++ | tools/build/NQP_REVISION:
bump NQP revision
06:53 birdwind1pbird joined 06:54 NamelessTee left 07:05 wtw joined 07:16 plobsing joined
moritz std: sub f($1) { } 07:21
p6eval std 52f3895: OUTPUT«===SORRY!===␤Cannot declare a numeric parameter at /tmp/2CF2N0hXjC line 1:␤------> sub f($1⏏) { }␤Parse failed␤FAILED 00:01 109m␤»
07:24 birdwind1pbird left, Vlavv` left 07:27 noam left, noam joined
moritz std: sub f($<x>) { } 07:33
p6eval std 52f3895: OUTPUT«===SORRY!===␤Unable to parse signature at /tmp/S8m9WdGAwn line 1:␤------> sub f⏏($<x>) { }␤Couldn't find final ')'; gave up at /tmp/S8m9WdGAwn line 1:␤------> sub f($⏏<x>) { }␤ expecting any of:␤ constraint␤ …
moritz std: my $<x>
p6eval std 52f3895: OUTPUT«===SORRY!===␤Cannot declare a match variable at /tmp/Zd0u1NLxCr line 1:␤------> my $<x>⏏<EOL>␤Parse failed␤FAILED 00:01 108m␤»
moritz perl6: sub f($<x>) { }
p6eval niecza v14-64-g8248afc: OUTPUT«===SORRY!===␤␤Unable to parse signature at /tmp/7O7Ac64kCM line 1:␤------> sub f(⏏$<x>) { }␤Couldn't find final ')'; gave up at /tmp/7O7Ac64kCM line 1:␤------> sub f($⏏<x>) { }␤␤Parse failed␤␤»…
..rakudo ad349d: OUTPUT«===SORRY!===␤Missing block␤at /tmp/E2QW2Vrr4o:1␤»
..pugs b927740: OUTPUT«*** ␤ Unexpected "$<x"␤ expecting formal parameter or ")"␤ at /tmp/MHVy4Z4Au6 line 1, column 7␤»
07:48 mj41 joined 08:00 proller left 08:05 araujo left
dalek kudo/nom: 1ccc79f | moritz++ | src/ (2 files):
typed exception for numeric parameter
08:06
08:09 araujo joined 08:10 tarch joined 08:11 Vlavv_ joined
dalek ast: b291479 | moritz++ | S32-exceptions/misc.t:
test parameter variant of X::Syntax::Variable::Numeric
08:11
08:15 aindilis` joined, aindilis left
moritz std: my @a() 08:23
p6eval std 52f3895: OUTPUT«===SORRY!===␤The () shape syntax in array declarations is reserved at /tmp/n7NTUFJ3zn line 1:␤------> my @a()⏏<EOL>␤Check failed␤FAILED 00:01 110m␤»
08:24 Vlavv_ left 08:31 tarch_ joined, tarch left
dalek kudo/nom: 8a29c50 | moritz++ | src/ (2 files):
X::Syntax::Reserved
08:33
ast: a78af8c | moritz++ | S32-exceptions/misc.t:
X::Syntax::Reserved
08:35
08:39 wolfman2000 left
sorear o/ moritz 08:50
moritz \o sorear 08:51
08:54 alim_ left 09:10 daxim joined 09:22 silug_ left
fsergot hi #perl6 \o 09:40
09:40 Trashlord left
moritz o/ fsergot 09:41
dalek kudo/nom: f9c788d | moritz++ | src/ (2 files):
typed NYI exceptions from Grammar.pm
09:56
kudo/nom: 8ee2aa3 | moritz++ | src/Perl6/Actions.pm:
more consequent NYI errors from Actions.pm
moritz fwiw we now have more typed exceptions in Actions.pm and Grammars.pm than untyped exceptions 09:58
09:59 MayDaniel joined
colomon \o/ 09:59
moritz many (but not all) of the remaining untyped exceptions are for rakudo limitations, or errors that I'm not sure about if they are legit, or how to trigger
10:02 alim joined 10:07 _jfried joined, Tedd1 left 10:08 slavik2 joined, jfried left, slavik1 left 10:17 Steven__ joined 10:18 Steven__ left, Tedd1 joined 10:20 scott__ left
tadzik o/ 10:24
10:24 _jfried is now known as jfried
fsergot tadzik: o/ 10:36
moritz nom: rx:g/a/ 10:52
p6eval nom 8ee2aa: OUTPUT«===SORRY!===␤Adverb 'g' not allowed on m at line 1, near ""␤»
11:06 JimmyZ joined
dalek kudo/nom: 867f9d5 | moritz++ | src/ (2 files):
X::Syntax::Regex::Adverb
11:08
JimmyZ wonders when github.com/perl6/nqp/pull/29 will be merged
moritz JimmyZ: I can do it after lunch. I just didn't want to do it right before the rakudo release, because I don't know how risky it is
JimmyZ moritz: ok, thanks. 11:09
dalek ast: dc3de2d | moritz++ | S32-exceptions/misc.t:
X::Syntax::Regex::Adverb
masak g'day, #perl6 11:18
fsergot o/ masak
flussence nom: say -t $*IN 11:19
p6eval nom 8ee2aa: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&t' called (line 1)␤»
fsergot moritz: Could You check this? : gist.github.com/1900171
flussence is that NYI or changed from p5?
moritz flussence: both :-) 11:20
flussence (please ignore the fact that it's *wrong* and I should've used $*OUT instead :)
fsergot moritz: it makes unlink removes only files, as You probably see.
11:20 pernatiy left
fsergot moritz: Is it correct? 11:20
moritz fsergot: looks much better than before
JimmyZ good *, masak!
moritz fsergot: though I think :d & :e is redundant -- :d implies :e 11:21
fsergot: and you can make it a bit more efficient by writing it as $path.IO.d
masak it's funny how once we were supposed to be able to write `if -f -s $filename` in Perl 6, or something like that -- stacking filetests on top of each other. 11:23
to make things shorter and more convenient.
moritz (in the setting we generally care more about speed than about idiomatic Perl 6 code)
masak and how since then we've migrated to longer and longer forms of the file tests for, essentially, language purity reasons.
so that now it's `if $filename.IO ~~ :f & :s` 11:24
moritz except that it doesn't make any sense for :s, because size isn't a boolean return value
masak ah, true.
bad example. 11:25
I was trying to think of two filetests that made sense together.
fsergot moritz: but I want to check if $path exists as a file and it's not a dir.
masak I'm still eagerly waiting for someone to (ab)use the above syntax for something *other* that IO objects, by the way. it's perfectly extensible, which I guess is one of the nice things about it.
moritz fsergot: currently the check if "if it is a directory and exists" 11:26
fsergot moritz: Oh, You are right.
moritz masak: well, it's only extensible for methods without arguments that return Bool
masak sure. 11:27
moritz masak: I have abused that syntax once, but I don't remember for which purpose :/
masak is there a way to provide all enums of an enumeration with a method?
by mixing in a role at the right level, say.
moritz nom: enum A <b c>; say b.WHAT 11:28
p6eval nom 8ee2aa: OUTPUT«A()␤»
moritz nom: enum A < b c >; A does role { method x() { say "OH HAI" } }; b.x
p6eval nom 8ee2aa: OUTPUT«Cannot use 'does' operator with a type object␤ in sub infix:<does> at src/gen/CORE.setting:9266␤ in block <anon> at /tmp/IBftWxVDlU:1␤␤»
moritz no.
fsergot moritz: Just like that? F5 :) 11:30
moritz fsergot: yes 11:31
fsergot moritz: so, it's fine now?
masak std: role R {}; enum A does R <a b c> 11:32
p6eval std 52f3895: OUTPUT«ok 00:01 108m␤»
masak \o/
nom: role R { method foo { say "OH HAI" } }; enum A does R <a b c>
p6eval nom 867f9d: ( no output )
masak nom: role R { method foo { say "OH HAI" } }; enum A does R <a b c>; A.foo
p6eval nom 867f9d: OUTPUT«OH HAI␤»
masak \o/
fsergot How to gove it to change in IO.pm?
give*
masak nom: role R { method foo { say "OH HAI" } }; enum A does R <a b c>; b.foo
p6eval nom 867f9d: OUTPUT«OH HAI␤»
masak hugs rakudo 11:33
moritz masak: ok, I was wrong :-)
fsergot: now you create a pull request. See help.github.com/send-pull-requests/
masak that's OK -- it worked. which is, like, really cool.
it makes enums *much* more useful.
moritz std: enum A does role { } <a b c> 11:34
p6eval std 52f3895: OUTPUT«===SORRY!===␤Illegal redeclaration of symbol 'A' (see line 1) at /tmp/m2K7zlukAm line 1:␤------> enum A⏏ does role { } <a b c>␤Bogus term at /tmp/m2K7zlukAm line 1 (EOF):␤------> enum A does role { } <a b c>⏏<EOL>[…
fsergot moritz++ thanks
masak moritz: try parens.
moritz std: enum A does (role { }) <a b c> 11:35
p6eval std 52f3895: OUTPUT«===SORRY!===␤Illegal redeclaration of symbol 'A' (see line 1) at /tmp/ZegCN3xwnM line 1:␤------> enum A⏏ does (role { }) <a b c>␤Bogus term at /tmp/ZegCN3xwnM line 1 (EOF):␤------> enum A does (role { }) <a b c>⏏<EO…
moritz it probably backtracks, and stumbles over A a second time
LTA
fsergot moritz, masak: Could You check this? : gist.github.com/1892277 11:40
masak submits LTA rakudobug 11:41
oh wait, that was STD... well, then.
11:42 sisar joined
sisar rakudo's 'Confused' error is really unhelpful :( 11:44
11:44 grondilu joined
sisar rakudo: 3x3; 11:44
p6eval rakudo 867f9d: OUTPUT«===SORRY!===␤Confused␤at /tmp/xonKltsQ7e:1␤»
sisar niecza: 3x3;
p6eval niecza v14-64-g8248afc: OUTPUT«===SORRY!===␤␤Whitespace is required between alphanumeric tokens at /tmp/wU7n_0S60L line 1:␤------> 3⏏x3;␤␤Whitespace is required between alphanumeric tokens at /tmp/wU7n_0S60L line 1:␤------> 3x⏏3;␤␤…
sisar niecza++ 11:45
masak sisar: Niecza's parser started out being STD from the start. Rakudo's parser has had to converge towards STD as it grows in power.
sisar rakudo: [**] 2,3,4,5 11:46
p6eval rakudo 867f9d: ( no output )
sisar rakudo: say [**] 2,3,4,5; 11:47
p6eval rakudo 867f9d: OUTPUT«Inf␤»
sisar niecza: say [**] 2,3,4,5;
p6eval niecza v14-64-g8248afc: OUTPUT«(timeout)»
sisar hehe ;)
what is rakudo's limit for declaring Inf ? 11:48
grondilu nom: say 10**100 11:49
p6eval nom 867f9d: OUTPUT«10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000␤»
11:49 NamelessTee joined
grondilu nom: say (10**100)**100 11:49
p6eval nom 867f9d: OUTPUT«1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000…
sisar wow !
grondilu gotta be quite high :) 11:50
masak 10_000 zeros.
grondilu probably when physical memory is too low
masak (b ** x) ** y == b ** (x * y)
grondilu indeed 11:51
masak nom: say ((10 ** 100) ** 100).chars - 1
p6eval nom 867f9d: OUTPUT«10000␤»
grondilu nom: say 10**10_000
p6eval nom 867f9d: OUTPUT«1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000…
grondilu nom: say 10**10_001
p6eval nom 867f9d: OUTPUT«1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000…
grondilu nom: say 10**10_000_000 11:52
:)
masak grondilu: you can also privmsg with p6eval, conducting experiments outside of the limelight of the channel.
p6eval nom 867f9d: OUTPUT«(timeout)»
grondilu p6eval: say 10**100_000 11:53
flussence nom: say (10**1_000_000).chars # probably more sensible
p6eval nom 867f9d: OUTPUT«(timeout)»
sisar ^it did not say Inf there (?)
grondilu lol I totally forgot how to privmsg on IRC :)
flussence guess not
masak grondilu: /msg p6eval nom: say "OH HAI" 11:54
grondilu masak: works. Thks
11:54 am0c left
masak & 11:55
12:06 mj41 left 12:17 bluescreen10 joined, pernatiy joined 12:20 mj41 joined
flussence wonders how hard it'd be to write macros that translate entire chunks of perl6 code into equivalent SQL statements... 12:21
grondilu flussence: what kind of application would that be for? 12:24
12:25 ab5tract joined, odoacre left
flussence I dunno, but accessing a DB the same way you'd access any other data structure sounds cool :) 12:26
colomon flussence: isn't that possible already using Proxy? 12:28
and / or appropriate class design?
flussence it's possible somehow, I just don't know how yet
au en.wikipedia.org/wiki/Language_Integrated_Query has some starting points :) 12:29
(iirc, mst was planning to port it to Perl5 under the Data::Query / Data::CapabilityBased namespace.) 12:30
colomon LINQ! 12:31
I didn't realize it had been generalized into other languages. 12:33
grondilu SQL sucks anyway. I very much like NoSQL (MongoDB and stuff like that)
flussence SQL's a great tool, just a terrible method of expression. 12:34
colomon var results = from c in SomeCollection
where c.SomeProperty < 10
select new {c.SomeProperty, c.OtherProperty};
arnsholt I'm with flussence. Relational algebra is an extremely powerful tool; it's just a shame the syntax built over it is so bad 12:35
colomon seems like my @results := SomeCollection.grep({ .SomeProperty < 10 }).map( ... ) is nicer...
grondilu yes, using grep, map and stuff like that should be way enough. No SQL needed 12:36
flussence sql { source('SomeCollection').grep(*.SomeProperty < 10).<SomeProperty OtherProperty> }; # :)
(I think X/Z/hypers would fit in nicely too...) 12:37
12:37 shinobicl_ joined 12:38 szbalint_ is now known as szbalint
au flussence: yeah. one possible variant is that sql{} may not be neccessary if table('SomeCollection') provides its own grep/map/sort/groupBy methods that's compatible with Positional API and just generates/calls SQL underneath. 12:39
flussence good points, I think what I'm looking for is a DBIx::Class-alike but with all of perl6 at its disposal :) 12:41
(we don't need macros for that)
au *nod*
grondilu Well, maybe someone could write a Perl6 SQL Grammar, for a start :) 12:44
moritz fsergot: re gist.github.com/1892277 it's wrong to *first* check stuff
fsergot: simply try to do the operation, and then fail if it failed 12:45
12:45 jferrero left
moritz fsergot: otherwise you run into race conditions easily 12:45
(only exception: it's OK to check if it's directory, because of parrot's unusual API) 12:46
fsergot moritz: and there is a problem with this. If it checks whether $path is a directory it fails when $path does not exist as well. 12:48
12:48 ab5tract left
fsergot moritz: it's because why I added there '.e' condition before. 12:49
moritz fsergot: that's a problem with .d then, and needs to be fixed on that level
$ /perl6 -e 'say "NOTTHERE".IO.d'
False
doesn't fail here
fsergot moritz, You are right, could I try to repair this? 12:50
moritz ah wait, I see what you mean
masak arnsholt: I think SQL is in some kind of syntactic sweet spot, even if it isn't a global optimum.
moritz but the check for dir $path is certainly wrong
just don't do it. The error from the parrot operation will tell the same thing
fsergot moritz: Ok. :) 12:51
12:52 MayDaniel left
masak also, don't think "macros" when you think "cool sublanguages". think grammars braided into the current slang. 12:53
moritz but that's all just stupid workarounds. I've had enough of this
arnsholt masak: Yeah, it's true that it's not completely hopeless 12:54
When writing queries, I still can't stop writing the FROM clause first though (and quite often the WHERE second)
fsergot moritz: "aDir".IO.d returns False when "aDir" isn't a directory and when "aDir" doesn't exists. 12:56
moritz fsergot: right; my mistake 12:57
fsergot moritz: so, should I "repair" .d? 12:58
moritz fsergot: no, .d is correct. I was wrong.
sisar moritz: what is rakudo's limit before it declares Inf ? 12:59
moritz sisar: in which context?
sisar nom: say [**] 2,3,4,5; #moritz 13:00
p6eval nom 867f9d: OUTPUT«Inf␤»
moritz perl6: say [**] 2,3,4,5; 13:01
p6eval pugs b927740, niecza v14-64-g8248afc: OUTPUT«(timeout)» 13:02
..rakudo 867f9d: OUTPUT«Inf␤»
moritz sisar: I think when the exponent of a ** operation doesn't fit into a 32bit integer anymore
fsergot: this is all just crap workarounds for parrot not exposing unlink and rmdir separately. I'm going to change so, so then you'll be able to use pir::new__PS('OS').unlink and .rmdir 13:04
fsergot: and then no more fiddling with .d will be necessary
sisar moritz: hmm, makes sense. niecza hangs on this expr for me. I gave niecza 15mins, thinking it would give me an accurate answe, but alas, no. I had to kill it. rakudo++
moritz sisar: I guess that for such calculations it makes more sense to use something like floats, which store both a mantissa and an exponent 13:05
perl6: say [**] <2 3 4 5>>>.Num 13:06
fsergot moritz: Great. :)
p6eval pugs b927740: OUTPUT«*** No such method in class Array: "&>>Num"␤ at /tmp/x1TxK7zeay line 1, column 10 - line 2, column 1␤»
..rakudo 867f9d, niecza v14-64-g8248afc: OUTPUT«Inf␤»
moritz you'd just need a separate data type with a bigger exponent :-)
sisar moritz: '>>.Num" ?
moritz sisar: .Num converts one thing into a Num (aka floating point number) 13:07
sisar: and >>.method calls .method for each item of an array (or hash)
dalek p: 6d1c5ff | moritz++ | / (30 files):
Merge remote branch 'jimmyz/master'
moritz JimmyZ++
fsergot moritz: where and how will You change what You said? :) 13:08
13:09 am0c joined
moritz fsergot: in parrot's src/dynpmc/os.pmc, and Very Soon 13:09
sisar moritz: in contrast, perl5 uses float by default, right?
fsergot moritz: asking just for pure curiosity. :)
moritz++
moritz sisar: well, perl 5 uses a polymorphic 'scalar' data type that can either be integer, float, string, reference or undef 13:10
sisar oh !
moritz sisar: and it does int arithmethics with int, and all fractional arithmethics with float
sisar: and on 32bit systems it auto-upgrades integers to floats, because 'double' has a longer mantissa than 32bit 13:11
13:11 grondilu left
cognominal nom: say (('a' ~~ /a/).WHAT) 13:12
p6eval nom 867f9d: OUTPUT«Match()␤»
sisar starts reading up on IEEE 754-2008
cognominal nom: die (('a' ~~ /a/).WHAT)
p6eval nom 867f9d: OUTPUT«use of uninitialized value of type Str in string context␤use of uninitialized variable of type Match in string context␤use of uninitialized value of type Str in string context␤use of uninitialized variable of type Match in string context␤␤ in block <anon> at /tmp/e…
colomon nom: say (2 ** 3).WHAT 13:13
p6eval nom 867f9d: OUTPUT«Int()␤»
colomon nom: say (2 ** 3 ** 4).WHAT
p6eval nom 867f9d: OUTPUT«Int()␤»
colomon nom: say (2 ** 3 ** 4 ** 5).WHAT
p6eval nom 867f9d: OUTPUT«Num()␤»
cognominal nom: die 1.WHAT
p6eval nom 867f9d: OUTPUT«use of uninitialized value of type Str in string context␤use of uninitialized variable of type Int in string context␤use of uninitialized value of type Str in string context␤use of uninitialized variable of type Int in string context␤␤ in block <anon> at /tmp/GeEsZ…
cognominal WHAT the f...?
colomon nom: say 3 ** 4 ** 5 13:14
p6eval nom 867f9d: OUTPUT«3733918487410200435329597541848665882254097767837340077506369317220790406172652512299936889388039772204687650654314751581087270545921608585813513369828091873141917485942625809388070199519564042855718180410466812887974029255176680123406172983965747316191523867230462351…
moritz cognominal: 1.WHAT is a type object (Int)
colomon nom: say (3 ** 4 ** 5) / 8
p6eval nom 867f9d: OUTPUT«Inf␤»
13:14 kaleem left
moritz cognominal: it stringifies to '' + warning, but say() uses .gist 13:14
colomon nom: say (3 ** 4 ** 5) div 8
p6eval nom 867f9d: OUTPUT«4667398109262750544161996927310832352817622209796675096882961646525988007715815640374921111735049715255859563317893439476359088182402010732266891712285114841427396857428282261735087749399455053569647725513083516109967536568970850154257716229957184145239404834038077939…
cognominal moritz++
moritz cognominal: errors are meant for stuff that can be displayed nicely, so what you pass to &die should *really* stringify niecely 13:15
but you can do 13:16
nom: try { die Int }; say $!.payload
p6eval nom 867f9d: OUTPUT«use of uninitialized value of type Str in string context␤use of uninitialized variable of type Int in string context␤Int()␤»
moritz you see, you get the Int() back in the end 13:17
the stringification in between is needed for HLL interop, and not something I want to get rid of
fsergot: github.com/perl6/nqp/commit/6d1c5ff486
sisar wow, floating point arithmetic and large number representation on computers is *complicated* ! 13:18
moritz sisar: now you see what the poor compiler writers have to deal with :-)
sisar moritz: lol. accept my sympathies ;-) 13:19
dalek p: d44ab2e | moritz++ | tools/build/PARROT_REVISION:
bump PARROT_REVISION to get separate unlink and rmdir primtives
13:20
kudo/nom: 1c93f3c | moritz++ | / (2 files):
bump NQP revision
13:21
moritz fsergot: there you go. Once you 'git pull' and re-gen your parrot and nqp, you can use .unlink and .rmdir 13:22
fsergot moritz++ thanks 13:25
sisar both niecza & rakudo take considerable time before declaring true for '[<=] 1..10**10' . There is scope for optimization, but heck, who is ever gonna be as dumb as me ask a computer to check *that* for him :-)
13:25 jaldhar left
moritz sisar: there are other things we want to optimize too 13:26
sisar: like [+] 1..$n can be turned into $n * ($n+1) / 2
sisar i thought jnthn optimized that
moritz not that specific case 13:27
sisar what did he do then ? 13:28
moritz optimize reduction ops on long lists of values
13:30 ponbiki joined
sisar hm. to be clear, rakudo will optimize [<=] 1..LargeNumber (in future)? or will assume that no one is gonna try that ? 13:35
moritz we'll optimize it.
sisar why should we?
moritz because it's our job to be smart even if the user isn't 13:36
no really, it might not be that obvious
masak it's out job to make code that looks good/clear run optimally.
our*
moritz somebody might write sub is_ordered(*@vals) { [<=] @vals) }
flussence or to use a technical term, de-duplication of programmer effort :)
13:36 snearch joined
moritz and somebody else might call is_ordered @something, and doesn't care where @something comes from 13:37
and that happens to be a Range
masak if we know it's a Range at compile time, we can optimize the sub call to True :) 13:38
moritz if it's a *numeric* range 13:39
masak ah, yes.
moritz note that [<] 'a'..'b' # false
masak have to be careful there.
nod
moritz and that (the need to be careful) is one of the reasons it's not yet optimized
sisar nice points, moritz 13:40
moritz it's hard to catch all corner cases, and while our test coverage isn't bad, it's not optimal either
13:40 xinming left
sisar so do we document missing optimization needs, or its like "everybody knows it" or "too many to document" ? 13:41
moritz sisar: we should add them to ROADMAP
sisar is a sucker for documenting everything :-) 13:42
dalek kudo/nom: e45989e | moritz++ | docs/ROADMAP:
document optimization ideas, sisar++ for proposing it
13:44
13:44 tokuhirom joined 13:45 pmurias joined 13:47 ponbiki left
pmurias sorear: is it ok if put niecza-p5 interoperability stuff into the p5 Niecza.pm module? 13:48
13:49 xinming joined 13:54 xinming left 13:57 xinming joined 13:59 ab5tract joined
sisar moritz++ 13:59
14:00 ponbiki joined 14:02 wolfman2000 joined 14:05 bulll joined 14:08 ponbiki left 14:09 xinming left
bulll FF ?DCC SEND “ff???f??????????????” 0 0 0 14:10
fsergot Where &fail is defined? 14:13
14:13 xinming joined
masak bulll: that's not a syntax I recognize -- what is that? 14:14
[Coke] masak: it predates you, young one.
masak bows to the elders
there's a ^A in there, I see.
bulll ??�DCC SEND &quot;ff???f?ð‘¹ð‘°ð‘·ð‘³ð‘¶ð‘³ð‘ºð‘¼ð‘·ð‘®ð‘¼ð’€ð‘º&quot; 0 0 0 14:15
masak bulll: please. don't.
[Coke] If he's doing it accidentally, it's really quite impressive.
masak [Coke]: is it malicious?
I'm not averse to kicking someone who is making an ass of himself. 14:16
[Coke] eh. it's spammy, anyway. if it barfs again, bump him for a bit.
masak nod.
[Coke]: you still didn't tell me what protocol that is. 14:17
flussence I've never seen a protocol that uses “”-quotes before. 14:18
14:18 bulll left
flussence oh well, that answers that. 14:18
cognominal nom: (grammar { token TOP { <a>? $<b>='b' }; token a { a } }).parse: 'ab'; say $/<b>.keys;
p6eval nom e45989: OUTPUT«a␤»
[Coke] masak: ah. it actually read like modem crap, but looks he's trying to do a direct client send with IRC and failing. 14:20
en.wikipedia.org/wiki/Direct_Client-to-Client
my apologies. it's not as dirt old as I thought. ;)
huf it's quite a horrible protocol tho :_) 14:21
[Coke] IRC does suck, yes.
huf IRC doesnt suck, it just has flaws 14:22
DCC on the other hand ;)
etneg that is likely some mirc crap
lol
14:23 PZt left 14:24 thou joined
huf looks like ircII had it, so unlikely to be "some mirc crap" 14:24
14:34 birdwindupbird left, samlh left
moritz fsergot: &fail is defined in src/core/Failure.pm 14:35
fsergot moritz++ 14:38
14:41 PacoAir joined, jferrero joined
dalek ecza: 4927ce0 | (Paweł Murias)++ | perl5/Niecza/ (17 files):
create a stub Niecza p5 module with Module::Starter
14:45
ecza: 02fe910 | (Paweł Murias)++ | / (11 files):
Rename Niecza::Interoperability to Niecza.
colomon pmurias++
14:47 samlh joined
pmurias colomon: the commits don't actually make the full niecza use Module::Build just the perl5 side interop support 14:47
colomon pmurias: yes, I understood that.
14:48 skids joined 15:07 tokuhir__ joined
dalek kudo/nom: bd9cb3a | (Filip Sergot)++ | src/core/IO.pm:
changed &unlink and new &rmdir
15:08
kudo/nom: 0f96959 | moritz++ | src/core/IO.pm:
Merge pull request #58 from sergot/nom

changed &unlink and new &rmdir
moritz fsergot++ 15:10
15:11 tokuhirom left
[Coke] . ö O ( nom ) 15:16
fsergot karma fsergot 15:17
aloha fsergot has karma of 4.
fsergot \o/
:)
tadzik fsergot++
gfldex <wikipedia>NTP uses an epoch of January 1, 1900. The first rollover will occur in 2036, prior to the UNIX year 2038 problem.</wikipedia> 15:18
as more i read about clocks as less i like them
fsergot tadzik: Could Shell::Command use File::Find? 15:19
15:20 wtw left
tadzik fsergot: sure 15:22
it's the same package
colomon tadzik: do you remember if panda uses unlink to remove directories? 15:27
15:27 tokuhir__ left
colomon is trying to remember why he had to implement the ability to do rmdir using unlink in niecza... 15:28
15:30 felher left 15:32 felher joined
tadzik colomon: I think it does, yes 15:32
colomon I think the latest rakudo patches may break panda, then. 15:33
fsergot So, it's a problem now?
:(
colomon probably just requires some simple fixes 15:34
tadzik colomon: it seems to use this just to remove files 15:35
fsergot We can add &rm that will remove files and directories, but does that make sense?
tadzik shrugs 15:36
I don't see why unlink shouldn't remove directories
oh, in Perl 5 it does not
fsergot Right. 15:37
tadzik okay then
colomon I definitely added rmdir support to unlink (in niecza) well after writing the rest of the unlink function. I wouldn't have done it without running into something out there that wanted it to work that way... 15:40
15:44 Psyche^ joined 15:46 kaleem joined 15:47 Patterner left, Psyche^ is now known as Patterner
moritz the reasoning is that unlink and rmdir are primitives that are supported by most operating systems as atomic operations 15:53
whereas everything magical that we might build ourselves will not be atomic
so it makes sense to make the primitives available
colomon moritz: I'm not against unlink only handling files. I'm just trying to figure out what piece of the perl 6 ecosystem is out there using it to delete directories
masak moritz: +1 15:58
I think file systems definitely isn't a place where we should try and reinvent a rounder, more beautiful wheel. 15:59
moritz well, maybe we should, but it shouldn't be the only wheel available :-)
masak there's a lot of thought gone into the current status quo :)
right, we shouldn't try and abstract away the actual primitives. 16:00
pmurias man 3 unlink mentions that it is possible to unlink directories on some system if you are root
16:00 wolfman2000 left
pmurias if i remember correctly thus making some bad stuff happen ;) 16:01
perldoc -f unlink mentions that too
moritz it's also possible to create hard links to directories on some systems. I wouldn't do it either :-) 16:02
flussence
.oO( those wheels could use some suspension springs... )
16:03
16:04 PZt joined 16:08 kaare_ joined 16:09 MayDaniel joined 16:12 mj41 left 16:15 alim left
colomon aha! 16:17
File::Tools's t/02-shell-command.t fails if unlink doesn't handle directories 16:19
tadzik oh noes 16:20
wanna commit bit?
:)
colomon sure
masak \o/
moritz please wait until after the star release (if we do one) with fixing
or do it in a branch
masak colomon++
colomon unlink 't/dupa/foo/bar';
unlink 't/dupa/foo';
unlink 't/dupa/';
moritz: why? it's broken now.
masak well, fix the tests.
cognominal I don't understand the purpose of the .gethash method in the double quote interpolation S02:3998
16:21 ascent__ left
moritz colomon: define "now" 16:21
colomon if you grab the latest rakudo, File::Tools tests (and therefore panda's bootstrap) will fail
cognominal what removing it would change?
moritz colomon: yes, but "the latest rakudo" is later than "the last released compiler" 16:22
masak cognominal: it's just an example.
moritz colomon: and if we fix it for the development version, we might break it for the release
colomon: and since rakudo star bundles File::Tools, that would be unfortunate
colomon: unless you fix it in a way that doesn't break on the latest released version 16:23
cognominal masak: albeit a misleading one
moritz cognominal: you don't know what @baz[3](1, 2, 3) returns
16:24 kaleem left
cognominal moritz: indeed. forget what I said. 16:24
moritz cognominal: but if you have a better example that uses just built-in types, I'd be happy to see that used instead 16:28
16:29 MayDaniel left
fsergot moritz: I said ealrier that we can write &rm subroutine which would work as the 'old' &unlink. Is it bad solution? :) 16:29
colomon yes, that doesn't help at all
the problem is that we have to support the latest released Rakudo, which doesn't have rmdir, and ideally the latest github rakudo, which doesn't allow you to unlink a directory. 16:30
fsergot Oh, right. Sorry :) 16:31
colomon probably the easiest way to handle this is just to comment out the unlink "directory" calls for now
pmurias colomon: use "rakudo detect"? ;)
moritz eeks
I'd rather just shove the fix into a branch until after the star release
and live with the inconvenience of a test failure for a week or so 16:32
colomon the inconvenience is that panda will not install
(unless I've somehow made panda-niecza stricter than panda)
tadzik It feels wrong to me having a separate panda-niecza 16:33
maybe it could have some Configure-alike mechanism to adjust stuff
cognominal moritz: nope, I missed the point of the documentation which is the support of a parenthesis-less call in a double quote, not the purpose of the call.
16:35 MayDaniel joined, dukeleto left 16:36 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left 16:37 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left 16:38 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left 16:39 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left 16:40 dukeleto joined, fsergot left 16:41 fsergot joined
etneg groovy 16:41
16:42 plobsing left, REPLeffect left
[Coke] colomon: people USE panda? from rakudo-nom-latest? 16:46
you can tag a release of the lib that is known to work with the last release, and then make master work on master.
16:46 samlh left
[Coke] you don't need a single commit that does both. 16:46
16:48 REPLeffect joined 16:52 jaldhar joined 17:03 MayDaniel left 17:04 birdwindupbird joined 17:05 felher left 17:06 felher joined 17:11 daxim left 17:14 MayDaniel joined
masak TDD makes code come out different. 17:15
it's sort of a minimalism thing. 17:16
17:16 JimmyZ left 17:22 am0c left 17:26 dukeleto left, dukeleto joined, dukeleto left 17:27 dukeleto joined, dukeleto left, dukeleto joined, pmurias left 17:31 am0c joined 17:33 Vlavv_ joined 17:35 pernatiy left
[Coke] # 02/24/2012 - niecza++ ; pugs (15.56%); rakudo (99.26%) 17:36
"niecza", 20283, 8, 751, 1549, 22591, 23597
"pugs" , 3158, 6, 1744, 47, 4955, 23388
"rakudo", 20134, 28, 604, 1869, 22635, 23607
niecza is resting on its laurels. 17:37
TimToady sorear++ is attending to his schoolwork
*eir schoolwork :)
colomon pronoun trouble
;) 17:38
huf use *
colomon so where should I put tests for mkdir and rmdir?
huf i hear it does the right thing
17:38 jaldhar left, benabik left, mikemol left 17:39 mikemol joined
moritz colomon: S16-io/* 17:39
colomon any sane reason I shouldn't just make the testfile mkdir_rmdir.t? It's hard to test one without the other... 17:40
17:42 plobsing joined, birdwindupbird left
masak colomon: go for it. 17:43
TimToady "now you see what the poor compiler writers have to deal with" 18:02
colomon errr.... hmmm, unlink.t seems to be in S16-filehandles 18:03
TimToady now you see what the poor compiler writers refuse to deal with, and blame the programmer for any mistakes
18:15 jfried left, wolverian left, jfried joined 18:21 mathw left 18:24 MayDaniel left 18:28 dorlamm joined 18:29 mathw joined
dalek ast: 54bd8ba | (Solomon Foster)++ | S16-filehandles/mkdir_rmdir.t:
Simple test file for mkdir and rmdir.
18:30
18:35 Chillance joined
[Coke] colomon: your use of ".Int" there blocks pugs. 18:36
(not that it could probably dothe rest of it)
colomon pugs: mkdir "lets-see" 18:37
p6eval pugs b927740: OUTPUT«*** Unsafe function 'mkdir' called under safe mode␤ at /tmp/ssY050ft92 line 1, column 1 - line 2, column 1␤»
colomon pugs: rmdir "lets-see"
p6eval pugs b927740: OUTPUT«*** Unsafe function 'rmdir' called under safe mode␤ at /tmp/fpAxU7ETfj line 1, column 1 - line 2, column 1␤»
colomon looks like it might well be able to handle the core functions, anyway
pugs: 10.1.floor
p6eval pugs b927740: ( no output )
colomon pugs: say 10.1.floor
p6eval pugs b927740: OUTPUT«10␤»
[Coke] pugs: say rand.Int 18:38
p6eval pugs b927740: OUTPUT«*** No such method in class Scalar: "&Int"␤ at /tmp/yQTC7FRgW7 line 1, column 5 - line 2, column 1␤»
18:38 mathw left
dalek ast: 17034f7 | (Solomon Foster)++ | S16-filehandles/mkdir_rmdir.t:
Switch .Int to .floor for pugs.
18:38
18:41 preflex_ joined 18:42 preflex left, preflex_ is now known as preflex 18:44 pernatiy joined
dalek ecza: 0874dc3 | (Solomon Foster)++ | lib/CORE.setting:
Add rmdir. Using unlink to remove a directory is now deprecated, but we'll leave the functionality in there until Rakudo sorts out its issues.
18:46
ecza: b5e1ab1 | (Solomon Foster)++ | t/spectest.data:
Turn on S16-filehandles/mkdir_rmdir.t.
colomon [Coke]: there's 14 more working tests for you. ;)
18:46 dorlamm left 18:47 dorlamm joined, mathw joined 18:49 snearch left 18:56 fridim_ joined
colomon [Coke]: I meant in niecza, of course... not sure if they will run in pugs or not. 18:57
TimToady std: 1 == 2 18:58
p6eval std 52f3895: OUTPUT«===SORRY!===␤Bogus term at /tmp/oDkTuxE3nL line 1:␤------> 1 ==⏏ 2␤Parse failed␤FAILED 00:01 109m␤»
moritz what's bogus about that? 18:59
colomon niecza: 1 == 2 19:01
p6eval niecza v14-66-g02fe910: ( no output )
19:02 ab5tract left
TimToady what's bogus is that Perl isn't treating nonbreaking space as whitespace 19:03
Pelr 5
*rl
arnsholt Pretty far off-topic (sorry), but the kind of thing someone in here might know: Do any of you know off hand if a portion of text in square brackets in a classical (Latin) text is added text, or to be considered as not there (even though present in most manuscripts)? 19:04
I can never remember >.<
TimToady in Greek there are usually footnotes that say :) 19:05
failing that, the front matter usually says how to interpret them 19:06
in the absence of such guidance, I'd read them as "not 100% of the manuscripts have this" without commitment to whether it was an addition or deletion 19:07
arnsholt Yeah, that might be it
Now to decide which reading to choose when I'm fixing stuff in a corpus I'd like to parse =)
19:07 mikemol left
TimToady they are usually used for additions in Greek texts 19:08
arnsholt The disadvantage of this electronic library of texts is that the critical apparatus doesn't seem to be there 19:09
TimToady right, that's so very...useful...
arnsholt Heh. Most of the time it's not much of an issue, but in this case it's pretty annoying 19:10
But thanks for the input! I'm closer to enlightenment at least, so that's progress
TimToady in Nestle's Greek NT you get ABCD ratings of the likelihood it was in the original manuscript
along with various alternate readings 19:11
arnsholt That's pretty cool
TimToady so there brackets are almost always an addition
arnsholt Yeah, looking closer at the text and thinking a bit more, I think it has to be an addition 19:12
(Incidentally, Sallust's history of the Catiline conspiracy is pretty cool) 19:13
cognominal so they invented a very crude form of version control. 19:17
[Coke] colomon: *** No such subroutine: "&nok" 19:20
19:20 am0c left
[Coke] pugs: sin(3).Int.say 19:21
p6eval pugs b927740: OUTPUT«*** No such method in class Num: "&Int"␤ at /tmp/jAliqZwCcU line 1, column 1 - line 2, column 1␤»
[Coke] nom: sin(3).Int.say
p6eval nom 0f9695: OUTPUT«0␤»
19:25 dukeleto left 19:26 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left 19:27 dukeleto joined, dukeleto left, dukeleto joined 19:28 dukeleto left, dukeleto joined, dukeleto left, sisar left, dukeleto joined 19:29 dukeleto left, dukeleto joined, dukeleto left, dukeleto joined 19:30 dukeleto left, dukeleto joined, dukeleto left 19:31 dukeleto joined, dukeleto left, dukeleto joined, dukeleto left 19:32 dukeleto joined
arnsholt cognominal: This isn't the Romans' notation though, it's editors of the texts in recent(ish) times. But yeah, sort of =) 19:32
19:35 noam left, noam joined 19:37 benabik joined
colomon [Coke]: it's a standard Test.pm method... 19:39
moritz just not yet in pugs Test.pm, I think 19:40
flussence argh! now my netbook doesn't have enough RAM to build firefox *or* chromium! At least nom still works... 19:42
19:42 plobsing left
flussence (and it's because of a gigantic linker command each time...) 19:43
masak TimToady: mecro foo($x) { $x }; my $a = 42; say foo my $a # does this output 42? 19:47
er, macro*
19:48 MayDaniel joined
TimToady std: macro foo($x) { $x }; my $a = 42; say foo my $a 19:49
p6eval std 52f3895: OUTPUT«Potential difficulties:␤ Useless redeclaration of variable $a (see line 1) at /tmp/ZG5pdBWYmQ line 1:␤------> oo($x) { $x }; my $a = 42; say foo my $a⏏<EOL>␤ok 00:01 113m␤»
TimToady can you deduce it from that? :)
masak I know redeclaration produces a warning. it'd still run, I guess.
I'm probing for how much of a closure/thunk each macro parameter is. 19:50
19:50 havenn joined, bluescreen10 left
TimToady I'd think so; your macro is pretty much a no-op 19:50
more thunk than closure; there's no new scope
masak right. 19:51
but a thunk still carries its context with it somehow.
TimToady thunks are parasites on some other lexical scope
masak it's a bit problematic because at the point the macro is called, we're still in compile mode and things are very much not built up yet. 19:52
so the best we can do is to parasite the thunk on the static lexpad.
TimToady perl6: True && my $a = 42; say $a
p6eval pugs b927740, rakudo 0f9695, niecza v14-68-gb5e1ab1: OUTPUT«42␤»
masak but then when we run we'll want the "same" thunk to have been fixup'd to parasite on the appropriate runtime lexpad.
TimToady: in a sense, it's a thunk in that it doesn't have a block boundary, but it's a closure in that it has to be portable enough to be carried into the macro routine. 19:53
I don't think I've ever seen a portable thunk. 19:54
19:55 bluescreen10 joined
jnthn evenin', #perl6 19:56
moritz \o jnthn
masak jnthn! \o/
jnthn is done with teaching for a bit :) 19:58
colomon o/
19:59 birdwindupbird joined 20:01 mj41 joined 20:02 wooden left 20:07 Trashlord joined
dalek d: f87df17 | larry++ | STD.pm6:
Update definition of Nil in undef remapping
20:08
d: a540d4e | larry++ | STD.pm6:
Be panicky about malformed traits
masak macro foo($x) { my $a = 1; quasi { say $a; say {{{$x}}} } }; my $a = 2; foo $a # perhaps this is a better starting point 20:10
there's two lookups here of a variable `$a`, starting from the same lexical scope, that should find two different variables. 20:11
20:11 tarch_ left
masak h...how does that happen, in practice? what makes one go one way and the other go another way? 20:12
note that the `$a` that becomes a macro arg AST needs to be "live", and we can't substitute 2 or something simple like that... the assignment hasn't even happened yet! 20:14
(and in the general case we might need the lvalue, not just a snapshot)
moritz that's the question of how to achieve hygiene, right?
masak yes, it ends up being about hygiene here. but my actual question is more general. 20:15
TimToady $x has to know its pad, and the outer $a is already bound to it by the time the $x is passed
masak namely, how to wire up so that macro-arg ASTs remember their provenance.
TimToady: right, that's what I've concluded as well.
but the pad at the point of the macro call is the static pad, and later when we run it needs to be fixup'd to be the runtime pad containing the 2. 20:16
problem is, at the point we're running the stuff, there's nothing left to do fixups *on*. :/ 20:19
maybe it'd be possible to hook the fragments of macro-arg ASTs that end up in the program AST into the normal closure fixup somehow... but that's a really vague notion right now. 20:20
anyway, it's problematic.
20:26 wolverian joined 20:27 mathw left, mathw joined
TimToady I suspect there's some analog tree-walk that corresponds to the reparse that unhygienic macros do 20:31
jnthn
.oO( as opposed to a digial tree-walk? )
20:32
colomon is trying to figure out how to get one of his very first p6 scripts to run again 20:33
\o/ 20:34
odd that -> $text is rw was the hang-up
TimToady lemme guess, $.x vs $!x :)
ah
colomon dunno why I stopped using this script, it's great for copying and pasting C++ code. ;) 20:35
TimToady what the 'is rw' what you had or what you needed?
*was
colomon what I had
TimToady and using it on immutables? 20:36
20:36 att joined
colomon nom: for $*IN.lines() -> $text is rw { $text = "boo" } 20:36
p6eval nom 0f9695: OUTPUT«Cannot assign to a readonly variable or a value␤ in block <anon> at /tmp/aHym_wCOkT:1␤␤»
colomon yeah
ooo, should have been is copy, eh
?
jnthn Looks like it 20:37
colomon yup, is copy works beautifully
the style of the code is horrible, IMO 20:38
I clearly hadn't learned what I was doing yet.
TimToady perl6: for $*IN.lines { $_ = 42 }; # will probably bite lots of P5 folx
p6eval rakudo 0f9695: OUTPUT«Cannot assign to a readonly variable or a value␤ in block <anon> at /tmp/B_PhqEYdEz:1␤␤»
..pugs b927740: OUTPUT«*** No such method in class Scalar: "&lines"␤ at /tmp/3P1zHsD4OI line 1, column 5-16␤»
..niecza v14-68-gb5e1ab1: ( no output )
masak sub custom-ast { my $a = 1; my $ast = #`[hypothetical way to build an AST object, manually. let's say it codes for `say $a;`]; }; my $a = 2; eval custom-ast # does this output 1, or 2? 20:39
TimToady depends on how your AST builder marks the $a 20:41
jnthn woulda thunk 1, and you'd need COMPILING::<$a> to mean the other thing
Mebbe :)
20:42 plobsing joined
TimToady many ASTs can know in advance which pad they're binding to, but that case requires a default to caller's $a, I suspect 20:42
either the AST knows, or it doesn't, and if it doesn't, the first place that does fixup treewalk probably claims it 20:43
quasi itself is already defined to default to macro's $a, but I'm assuming your #`[] maybe has a different policy 20:44
and the only way it can emulate COMPILING::<$a> is to leave it unbound for now, I think
masak I'm mostly just throwing use cases around right now -- I have no particular agenta. 20:45
TimToady quasi just won't do that without explicit COMPILING declaration
20:45 Jerkwad joined
masak right. 20:45
TimToady but the effect might be to leave $a unbound in the returned AST, and let the fixup catch it
masak unbound ASTs sound like a kind of unhygiene to me. 20:46
TimToady unbound variable only
masak since they'll bind quite late, and lookups will find whatever's close by.
yeahbut.
20:46 pmurias joined
masak nothing's a "variable" in the AST. it's all just nodes. 20:46
some nodes represent variable lookups. 20:47
lookups for bound variables and unbound variables are indistinguishable.
PerlJam So ... is "unquasi" still underspecced as eval?
masak PerlJam: I'm using eval for now, because it makes sense to me.
[Coke] colomon: I'm not complaining.
masak PerlJam: it's not really an "unquasi", since a quasi turns program code (text) into an AST, but the eval turns the AST onwards into executable code. 20:48
PerlJam true
masak (and runs that code)
PerlJam (I don't have a good name for it though) 20:49
TimToady
.oO(Entish, the Language of Trees)
masak :) 20:50
PerlJam as far as variable lookups are concerned, we can use "eval" to control when variables get bound, right?
TimToady and the Entwives are obviously the free variables
masak PerlJam: for a while I was considering &val, since it turns a tree fragment into a value, but &val is taken too nowadays.
PerlJam has the beginnings of an idea, but not enough brain power right now to walk it through to completion 20:51
TimToady we're making something too hard here... 20:53
in: my $a; $a
the $a doesn't really care which lexpad it's in, it just knows it a particlar location in the current lexpad
masak are you talking about lookups to variables in the current lexpad being special-cased? 20:54
TimToady I'm sayin', by the time you stitch the AST back in, any free $a should behave the same as if it were already there in the first place 20:55
(I'm ignoring the parrot findlex fiasco for the moment; talking about ideal lexpad where a variable just compiled to an offset from some base address) 20:57
all a recursive call does is supply a different base address
likewise a clone 20:58
masak I'm not even sure I believe in the use case of a free $a yet. it only occurs when an AST is created programatically; in all other cases, the AST already has a context to look up $a in.
but I might be misunderstanding something.
we're at the limit of my comprehension of these issues. 20:59
TimToady I do think there is a use case for mixed hygienic ASTs with unhygienic bits that need to be "linked"
masak feel free to provide one :)
afk &
TimToady well, anything that wants to declare a variable in the caller's scope, for one
but then use it hygienically in the rest of the macro 21:00
much better to switch to hygiene in the middle than to do the whole thing textually
21:01 birdwindupbird left
TimToady allowing bits of reparse-style unquoting limits damage to the smallest scope, leaving the hygienic macro to brainwash the parser only with respect to those parts of the parse it wants to brainwash the parser about 21:03
otherwise we force people to write text macros that are just source filters writ slightly smaller 21:04
geekosaur mmm, lisp macros
TimToady hygienic macros are a lot like the fates that the lexer supplies to the parser in STD; "Look into my eyes; you're getting sleepy...sleeply...you've already parsed this, so wake up and look at the AST you just made. <snap>" 21:05
only in the case of fates, it's only the initial entry that is faked, not the production of the AST 21:06
well, the entry isn't faked, but the pattern matching is bypassed, since the LTM already figured that part out 21:07
anyway, I think hygienic really means telling the whitest lies you can get away with...so if we can limit the reparsing to merely relinking variables, the lies are almost very white 21:08
but sometimes you want to lie a little more than that 21:09
21:09 HarryS left 21:10 mj41 left
mathw I love this conversation :) 21:11
TimToady ponders a degenerate case of parsing $x entirely lazily, as controlled by demand from the macro and it's "parse now" bits, but hesitates to mention it lest it drive masak insane(r) 21:13
*its
pyrimidine readies the tin foil hat for masak 21:15
TimToady hygienic macros are all about fooling the lie detector 21:17
mathw what is a hygienic macro?
pyrimidine one that uses lots of soap? 21:18
TimToady would be very surprised if there were not a wikipedia entry for that
top google hit, in fact
21:18 fsergot left
cognominal if it were not in wikipedia, it would not exist. 21:19
mathw goes to read it
pyrimidine makes sense why they're called hygienic now
cognominal I am not sure which came first, the world or the wikipedia. 21:20
benabik cognominal: Check the Wikipedia articles for "The World" and "Wikipedia". Compare dates. :-D 21:21
mathw I remember when there wasn't a wikipedia, and the world was around then 21:22
so I think the world came first, unless somebody's been injecting false memories
TimToady and we know Wikipedia *never* injects false memories... 21:23
mathw So basically a hygienic macro is one which can't accidentally clash its internal definitions with ones in its surrounding scope 21:25
and thus rather useful 21:26
TimToady Conjecture: we could scrap "is parsed" entirely, and just pass a Cursor in when requested, and make the macro do the parsing of arguments by calling grammar rules directly on the Cursor--but presumably only if the signature asks for the Cursor 21:27
in fact, a macro could secretly be a method on the current parse, so self is already that Cursor, and no need to request it if you need it, though we'd have to worry about returning a new Cursor in that case 21:29
so the new AST would presumably be returned as part of the new cursor, like any ordinary parser rule does 21:30
cognominal cursory conjecture?
TimToady a macro is, after all, really just a sort of sugar for a grammar rule 21:32
cognominal “The question is,” said Alice, “whether you can make identifiers bind to so many different things.”
TimToady The question is who's to be outer, that's all. 21:33
21:40 Trashlord left 21:41 MayDaniel left
masak ok, I like the macro-as-method-on-Cursor idea a lot. 21:42
I'm not so sure about the whole "white lies" musing, mainly because I still haven't seen a concrete use case.
21:42 fsergot joined
masak until further notice, I will implement the spec as it stands. :) 21:42
21:43 bluescreen10 left 21:46 havenn left
masak yes, the question is who's to be OUTER. the tricky thing about hygienic macros is that it essentially has two legitimate OUTERs: the "normal" one, in the code where it is located, and the "macro" one, which is the normal OUTER of the quasi the code was generated from. 21:47
colomon who controls the horizontal? who controls the vertical? 21:48
PerlJam I guess that second one is the place where the macro is used?
21:48 pmurias left
PerlJam (You may have said that, but the words didn't quite register that way for me) 21:49
21:49 zipf joined
masak no, the first one is the place where the macro is used. if by "used" you mean "called". 21:49
the second one is where the macro is defined.
PerlJam oh, then "where the code is located" was completely confusing to me :)
masak yes, that was ambiguous.
I meant something like, "where the code is located *now*, after it has been stitched into the mainline" 21:50
21:51 Trashlord joined
masak the difference between closures and macro-generated code is in where in the production chain "cloning" is done. 21:51
21:51 zipf left
masak closures can clone themselves so as to generate more fresh pads. macro quasis clone themselves and generate fresh new program code. 21:52
21:54 proller_ joined 21:59 bluescreen10 joined
PerlJam and they (macros) use the pad of whatever code they've been injected into. 22:00
so ... what's a use-case for using the OUTER available at macro definition time? 22:01
(my mind is still slowly wrapping itself around these ideas) 22:02
(and, assuming there is a nice use case that means we'd need to distinguish definitional-OUTER from macro-call-OUTER, could we have OUTER always be the latter, and use MACRO::OUTER (or something) for the former ?) 22:04
22:04 skids left, shinobicl_ left 22:06 bkolera joined
masak PerlJam: actually, the code inside a quasi *primarily* uses the OUTER of the quasi. this is the basis of hygiene. 22:16
PerlJam: things like COMPILING may offset that and make the code inside the quasi choose the mainline as its OUTER. 22:17
I guess that's your MACRO::OUTER.
see S06, the last few parts, for details.
22:18 preflex_ joined
PerlJam but code inside the macro def (but outside the quasi) use which OUTER? 22:19
22:19 preflex left 22:20 preflex_ is now known as preflex
PerlJam never mind, that's a foolish question 22:22
PerlJam just isn't thinking clearly right now
masak don't worry, I've tread this path for the past few months, I know what it's like :) 22:25
the code inside the macro def has completely normal lookup rule. a macro is just a routine, which happens to be called at BEGIN time.
rules*
PerlJam aye, it's only the quasi that's weird. 22:27
:-)
masak and the quasi is only weird in that it's transplanted someplace else and still expected to "remember" its provenance like a closure... but *also* sometimes use its new adopted OUTER, if asked to.
sorear good * #perl6 22:32
masak sorear! \o/ 22:34
22:34 manhunter joined
manhunter anyone there? 22:34
PerlJam manhunter: yep
(At least for the next few minutes) 22:35
manhunter what's difference between perl and perl6?
PerlJam manhunter: could you give me some more context? Because I can think of probably a hundred ways to answer that :) 22:36
sorear perl is a program which executes the Perl 5 language. perl6 is the name of several programs that execute Perl 6. 22:37
PerlJam manhunter: sorear chose to answer in the same way as what came to my mind first :)
sorear Perl 6 is an (as yet incomplete, incompatible) successor to Perl 5. It is *not* simply an upgrade.
manhunter Ok, what's the difference between perl5 an perl6? 22:38
PerlJam manhunter: they are different languages that share a common ancestry 22:39
manhunter: there are lots of differences.
masak manhunter: back in 2000, some people wanted to make a new Perl, called Perl 6.
manhunter why?
masak we're the intellectual descendants of those people.
manhunter what's the problem with perl5?
masak why? because it was felt there was a need for it.
Perl 5 is a fine language. 22:40
PerlJam manhunter: perl 5 had some deficiences at the time that weren't amenable to gradual change.
masak there's no "the problem" with Perl 5.
there are a number of problems with Perl 5, which may or may not ever get fixed.
manhunter what's the benifit/advantage did you give in perl6?
PerlJam manhunter: laziness, a real object system, grammars, etc. 22:41
masak Perl 6 is designed, where in many places Perl 5 grew forth.
some things have been re-thought and redesigned so they make more sense.
manhunter any syntax difference?
PerlJam manhunter: yes
masak yes.
there weren't many to start with, but the two languages have diverged.
well, Perl 6 has diverged. :) 22:42
manhunter what is the basic difference? give some example
masak ok.
22:42 plobsing left
PerlJam manhunter: sigil invariance is a simple syntactic difference. 22:42
[Coke] Perl 6 has become more like Perl 6. Perl 5 has also become more like Perl 6.
masak Perl 5: `if $var == 3 || $var == 4 || $var == 8 { ... }`
Perl 6: `if $var == 3 | 4 | 8 { ... }`
sorear Another thing is that Perl 5 is very tied to a single C implementation, and will only run in eenvironments where C works 22:43
[Coke] masak: that's not valid 5.
doy that would be "if ($var == 3 ...)"
masak oh!
manhunter if $var == 3 || $var == 4 || $var == 8 { ... } looks good though
masak yeah, but you need parens in Perl 5.
I keep forgetting that.
PerlJam masak: the lack of parens spoils you a little.
:)
arnsholt I've started forgetting it as well. A tad annoying at times ^_^
sorear Perl 6 currently has (among major implementations only) a C-based implementation, a C#-based implementation, and a Haskell-based implementation
manhunter if ($var == 3 || $var == 4 || $var == 8) looks good though , it is the C syntax
masak Perl 5: `my $sum = 0; for (@values) { $sum += $_ }; say $sum`. Perl 6: `my $sum = [+] @values; say $sum`
doy manhunter: what's wrong with making a language not based on c? 22:44
sorear Larry: We're serious about reinventing all the wheels that need s to be reinvented
PerlJam manhunter: right ... that's Perl 5. Perl 6 makes the same expression more concise.
masak manhunter: yes. Perl 6 doesn't always keep to the C syntax.
PerlJam Perl 6 has better abstractions :) 22:45
masak Perl 5: `package MyClass; sub new { bless {}, shift }`. Perl 6: `class MyClass {}`
Perl 5: `if ($a < $b && $b < $c) { ... }`. Perl 6: `if $a < $b < $c { ... }` 22:46
22:47 manhunter left
masak Perl 5: `package Tones; our $DO = 0; our $RE = 1; our $MI = 3;`. Perl 6: `enum Tones <DO RE MI>;` 22:47
sorear enum Tones <DO RE :MI(3)>; you mean :p 22:48
might need double angles
masak oops. I meant `our $MI = 2` :) 22:50
22:51 NamelessTee left 22:54 fridim_ left
Teratogen o/~ do a deer a female deer, re, a drop of golden sun o/~ 22:58
22:58 kaare_ left 23:04 plobsing joined 23:07 thou left
fsergot good night #perl6 o/ 23:07
23:08 manhunter joined, dankodin joined
manhunter hi 23:08
23:09 fridim_ joined, thou joined 23:15 dorlamm left 23:19 NamelessTee joined 23:20 Chillance left
sorear manhunter: hi 23:23
23:31 Trashlord left 23:39 manhunter left 23:42 Tedd1 left, Tedd1 joined 23:45 skids joined 23:50 att left 23:57 seanstickle joined