svn switch --relocate svn.openfoundry.org/pugs svn.pugscode.org/pugs/ | run.pugscode.org | spec.pugscode.org | paste: sial.org/pbot/perl6 | pugs.blogs.com
Set by avar on 16 November 2006.
[particle] perlers aren't used to dimensions greater than one 00:00
TimToady having one level of auto-list-interpolation also fits in well with the notion that Perl likes interpolative solutions 00:01
people grok "Answer = $answer\n" a lot better than "Answer = " ~ $answer ~ "\n" 00:02
[particle] which is why we now have $?LINE etc 00:03
TimToady P6 is supposed to be more like Perl than P5. :) 00:04
(in the good ways...) 00:05
[particle] p6 is definitely trending in the interpolative direction 00:06
putter re learning monads, one approach is to learn arrows first. they are a later generalization of monads, and at least to me, make far more sense. then one can work backward to understanding the more limited and twisted monads. ;)
www.cs.chalmers.se/~rjmh/afp-arrows.pdf www.haskell.org/arrows/ etc 00:07
Ziggy6 pugs has a lexer? 00:13
found it, Lexer.hs :D 00:14
[particle] not many languages without lexers exist 00:15
written latin almost qualifies
putter Ziggy6: also Parser/* 00:16
[particle] GALLIAESTOMNISDIVISAINPARTESTRES
Ziggy6 i guess it's too hard to learn monads, parsec and to try to understand the complex pugs parser at the same time :)
allbery_b has monads and parsec down, but the lexer has defeated him 00:19
putter the parser can certainly be skimmed. one can get a feel for it's structure without yet knowing enough to write or modify bits... 00:20
allbery_b specifically, trying to fix "- f" being parsed as filetest operator "-f" without breaking everything else
allbery_b couple of us tried to attack it last weekend, managed to break things in such a way that the test suite went into an infinite loop :/ 00:21
TimToady languages with mandatory endings tend to be self clocking 00:23
provided the endings can usually be disambiguated from the roots 00:24
kanji vs okurigana works that way too
allbery_b <-- learning Hebrew. suffixes and prefixes can *usually* be unambiguously removed from the roots... but not always 00:25
[particle] there are always irregular forms to gum up the works
allbery_b not to mention the incredible is-it-a-vowel-or-a-consonant-here? vav 00:27
putter [particle]: re "YOUONLYNEEDVOWELSORSPACESBUTNOTBOTH", "Y NLY ND VWLS R SPCS BT NT BTH". my fuzzy impression is ancient greek went back and forth a bit. 00:29
though the human reader may do an entirely separate pass at the first in order to "tokenize" it... 00:30
or read aloud and use language auditory word recognition 00:31
allbery_b took 'em a while to all agree to appropriate otherwise unused phoenician/aramaic letters for vowels :) it's not like the ancient Greeks were particularly unified
luqui @pl \a -> (>>= b a) 00:33
lambdabot (=<<) . b
[particle] nope, plenty of city/states
allbery_b interesting that it parsed that, I think it's illegal (need parens around (>>=) to use it as a prefix op) 00:34
@pl \a -> b >>= a
lambdabot (b >>=)
allbery_b @pl \a -> (>>=) b a 00:35
lambdabot (b >>=)
allbery_b aha
@unpl (=<<) . b
lambdabot (\ d g -> g >>= (b d))
allbery_b ah, right 00:36
duh
luqui didn't know about unpl
allbery_b @. redo unpl (=<<) . b 00:41
lambdabot (\ d g -> do { a <- g; (b d) a})
luqui what's that? 00:49
expands even more?
(that's a great learning tool though) 00:50
allbery_b redo converts >>= form back to do form; . is composition (it's a haskell lambdabot, of *course* it does composition...) 01:00
allbery_b sadly, only in prefix form 01:01
putter random musing (as I continue to try to picture how all the pieces we have could be variously assembled to get us nearer to xmas)... 01:13
pil2run is our best backend after pugs itself. its jsperl5 allows it to 01:14
use p5. a r5r (p5 regexs with <rules>) exists. the redsix p5 grammar is written in r5r. 01:15
err, that's "a r5r implementation exists for p5".
redsix was passing not quite 20% of tests, but the grammar was ripped/derived/kludged from the pugs one, so it should be not horribly incomplete. 01:17
putter though it has flaws, such as not integrating ast generation with parsing, so arity-based parse decisions don't work. 01:18
so anyway, one random thought is one might translate the redsix grammar and opp from ruby to p5, combine it with Regexp::Engine::Reentrant (or some such), and give jsper an alternate front end. one which, unlike pugs/pil1, could provide object info. 01:20
s/object info/class declarations./
pil2js already heavily uses p6 and oo. it just can't get oo info through the pugs/pil1 parser bottleneck. this way it could. 01:21
and p5 could be rewritten as p6, providing a bootstrap. much of what is currently js code could also be rewritten as p6. 01:22
svnbot6 r15140 | putter++ | project_planning/TALK - added "redsix on PIL2JS". Feedback encouraged. 02:32
Ziggy6 ?eval use v5; print "hello" 02:34
evalbot_r15139 1.0
putter Does anyone know approximately when pil2js stopped working? I'd like to svn back to then and run a pil2js smoke. tnx. 02:40
Else I'll just start walking back through the releases. 02:41
wolverian binary search is better than linear :) 02:42
putter unless one expects a small k :) 02:43
Ziggy6 hmm, strange, when i try the same thing in my pugs build, i get "Undefined subroutine &main:: called." 02:47
putter no, you're right. also essential is the implicit context that for this I don't really care just when it broke. since pil2js is rather stable (aka wedged waiting for pugs oo ast), any version pre breakage would be fine. releases tend to be less broken than random, so any release from last year should serve.
Ziggy6: me too. let's see... 02:49
allbery_b same here. r15101 fwiw 02:50
putter only two t/perl5/ smoke failures - modify_*
odd 02:51
Ziggy6 perl5 embedding is supposed to be fully functional? 02:52
putter for some value of "fully"
bbiab 02:53
allbery_b interesting. it's the use that triggers the error 02:58
luqui ?eval use v5; my %h = (a => 1); $h{a}
evalbot_r15140 1 02:58
luqui neat
allbery_b wonders what's up that it works in evalbot 03:00
huh. the tests don't test for this case 03:02
allbery_b pugs -e 'use v5;' fails, pugs -e '{use v5;}' fails, pugs -e 'sub foo ($x) {use v5;} foo(0)' succeeds 03:14
allbery_b pugs -e 'eval "use v5;"' succeeds, likely explaining evalbot (and also the test suite) 03:17
Ziggy6 should I add a test? 03:29
allbery_b probably a good idea 03:30
putter about to commit one... 03:33
actually, you know... 03:35
'use v5' simply isn't implemented. all the eval is doing is hiding that from us. and the bug is that pugs -e 'sub foo ($x) {use v5;} foo(0)' compiles. no? 03:38
./perl5/modify_* is what tests 'use v5', and that's failing. 03:39
so no new test needed. 03:40
allbery_b hm, yep, use v5 doesn't actually work 03:44
Ziggy6 well, then mp6 won't run on pugs 03:46
putter mp6? isn't the idea to try kp6? ie, use pugs instead of, or in addition to, mp6, in supporting kp6 development. 03:50
svnbot6 r15141 | putter++ | TALK - putter argues with himself about "redsix on PIL2JS". Other participants welcome.
Ziggy6 they have almost the same runtime 03:51
putter ah. try replacing "use v5; ..." with "eval('...,:lang<perl5>)"? 03:52
allbery_b actually, I did. 03:53
./pugs -e 'eval "my \@a = (1, 2); print \$a[0]", :lang<perl5>' # empty string output 03:54
I might be doing somethng else silly though
putter allbery_b: sorry, "try replacing" was regards kp6 :) 03:55
allbery_b fails with <> quotes too
ah
but I think this demonstrates that perl5 mode doesn't quite DTRT
putter looks like the last line of output disappears if it doesn't end in a newline. 04:03
?eval eval(q/print "a\nb\n";/,:lang<perl5>)
evalbot_r15141 1.0 04:03
allbery_b ah, yes, there it is 04:04
oh, and use v5; works in eval with that 04:05
so use v5 works, but something's wrong at the very beginning of a file (or -e). but beginning of an eval works. 04:06
putter really...?
Ziggy6 ?eval 1; use v5; print "test";
evalbot_r15141 OUTPUT[test] Bool::True
Ziggy6 nice
hmm 04:07
?eval 1; use v5; my %h = (a => 'b') print ${a};
evalbot_r15141 Error: ␤Unexpected "print"␤expecting operator or ","
Ziggy6 ?eval 1; use v5; my %h = (a => 'b'); print $h{a};
allbery_b mress:10028 Z$ ./pugs -e 'eval <use 5; my @a = (1, 2); print $a[1], "\n">;'
2
evalbot_r15141 Error: No compatible subroutine found: "&a"
allbery_b (I presume that v6 does the v6 thing with sigils) 04:08
Ziggy6 ?eval 1; use v5; my %h = (a => 'b'); print $h{'a'};
evalbot_r15141 OUTPUT[] Bool::True
putter thinks 'use v5' is a noop for p6 (unintentional), and a noop for p5 (intentional).
allbery_b if I remove the "use 5" I get an empty string as output (v6 mode variable parsing) 04:09
it may ntot be fully implemented, maybe, but it's doing *something* 04:10
Ziggy6 ?eval use v5; my %h = (a => 'b'); print $h{'a'};
evalbot_r15141 1.0 04:11
Ziggy6 odd
putter (evalbot may have p5 embedding disabled for security...) 04:12
end of day for me 04:15
anyone: any feedback on redsix on pil2js proposal welcome.
&
svnbot6 r15142 | szabgab++ | optionally generate index.html by smartlinks.pl 07:06
ingy gour: it's been dead in here for some hours 14:18
gour ingy: well, i'll ask anyway ;)
ingy but it usually wakes up in bursts...
yeah
gour audreyt: are haskell bindings for yaml available somewhere? 14:19
[particle] wikipedia says yes 14:20
look for HsSyck iirc
gaal gour: svn.pugscode.org/pugs/third-party/HsSyck/ 14:23
lambdabot Title: Revision 15142: /third-party/HsSyck
gour thanks, i just got it
long live yaml ;) 14:24
[particle] death to yaml! long live syck!
gaal gour: you may also find this useful: svn.pugscode.org/pugs/src/DrIFT/YAML.hs 14:26
and an example usage -- binding Perl 6 to HsSyck -- at svn.pugscode.org/pugs/src/Pugs/Prim/Yaml.hs 14:27
gour is a bit confused with syck vs. yaml :-(
[particle] syck is an easier to parse subset of yaml 14:28
gour where is some syck spec available? 14:29
[particle] look at yaml.org 14:33
gour [particle]: i saw that and dl-ed yaml spec, but what is missing in syck? 14:36
[particle] actually, maybe it's not a subset anymore, based on the stuff i'm reading now 14:37
it is much faster
oh, here: whytheluckystiff.net/syck/ 14:38
lambdabot Title: ( Syck ): YAML for Ruby, Python, PHP and OCaml
[particle] look at the Progress Meter section
gour [particle]: thanks a lot. this one is very helpful 14:39
gaal hmm? syck's a library that parses and emits yaml. 14:57
it's written in c and has bindings for lots of moose
gaal you may have been thinking of JSON, [particle] 14:58
[particle] no, syck doesn't support all yaml
see the link i just posted -- however it's much more complete than the last time i looked 14:59
gaal yeah, but near enough
[particle] indeed
gaal it's not subset in the sense that it's a well defined intentional part of yaml
[particle] death to yaml! long live syck!
xinming_ misses audreyt. >_< Can anyone tell me if audreyt is busy with work? <-- Sorry If I resend the message. :-) 18:02
nferraz hello! 18:56
anybody here working with perl6 in perl5?
ofer0 hey
kolibrie nferraz: I'm doing a bunch of grammar stuff under v6.pm 19:00
nferraz cool 19:03
I was trying a simple map... 19:04
since it didn't work as I expected, I built a small test case...
pasteling "nferraz" at 194.65.5.240 pasted "map.t (test case)" (22 lines, 325B) at sial.org/pbot/22634 19:09
audreyt TimToady: S04:93 has this form -- is it archaic? 20:38
constant Num PI { 3 }
I thought we removed block-init from "has" 20:39
seems strange to only allow it for constant decl
TimToady seems somewhat archaic 20:44
but the block-init of has was '= { 3 }'
I think the idea was more that you could put either a block or an = on any declaration. 20:45
audreyt my $x { 123 };
TimToady but in the case of a sub, it doesn't autocall.
TimToady but I think that was before we had state = FIRST semantics 20:45
audreyt right. pseudoassign seems to obsolete this form 20:46
TimToady and it conflicts with hash decl now.
audreyt yup.
TimToady so it's dead
any feelings on recent design changes? 20:47
audreyt autotokening etc makes sense. 20:48
a two-level list context seems a little bit bizzare.
what happens when you have multislices composed from multislices 20:49
and you use them in smooth (linear list) context?
does it flatten all the way recursively?
TimToady As far as they're captures, I think.
which is one level for ordinary list return, two for mappish things 20:50
audreyt no, what I mean is (probably not Capture related)
@@multislice := map { $_, map { $_ * $^moose}, 1..5 }, 1..3 20:51
does it flatten to 1,2,3,4,5,2,4,6,8,10, ... ?
TimToady I believe the inner map is flatted by that list context by default
unless you chunky it inside 20:52
audreyt ok, so mlist context doesn't propagate
gaal mooses
stevan moves quickly away from gaal and covers his nose 20:53
audreyt @@multislice := map { $_, $_ * 10 }, 1..3
@@multislice.perl # ( (1, 10) ; (2, 20) ; (3, 30) )
[particle] thinks stevan should cover his own nose
audreyt correct? 20:54
and there's currently no easy way to make three-dimensional literal?
TimToady sec... 20:55
sorry, sitting in a tire store getting a tire repaired... 20:56
using GoogleWiFi that Mountain View provides, yay 20:57
audreyt cool
TimToady um, isn't (1,2;3,4;5,6) 3-D?
@foo[1,2; 3,4; 5,6]
lambdabot Unknown command, try @list 20:58
audreyt well, in arglists it's 2d...
it's 3d when dereferencing
yay inconsistency
TimToady well, my tire's done, so I need to wander on down the road... 20:59
audreyt k
TimToady thanks
pocketa, pocketa, pocketa &
audreyt maybe we call it a Matrix containing 3 derefs.
3d-slices
which is really just a matrix with 3 rows 21:00
audreyt ponders "matrix context"
in which case 21:02
sub f (*@_) { ... flattens into Seq ... }
sub f (*@@_) { ... nonflattens into Matrix ... }
bonesss is away: banho 22:44
audreyt miyagawa: JSON::syck now raises proper exception when passed circular refs 23:05
miyagawa audreyt: great 23:05
audreyt also I finally effected the license change to MIT
which is iirc okay with you, I hope 23:06
miyagawa sure
audreyt also finally structures like 23:07
[ $unicode_string, $some_raw_octets ]
can be dumped fine in YAML::Syck
(the raw octets gets !binary typed and base64 encoded)
(with $YAML::Syck::ImplicitBinary)
but sadly JSON::Syck has no bytebuffer support 23:08
so we're still stuck with either/or there
miyagawa ah 23:08
audreyt limitation of json spec
miyagawa hmm
audreyt no support for x'001234ff' literals
miyagawa 1) dump both as UTF-8
2) dump bytes as UTF-8 and unicode string as \uXXX? 23:09
audreyt uhm
problem is that json has no \xff form
miyagawa yeah 23:10
audreyt so you can't tell \uff from \xff
so it's mostly moot :/
miyagawa I remember that the spec suggests all bytes should be in UTF-8
audreyt that I think is what we currently do
bbiab 23:11
bonesss is back (gone 00:33:43) 23:18