»ö« 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. |
|||
jnthn | Ah, I see | 00:00 | |
Any defaults will be set | |||
r: class Foo { has $.a = 'lol'; submethod BUILD() { say 42; } }; Foo.new.a.say; | |||
p6eval | rakudo e26703: OUTPUT«42lol» | ||
jnthn | Unless you explicitly touch them in your BUILD | 00:01 | |
r: class Foo { has $.a = 'lol'; submethod BUILD() { $!a = 'omgz'; } }; Foo.new.a.say; | |||
p6eval | rakudo e26703: OUTPUT«omgz» | ||
jnthn | r: class Foo { has $.a; submethod BUILD() { } }; Foo.new.a.say; | 00:02 | |
p6eval | rakudo e26703: OUTPUT«Any()» | ||
jnthn | You just get that if you never initialize the attribute | ||
bbkr | I find this BUILD more user friendly than P5 Moose BUILDARGS+BUILD approach | 00:03 | |
perigrin | r: class Foo { has Foo $.a; submethod BUILD () }; Foo.new.a.say; | ||
p6eval | rakudo e26703: OUTPUT«===SORRY!===Missing blockat /tmp/fjdaMotsxl:1------> s Foo { has Foo $.a; submethod BUILD () ⏏}; Foo.new.a.say; expecting any of: scoped declarator constraint postfix infix or meta-infix … | ||
perigrin | bah | 00:04 | |
r: class Foo { has Foo $.a; submethod BUILD () {} }; Foo.new.a.say; | |||
p6eval | rakudo e26703: OUTPUT«Foo()» | ||
timotimo | r: class Foo { has $.a; submethod BUILD() { say $.a } }; Foo.new.a.say; | ||
p6eval | rakudo e26703: OUTPUT«===SORRY!===Virtual call $.a may not be used on partially constructed objectsat /tmp/FwUvCK26Ov:1------> o { has $.a; submethod BUILD() { say $.a⏏ } }; Foo.new.a.say; expecting any of: argument list prefix… | ||
bbkr | timotimo: you have to use $!a | ||
timotimo | oh, that's the trick? | ||
jnthn | Use $!a; $.a is a method call and if you get subclassed then somebody may override it and break your initialization. | ||
perigrin | bbkr: BUILDARGS+BUILD really is a hack because we didn't have the right places to hook into things due to Moose happening at Runtime. | 00:05 | |
jnthn | If you use $!a that can't happen. Even if their subclass has its own $!a. | ||
timotimo | that's a good hint, thanks! | ||
00:07
skids joined
|
|||
bbkr | perigrin: I know. And I don't call it a "bad design" - it is as good as it can be. And BUILDAGRS can give huge boost when you know how to use it. | 00:13 | |
perigrin nods. | 00:14 | ||
bbkr | perigrin: For example I have tons of ORM-like objects which I initialize in "Client->new(id=>3)" way. Then I fetch record from database in BUILDARGS and pass-through it to SUPER::BUILDARGS. This way I can have all attributes in Client class as read-only (faster) and it is 40% faster than initializing attributes in BUILD. | 00:18 | |
timotimo | r: say "a"; map (-> $x { say $x }), ^4; say "b"; | 00:20 | |
p6eval | rakudo e26703: OUTPUT«a0123b» | ||
timotimo | locally, i get only a and b. | ||
and i don't know why. | 00:21 | ||
if i write "sink" before the map, it does work, however | |||
bbkr | timotimo: works for me on HEAD Rakudo built 3 hours ago | 00:22 | |
jnthn | timotimo: That didn't work in the last Rakudo release, I suspect. This is why we implemented sink context... :) | 00:27 | |
timotimo | oh, what, this rakudo is old?! | 00:31 | |
well, gotta run anyway | |||
and then sleep. good ** perl6 :) | |||
jnthn | o/ | 00:32 | |
bbkr | I would love to see blogpost explaining sink context in nearest future. | ||
00:34
bitonic left
|
|||
perigrin | bbkr: yeah that would do it. | 00:35 | |
though I do ro not for speed but because mutability is the devil. | |||
00:39
xinming joined
|
|||
bbkr | This is completely new approach and I assume many users will misunderstand "sink context" because "context" word is strongly associated with "wantarray" behavior in p5. | 00:40 | |
TimToady | sink context is the same as void context in P5 | 00:41 | |
wantarray went away because list vs item is lazily determined; sink, however, is eager by definition, so can flow downhill | 00:45 | ||
(as can eager, with its variants hyper and race) | 00:51 | ||
japhb_ | BTW, I very much like that Perl 6 allows me to specify different levels of "hurry up". I wish I could do that in other contexts ... no pun intended, believe it or not. :-) | 00:52 | |
00:54
am0c joined
|
|||
bbkr | TimToady: i think most programmers do not understand void/sink context idea and cannot use it intentionally, so article that will explain it on simple examples would be valuable. | 00:56 | |
for example very common p5 warning 'use warnings; "a" ~~ /(a)/; print $1' is misunderstood. most people who googled for it are like "why void context warning? it was not useless smart match after all" | 00:59 | ||
TimToady | eval: use warnings; "a" ~~ /(a)/; print $1 | 01:00 | |
01:00
am0c_ joined
|
|||
TimToady | hmm | 01:01 | |
ENOBUUBOT | |||
01:01
am0c_ left
|
|||
TimToady | anyway, sink/void is used *only* to indicate that some procedural code is to be executed; the "Useless use of" warning is for when you're using immutable value semantics in sink context, which requires mutable semantics in order for whatever it is to have side effects | 01:03 | |
since ~~ has side effects, it should not be emitting such a warning | |||
so, a p5 bug | |||
well, arguably a bug, but maybe they're indicating you should use =~ in that situation | 01:04 | ||
bbkr | thanks for explanation :) | 01:06 | |
good night perl6 | |||
TimToady | arguably in p6 ~~ should defer the warning to the rhs somehow | ||
night | |||
01:11
slayer101_ left
01:12
anuby joined
01:23
jeffreykegler joined
01:25
hypolin joined
01:26
jeffreykegler left
|
|||
timotimo | turns out my rakudo really was from before last star :/ | 01:30 | |
but now that i noticed thar, i can do excellent tgings at last! | |||
01:30
raiph joined
|
|||
raiph | TimToady: ping | 01:31 | |
phenny: tell TimToady are you aware there's a summary version of the #perl6 log? Might save you a few days... | 01:38 | ||
phenny | raiph: I'll pass that on when TimToady is around. | ||
japhb_ | r: say [\] 1..10 | 01:44 | |
p6eval | rakudo e26703: OUTPUT«===SORRY!===You can't backslash thatat /tmp/slFpVO08KF:1------> say [\⏏] 1..10 expecting any of: infix or meta-infix infix stopper prefix or term prefix or meta-prefix» | ||
japhb_ | r: say [\+] 1..10 | ||
p6eval | rakudo e26703: OUTPUT«1 3 6 10 15 21 28 36 45 55» | ||
01:45
whiteknight joined
01:50
dayangkun left
01:59
raiph left
|
|||
jnthn | 6guts.wordpress.com/2013/01/10/a-bu...kudo-news/ # blog post | 02:05 | |
'night, #perl6 | |||
02:08
odoacre joined
02:21
lichtkind left
02:23
werwerwer_ joined,
werwerwer left
02:27
whiteknight left
02:36
japhb_ left
02:46
cognominal left
|
|||
dalek | ecs: e5b8663 | larry++ | S06-routines.pod: --> as context for code body Allow definite values and containers on the right side of -->, in order to make a way to declaratively distinguish procedural code from functional without creating more keywords like "proc" or "fun", which doesn't help distinguish methods. Also allow warning on loops accidentally treated as functional maps due to lack of a return spec. |
02:54 | |
TimToady | Note that this is consistent with the change to STD some weeks ago. | 02:56 | |
phenny | TimToady: 01:37Z <raiph> tell TimToady are you aware there's a summary version of the #perl6 log? Might save you a few days... | ||
TimToady | std: sub foo ( --> Nil ) { "I am a useless use of string in sink context" } | 02:57 | |
p6eval | std a8bc48f: OUTPUT«ok 00:00 44m» | ||
TimToady | dinner & | 02:58 | |
02:59
marloshouse_ left
03:01
marloshouse joined
03:07
dayangkun joined
03:13
aindilis` joined
03:17
cognominal joined
03:40
libertyp1ime joined,
libertyp1ime left
03:43
orafu left,
orafu joined
04:15
anuby left
04:20
woosley joined
04:21
anuby joined
04:49
sisar joined
04:52
cognominal left
05:11
SeaRobber_ joined
05:16
_jaldhar joined
05:18
Chillance joined
05:19
skids left,
rindolf joined
05:28
telex left
05:30
slayer101_ joined
05:33
rindolf left
05:34
rindolf joined
05:37
telex joined
05:38
slayer101_ left
05:40
slayer101_ joined
05:42
tokuhiro_ joined
05:45
LV joined
05:49
slayer101_ left
05:50
slayer101_ joined
05:52
rindolf left
05:53
rindolf joined
05:55
slayer101_ left
05:56
kaleem joined
05:57
LV left,
LordVorp joined
05:58
slayer101_ joined
06:00
Chillance left
06:06
cognominal joined
06:08
sftp left
06:09
sftp joined
06:11
thou joined
06:12
rindolf left
06:13
rindolf joined
|
|||
moritz | jnthn: I think that .sink works as expected in bbkr's example | 06:19 | |
06:19
snarkyboojum joined
|
|||
moritz | once for the nqp::can, once for the actual call | 06:19 | |
06:20
PacoAir joined
|
|||
moritz | we could certainly optimize it with a call-method-if-exists op that only does one find_method | 06:20 | |
06:24
PacoAir left
06:29
rindolf left,
rindolf joined
06:43
FROGGS[mobile] joined
|
|||
FROGGS[mobile] | morning | 06:43 | |
06:45
tokuhiro_ left
06:46
tokuhiro_ joined
06:49
rindolf left,
rindolf joined,
SamuraiJack joined
06:50
cognominal left
06:51
tokuhiro_ left
06:52
cognominal joined
07:00
quester joined
|
|||
tadzik | hello | 07:02 | |
07:04
cognominal left
|
|||
sorear | hello tadzik | 07:06 | |
07:11
vm joined
07:12
cognominal joined
07:13
erkan joined,
erkan left,
erkan joined,
rindolf left
07:14
rindolf joined
07:33
rindolf left
07:34
vm left,
rindolf joined,
aloha joined,
sisar left
07:36
FROGGS joined
|
|||
FROGGS | morning (again) | 07:39 | |
07:40
FROGGS[mobile] left
07:42
rindolf left,
aloha left
07:43
aloha joined,
rindolf joined
07:55
rindolf left,
rindolf joined
07:56
PacoAir joined,
cognominal left
08:00
PacoAir left
|
|||
moritz | jnthn++ # blog post | 08:02 | |
TimToady++ # spec commit | |||
08:07
ServerSage joined
08:12
rindolf left,
rindolf joined
08:21
quester left
|
|||
FROGGS | TimToady: do you think it is possible to change STD.pm6 in a way that I can use it to dump the GLOBAL symbols of a single file? | 08:23 | |
TimToady: I am trying to do this: github.com/FROGGS/p6-File-Inspector-Namespace | 08:24 | ||
bbkr | good morning perl6 | ||
FROGGS | TimToady: ... because IMO we need something like this to fulfil the requirements given by S11/versioning, I can describe the problems and the need for it if you want to know | 08:25 | |
08:26
rindolf left
08:27
rindolf joined
|
|||
FROGGS | moritz++ # $socket.read commit | 08:34 | |
moritz | testing of that commit would be very welcome and helpful | 08:35 | |
FROGGS | hmmm, that shouldnt be too hard | ||
moritz | probably not | 08:38 | |
just do a read of 16k, and on the write site, 4 x 4k | |||
08:38
slayer101_ left
|
|||
moritz | and check if the read actually returned 16k bytes | 08:38 | |
FROGGS | right | 08:40 | |
08:44
wk joined,
wk is now known as Guest62890
08:47
rindolf left,
rindolf joined
|
|||
bbkr | i've already tested socket changes and everything works as expected. but I have no idea how to write spectestst for it without fork | 08:49 | |
08:52
sqirrel joined
|
|||
bbkr | also I've tested LWP::Simple affected by this bug on couple of sites and also everything works | 08:53 | |
FROGGS | cool | 08:54 | |
bbkr | so now only get() bug remains - rt.perl.org/rt3/Ticket/Display.html?id=116302 (affected Star module - HTTP::Easy) | 08:55 | |
08:59
rindolf left,
grondilu joined
09:00
rindolf joined
|
|||
grondilu | couldn't I use $^ as a self-declared anonymous variable? Like: sub id { $^ }; say id "hello"; | 09:01 | |
moritz | that's what $_ is for | 09:02 | |
erm, not in a sub | |||
no | |||
09:04
erkan left
09:05
bitonic joined
|
|||
bbkr | I've just also tested few unicode cases - where chunk ends in the middle of multibyte char / read()ing multibyte char partially, etc. and also everything works. moritz++ | 09:07 | |
including cases where read param is bigger than available chars. and sleep on server side. | 09:10 | ||
FROGGS | r: say 'abc'.substr( *-1 ) | ||
p6eval | rakudo e26703: OUTPUT«c» | ||
FROGGS | n: say 'abc'.substr( *-1 ) | ||
p6eval | niecza v24-16-g89e47b6: OUTPUT«c» | ||
09:13
dayangkun left
09:15
kaleem_ joined
|
|||
Woodi | morning #perl6 :) | 09:16 | |
bbkr: I just thinked, what are danger corners for utf8 'parsing' ? eg. www.cprogramming.com/tutorial/unicode.html is simple lib for utf8 but described as not quite secure and for 'internals' only... | 09:18 | ||
09:19
kaleem left,
kaleem joined
|
|||
Woodi | looks utf8 is dangerous as file paths and html... | 09:20 | |
09:22
kaleem_ left,
rindolf left,
rindolf joined
|
|||
bbkr | Woodi: I'm not sure that the described dangers are an issue in a language that distinguish Buf and Str types with internal utf8 representation of Str type and strict Buf->Str decode | 09:24 | |
09:25
cognominal joined
09:27
rindolf left
09:28
rindolf joined
|
|||
bbkr | Woodi: in C you have just *char for both buffers and strings, charset information is not passed along with it, that's why it may get messy when it is passed from unicode aware method to not-aware one | 09:28 | |
09:29
erkan joined,
erkan left,
erkan joined
|
|||
Woodi | I just looked for "internal utf8 repr of Str" but looks bigger libraries just use int32 internally so not realy 'internal utf8'... | 09:29 | |
09:31
dakkar joined
09:34
SamuraiJack left
09:42
Psyche^ joined
|
|||
FROGGS | bbkr: my socket.read test is done, just need to recheck | 09:45 | |
09:45
Patterner left,
Psyche^ is now known as Patterner
09:46
rindolf left,
rindolf joined
|
|||
jnthn | morning o/ | 09:48 | |
arnsholt | o/ | 09:51 | |
moritz | \o | 09:52 | |
arnsholt | jnthn: Speaking of the JVM stuff, chromatic said something about an "impedance mismatch due to a foreign memory model" (quoting from memory) in a recent missive. Do you have any idea what he might be referring to? | 09:54 | |
10:02
cibs left
|
|||
jnthn | Not exactly, but since the place we worry most about the memory model is REPRs, I guess we could try and weigh up whether the statement is correct by seeing how well things are going on the JVM implementation of 6model from that angle. | 10:03 | |
10:04
hypolin left
|
|||
jnthn | Given that my JVM 6model implementation's P6opaque probably already represents objects more efficiently than the 6model on Parrot one, I think we can conclude that whatever impedance mismatch we have on the JVM, it's smaller than the Parrot one we already have. | 10:05 | |
(With regard to memory model, that is.) | |||
arnsholt | That's definitely an interesting data point | ||
10:06
rindolf left,
rindolf joined
|
|||
nwc10 | does the JVM offer a richer primitive type system? In that, as I understand it, Parrot is "INTVAL", "NUMVAL", String and PMC (and the last 2 are effectively just pointers to something) | 10:06 | |
arnsholt | I think JVM has a bit more | 10:07 | |
jnthn | nwc10: A bit more. | ||
arnsholt | float and double at least, and int | ||
But not signed/unsigned | |||
moritz | before I read jnthn++'s explanation, I'd thought that parrot gives us the option to use un-GCed memory, and java doesn't | ||
arnsholt | And byte? | ||
nwc10 | and you can't be sure whether INTVAL is 32 or 64 bits. And NUMVAL is probably a 64 bit IEEE float | ||
jnthn | Yes, byte | ||
moritz | and that might or might not be relevant | 10:08 | |
nwc10 | you can build small things from bytes. (Not sure how often that ends up being useful) | ||
jnthn | moritz: Even the JVM has an escape hatch there, but so far I've not needed to use it. Unmanaged stuff probably gets in the way of a bunch of analysis. | ||
10:08
SmokeMachine joined
|
|||
moritz | new java versions offer unsigned arithmetics, iirc | 10:09 | |
jnthn | It's true that there's no stack allocation exposed BUT any modern JVM will be doing escape analysis and turning some heap allocations into stack ones anyway. | ||
moritz | so I guess that new JVMs have optimizations for it | ||
arnsholt | Oh, neat! | ||
moritz | blogs.oracle.com/darcy/entry/unsigned_api | 10:11 | |
10:13
cibs joined
|
|||
jnthn | OK, I gotta do some $dayjob bits for a while. :) | 10:13 | |
10:23
anuby left
10:25
rindolf left,
rindolf joined
|
|||
arnsholt is becoming increasingly proficient at wrangling Makefiles | 10:44 | ||
This may or may not be a good thing ^_^ | |||
moritz | it's certainly helpful | ||
arnsholt | That's certainly true | 10:46 | |
10:47
rindolf left,
rindolf joined
11:00
rindolf left
11:01
rindolf joined
|
|||
dalek | ast: bbc7541 | (Tobias Leich)++ | S32-io/IO-Socket-INET. (2 files): RT #116288, test that $socket.read will give us the whole cake Even if .recv will get several chunks, read will concatenate all these. |
11:01 | |
jnthn | .oO( the WHOLE cake? accidentally? ) |
11:03 | |
FROGGS | jnthn: whats wrong with it? | 11:05 | |
ahh | |||
like whole-grain cake | 11:06 | ||
bah | |||
11:07
thou left
|
|||
dalek | ast: 033cbc9 | (Tobias Leich)++ | S32-io/IO-Socket-INET. (2 files): RT #116288, linked ticket to test case |
11:09 | |
11:13
rindolf left
11:14
rindolf joined
11:17
kresike joined
|
|||
kresike | hello all you happy perl6 people | 11:17 | |
tadzik | kresike! \o/ | ||
kresike | tadzik, o/ | ||
11:23
dayangkun joined
11:26
SamuraiJack joined
11:32
rindolf left
11:33
rindolf joined
11:35
SamuraiJack left
11:41
MayDaniel joined
11:59
dayangkun left
12:10
SamuraiJack joined
12:12
dayangkun joined
12:13
SeaRobber_ left
12:27
_jaldhar left
|
|||
FROGGS | moritz: do you wanna close it? rt.perl.org/rt3/Ticket/Display.html?id=116288 | 12:33 | |
moritz | FROGGS: I want to give .read a default buffer size first | 12:41 | |
hanging on .read() isn't good | 12:42 | ||
FROGGS | you mean if I dont supply the desired bytes to read? | 12:43 | |
moritz | yes | ||
if you don't know how many bytes to read, you just use .recv | 12:44 | ||
FROGGS | is there a flag from the server that tells one that the received data is just a chunk and that there is more (later) ? | 12:45 | |
moritz | well, there's .eof | ||
(if the client closes the connection after sending the last chunk) | |||
FROGGS | s/client/server/ ? | 12:46 | |
12:46
hash_table joined
|
|||
moritz | s/client/remote/ | 12:46 | |
FROGGS | k | ||
moritz | depends on whether you're listening on the socket or not | ||
FROGGS | so there will be nothing for persistent connections... | 12:47 | |
like: see, I have 2MB to send, here is the first chunk... | |||
so the receiving client would know: ahh I got 256kB but there is more | 12:48 | ||
because if the remote will send exactly 256kB you won't know if it is just a chunk or if it is all | |||
moritz | no | 12:51 | |
12:51
hash_table left
|
|||
moritz | you need some information on a higher protocol level for that | 12:51 | |
nwc10 | IIRC you (officially) don't even know if there is more on a short read. Only if the read returns 0 octets | ||
but IIRC reads from disks are never short. | 12:52 | ||
and this is assumed by too much stuff to change | |||
moritz | (we're talking about sockets, not discs) | ||
nwc10 | I realise. But on sane operating systems, you can treat all file descriptors the same, if you need to | 12:53 | |
arnsholt | And by sane OSes, we all agree that the only sane one is Plan 9, right? O;) | ||
nwc10 | that wasn't quite what I was thinking, but I'm prepared to accept this argument | 12:54 | |
arnsholt | Mostly kidding, of course =) | ||
moritz | well, that rules out parrot as a sane OS :-) | 12:55 | |
nwc10 | I'm not sure what the biggest bout of insanity on the JVM is. long isn't atomic, is it? | 12:56 | |
jnthn | That probably depends if you're on a 32-bit or 64-bit. | 12:57 | |
So no, you shouldn't rely on it. Same story on CLR, fwiw. | |||
woo, a pull request | |||
12:59
cognominal left
|
|||
dalek | p-jvm-prep: 93418f5 | (Jonathan Stafford)++ | / (3 files): implements nqp::sha1 Implements nqp::sha1 using the UTF-8 encoding of the input string. Although a test is included (of an ASCII-compatible string), when a non-ASCII input string is provided the test will fail. For example, if the input string is "Iñtërnâtiônàlizætiøn" the SHA-1 hash of the UTF-8 encoding should be 4B9C5D2FA4C83F7561787EB4E5F7F06A2CD47425 (according to both the JVM and nqp::sha1 on Parrot), but the test fails. I'm not sure if this is an issue with using non-ASCII characters in the test file or something deeper. |
12:59 | |
p-jvm-prep: baf26c3 | jonathan++ | / (3 files): Merge pull request #4 from thecabinet/master nqp::sha1 |
|||
arnsholt | nwc10: I don't know about long, but double is supposed to be atomic (IIRC there's even a fairly detailed discussion in the JVM spec about ways to avoid word-tear on 32-bit machines) | 13:00 | |
jnthn | Oh...maybe I'm wrong on long then. | ||
arnsholt | At least I think so. It's been a while since I looked at it | 13:01 | |
dalek | p-jvm-prep: 03bad2f | jnthn++ | docs/LHF.md: Remove completed task. |
13:02 | |
FROGGS | jnthn: there is no LHF.md for nqp/rakudo, right? | ||
jnthn | FROGGS: No, though sometimes we tag RT tickets with [LHF] or so | 13:03 | |
FROGGS | hmmm, then I should search for it ;o) | ||
thanks | |||
13:07
cognominal joined
|
|||
dalek | ast: f493956 | jnthn++ | S14-roles/conflicts.t: Unfudge some now-passing tests. |
13:07 | |
timotimo | jnthn: how does one find what tests to unfudge? purely by luck? or by saying "i'll work on rakudo so that this test no longer needs to be fudged!"? | 13:12 | |
tadzik | there's autounfudge somewhere, isn't there? | ||
arnsholt | There's a script that runs the test suite without fudging as well I think, and reports fudged tests that run/pass | 13:13 | |
timotimo | ah, that's useful | ||
moritz | tools/autounfudge.pl iirc | ||
or util/ or so | |||
but in this case, they were passing TODO tests | 13:14 | ||
which you can see at the end of a spectest summary | |||
timotimo | i must say: it seems to me that perl projects come up with decent tooling all the time | ||
jnthn | timotimo: I fixed something and saw the extra passes last night | 13:15 | |
Just forgot to push the test | |||
timotimo | i'm considering writing (or at least drafting) that article/blogpost about sink/void context today. | 13:16 | |
moritz | timotimo: I'll be happy to proof-read it for you | ||
timotimo | thanks. for now: errands & | 13:17 | |
13:18
erkan left
13:30
colomon left
|
|||
Woodi | about nqp::sha1 above - isn't it a utf8 string engine bug not filtering malformed bytes in the first place ? Str should encapsulate such things IMO | 13:31 | |
moritz | Str should know nothing about UTF-8 | 13:32 | |
Buf.decode should | |||
and whatever other ways there are to create strings from UTF-8 bytes | |||
Woodi | Str user API should not know, but internally it should "explode" on malformed sequence... | 13:34 | |
moritz | Str is encoding-agnostic. Would could it '"explode" on malformed sequence...'? | 13:35 | |
s/Would/How/ | 13:36 | ||
Woodi | I think about Str internals vs externals... | ||
moritz | Str internals might know nothing about UTF-8 either | ||
niecza's Str internals only know about UTF-16, I think | |||
arnsholt | If you have an invalid byte sequence, it should be impossible to get a Str object at all | ||
moritz | right. | 13:37 | |
and just to be clear, there are no "invalid byte sequences" in general, only "invalid byte sequences for the encoding we are trying to decode right now" | |||
arnsholt | A Str with invalid internal data regardless of whether the native representation is UTF-8 or -16 or pink unicorns is a compiler bug | ||
moritz: Yeah, that's a necessary qualifier | 13:38 | ||
moritz | what's invalid UTF-8 in one context can be perfectly valid Latin-1 | ||
Woodi | things depends on how complicated Str is... is it internally array of bytes without creating logic or kind of str engine with conversions/constructions methods... | ||
s/bytes/somebettertermformemorybits/ :) | 13:39 | ||
moritz | Woodi: that's totally not the point. The point is that as soon as you have a Str object (which is immutable), it must have been validated already | ||
Woodi | yes | ||
moritz | it's not at all relevant how complicated Str is | ||
Woodi | do invalid Str's are allowed ? | 13:41 | |
moritz | No | 13:42 | |
arnsholt | No. | ||
Woodi | \o/ | ||
moritz | that's what we've been trying you to tell you for five minutes now :-) | ||
Woodi | but in example above nqp::sha1 was using invalid Str with 8-bit-ascii encoding ? | 13:43 | |
jnthn | Woodi: It's on nqp-jvm, where I've spent about zero time making sure you can even have a non-ASCII string literal so far. | ||
I'll get something is going wrong in the JAST -> bytecode phase. | 13:44 | ||
*bet | |||
Woodi | not blaming anyone :) especially jnthn++ ! just looking what is going on... | ||
or maybe assumption was that nqp::str can contain 8-bit str ? or maybe it is allowed on nqp lvl ? | 13:45 | ||
jnthn | Woodi: I didn't think you were, just saying don't rely on nqp-jvm doing sensible things that Perl 6 would yet because it's very early days. | 13:46 | |
It could be as easy as the assembler reading the JAST dump in the wrong encoding... | 13:47 | ||
Woodi | my point is such errors should be catched on Str lvl... | 13:48 | |
moritz | NO IT SHOULD NOT | ||
we've been discussing this enough now, haven't we? | |||
Woodi | oki, thinking more | ||
13:48
dayangkun left
|
|||
jnthn | In a fully implemented Perl 6, Str is NFG, which is more of a data structure than encoding | 13:49 | |
13:56
cognominal_ joined
13:57
cognominal left
14:03
PacoAir joined
|
|||
moritz | I hate twitter. An awesome hashtag comes up, and then it's flooded with people tweeting about how awesome that hashtag is, and then you are swamped by meta tweets, and it becomes boring | 14:05 | |
14:05
dakkar left
14:06
dakkar joined
|
|||
moritz | happening right now to #overlyhonestmethods | 14:06 | |
arnsholt | Yeah, that's a bit annoying | ||
timotimo | moritz: make some meta-meta-tweets to remedy the situation, is my advice. | 14:08 | |
14:09
dayangkun joined
|
|||
moritz | nah, just complain about it here, and be done with it :-) | 14:12 | |
arnsholt | Speaking of #overlyhonestmethods, have you seen research in progress? | 14:21 | |
moritz | I've mostly seen research in stand-still | ||
in progress too, but that was very rare | |||
arnsholt | researchinprogress.tumblr.com/ | ||
As a computational linguist, my favourite is researchinprogress.tumblr.com/post/...e-baseline | 14:23 | ||
14:23
atrodo joined
14:24
tokuhiro_ joined
|
|||
FROGGS | would it makes sense to add a trait like "is_hidden_from_introspection" for things like Buf.Str ? | 14:28 | |
because: | |||
r: say so Buf.^can('Str') | |||
p6eval | rakudo e26703: OUTPUT«True» | ||
FROGGS | r: say Buf.Str | 14:29 | |
p6eval | rakudo e26703: OUTPUT«Cannot use a Buf as a string, but you called the Str method on it in method Str at src/gen/CORE.setting:7320 in block at /tmp/mXbE1vhlK4:1» | ||
moritz | FROGGS: no. Don't have the runtime lying to itself | ||
jnthn | No, it's a bad idea. | ||
moritz | FROGGS: it's simply wrong to assume that you can call every method you find. | ||
jnthn | Remember that .^can is probably used by many internaly bits too | ||
FROGGS | hmmm, so I cant really use .^can('Str') for testing if something can be stringified... | 14:30 | |
14:30
tokuhiro_ left
|
|||
FROGGS | sad that is | 14:30 | |
(not that I need it right now) | |||
jnthn | FROGGS: Given Mu has a Str method, *everything* will claim to be able to be stringified ;) | 14:31 | |
[Coke] | the only way to know for sure if calling a method will work is to call it. | 14:32 | |
FROGGS | bah, arguments -.- | ||
:P | |||
brbr | |||
brb | |||
[Coke] | can is necessary but not sufficient? | 14:33 | |
moritz | correct | 14:34 | |
[Coke] | (I mean, I know that, I just wanted to restate it) | 14:42 | |
er, to ask if that was a better way to restate it. | |||
bah. time for coffee #2 | |||
14:50
stopbit joined
14:56
am0c left
15:00
am0c joined
15:06
kaare_ joined
15:08
cognominal_ left,
cognominal joined
15:11
am0c left
15:13
SunilJoshi joined
15:20
werwerwer_ left
15:21
inokenty joined
15:30
wtw left
15:40
rindolf left
15:42
rindolf joined
15:50
kaleem left
15:55
Guest62890 left
15:58
cognominal left
16:00
bluescreen10 joined
16:02
kaleem joined
16:07
SunilJoshi left
16:08
SunilJoshi joined
|
|||
flussence | re: sha1 utf8 - maybe it's using the wrong normalisation form | 16:09 | |
FROGGS | r: say 0xbeef.chr; say Buf.new(0xbe, 0xef).decode | 16:12 | |
p6eval | rakudo e26703: OUTPUT«뻯Malformed UTF-8 string in method decode at src/gen/CORE.setting:7344 in block at /tmp/YwdAhLtMSs:1» | ||
FROGGS | how can it be malformed? | ||
flussence | r: say 0xbe.fmt('%b') | 16:14 | |
p6eval | rakudo e26703: OUTPUT«10111110» | ||
flussence | that's a continuation byte | ||
bit 6 isn't set | |||
16:15
SunilJoshi left
|
|||
FROGGS | r: say 0xbeef.fmt('%b') | 16:15 | |
p6eval | rakudo e26703: OUTPUT«1011111011101111» | ||
16:15
SunilJoshi joined
16:17
skids joined
|
|||
kresike | bye folks | 16:18 | |
16:18
kresike left
|
|||
FROGGS | flussence: I dont get it | 16:18 | |
ahh | 16:19 | ||
r: say Buf.new(0xbeef).decode | |||
p6eval | rakudo e26703: OUTPUT«뻯» | ||
FROGGS | I thought Buf.new only takes bytes | 16:20 | |
flussence | it can take 16 and 32 bit values, and there's supposed to be a "utf8" subset (which nothing supports) | 16:21 | |
FROGGS | woulde it be sane to handle Buf.new(0xbe, 0xef) like Buf.new(0xbeef) when trying to .decode? | 16:22 | |
( .decode('utf-8') that is ) | 16:23 | ||
so that .decode.chars will give 1 instead of 2 | 16:24 | ||
flussence | that'll make it impossible to determine if you have a valid byte buffer or an invalid stream that happens to decode as some other charset | 16:25 | |
FROGGS | I mean it should do its best to give you an utf-8 string if you ask it to, internally it can/should stay a bytestream | 16:29 | |
flussence | But you're no longer asking for utf-8 in that case, you're expecting it to decode as utf-16. | 16:30 | |
16:31
Chillance joined
|
|||
FROGGS | how comes that? IMO this is utf-8 | 16:31 | |
one to four bytes per character | |||
16:32
colomon joined
|
|||
FROGGS | two in this case | 16:32 | |
flussence | r: say 0xbeef.chr.encode('utf-8') | ||
p6eval | rakudo e26703: OUTPUT«Buf:0x<eb bb af>» | ||
FROGGS | hmmm | ||
damn | |||
say 0xebbbaf.chr | 16:33 | ||
r: say 0xebbbaf.chr | |||
p6eval | rakudo e26703: OUTPUT«Invalid character for UTF-8 encoding in method chr at src/gen/CORE.setting:3104 in block at /tmp/kOTnJVXaVr:1» | ||
flussence | utf-8 is defined only for codepoints up to 1FFFFF | ||
FROGGS | r: say 0xbeef | 16:34 | |
p6eval | rakudo e26703: OUTPUT«48879» | ||
FROGGS | 0xbeef.chr.encode('utf-8') <-- this should give me the byte representation of that utf-8 char, no? | 16:35 | |
flussence | yes. | 16:36 | |
FROGGS | so why isnt it valid utf-8? | ||
flussence | or more correctly, it will give you the valid utf-8 byte representation of that unicode char | ||
FROGGS | r: say 0xbeef.chr.encode('iso-8859-1') | 16:37 | |
p6eval | rakudo e26703: OUTPUT«Lossy conversion to single byte encoding in method encode at src/gen/CORE.setting:4558 in block at /tmp/xLxLXmO7zq:1» | ||
FROGGS | k | ||
r: say 0xbeef.chr.encode('utf-8') # I'm not sure but I believe you are encoding an already as utf-8 encoded string as utf-8, so it gets messed up | 16:39 | ||
p6eval | rakudo e26703: OUTPUT«Buf:0x<eb bb af>» | ||
flussence | You are encoding an *abstract unicode codepoint* into a *binary representation*. Unicode is *not* utf-8 and it is *not* getting messed up. | 16:41 | |
FROGGS | so 0xbeef is the unicode codepoint that chr can handle | 16:42 | |
flussence | Yes, exactly. | ||
FROGGS | okay | 16:43 | |
need to think while walking home | 16:44 | ||
see you later | |||
16:44
FROGGS left
16:47
SunilJoshi left
16:49
sqirrel left
16:55
spider-mario joined
|
|||
rurban | pmichaud: github.com/rakudo/rakudo/pull/93 is now ready | 17:01 | |
17:10
FROGGS joined
|
|||
timotimo | hm. the highlighting program my blog software uses doesn't handle perl6 yet :| | 17:21 | |
17:23
kaleem left,
thou joined
17:32
wtw joined
|
|||
dalek | ecs: 4909197 | masak++ | S06-routines.pod: [S06] typo fixes |
17:36 | |
masak | (evenin', #perl6) | ||
TimToady | (mornin', masak) | 17:38 | |
timotimo | trying to come up with sensible and good examples for when lazy-by-default-for can bite you, somewhat unsuccessfully | 17:39 | |
TimToady | it tends to bite you on the non-lazy end, when you save up something that shouldn't be cached, wasting memory | 17:40 | |
it tends to be less efficient if the lazy algorithm can't deduce when to do batches, and you get too much control flow overhead | 17:41 | ||
oh way, you said "-for" | 17:42 | ||
17:42
kaleem joined
|
|||
TimToady | *wait | 17:42 | |
timotimo | were you thinking about "lazy-by-default" instead? | 17:43 | |
TimToady | yes | ||
timotimo | now what you said makes more sense to me :) | ||
TimToady | allowing the --> to provide context for the final statement fixes most of the badness, as far as I can see | 17:44 | |
(plus warning if --> isn't there, and the for wants it) | |||
doy | timotimo: for @items -> $item { check($item) }, at the end of a function, where check is meant to throw exceptions on error and do nothing else | ||
is the context where i ran into it | |||
TimToady | but then this is a function that would be marked with --> Nil since you're obviously not wanting to return anything | 17:45 | |
doy | (if you proceed to then call that function in void context) | ||
right | |||
TimToady | and --> Nil would put it into sink context | ||
doy | if there was a warning/error for that, it would help a lot | ||
TimToady | just specced last night | ||
"if you proceed to call that function in void context": What would you expect it to return if you didn't call it in void context? | 17:47 | ||
17:48
wtw left
|
|||
doy | well, nothing(: | 17:48 | |
17:48
kaleem left
|
|||
TimToady | which kind of nothing? :) | 17:48 | |
jnthn will try and get the warning/changes in before the Jan release. | |||
doy | as in, i wouldn't have any particular expectation | ||
(: | |||
jnthn | TimToady: I'm a little curious it's parsed as a <parameter>. | ||
TimToady: sub foo($x, $y --> $z) { } | 17:49 | ||
TimToady: What does this actually mean? | |||
TimToady | the spec says now | ||
jnthn | I read it but didn't get it :) | ||
The variable case, that is. | |||
TimToady | S06:687 | 17:50 | |
jnthn | Presumably it's declaring $z | ||
TimToady | yes, and then it implicitly returns $z at the end, since "return $z" is illegal | ||
could even do --> $!foo | |||
moritz likes it | |||
TimToady | so you can write an accessor with an empty body | 17:51 | |
jnthn | OK, but the default for parameters is that $z is a readonly alias...apart from there's nothing for it to be an alias for :) | ||
moritz | well, that would need to have a different default | ||
TimToady | yes, the semantics would have to fudge to rw, since it's an "out" parameter | ||
jnthn | OK, then it makes a bit more sense. | ||
jnthn wonders what <parameter> may be implying now that will make implemetning this a little odd | 17:52 | ||
I hope not too much :) | |||
Is the detection of "for" as the last statement syntactic? | |||
As in, are we looking for an explicit "for" loop there? Not a call to map? | 17:53 | ||
TimToady | yes, same pass as would decide whether to put the sink on it or return it | ||
jnthn | Which was the "yes" to? :) | ||
The sink analysis is semantic :) | |||
afaik, anyway | |||
TimToady | but you need to know where the statements are | ||
jnthn | sub foo() { for 1..10 { .say } } # warning | 17:54 | |
sub foo() { .say for 1..10 } # warning | |||
TimToady | any loop, in fact | ||
jnthn | sub foo() { 1..10.map: *.say } # warning or not? | ||
TimToady | conservatively, we can warn on that too, and see if any use cases pop up to the contrary | 17:55 | |
the other slightly unresolved thing is what to put after the --> if you *do* want to return a list | |||
[Coke] wonders if there is a writeup as to why it makes sense for those 2 to be warning? | |||
timotimo | doy: i tried to construct a pretty example like that, but now i fail to cause the for at the end of the sub to not be sinked | ||
TimToady | List? Parcel? | ||
timotimo | i seem to be confused as to what void context means, perhaps? | ||
[Coke] | is it the implicit return? | ||
(that's easy. let me say "void sub foo() {... }" ! ;) | 17:56 | ||
jnthn | TimToady: Positional or Iterable is most general I guess, but dpeneds what we want to encourage | ||
TimToady: Why do other kinds of loop need the warning? Not because of laziness, but to avoid saving all the values? | |||
TimToady | well, any loop that returns all its values :) | 17:57 | |
jnthn | (Rakudo doesn't currently implement the "collect the values" thing for loops other than for...) | ||
TimToady | is it better to spec "loop" as primitive, or to look for use cases for loop returning values? | 17:58 | |
jnthn | I'd be curious to see some good use cases (e.g. where it's better than "for") | 17:59 | |
I guess there's a consistency argument. | |||
TimToady | might be a foolish consistency | 18:00 | |
jnthn | Aye | ||
jnthn sometimes wonders if for/map are ;) | |||
But I guess list comprehensions make it worthwhile... | |||
TimToady | that's partly for pedagogy too | ||
and to stomp the meme that differentiates map from for :) | 18:01 | ||
jnthn | I think a lot of people's prior experience of "for" won't be that it's a kind of map (that is, that it produces results) | ||
TimToady | sure, but we're tilting the playing field toward FP here | 18:02 | |
18:02
jeffreykegler joined
|
|||
timotimo | do for and map work exactly the same in perl6? or are there subtle differences? | 18:02 | |
18:02
snarkyboojum left
|
|||
jnthn | I think "you have to write --> Nil" will actually be harder to teach/justify, for what it's worth. | 18:02 | |
18:02
moritz joined,
snarkyboojum joined,
gfldex joined,
steven_ joined,
revdiablo joined,
phenny joined
18:03
_ilbot joined,
p6eval joined,
ChanServ sets mode: +v p6eval
|
|||
jnthn | Also, while so far we've had plenty of people putting type constraints on parameters in Perl 6 code, I've seen much less of that happen with return values. | 18:03 | |
er, return types | 18:04 | ||
jeffreykegler | hi. Is there a resource where I can check out how the Perl 6 team handles collaboration? | 18:05 | |
I mean things like github, etc. | |||
The technical stuff | |||
A project of mine is going collaborative, so as usual I am here to steal ^W borrow ideas | 18:06 | ||
18:06
Celelibi joined
|
|||
timotimo | can i get a small example where a for loop at the end of a sub doesn't get executed because of its lazyness? | 18:06 | |
jnthn | While I'm all for biasing towards FP, in reality I'm not sure "for" will be naturally seen as an FP construct. | 18:07 | |
arnsholt | jeffreykegler: One facet of the Perl 6 project which seems pretty special is the liberal attitude to commit bits | ||
timotimo | r: sub test() { for ^2 { print "hip " } }; test(); say "hooray!" | ||
p6eval | rakudo e26703: OUTPUT«hip hip hooray!» | ||
timotimo | r: sub test() { for ^2 { print "hip " } }; test(); | ||
p6eval | rakudo e26703: OUTPUT«hip hip » | ||
jnthn | timotimo: It's not "doesn't get executed" | ||
masak | jeffreykegler: we do most of the collaboration under the perl6/ account of github. | ||
TimToady | well, and here on IRC | 18:08 | |
jnthn | r: sub test() { my $*x = 2; for ^2 { print "hip " } }; my $*x = 1; test(); | ||
p6eval | rakudo e26703: OUTPUT«hip hip » | ||
arnsholt | Getting a commit bit to stuff like the specs or roast is mostly a question of showing some kind of interest | ||
jnthn | r: sub test() { my $*x = 2; for ^2 { print "hip $*x " } }; my $*x = 1; test(); | ||
p6eval | rakudo e26703: OUTPUT«Dynamic variable $*x not foundcurrent instr.: 'throw' pc 329834 (src/gen/CORE.setting.pir:147383) (src/gen/CORE.setting:9248)called from Sub 'Str' pc 359008 (src/gen/CORE.setting.pir:159143) (src/gen/CORE.setting:10396)called from Sub 'Stringy' pc 146729 (src/ge… | ||
TimToady | jeffreykegler: there's also github -> IRC feedback via the dalek bot | ||
jeffreykegler | TimToady: yes your IRC example has already convinced me that we need to converse in public | ||
timotimo | so the main problem is different order of instructions? | 18:09 | |
jeffreykegler | Something I certainly would not have thought of on my own | ||
TimToady | some info and discussion flows on mailing lists too, but that tends to be secondary | ||
jeffreykegler | masak: whose is the repository? that is, what github user? | ||
doy | timotimo: seems to only happen with methods, not functions? | ||
timotimo | it belongs to the organisation, i believe, jeffreykegler | 18:10 | |
18:10
preflex joined
|
|||
doy | r: class Foo { has @.items; method check_items { for @.items -> $item { die "bad" if $item == 2 } }; method foo { self.check_items; say for @.items } }; Foo.new(items => (1, 2, 3, 4)).foo | 18:10 | |
p6eval | rakudo e26703: OUTPUT«» | ||
doy | r: class Foo { has @.items; method check_items { for @.items -> $item { die "bad" if $item == 2 }; return }; method foo { self.check_items; say for @.items } }; Foo.new(items => (1, 2, 3, 4)).foo | ||
p6eval | rakudo e26703: OUTPUT«bad in method check_items at /tmp/uaYwCfXmAp:1 in method foo at /tmp/uaYwCfXmAp:1 in block at /tmp/uaYwCfXmAp:1» | ||
masak | jeffreykegler: it is an organization. | ||
jeffreykegler | github.com/perl6 ? | ||
timotimo | doy: that surprises me. | ||
doy | i couldn't reproduce ^^ with subs, for some reason | ||
jeffreykegler | I will probably use a mailing list not an IRC for two reasons | 18:11 | |
One is I don't expect this kind of traffic | |||
Second is almost none of my community is in the same time zone | |||
TimToady | jeffreykegler: another important datapath is the irc logs that we can refer back to | ||
for instance, did you see what I said at irclog.perlgeek.de/perl6/2013-01-09#i_6313797 | 18:12 | ||
jeffreykegler | TimToady: about scannerless parsing? Yes I did | ||
By the way, I agree that "scannerless" is not a fortunate choice of terminology | 18:13 | ||
But I *do* try to track the literature and it seems to be pretty much embedded | |||
TimToady | I'm glad somebody tracks the literature, and that it's not me :) | 18:14 | |
the fact that S06 mentions PEGs is also a retrofit | 18:15 | ||
jeffreykegler | By the way, the solution I adopted for scannerless parsing is more or less that of Perl 6, with different notation | ||
I tried what I call a "Ruby Slippers" approach, but discovered my parser needs a few extra "hooks" for that to work | 18:16 | ||
TimToady | is that Ruby as in the language? | ||
timotimo | doy: i'd be interested to see the comments of some of the experts on that issue | 18:17 | |
PerlJam | TimToady: no, it's not. | ||
jeffreykegler | No, it's a parsing technique where on failure, you ask the parser, "OK what do you wish for?" | ||
Then you give it to it. | |||
arnsholt | "Ruby slippers" as in Wizard of Oz, I think | ||
PerlJam | jeffreykegler: btw, "ruby slippers" makes everyone thing of Ruby the language :) | ||
TimToady | got that part | ||
PerlJam | s/thing/think/ | ||
TimToady | just didn't know if there was a rubylang overlay | 18:18 | |
jeffreykegler | Perljam: so I discover | ||
arnsholt | (Although that particular cultural reference is far enough outside my sphere of reference I'm not really sure what it actually means =) | ||
jeffreykegler | arnsholt: A land without the "Wizard of Oz"? | ||
TimToady | well, it's not transparent in how it would apply to parsing | ||
arnsholt | A land called Europe ;) | ||
jeffreykegler | My parser is Earley based and is 100% accurate (in the technical sense) when it fails .... | 18:19 | |
arnsholt | A did see it once (an open-air showing on the Mall in Washington DC, actually) but it's been 20 years | ||
jeffreykegler | ... as to why. It knows what rules it was looking for, what symbols it wants, how far it got in the rules, etc. | ||
arnsholt | Pretty much all I remember is "lions, tigers, bears, oh my" and a yellow brick road | ||
TimToady | arnsholt: the ruby slippers come at the end, where she wishes herself back to Kansas | 18:20 | |
jeffreykegler | arnsholt: So you don't live near Kansas? | ||
PerlJam | arnsholt: "there's no place like home; there's no place like home; there's no place like home" | ||
arnsholt | Yeah, I've been reading your posts on blogs.perl.org with quite a bit of interest. I always had a soft spot for the Earley algorithm | ||
Right, right. I think that rings a bell | 18:21 | ||
jeffreykegler: Definitely not. I'm in Norway, so it's a bit off the beaten track =) | |||
jnthn | doy: I'm a bit surprised the first of those two didn't die. | 18:22 | |
jeffreykegler | An example of using the Ruby Slippers: HTML parsing. Write a "perfect world" grammar, assuming all start and end tags are physically present | ||
Then start parsing. If the parse wants a tag, that you didn't see, just invent it. | |||
jnthn | dinner, bbiab | 18:23 | |
jeffreykegler | Essentially, the lexer plays Glenda and tells the parser that it has always been in Kansas | ||
doy | jnthn: so was i! | ||
jeffreykegler | I was a little surprised myself when I found this works very smoothly | ||
TimToady has some familiarity with lexers that lie, and tends to avoid them these days :) | 18:24 | ||
we would tend to just return a synthetic AST in that case | |||
jeffreykegler | I think reality is overrated as a concept | ||
arnsholt | Well, one of jeffreykegler's use cases for the technique was parsing Perl 5 =) | 18:25 | |
TimToady | of the four or five ways a compiler can cheat, Perl 5 uses about eight of them | ||
jeffreykegler | Yes, actually a form of the technique shows up, I think in Perl 5's parsing of the "use statement" | ||
Also, there's a semi-colon hack, as I recall | |||
By the way, the other day you were looking for code that survived from Perl 1 to Perl 5 | 18:26 | ||
If you look in the yacc grammar, there's a whole lot of it. | |||
huf | what are these ways a compiler can cheat? | ||
TimToady | those techniques that make the parser unsure of which language it's in currently have now been considered harmful for Perl 6 | ||
PerlJam | TimToady: jeffreykegler's technique is more like assuming you're in the language you thought you were. | 18:27 | |
(granted, this assumption can go wrong, just like any other "guessing" technique) | 18:28 | ||
TimToady | huf: well, just on the lexer level, lookbehinds, lookaheads, synthetic token queueing, sublexing for strings, fake lexer states, to name a few | ||
huf | looks like i'll need to grow up a bit to know what those things are :) | ||
TimToady | that's even before you start rewriting ASTs | 18:29 | |
huf | why are these things cheating? | ||
PerlJam | TimToady: so, Perl 6 is about legitimizing the cheats by making them first class language? :) | ||
jeffreykegler | A nice feature of Earley/Marpa/Ruby Slippers parsing is no lookahead, and no backtracking. | ||
huf | i mean, isnt this precisely why we have compilers? :) | ||
TimToady | PerlJam: no, it's really throwing out the cheats that cause the parse to be insane | 18:30 | |
18:30
marloshouse left
|
|||
TimToady | we do allow backtracking, with the proviso that such code must store all its result data in the AST, so it can be thrown away if we backtrack | 18:31 | |
jeffreykegler | There's a saying on the NASCAR circuit, I'm told, "You ain't cheatin', You ain't tryin'" | ||
18:31
bluescreen10 left
|
|||
jeffreykegler | LALR parsing is always in practice a kind of cheat | 18:31 | |
japhb | obCheating/TechniqueReference | 18:32 | |
huf | the output of a compiler is magic anyway, magic that, if all went well, does what the code was supposed to do. | ||
jeffreykegler | Because it seems that no practical grammar is ever *quite* LALR | ||
18:32
marloshouse joined
|
|||
PerlJam | jeffreykegler: In theory, theory and practice are the same; in practice, they're not. :) | 18:32 | |
jeffreykegler | In any case, the crucial consideration for me was, "does it work?" | 18:33 | |
TimToady | an additional constraint on the Perl 6 design is that it *must* allow backtracking to allow Perl 5 regexes as a degenerate case | ||
arnsholt | huf: But there are varying degrees of magic. Parsing Perl 5 for example, is so magical it's all but impossible to replicate outside of the perl codebase | ||
TimToady | well, p5 semantics, not notation | ||
arnsholt | (AFAICT) | ||
18:34
preflex left
|
|||
japhb | timotimo, The place lazy-default for has really been biting me is when I'm working on glue scripts that do things like chdir around a filesystem as they do different tasks, perhaps executing a loop in a given directory. When for is lazy, and the contents of the loop don't happen until sometime later, the loop contents end up executing in a different directory than they expected. Hilarity ensues. | 18:34 | |
huf | arnsholt: well yes, you need to run it to parse it to run it to ... :) | ||
dalek | p: 79adaf3 | rurban++ | .gitignore: Revert "add MANIFEST.generated to .gitignore" This reverts commit 5f89700d9c98f0f8216f72edadfc6134726c324c. Not generated with parrot 5.0, since github.com/parrot/parrot/issues/922 |
18:35 | |
p: 5a9b349 | rurban++ | tools/build/Makefile.in: install dynpmc headers, as parrot 5.0 does so See github.com/parrot/parrot/issues/922 |
|||
18:35
PacoAir left
|
|||
jeffreykegler | So back to "how to colloborate", the organization owns the github repository and I see you've got a lot of members | 18:36 | |
TimToady | it's a pretty flat org chart | ||
18:36
PacoAir joined
|
|||
TimToady | perhaps the most important organizing principle is "forgiveness > permission" | 18:37 | |
japhb | Several individuals are higher on the org chart, but not because they are in a supervisory layer. More like they are taller bumps on a pancake. :-) | ||
au++ introduced us to radical trust. It has served us well since. | 18:38 | ||
PerlJam didn't even realize we /had/ an org chart | |||
TimToady | like I used to tell my kids: "I don't care if you're taller, as long as you're tolerable." | ||
japhb | *chuckle* | ||
TimToady | more of a disorg chart | 18:39 | |
japhb | I'm going to have to use that. | ||
[Coke] | people work on things that interest them, or maybe on things that will help other people. | ||
japhb | Along with my father's "You grew some? Yeah, you gruesome all right ...." | ||
jeffreykegler | And the approach to commit bits? | ||
japhb | "here you go" | ||
dalek | rl6-roast-data: bec8594 | coke++ | / (4 files): today (automated commit) |
||
rl6-roast-data: 66f4008 | coke++ | / (4 files): today (automated commit) |
|||
rl6-roast-data: eb3d723 | coke++ | / (4 files): today (automated commit) |
|||
rl6-roast-data: de06f3e | coke++ | / (4 files): minor fixups |
|||
jeffreykegler | japhb: au == Audrey Tang? | ||
TimToady | except for historically parrot required CLA signing, so I think rakudo still does too? | ||
japhb | Generally I think the only real limitation is that Rakudo requires a CLA (Contributor License Agreement), presumably to avoid someone's $day_job employer trying to claim ownership. | ||
jeffreykegler, yes. | |||
[Coke] | rakudo requires perl.org CLA - but it's not because parrot did, I don't think. | ||
(but parrot does also) | 18:41 | ||
TimToady | well, they used to be the same project, more or less | ||
jeffreykegler | Ok. I always associated the idea with Audrey. Does her work predate your discussing the project in public on IRC? | ||
TimToady | pretty much started the same time | 18:42 | |
japhb | Yeah, that's my (fuzzy) memory too. | ||
TimToady | it was au++ that started me on IRC | ||
for certain kinds of design discussions, it's just much more efficient than email | 18:44 | ||
though email has its place too, as do other scales of communication | |||
jeffreykegler | I have the problem that most of my community is not in the US, and not anywhere near my time zone | ||
PerlJam | TimToady: Does the Cabal Call happen anymore? | ||
TimToady | not for several years | ||
jeffreykegler | So IRC might not work for Marpa::R3 (my project) | 18:45 | |
japhb | jeffreykegler, Which is why IRC logs (as well as just leaving an IRC window open) work well | ||
Perl6 development manages pretty well in handling timezones world wide. | |||
jeffreykegler | Of course maybe everybody else will develop it just fine without me | ||
japhb | Because people aren't on here only during "work" hours | ||
PerlJam | jeffreykegler: I bet if you ask moritz, he could log your channel just like #perl6 | 18:46 | |
TimToady | jeffreykegler: you need to have more Hubris :) | ||
18:46
Chillance left
|
|||
jeffreykegler | TimToady: Actually, I get that criticism a lot | 18:47 | |
TimToady | "If I take a vacation, they'll screw it up for sure..." :) | ||
"in the nicest of possible ways..." | |||
jeffreykegler | moritz has been very helpful to me in the past | ||
TimToady | of course, when I'm online, it gets screwed up a different way... | 18:48 | |
PerlJam | jeffreykegler: Is your community 12 hours out of phase with you? If so, you might need to find a couple of long nights every once in a while, but otherwise IRC handles multi-timezone communication quite well. | ||
jeffreykegler | Perljam: basically, yes | ||
TimToady | with approriate bots, you can leave messages for people | ||
or if you know your other person always reads the backlogs, you can just address them vocatively | 18:49 | ||
jeffreykegler | I don't know if it's the education system or what, but Americans do not do parsing theory nearly as much as those outside the US | ||
TimToady | and most IRC clients will highlight that your name has been evoked | ||
japhb | India <-> West Coast US is indeed approximately pessimal. But I find it less so when it's personal project coordination instead of $day_job coordination. | ||
PerlJam | jeffreykegler: maybe it's population differences. You're dealing with a self selected group of people from a larger population, so you encounter objectively more parsing-theory-people but probably proportionally the same in a per-capita fashion | 18:52 | |
(that's my anti-americans-are-stupid optimism anyway :) | 18:54 | ||
jeffreykegler | Btw, I am a US citizen living in California | ||
diakopter too, and is anti-anti-americans-are-stupid | 18:55 | ||
jeffreykegler | What's my next step? Contact moritz? | 18:56 | |
japhb | Create your channel first | ||
jeffreykegler | (About IRC, not about the US educational system, that is) | ||
dalek | ecs: ffef865 | flussence++ | S (2 files): Tidy up overly long lines |
||
PerlJam | jeffreykegler: create a channel; invite people; ask moritz to log it; maybe setup some messaging bots | 18:58 | |
japhb | Can dalek be told to report commits from a given repo to only one of the channels it is in? | 18:59 | |
jeffreykegler | I'll get back to my mailing list, and see if the Marpa community likes this idea | 19:00 | |
arnsholt | japhb: Pretty sure it can | ||
It reports commits to the parrot repo only in #parrot and not here | 19:01 | ||
diakopter | japhb: yes; the listener first writes the messages it receives from github/etc to disk then the dalek process read/spits/deletes them | ||
japhb | Ah, good. | 19:02 | |
moritz | jeffreykegler: yes | 19:06 | |
erm, meant japhb, but it's also a "yes" to jeffreykegler :-) | 19:07 | ||
japhb: in the mu repo, there are some files im misc/dalek* that contain all the info you need | |||
japhb | I keep forgetting dalek is in mu. | 19:08 | |
moritz | not dalek itself | ||
only some documentation and configuration | |||
19:08
inokenty left
|
|||
japhb | ah, that explains my confusion | 19:08 | |
jnthn back | 19:10 | ||
FROGGS | you dont even need dalek, the github service hooks can spam every channel | 19:16 | |
dalek is just a bit better than the github service hook | |||
19:22
MayDaniel_ joined
19:24
MayDaniel left
19:27
Detroit joined
|
|||
dalek | nda: fcfec51 | tadzik++ | / (2 files): In a long dependency chain, ensure that some projects don't get installed twice |
19:30 | |
19:30
SamuraiJack left
|
|||
jeffreykegler | moritz: thanks! | 19:41 | |
moritz | jeffreykegler: do you have a channel name already? | 19:43 | |
jeffreykegler | moritz: not yet. I'm checking with the Marpa mailing list, just in case the community there hates the idea. I'll let you know. Is your email address on github good? | 19:46 | |
dalek | nda: 84e6bd9 | tadzik++ | / (2 files): Skip git files during local installation |
19:50 | |
moritz | jeffreykegler: yes | 19:55 | |
skids discovers he will not be debugging C++ for the next two hours. o/ | |||
moritz | on monday I've fixed a bug in some of the worst Perl code I've ever seen | 19:56 | |
full of two-letter named variables | 19:57 | ||
and anonymous subroutines that don't get their data from arguments passed, but from semi-global variables | |||
(mostly lexicals, but valid in scope of ~2k lines) | 19:58 | ||
masak | o.O | ||
tadzik | duh | ||
masak | nothing you said shocked me, until you said "scope of ~2k lines". | ||
what's wrong with people!? | |||
japhb | Oh, that's nothing in terms of hellish codebases. | ||
japhb mightily resists telling war stories for an hour. | 19:59 | ||
diakopter agrees that's nothing | |||
(though I'm sure there's more moritz hasn't mentioned) | |||
skids | The first person to ask "how can I automatically get attributes to be sigilless in an object method" I swear I am going to pelt them with dirty socks. | 20:00 | |
tadzik | :D | ||
masak | Oh, that's nothing in terms of being pelted with undesirable things. | 20:02 | |
:P | |||
skids | Yes but dirty socks are always at hand. Or at least, at foot. | 20:04 | |
masak | heh. | 20:05 | |
tadzik | gah, where did github hide the "new repository button" : | 20:07 | |
it's the 3rd time I look for it today | |||
flussence | try looking on the page with "enable middle click paste in gists"... :/ | 20:08 | |
.oO( why do sites do giant sweeping redesigns without *using* them to see if *they work*? ) |
|||
diakopter | "people are getting repo happy" "hide the button" | ||
tadzik | bah, I can't even lift-click the "Create public gist" | ||
20:11
jeffreykegler left
|
|||
dalek | osystem: b871794 | tadzik++ | META.list: Add Task::Star |
20:11 | |
ecs: b35224c | larry++ | S32-setting-library/Containers.pod: Clarify uniq semantics; add squish alternative The uniq function guarantees uniqueness throughout the list, but is overkill if the input is sorted appropriately. If the user knows the input is sorted, or if the user merely desires to reduce runs of adjacent identical instances to one instance, the squish function will do that. |
20:12 | ||
ecs: 41ec325 | larry++ | S (2 files): Merge branch 'master' of github.com:perl6/specs |
|||
TimToady | hmm, did I do that right? | 20:13 | |
diakopter | yay for squishy | 20:15 | |
TimToady | prior art is the "squish" flag on tr/// | 20:16 | |
diakopter | TimToady: did someone ever codify the syntax for using a function signature as the type of a parameter or return value? | 20:17 | |
20:17
phenny left
|
|||
TimToady | nr: $_ = "aabcccddaabbb"; tr:s/a..z/a..z/; .say | 20:17 | |
diakopter | I remember talking about it | ||
p6eval | niecza v24-16-g89e47b6: OUTPUT«===SORRY!===Action method quote:tr not yet implemented at /tmp/UZia1Zjt3P line 1:------> $_ = "aabcccddaabbb"; tr:s/a..z/a..z/⏏; .sayUnhandled exception: Unable to resolve method statement_level in type Any at /h… | ||
..rakudo e26703: OUTPUT«===SORRY!===Operators '..' and '..' are non-associtiave and require parenthesisat /tmp/WL_CVMs0gg:1------> $_ = "aabcccddaabbb"; tr:s/a..z/a.⏏.z/; .say expecting any of: dotty method or postfix» | |||
TimToady | o_O | ||
20:17
phenny joined
|
|||
TimToady | diakopter: there's something about that somewhere in the specs | 20:18 | |
flussence | r: $_ = 'associtiave'; s[.*] = 'associative'; .say | 20:19 | |
p6eval | rakudo e26703: OUTPUT«associative» | ||
TimToady | S06:1689 | ||
masak | TimToady: 'git pull --rebase' avoids pesky merge commits in the specs repo. | ||
TimToady | yes, but I've been burned by that too, meseemeth | 20:20 | |
diakopter | TimToady: oh yeah. thx | ||
masak | using any kind of rebasing before achieving git nirvana is risky, indeed. | 20:21 | |
and of course, conflicts are still possible, but rather more pleasant (IMO) than merge conflicts. | |||
TimToady is still in git limbo | |||
masak | :) | ||
TimToady | I'd rather inflict extra dalek messages on people than accidentally delete their patches... | 20:23 | |
masak | yes, that's pre-nirvana reasoning ;) | 20:24 | |
diakopter | exterminate... | ||
masak | diakopter: I have never heard a dalek pronounce it quite like that. not even a melancholy one. | 20:28 | |
it's more like EX-TER-MI-NATE. | |||
FROGGS | is that right? (multi multi note): github.com/perl6/specs/blob/master...O.pod#note | 20:34 | |
[Coke] | r: sub postfix:<!!> ($x) { my $a = $x %% 2 ?? 2 !! 3; [*] $a, $a+2 ... $x } ; say 4!!; say 5!! | 20:35 | |
p6eval | rakudo e26703: OUTPUT«815» | ||
20:37
snearch joined
|
|||
masak | FROGGS: no, that looks like a typo. feel free to fix. | 20:37 | |
FROGGS | will do, thanks | ||
masak | r: sub postfix:<!!>($x) { [*] $x, $x - 2 ... 2|3 }; say 4!!; say 5!! | 20:38 | |
jnthn | woo, finally I have some Perl 6 tuits :) | ||
p6eval | rakudo e26703: OUTPUT«(timeout)» | ||
masak | huh! | ||
jnthn | r: say ($x, $x - 2 ... 2|3).perl | ||
p6eval | rakudo e26703: OUTPUT«===SORRY!===Variable $x is not declaredat /tmp/k7eWANcb5Q:1------> say ($x⏏, $x - 2 ... 2|3).perl expecting any of: postfix» | ||
jnthn | r: sub foo($x) { say ($x, $x - 2 ... 2|3).perl }; foo(2) | 20:39 | |
masak | r: sub postfix:<!!>($x) { [*] $x, $x - 2 ... any(2, 3) }; say 4!!; say 5!! | ||
p6eval | rakudo e26703: OUTPUT«(timeout)» | ||
masak | something's wrong here. | ||
"I notice that I am confused." | |||
jnthn | Maybe. | ||
I think the 2|3 may be auto-threading earlier than any("you expect", "it should be") | 20:40 | ||
So it results in two sequences | |||
[Coke] | or, $x is 4, you have 4, 2, ... any (2,3) ... it's too late. | ||
jnthn | One of which never terminates. | ||
[Coke] | you already have your 2. | ||
sub postfix:<!!>($x) { [*] $x, $x - 2 ... any(2, 3) }; say 6!! | 20:41 | ||
masak | oh! | ||
[Coke] | r: sub postfix:<!!>($x) { [*] $x, $x - 2 ... any(2, 3) }; say 6!! | ||
masak | jnthn: yes, I think you're right. | ||
[Coke] | yup, I was wrong. :) | ||
p6eval | rakudo e26703: OUTPUT«(timeout)» | ||
masak | what I really wanted is not a junction, but an object which .ACCEPTs 2 or 3 ;) | ||
dalek | ecs: 0c7f42d | (Tobias Leich)++ | S32-setting-library/IO.pod: typo: was "multi multi note (...)" |
||
20:42
Detroit left
|
|||
masak | r: sub postfix:<!!>($x) { [*] $x, $x - 2 ... class { method ACCEPTS($n) { $n == 2 || $n == 3 } } }; say 4!!; say 5!! | 20:42 | |
p6eval | rakudo e26703: OUTPUT«815» | ||
masak | \o/ | ||
[Coke] | r: sub postfix:<!!>($x) { [*] $x, $x - 2 ... {* >=2} }; say 6!! | 20:43 | |
p6eval | rakudo e26703: OUTPUT«6» | ||
[Coke] | r: sub postfix:<!!>($x) { [*] $x, $x - 2 ... {* >=2} }; say 4!!; say 5!! | 20:44 | |
p6eval | rakudo e26703: OUTPUT«45» | ||
masak | r: sub postfix:<!!>($x) { [*] $x, $x - 2 ... 2<=*<=3 }; say 4!!; say 5!! | ||
p6eval | rakudo e26703: OUTPUT«===SORRY!===Unable to parse quote-words subscript; couldn't find right angle quoteat /tmp/KcXUvl_XnJ:1------> , $x - 2 ... 2<=*<=3 }; say 4!!; say 5!!⏏<EOL> expecting any of: postfix» | ||
jnthn | r: sub postfix:<!!>($x) { [*] $x, $x - 2 ... * == 2|3 }; say 6!! | ||
p6eval | rakudo e26703: OUTPUT«48» | ||
[Coke] | jnthn++ | ||
masak | r: sub postfix:<!!>($x) { [*] $x, $x - 2 ... 2 <= * <= 3 }; say 4!!; say 5!! | ||
p6eval | rakudo e26703: OUTPUT«45» | ||
moritz | 2<= # <-- bad | ||
masak | hm. | ||
moritz: yeah. momentary lapse. | |||
but still, the last one should be OK. why isn't it? | 20:45 | ||
moritz | which last one? | ||
masak | r: sub postfix:<!!>($x) { [*] $x, $x - 2 ... 2 <= * <= 3 }; say 4!!; say 5!! | ||
p6eval | rakudo e26703: OUTPUT«45» | ||
masak | 5!! should be 15. | ||
FROGGS | moritz: would you say that IO::Socket::INET.recv is for strings and .read is for binary data? | ||
TimToady | the RHS of ... should be able to do a smartmatch, so shouldn't autothread, I'd think | ||
masak submits rakudobug | |||
jnthn | TimToady: wfm, it's probably not hard to fix it that way. | ||
moritz | FROGGS: .read is for binary data, .get and .lines are for strings | 20:46 | |
TimToady | I certainly expected 2|3 to work there | ||
moritz | FROGGS: .recv could be either; happens to be Str right now, but we should really offer both options | ||
[Coke] | so, someone on another chat server said something about a function being undefined for negative even integers. from this I googled to find the double factorial. and now we have a rakudobug. yay. | 20:47 | |
jnthn | TimToady: Is the "for is just map" thing decidedly staying the same, or is it in the set of things you're currently pondering? | ||
moritz | r: say (2 <= * <= 3).perl | 20:48 | |
p6eval | rakudo e26703: OUTPUT«WhateverCode.new()» | ||
TimToady | jnthn: I'm not thinking about changing that part; I'd like to see how the warning approach works out | 20:49 | |
I'd be more likely to introduce some sugar for --> Nil and --> List | |||
jnthn | TimToady: I'm more worried --> Nil feels like a design smell than I am about the warning, fwiw. | ||
TimToady | no idea what that might be though | ||
the smelly thing about it, to my mind, is that it is introspecting .DEFINITE | 20:51 | ||
thought about syntax for value return like --> (42) | 20:52 | ||
doy | seems like making for be equivalent to 'eager map' or something similiar would make more conceptual sense to me | ||
TimToady | then --> () is "returns nothing" | ||
and then you can return a type as a value --> (Any) | |||
jnthn | I think it bothers me because I don't feel having to add type information is a particularly right-feeling fix. | 20:53 | |
TimToady | but sigs ending with () seems a bit ucky | ||
20:53
xalbo joined
|
|||
TimToady | well, special-casing 'for' is just as smelly, to me | 20:53 | |
jnthn | It's not really a special case | 20:54 | |
If anything, it makes it more uniform with the other loops | |||
TimToady | well,the real issue is whether the final statement is to be in sink context | ||
jnthn | Which also always do their work "right away" | ||
Hm, true | 20:55 | ||
TimToady | sink context is Perl6-ese for "side effects wanted" | ||
jnthn | Just making it eager fixes the "programs don't behave right" thing, but not the memory leak. | ||
TimToady | it's also what triggers "useless use of" warnings | ||
so it's fundamentally the Pascalish proc vs fun thing, but I don't want to use the declarators for that, since methods can also be proc-ish or fun-ish | 20:56 | ||
or was it "func"? don't remember | 20:57 | ||
jnthn | I dunno. I grew up on a basic dialect that did sub vs. function :) | 20:58 | |
japhb | I would just like to get to a place that I don't have to add boilerplate all over just to make it sane that I ended a subroutine with a for loop. | ||
'eager do for' is ... LTA | |||
rurban | ad sockets: .recv is low-level with full options, .read is higher-level with max bytes only | 20:59 | |
we just do not support }g,s}etsockopt() options yet :) | |||
masak | japhb: isn't 'eager for' enough? | 21:00 | |
japhb | And having a signature item at the top change not just the constraint on the return, but the semantics of a not-obviously-related looping construct as well, feels like spooky action at a distance. | ||
TimToady | japhb: also thinking about how to give the optimizer enough info to actually do decent optimization, and return types figure into that heavily | ||
japhb | masak, It may be -- I think I ended up with 'eager do for' working around a bug at some point, and the idiom stuck in my head. | 21:01 | |
21:01
thou left
|
|||
TimToady | I think it's mischaractarizing it to call it "boilerplate" | 21:01 | |
rurban | ad .recv(): here are the proposed options: github.com/parrot/parrot/commit/3f...db57f8d250 | ||
jnthn keeps seeing a lot of people getting bitten by this "for loop at end of sub/method may run the code later" thing | |||
japhb | OK, I can see that being a strong word. But from my perspective, it's code that I have to add that makes the semantics sane *to me*. It's kindof like //x from Perl 5. | 21:02 | |
TimToady | at worst, it's mis-huffmanized, I think | ||
but people do need to actually think about what a routine returns | |||
flussence | I'd be okay with for loops there emitting a compile-time warning without an "eager" or "return" | ||
moritz | please not | ||
TimToady | and the --> is darn good documentation of that | 21:03 | |
moritz | warnings are the worst thing to do | ||
21:03
thou joined
|
|||
moritz | because if you emit a warning, you discourage the lazy usage, because it warns | 21:03 | |
flussence | oh. | ||
moritz | but then you could make the loop eager in the first place | ||
japhb | I guess a big annoyance with the current state is something that the spec commit addressed, which is that if I forget to say either eager or sink, the semantics of the for have changed -- and I don't know about it until much later (unlike a return constraint failure which would die right out). So the warning is at least helpful | ||
moritz would be fine with 'for' being eager and 'map' being lazy | 21:04 | ||
[Coke] | building hs-cabal via macports seems brain damaged. | ||
japhb | Yes, mis-huffmanized is fair. But I maintain that the interaction of things like chdir with laziness means that eager for and plain for are semantically different. | ||
jnthn | moritz: eager or sinky? | ||
japhb | Not just caring about return value. | ||
flussence | whatever happens, please don't copy Rust's end-of-block fubar-ness | ||
TimToady | which is? | ||
flussence | trailing semicolon -> return Nil | 21:05 | |
jnthn | moritz: I think I just found the lingering method sinking bug. | ||
21:05
hash_table joined
|
|||
jnthn | moritz: The one doy hit earlier | 21:05 | |
Spectesting the fix | |||
flussence | (no trailing semicolon -> return last statement's value) | ||
xalbo | I'm curious, what is the case for "for" being anything other than eager and sinky, when "map" exists and handles the other case just fine? | ||
[Coke] | I suppose requiring "return" to return a value is right out. | ||
moritz | rurban: a versio of recv that returns a ByteBuffer would be awesome | 21:06 | |
japhb | Also, if the end of your for loop is a push call, and you forget to sink the for, the requirement to save all loop values means you may OOM because of the quadratic space explosion. I know because I did it to myself repeatedly. :-( | ||
TimToady | xalbo: you'd like to be able to write list comprehensions in either order | ||
xalbo | Doesn't map do both orders? That is, map as a method puts the list first, map as a function puts the operation first. Or am I out of date? | 21:08 | |
flussence | map as a method puts the list first, map as a function puts the map function call first... | 21:09 | |
japhb | Hmmm, what about calling for "mostly sinky"? So that it defaults to sink/eager, unless it is part of a larger expression/statement? | ||
So "return for ..." works as lazy, but "for" by itself is sink? | |||
flussence | can't that be generalised to "implicit returns are eager"? | 21:10 | |
japhb | flussence, no, I think that's a false generalization. | ||
You want to be able to say: | |||
sub add_these ($a, $b) { $a + $b } | |||
flussence | hm | ||
21:11
pmurias joined
|
|||
pmurias | how can I install ASUSTek Computer, Inc. USB-N10 802.11n Network Adapter [Realtek RTL8188SU] | 21:11 | |
japhb | Well, you know what I mean. | ||
TimToady | at the moment, I'm inclined to make it a hard error, saying "Use of 'for' as the final statement is disallowed; please put a return after it if it is procedural, or declare signature with --> List if it is functional" or some such | ||
flussence | yeah | ||
pmurias | sorry | ||
wrong channel | |||
japhb | I still like 'return for', if that's what you want. | 21:12 | |
TimToady | except that syntax is currently invalid | ||
unless we turn return into a statement_prefix | |||
masak | std: return for 1..3 # Illegal? I think not! | 21:13 | |
p6eval | std a8bc48f: OUTPUT«ok 00:00 42m» | ||
masak | :P | ||
japhb | I accept any variant that captures the flavor of what I mean: you have to state that you want a for to return loop values. | ||
rurban | moritz: the default encoding for recv() is binary | ||
but still, yes | |||
jnthn | TimToady: If we make that an error, we invalidate a load of existing code. | ||
flussence | .oO( maybe we should have --> return types on for loops ) |
21:14 | |
TimToady | jnthn: sure, would require a deprecation cycle, or maybe a Deprecation Cycle | ||
jnthn | TimToady: I think it'll also cause a lot of "wtf"... :( | ||
For all its problems, I still find making the imperative-style loop constructs never producing a result list the least bad option so far. :( | 21:15 | ||
My main problem with it being breaking list comprehensions... | 21:16 | ||
TimToady | well, that will break a lot of code too | ||
jnthn | Hm, true | ||
TimToady | it's one of those design issues where the language simply doesn't make a needed distinction | ||
21:17
pmurias left
|
|||
TimToady | we simply don't know whether the final statement is intended as imperative or functional | 21:17 | |
21:18
kaare_ left
|
|||
TimToady | and defaulting it either way is gonna screw someone up, and defaulting it neithier way is gonna screw someone up | 21:18 | |
*neither | |||
and any solution that involves doctoring the end of the code strikes me as a mere workaround to the fundamental problem of not understanding the intent of the routine | 21:19 | ||
maybe we just need a special marker that says "this function is allowed to return a lazy list" | 21:20 | ||
jnthn | To what degree is it fixable by having a forsink and a forresults (but probably one being called for and the other getting another name)? | ||
TimToady | but that still doesn't help know whether you want the eager results of the loop | 21:21 | |
skids | .oO("use N00b": warn about things you normally wouldn't want warned) |
||
21:21
pmurias joined
|
|||
FROGGS .oO( use help; ) | 21:21 | ||
jnthn | forsink = sink, no results. forresults = exactly what map does. | ||
TimToady | jnthn: doesn't scale to other loops if we want to generalize | ||
rather have something composable | 21:22 | ||
it's what I'd characterize as a low-wattage solution, and we try to avoid those in P6 | |||
jnthn | Yes, I was kinda assuming we leave the other loops not producing a result list, given nobody seems to have missed them much... :) | ||
But we could go the composable route on all of 'em too I guess | 21:23 | ||
TimToady | but again, these are kinda bandaids over the real problem of not knowing the intent of the routine | 21:24 | |
japhb | 'is lazy'? | ||
Oh NM, you're talking procedural or functional, and that's an oblique angle | |||
dalek | kudo/nom: 99c4f9c | jnthn++ | src/Perl6/Actions.pm: Fix a broken case of autosink. $foo.bar() will not be a top-level callmethod, but will actually wrap it in something to do Perl 6 type coercion if the method returns some other object. This we need p6type in the autosink list too. |
21:25 | |
moritz | note that traits can only be an answer for routines | 21:26 | |
FROGGS | but adding a trait to the for loop (and maybe other statements) is most perl-six-y I think | ||
moritz | but the problem with sink also exists with blocks | ||
consider try { for @list { die "foo" if $_ ~~ /OHNOEZ } } | |||
FROGGS | you can apply a trait to an anon block, right? | ||
moritz | not with easy syntax | 21:27 | |
and such traits are really just band-aids | |||
you don't want to litter you code with them | |||
TimToady | if the try is in sink context, then so is the for, and the die, transitively (is where I'd like to get to, so that sink optimizations work well) | 21:28 | |
Perl 5 manages this | 21:29 | ||
dalek | ast: fa9e6b7 | jnthn++ | S04-statements/for.t: Test sink/method call/die interaction bug. |
||
TimToady | as I said yesterday, I think all the eager contexts want to be able to propagate inward for optmization purposes | 21:30 | |
sink/eager/hyper/race | |||
if this were the case, a 'for' in final position would always be eager *except* when some outer context actually expects a lazy result | 21:33 | ||
well, maybe that's an overstatement | 21:37 | ||
moritz | I don't think we can reliably propagate sink context inwards | ||
TimToady | why not? | 21:38 | |
21:38
not_gerd joined
|
|||
not_gerd | hello, #perl6 | 21:38 | |
phenny | not_gerd: 09 Jan 20:19Z <jnthn> tell not_gerd Grammar::Tracer issue fixed, and also added a test. Still gotta look at the Grammar::Debugger issue. | ||
not_gerd | jnthn++ | ||
21:38
stevan_ joined
|
|||
moritz | TimToady: well, maybe with extra run-time meta information we could | 21:38 | |
TimToady | routines without explicit return specs might have to maintain a dynamic variable, seems to be about the limit of it | 21:39 | |
21:39
thou left
|
|||
not_gerd | OO question: if I want to initialize an attribute based on the value of a (public) attribute of the parent class, do I need to write a custom &new? | 21:39 | |
moritz | r: sub f() { fail "foo" }; f(); say 42 # jnthn, any idea why this doesn't throw the exception? | ||
p6eval | rakudo e26703: OUTPUT«42» | ||
moritz | not_gerd: no | 21:40 | |
jnthn | r: sub f() { fail "foo" }; f().sink; say 42 | ||
p6eval | rakudo e26703: OUTPUT«foo in method sink at src/gen/CORE.setting:10405 in block at /tmp/MeGJ70txCP:1» | ||
moritz | r: class A { has $.x = 42 }; class B is A { has $.y = self.x / 2 }; say B.new(x => 18).y | ||
p6eval | rakudo e26703: OUTPUT«9» | ||
moritz | not_gerd: see above | 21:41 | |
TimToady | or to look at it backwards, every caller can report to the callee its disposition for final statements, and for routines of known return specification, that disposition is a constant | ||
21:41
thou joined
|
|||
moritz | not_gerd: objects are initialized parent-first, so if you need something more complex than a default value, you can define a submethod BUILD | 21:42 | |
TimToady | so perhaps then the motivation for --> is more for speed than correctness | ||
jnthn | r: sub f() { fail "foo" }; say f().defined | ||
p6eval | rakudo e26703: OUTPUT«False» | ||
jnthn | moritz: Because we check for definedness | ||
TimToady | and I suspect people will be quite motivated to add --> if it makes their programs run faster :) | ||
jnthn | moritz: Should we only be checking for "not a type object"? | ||
moritz | jnthn: do we? I thought we checked for p6definite | ||
21:43
hash_table left
|
|||
jnthn | moritz: We do both | 21:43 | |
moritz | erm, what? | ||
jnthn | Because .DEFINITE is a *really* cheap test, I assume. | ||
xalbo | Speed, but also documentation. --> Nil seems a handy way to make sure that someone doesn't accidentally try to get a value back from your routine. | ||
moritz | jnthn: ok, we shouldn't :-) | ||
jnthn: what's the difference between isconcrete and p6definite? | 21:44 | ||
doy | TimToady: that sounds like it would be a reasonable solution to me | ||
jnthn | moritz: uh, good question | ||
skids | What's the rule as to the laziness of the loop control iterator? | ||
moritz | I guess checking only .DEFINITE would be righter | ||
because we really want Failure in sink context to blow up | 21:45 | ||
jnthn | moritz: oh | ||
nqp::isconcrete returns an integer | |||
perl6_definite returns a Bool (True or False) | |||
moritz | but they check the same logic? | ||
jnthn | moritz: Yes | ||
moritz: Just different result type | |||
moritz: Shall I try it? | 21:46 | ||
moritz | jnthn: yes, please | 21:47 | |
moritz needs to go to bed now, have to get up early tomorrow :/ | |||
jnthn | aww | ||
OK, trying :) | |||
Will commit/push if spectest looks good | |||
xalbo | The new spec for uniq is nice, but it's still a little less explicit than I think it should be for whether the order of the remaining elements is preserved. | 21:48 | |
not_gerd | r: (class :: is X::AdHoc { has $!first-user-frame = self.backtrace.grep({ !.is-hidden && !.is-setting && .is-routine })[0] }).new | 21:49 | |
p6eval | rakudo e26703: OUTPUT«No such method 'backtrace' for invocant of type 'Any' in method new at src/gen/CORE.setting:9095 in method backtrace at src/gen/CORE.setting:9226 in method at /tmp/ZcPXDcuYGT:1 in block at src/gen/CORE.setting:779 in method BUILDALL at src/gen/CORE.sett… | ||
moritz | xalbo: then reword :-) | 21:50 | |
masak | 'night, #perl6 | 21:51 | |
moritz | 'night masak, #perl6 | ||
jnthn | moritz: darn, at least one fail | ||
no, 2 :( | |||
xalbo | "suppresses all subsequent instances": Turns out, I just suck at reading. Apologies. | ||
jnthn | It does fix the bug though... | 21:52 | |
lives_ok { @arr[*-1] }, "readonly accessing [*-1] of an empty array is ok (1)"; | 21:56 | ||
That now fails, since @arr[*-1] returns a Failure, which lives_ok then sinks. | |||
diakopter | change the test to look for Failure | 21:57 | |
:) | |||
jnthn | Yeah, all the test regressions seem at first glance to be due to sinking failures | 21:59 | |
ah, there is a genuine bug that at least one test exposes, though | 22:01 | ||
skids | tests++ | 22:02 | |
22:03
thou left,
rindolf left
|
|||
not_gerd | bye, #perl6 | 22:03 | |
22:03
not_gerd left
|
|||
skids | .oO(use Test::GlaDOS) |
22:04 | |
22:05
thou joined
22:10
skids left
22:15
xinming left
22:17
xinming joined
22:20
snearch left
22:22
djanatyn joined
|
|||
dalek | ast: d0088f5 | jnthn++ | S (2 files): Fix tests for Failure/sink interaction. A couple of places sunk unhandled Failures, unintentionally. This corrects them, now that Rakudo does Failure sinking. |
22:24 | |
kudo/nom: 45c445a | jnthn++ | src/core/Failure.pm: Failure.sink should not throw if handled. |
22:25 | ||
kudo/nom: 8ca20db | jnthn++ | src/Perl6/Actions.pm: Remove bogus defined test in sink handling. This means that Failure is now correctly sunk. |
|||
22:25
preflex joined
|
|||
FROGGS | how do I compare Bufs? == and eq doesnt work | 22:26 | |
jnthn | eqv may work | 22:27 | |
FROGGS | ohh ya, it is listen in Buf.pm | 22:28 | |
(that I have open...) | |||
dalek | ast: 61f8766 | jnthn++ | S (2 files): Unfudge a couple of now-passing tests. |
22:31 | |
22:33
FROGGS left
22:37
MayDaniel_ left
22:41
spider-mario left
22:42
thou left,
lichtkind joined
22:43
thou joined
|
|||
lichtkind | call me janitor | 22:53 | |
jnthn | hi, janitor | 22:54 | |
lichtkind | unless perl 6 wiki is put off i feel obligated to clean out spam there | 22:55 | |
dalek | ast: 6b0ddf1 | jnthn++ | S32-array/splice.t: Unfudge now-passing splice tests. |
22:58 | |
kudo/nom: 099d0ec | jnthn++ | src/core/List.pm: Implement whatever star cases of splice. |
22:59 | ||
22:59
whiteknight joined
|
|||
lichtkind | wiki is clean again | 23:06 | |
jnthn | lichtkind++ | 23:07 | |
23:07
PacoAir left
|
|||
japhb | lichtkind++ | 23:07 | |
dalek | p: d5c0011 | jnthn++ | src/HLL/Compiler.pm: Fix REPL variable updating bug. |
23:11 | |
23:13
slayer101_ joined
|
|||
dalek | kudo/nom: 4eca84f | jnthn++ | tools/build/NQP_REVISION: Bump NQP_REVISION to get REPL fix. |
23:14 | |
23:16
sivoais left
|
|||
jnthn | TimToady: Sorry if you missed it, but if you have chance to comment on what the precedence of setops like (|) would be, it'd help me get rt.perl.org/rt3/Ticket/Display.html?id=116100 fixed :) | 23:16 | |
TimToady: er, if *I* missed it! | |||
23:16
sivoais joined
23:17
pmurias left
23:22
lichtkind left
23:25
tokuhiro_ joined
23:29
japhb left,
japhb joined
23:31
stopbit left
23:35
cognominal joined
|
|||
dalek | kudo/nom: 3c475e3 | jnthn++ | src/core/operators.pm: Fix sequences with Junction endpoints. |
23:37 | |
23:43
skids joined
23:50
aloha left
23:53
hash_table joined,
aloha joined
|
|||
jnthn | sleep & | 23:59 | |
diakopter | o/ |