»ö« 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. |
|||
00:12
cognominal left
00:13
tokuhiro_ left
00:14
cognominal joined,
tokuhiro_ joined
00:18
kst left,
tokuhiro_ left
00:19
ihavetoes_ joined
00:21
atrodo left,
atrodo joined
|
|||
ihavetoes_ | perl6: say 3; | 00:21 | |
p6eval | rakudo d8e7b6, niecza v19-13-g442e075: OUTPUT«3» | ||
00:22
ihavetoes_ left
00:25
am0c joined
00:39
Coleoid joined
00:45
kst joined,
seldon left,
am0c left
00:50
mikemol left
00:55
odoacre left
01:10
sudokode joined
01:12
sftp left
01:13
sftp joined
01:14
ponbiki joined
01:16
scott___ joined
01:19
[particle] joined
01:22
odoacre joined,
Gruber joined,
Gruber is now known as Guest96273
01:23
samlt joined
01:26
fgomez joined,
mikemol joined,
Guest44870 left
01:31
odoacre left
01:38
kst left
01:39
odoacre joined
01:44
geekosaur joined,
rafl joined
01:46
am0c joined
01:47
odoacre left,
odoacre joined
01:54
aloha joined
02:04
jaldhar joined
02:08
quietfanatic left
02:18
jaldhar left
02:20
jaldhar joined
02:45
kst joined
02:54
atrodo left
04:09
kaare__ joined
04:52
birdwindupbird joined
04:56
stephenlb left,
am0c left
05:01
larks joined
05:07
am0c joined
05:12
jeffreykegler joined
05:13
jeffreykegler left
05:21
stephenlb joined
05:23
kaleem joined
06:02
wtw joined
06:18
libertyprime left
06:20
libertyprime joined
06:26
zhutingting joined
06:27
Su-Shee joined
|
|||
Su-Shee | good morning everyone. | 06:27 | |
tadzik | hey hey Su-Shee | 06:28 | |
moritz | \o * | 06:31 | |
sorear | o/ | 06:35 | |
Su-Shee | moritz: are you throwing a snowball at me in JULY? ;) | 06:36 | |
moritz | Su-Shee: I'm just wild-card snowballing everyone :-) | 06:37 | |
Su-Shee | o/* <- I'm going to use that in winter. ;) | 06:39 | |
06:56
nodmonkey joined
07:04
brrt joined
07:08
stephenlb left
07:24
plobsing joined
07:30
telex left
07:33
telex joined
07:41
thou joined
07:42
BigBear joined
07:45
mucker joined
07:50
thou left,
thou joined
07:53
fhelmberger joined
|
|||
mathw | Morning o/ | 07:53 | |
tadzik | hello mathw | ||
mathw | I have to find out some Perl 5-y stuff for work (unfortunately Perl 6 doesn't display the required performance characteristics yet), does anybody know the right place for me to look for database access best practice? | 07:54 | |
tadzik | bobby-tables.com/perl.html :) | 07:56 | |
Su-Shee | mathw: you mean other than using DBI? (or DBIx::Class if you prefer an ORM) | ||
mathw | tadzik: that's a good start, fortunately I knew that bit already :) | 07:57 | |
tadzik | :) | ||
moritz | the most important advise is 1) don't do stupid stuff 2) use indexes wisely | ||
mathw | Su-Shee: I've always just used DBI before, but I'm looking at this blank screen here and wondering if the mess I always end up in is actually necessary | ||
Su-Shee | mathw: well I don't have a mess usally, so I'd probably say: "no, it's not". but you use DBI, yes and then your application somewhat decides what else you really need - some SQL abstraction, something more ORM-ish and so on.. there isn't really a "do this that way" in the end (set aside "avoid injections" ;) | 07:59 | |
mathw | believe me, avoiding injections is always at the top of my priority list :) | ||
07:59
BigBear left
|
|||
mathw | what's the performance overhead with DBIx::Class? | 08:00 | |
moritz | small enough that the bottleneck is still mostly the DB | ||
08:00
thou left
|
|||
mathw | awesome | 08:00 | |
Su-Shee | mathw: measure it? after you made sure that you get your selects etc right? | ||
moritz | though you have to be a bit careful to prefetch related objects that you're going to need anyway | ||
otherwise you're setting off a ton of requests | 08:01 | ||
but DBIx::Class has an awesome environment variable DBIC_TRACE=1 | |||
it shows all the DB quries fired | |||
and it makes it pretty obvious where to add prefetches | |||
Su-Shee | it has also quite good documentation what ORM construct gets translated into what kind of SQL | ||
mathw | that's good | 08:02 | |
I've used entity framework a lot, and that can be a tad opaque without external sniffer tools to figure out what SQL's being generated | |||
which is usually the key to figuring out why some query is unexpectedly slow | 08:03 | ||
because the framework goes and generates 10,000 different selects when it could've done it in just one if you'd given it a bit more of a hint | |||
moritz | well, DBIC_TRACE really helps there | 08:04 | |
mathw | sounds like it | ||
I'll look into it, thanks | |||
sorry about co-opting the channel to talk about Perl 5 | |||
08:05
thou joined
|
|||
Su-Shee | well so far I didn't really like treating SQL in an object manner so I tend to actually try to fetch data mostly and return it in a handy, meaningful way. I usally think more about what part I want to leave to the db and how much I put into the application level code... | 08:05 | |
mathw: well the same problem would apply to a perl6 DBI versus DBIx::Class ... | |||
do you want ORM or not. | 08:06 | ||
08:06
yves_ joined
|
|||
mathw | I oscillate wildly between the two, usually when one approach causes me headaches that wouldn't be caused by the other | 08:06 | |
For this particular application, it may well be easier just to tuck some plain DBI code away in its own module. All the database access and update code in one place and out of the way so there's not SQL scattered all over | 08:07 | ||
Su-Shee | mathw: well not scattering sql all over is more of a discipline question. :) | 08:08 | |
moritz | aye | ||
if you use DBIx::Class, you can also scatter queries all over the code base | |||
mathw | There is that :) | 08:09 | |
moritz | it's not directly SQL, but it still reflects the DB structure very closely | ||
mathw | Can you tell that the code this is based on is a digusting mess? | ||
Su-Shee | mathw: how do you mean? | ||
moritz | so you need some discipline to put such queries in methods in the result or resultset classes | 08:10 | |
brrt | oh, there is a (there are many) solution to scattering sql queries | ||
Su-Shee | mathw: if I see a DB related call somewhere within handling buttons to display whether or not userlevel X can have this interaction, I know the architecture is a mess. | ||
mathw | The reassuring thing I'm getting from this conversation is that what I should be doing is exactly what I'd do in any other language. | 08:12 | |
Su-Shee | mathw: good architecture and good code is good architecture and good code in any of the code cultures... | 08:13 | |
mathw: I personally put an effort into loose coupling which I have come to value a lot because it makes throwing away some old thingie and plugging in something new easier. So I try to do things not being tightly integrated with a lot of hidden magic. | 08:14 | ||
brrt | what about the 'adapter pattern' (my own device) | 08:15 | |
Su-Shee | So I would keep my SQL relatively standing on its own so if in doubt, I could switch from let's say Perl DBI to something else. | ||
moritz | loose coupling also helps a great deal with testing | ||
brrt | its a class that reads a file of queries, and converts them into callable methods | ||
i'll gist it | |||
Su-Shee | brrt: I'm not a fan of pattern, I use and see value in maybe two or three | ||
brrt | Su-Shee: i am fan of pattern because it can help you think about code abstractly | 08:16 | |
mathw | a lot of formalised patterns just say to me 'you're usin ghte wrong programming language', but sometimes pattern-y things are useful | ||
Su-Shee | moritz: on top of that, yes. but it makes coding harder, you really have to understand how to pass things from A to B properly. | ||
mathw | loose coupling is definitely the way to do Stuff. | 08:17 | |
brrt | then you are using the patterns wrongly | ||
or, the wrong patterns | |||
:-) | |||
moritz | Su-Shee: OTOH it makes coding easier, because you only have to know the interface, not the whole layer | ||
Su-Shee | brrt: you realize that in many dynamic languages most of the pattern are useless at best and really just "bad code" at worst? | ||
moritz: I've recently played with Mongrel2, which forced me into "no coupling" thinking, really interesting lessons. | 08:18 | ||
brrt | gist.github.com/3081997 | 08:21 | |
oh, yes, if think that all patterns are the patterns of 1995 | |||
dynamic languages need / use new patterns | 08:22 | ||
its just that most of them are so short they are called idioms instead :-) | |||
or bigger things, such as Active Record | 08:23 | ||
(yes, thats php you see there, so sue me) | |||
moritz sues brrt | |||
tadzik | hugme: sue brrt | ||
Su-Shee | unless a concept or idea doesn't give me a real elegant simplification AND more flexibility, I'm not convinced. | 08:24 | |
and no, I'm not taking one without the other. so "more flexibility" for the price of "complicating things": no. | |||
moritz | hoelz.ro/blog/another-look-at-perl-6 | 08:25 | |
08:25
dakkar joined
|
|||
jnthn | morning o/ | 08:26 | |
moritz | \o jnthn | 08:27 | |
mathw | IJLTS: Visitor Pattern | ||
brrt | i think there are lot of concepts and / or ideas that will simplify things | 08:28 | |
what about parallelisation? | 08:29 | ||
there a lot of 'patterns' that hugely simplify things | |||
map/reduce is perhaps the most hyped | |||
but the 'unix process' is a pattern of sorts, too | 08:30 | ||
moritz thinks about a completely generic visitor | |||
sub visit(:$start, :&pre, :&post, :&children, :&assemble) or so | 08:31 | ||
08:31
mucker left
|
|||
moritz | $start is the root of the tree | 08:31 | |
&pre the code be run pre-order | |||
&post is post-order | |||
mathw | I always felt visitor is just a substitution for an insufficiently powerful programming language. Maybe that's because I learned it in Java. | ||
Su-Shee | I usally think about how I can get rid of more code, throw away another module and make things simpler. ;) | ||
moritz | children($start) gives $start's children | ||
mathw: well, Pod::To::{HTML,Text,$other_formats} need to visit all Pod nodes to do their work | 08:32 | ||
Su-Shee | mathw: there's an interesting presentation by peter norvig why 17 of the 23 orginal pattern are obsolete in lisp, dylan or smalltalk... which probably means it applys to perl6 as well... | ||
mathw | moritz: that's a tree fold though, not a visitor pattern. visitor is a substitution for multiple dispatch. | 08:33 | |
moritz | mathw: oh | ||
mathw: then my terminology is off :-) | |||
mathw | to be fair, if I'd needed to name what you just talked about i'd probably have called it visiting | ||
moritz | I never read the Gang of Four book | ||
mathw | Su-Shee: I would imagine so, yes. Many of them are also obsolete in other good programming languages | 08:34 | |
08:34
BigBear joined
|
|||
mathw trawls the depths of his brain to remember how to write Perl 5 objects | 08:35 | ||
Su-Shee | moritz: ignore it. it's really mostly irrelevant in our culture. the orginal book by alexander is really cool though and also the "book in the middle" by richard gabriel ("patterns of software hmhmhm") is very valuable to read (he's the lucid emacs lisp guy who wrote the "worse is better" articles - also a very good read.) | ||
mathw: use Moose; | |||
08:35
daxim joined
|
|||
mathw | Su-Shee: succinct and to the point :) | 08:36 | |
actually I've never used Moose | |||
brrt | mathw: Package foo; sub new { bless {}, shift; } | ||
moritz | Su-Shee: I hadn't planned on reading it | ||
mathw | brrt: this is my usual approach :) | ||
brrt | mine as well | ||
dumb, fast, highly effective | |||
08:37
fgomez left
|
|||
sorear | mathw: IJLTS eh. | 08:37 | |
mathw | sorear: call me a lazy typist | 08:39 | |
tadzik | I can't imagine when not using Moose is the Lazy approach :) | 08:41 | |
sorear | actually, I'm going to call you a probable zephyr user and/or mit alum | ||
mathw | sorear: neither | ||
tadzik: not using Moose probably gets out of control fairly quickly. I'm now reading the Moose docs | 08:42 | ||
sorear | sleep& | ||
arnsholt | I started using Moose (or actually Moo) for my most recent Perl 5 project | ||
mathw | argh no Moose | ||
arnsholt | I'm very happy with it so far | ||
tadzik | mathw: get used to it, p5-mop is coming, want it or not :) | 08:43 | |
daxim | DO WANT! | ||
moritz | I'm sure there will be lighter-than-moose OO solutions baesd on p5-mop | ||
tadzik | see github.com/stevan/p5-mop/blob/mast...-example.t | ||
moritz | (if nobody else does, I'll provide one :-) | ||
tadzik | does that look good :] | ||
mathw | oh | 08:44 | |
my | |||
tadzik | yes. This test does run | ||
moritz | tadzik: but that looks just like a class, not "real" MOP | ||
tadzik | yes | 08:45 | |
mathw | I'm going to assume it's just using the default metaclass | ||
tadzik | that's just an example of how Moose-like syntax looks there | ||
there are tests for mop bits as well | |||
08:48
sergot joined
|
|||
sergot | hi o/ | 08:48 | |
tadzik | \o | ||
08:48
BigBear left
08:51
GlitchMr joined
|
|||
Su-Shee | there are _three_ lighter moose-style MOPs already. mouse, moo and another one. | 08:52 | |
arnsholt | Mo is the bare-bonest of them I think | ||
mathw | so the next one's going to be called M then? | 08:54 | |
arnsholt | I think mst did leave that option open, yes =) | ||
moritz | and the next one after that will be called '' | ||
you'll have to write $::{''} or so to get at it | 08:55 | ||
mathw | use ''; object(); | ||
arnsholt | Ah, no. Mo is Ingy, actually | ||
"Moose is huge. Moose led to Mouse led to Moo led to Mo. M is nothing. Mo is more. Not much." | |||
tadzik | after M there will be this viking rune | 08:56 | |
|\ or so | |||
moritz | oh, and then I | ||
moritz is sorely tempted to write Acme::I | 08:57 | ||
mathw | So, it turns out I can't use Moose or Mouse or anything because the target box has a too-old Perl with a somehow-busted CPAN and I can't get it upgraded. | 09:01 | |
moritz | perlbrew to the rescure | ||
*rescue | |||
09:02
muixirt joined
|
|||
mathw | interesting | 09:03 | |
mathw has a think about how that might fit into this system | |||
btw you guys are awesome | |||
(and I'm sure you recognise my use of 'guys' in a colloquial sort of gender-neutral manner) | 09:04 | ||
muixirt | hi there, will callbacks be implemented in zavolaj any time soon? | 09:05 | |
arnsholt | muixirt: My current plan was to wait a bit longer, but some of my other plans have fallen through so I might be convinced to change my mind | 09:11 | |
What're you looking at working with? | |||
muixirt | arnsholt: nothing particular, but it seems callbacks are important for transfering data back and forth like libcurl | 09:12 | |
not to mention gui frameworks... | 09:14 | ||
arnsholt | Yeah, it's something I'd like to get in | 09:15 | |
moritz | (off-topic but cool: what-if.xkcd.com/1/ ) | ||
arnsholt | muixirt: But there are some issues with the implementation (namely, me not knowing how to actually implement it properly), so it might be a little while | 09:21 | |
jnthn | dyncall has some callback stuff that will do some of the heavy lifting. But then there's till plenty of other scary bits. | ||
arnsholt | Yeah, it's the other scary bits that are the problem right now | 09:22 | |
muixirt | moritz: send that link to DHS, the pitchers have to be screened | ||
arnsholt | The dyncallback stuff looks reasonably straightforward | ||
muixirt | arnsholt: ok, no problem | ||
dyncallback? | 09:23 | ||
arnsholt | It's the callback part of the dyncall library, which is what NQP uses to do the C-calling bits | 09:24 | |
09:26
nodmonkey left
|
|||
arnsholt | jnthn: What's a good place to look at for figuring how to call a P6/Parrot sub from C? | 09:27 | |
moritz | dyncall.org/stable/manual.pdf | ||
tadzik | oh oh, stuff gets exciting | ||
moritz | arnsholt: src/ops/perl6.ops has several examples | 09:28 | |
arnsholt: look for Parrot_pcc_invoke_sub_from_c_args | |||
and Parrot_pcc_invoke_from_sig_object | |||
arnsholt | Cheers! | 09:29 | |
moritz has fiddled with Parrot_pcc_invoke_sub_from_c_args for the exception stuff | |||
hoelzro | how does one build the docs in github.com/perl6/doc? | 09:36 | |
moritz | hoelzro: you mean, generate the HTML? | 09:37 | |
panda install Pod::To::HTML; ./htmlify | |||
erm, ./htmlify.pl | |||
though you can use the bin/p6doc command to read some docs directly | 09:38 | ||
09:39
fgomez joined
|
|||
moritz | dyncall.org/stable/manual.pdf page 49, Status "dyncallback is buggy" | 09:40 | |
jnthn | arnsholt: What moritz++ said. Building the sig object will be the slightly fun part. :) | 09:42 | |
arnsholt | That's for 32-bit PPC SysV (early OS X I assume), no? | ||
jnthn: Yeah, I'm trying to figure out how these Parrot_pcc_* things work now | |||
I think there might be some code using that which git blame will assign to me, but I cargo-culted all that from jnthn-code O:) | 09:43 | ||
moritz | why do we need to build a signature object at all? | 09:44 | |
can't we just assume that callbacks have zero args, and handle all the marshalling with p6 level closures? | |||
hm, might be more expensive though | 09:45 | ||
oh, and I'm completely wrong. Never mind me. | |||
arnsholt | Yeah, I was trying to see how to get the C-level data back to P6 | ||
moritz | maybe we need the same marshalling as for the existing NCI return values | 09:46 | |
arnsholt | Yeah, the callback handler will have to marshal all the C args to the correct objects, then set up the call and finally invoke it | 09:47 | |
moritz | sounds like a MMOP :-) | 09:48 | |
jnthn | Really though, that logic is similar to what we do now for marshalling return values. | ||
moritz | (medium-sized atter of programming) | ||
*matter | |||
arnsholt | Yeah, the marshalling I'm expecting to be able to steal a lot of from the return value stuff | 09:49 | |
jnthn | Well, or refactor so those can be called directly. | ||
arnsholt | Or that | ||
You beat me to writing it =) | |||
hoelzro | moritz: No such method 'f' for invocant of type 'Str' | 09:52 | |
I get that error from htmlify | |||
moritz | hoelzro: then your rakudo isn't new enough | ||
hoelzro | how new does it need to be? | 09:53 | |
I'm using Rakudo * 2012.06 | |||
moritz | needs to be newer than that | ||
hoelzro | =( | ||
09:53
zhutingting left
|
|||
hoelzro | does anyone have a tool for managing two Rakudo installs? =) | 09:54 | |
tadzik | hmm. Could we teach perlbrew to install Rakudo as well? :) | ||
moritz | we might be better off writing our own 6brew | 09:55 | |
tadzik | Well, I don't think it's worth to duplicate the effort is there's a good, working thing. Maybe a fork would be better | ||
09:57
nodmonkey joined
09:58
nodmonkey left
|
|||
hoelzro | tadzik: but we'd need it to be in Perl6 =) | 09:59 | |
which presents a bootstrapping issue | |||
unless we say "just install Rakudo *, then use 6brew" | |||
10:01
nodmonkey joined
|
|||
arnsholt idly wonders what would happen if you did pthread_create(&my-function, ...) in Perl 6 | 10:06 | ||
moritz | segfault? | 10:07 | |
:-) | |||
arnsholt | Well, actually yes | ||
arnsholt misread the manpage | 10:08 | ||
Actually, output parameters is something I don't think Zavolaj can do yet | |||
moritz | you mean, besides arrays? | 10:09 | |
10:09
kresike joined
|
|||
kresike | hello all you happy perl6 people | 10:09 | |
moritz | \o kresike | ||
arnsholt | Right, the array hack. Forgot about that one | ||
kresike | moritz, o/ | 10:10 | |
flussence | outparams do work: github.com/flussence/perl6-XMMS2/b...lue.pm6#L9 | ||
moritz | wait, what? | 10:11 | |
you can just add 'is rw', and it DTRT? | |||
flussence | yep | ||
jnthn | o.O | ||
I didn't know that was implemented! | |||
moritz | flussence: does that pointerize the parameter? | 10:12 | |
jnthn | But, nice! :) | ||
flussence | moritz: honestly, I don't know how it works, other than it does :) | ||
moritz | :-) | ||
moritz wonders if it's an accident | |||
10:13
scott___ left
|
|||
moritz | flussence: can you test if it still "works" if you remove the "is rw" (by accident, that is)? | 10:13 | |
arnsholt | I had no idea either. Wonder why | ||
moritz | so, nobody implemented it :-) | ||
flussence | moritz: don't have access to a working rakudo until I get out of $dayjob later :/ | 10:14 | |
moritz | flussence: no hurry | ||
10:21
spider-mario joined
10:22
Patterner left
10:25
Psyche^ joined,
Psyche^ is now known as Patterner
10:50
muixirt left
12:04
spider-mario_ joined
12:06
spider-mario_ left
12:07
spider-mario left
12:09
zamolxes joined
12:10
Coleoid left
12:13
gfldex left,
gfldex joined
12:33
tokuhiro_ joined
12:40
JimmyZ joined
12:43
mtk left
12:45
mtk joined
12:54
PacoAir joined
13:04
xinming left
13:06
xinming joined
13:08
atrodo joined
|
|||
[Coke] chuckles at the internets: | 13:10 | ||
¯\(°_o)/¯ | |||
colomon | _/(°_o)\_ | 13:11 | |
tadzik | ( `ー´) | 13:16 | |
moritz | |.......| | ||
JimmyZ | O(∩_∩)O | 13:17 | |
moritz | \ / | ||
13:18
skids joined
13:19
zhutingting joined
13:20
mtk left
|
|||
PerlJam | .oO( ... and it's all valid Perl 6! ) |
13:23 | |
[Coke] | r: ¯\(°_o)/¯ | 13:24 | |
p6eval | rakudo d8e7b6: OUTPUT«===SORRY!===Confusedat /tmp/ZDamakwAex:1» | ||
[Coke] | r: :P | ||
p6eval | rakudo d8e7b6: ( no output ) | ||
[Coke] | ... huh. | ||
r: :P.say | |||
p6eval | rakudo d8e7b6: OUTPUT«"P" => Bool::True» | ||
jnthn | r: :D.say | ||
p6eval | rakudo d8e7b6: OUTPUT«"D" => Bool::True» | ||
jnthn | :) | ||
tadzik | r: Cool:D | 13:25 | |
p6eval | rakudo d8e7b6: ( no output ) | ||
13:26
mtk joined
|
|||
tadzik | r: Cool :D | 13:26 | |
p6eval | rakudo d8e7b6: OUTPUT«===SORRY!===Confusedat /tmp/V06VR6yF5F:1» | ||
tadzik | bah | ||
13:27
zhutingting_ joined
13:28
zhutingting left,
zhutingting_ is now known as zhutingting
|
|||
moritz | r: Cool(:D) | 13:28 | |
p6eval | rakudo d8e7b6: OUTPUT«No such method 'Cool' for invocant of type 'Parcel' in <anon> at src/gen/BOOTSTRAP.pm:804 in <anon> at src/gen/BOOTSTRAP.pm:801 in any <anon> at src/gen/BOOTSTRAP.pm:796 in block <anon> at /tmp/OopKddJzN2:1» | ||
jnthn | r: not Cool | 13:29 | |
p6eval | rakudo d8e7b6: ( no output ) | ||
moritz | r: not so Cool | ||
p6eval | rakudo d8e7b6: ( no output ) | ||
JimmyZ | r: so Cool | 13:31 | |
p6eval | rakudo d8e7b6: ( no output ) | ||
JimmyZ | r: say so Cool | ||
p6eval | rakudo d8e7b6: OUTPUT«False» | ||
13:33
bluescreen10 joined
|
|||
JimmyZ | r: say not so Cool | 13:34 | |
p6eval | rakudo d8e7b6: OUTPUT«True» | ||
13:38
Woodi joined
13:41
kaleem left
|
|||
arnsholt | jnthn: Where does the -I flags adding the dyncall dirs get specified? | 13:52 | |
I need to fiddle with them to get the dyncallback header working | |||
jnthn | arnsholt: In the Makefile, iirc | ||
arnsholt | Well, yes. But the Makefile is generated, and I can't seem to pin down where it comes from | 13:53 | |
[Coke] | r: Rat and so not Cool but Whatever | ||
p6eval | rakudo d8e7b6: ( no output ) | ||
moritz | r: Rat and so Cool but not Whatever | 13:54 | |
p6eval | rakudo d8e7b6: ( no output ) | ||
arnsholt | Looks like it's from @ccflags@ | ||
JimmyZ | r: say Rat and so not Cool but Whatever | 13:55 | |
p6eval | rakudo d8e7b6: OUTPUT«Rat()Cannot mix in non-composable type Whatever into object of type Cool in sub infix:<but> at src/gen/CORE.setting:11329 in block <anon> at /tmp/4THWQqU0X8:1» | ||
JimmyZ | r: say Rat and so Cool but not Whatever | ||
p6eval | rakudo d8e7b6: OUTPUT«Rat()» | ||
JimmyZ | n: say Rat and so not Cool but Whatever | 13:56 | |
p6eval | niecza v19-13-g442e075: OUTPUT«Rat()» | ||
JimmyZ | so, rakudo bug or niecza bug? | 13:57 | |
n: say Rat and so Cool but not Whatever | 13:58 | ||
p6eval | niecza v19-13-g442e075: OUTPUT«Rat()Unhandled exception: Cannot initialize a slot when mixing into a type object at /home/p6eval/niecza/lib/CORE.setting line 1359 (infix:<does> @ 23)  at /home/p6eval/niecza/lib/CORE.setting line 1363 (infix:<but> @ 4)  at /tmp/CjkwhOIi3r line 1 (… | ||
colomon | martinsprogrammingblog.blogspot.de/...-slow.html | ||
JimmyZ | hmm, niecza and rakudo are different outputs | 13:59 | |
13:59
am0c left
|
|||
colomon | clojureclr.blogspot.com/2011/12/usi...reclr.html | 14:00 | |
pmichaud | good morning, #perl6 | 14:04 | |
jnthn: ping | 14:05 | ||
moritz | good am, pm | ||
colomon | \o | ||
jnthn | pmichaud: pong | 14:07 | |
arnsholt: Sorry, had phone call. tools/build/Makefile.in | |||
arnsholt: And running Configure.pl updates it. | |||
JimmyZ | who can tell whether it's rakudo bug or niecza bug? | ||
pmichaud | jnthn: I'm looking at typed arrays and typed lists; is there a strong reason why the TypedArray code was done in Array and not List ? | 14:08 | |
14:08
tokuhiro_ left
|
|||
jnthn | JimmyZ: Rakudo's error seems more awesome to me. | 14:09 | |
JimmyZ: I'm not sure either implementation is wrong to refuse to do it. | |||
pmichaud: Hmm. | |||
14:09
am0c joined
|
|||
jnthn | pmichaud: Perhaps not wanting to prematurely generalize. | 14:09 | |
JimmyZ | jnthn: thanks | ||
jnthn | pmichaud: I don't think we have syntax for constructing a typed list? :) | 14:10 | |
pmichaud | jnthn: wouldn't it be just List[Int] ? | ||
jnthn | pmichaud: ah | ||
pmichaud: Yeah | |||
Duh :) | |||
moritz | erm | ||
jnthn was thinking Parcel instead of List somehow | |||
moritz | wouldn't that imply that List is a role? | ||
jnthn blames thinking about difficult $dayjob problem at the same time as this :) | 14:11 | ||
moritz: Array manages not to be. | |||
moritz | or is it simply a call to &.[] ? | ||
jnthn | In general, the way I factored the MOP is that there's a fairly generic way to respond to "parameterize me" | ||
pmichaud | and technically I'm wondering if my Int @a say something about the typed-ness of the @a symbol | ||
jnthn | For RoleHOW it does what you'd expect. | ||
pmichaud | *says | ||
jnthn: that was my other question -- whether the interface used by Array for typedness is "canonical" | 14:12 | ||
jnthn | For ClassHOW it calls a method on the type which, if it exists, can do the right thing. | ||
moritz | Positional[Int] I'd guess | ||
jnthn | Positional[Int] is a role. | ||
Note that | |||
r: my @a; say @a.WHAT | |||
p6eval | rakudo d8e7b6: OUTPUT«Array()» | ||
jnthn | r: my Int @a; say @a.WHAT | ||
p6eval | rakudo d8e7b6: OUTPUT«Array+{TypedArray}()» | ||
jnthn | r: my Int @a; say @a ~~ Positonal[Int] | 14:13 | |
p6eval | rakudo d8e7b6: OUTPUT«===SORRY!===CHECK FAILED:Undefined routine '&Positonal' called (line 1)» | ||
moritz | (I mean, 'my Int @a' should type-constraint @a to Positional[Int]) | ||
jnthn | r: my Int @a; say @a ~~ Positional[Int] | ||
p6eval | rakudo d8e7b6: OUTPUT«True» | ||
jnthn | moritz: I think it is. | ||
moritz | \o/ | ||
jnthn | my Int @a; my Str @b; @a := @b | ||
r: my Int @a; my Str @b; @a := @b | |||
p6eval | rakudo d8e7b6: OUTPUT«Type check failed in binding; expected 'Positional' but got 'Array+{TypedArray}' in block <anon> at /tmp/1yhc6IvKQt:1» | ||
moritz | r: my Int @a := Positional[Int] | ||
p6eval | rakudo d8e7b6: ( no output ) | ||
moritz | r: my Int @a := Positional[Str] | ||
p6eval | rakudo d8e7b6: OUTPUT«Type check failed in binding; expected 'Positional' but got 'Positional' in block <anon> at /tmp/nIniw5uvLu:1» | ||
jnthn | The output of all this is sucky though. :/ | ||
As in, error reporting output. | |||
14:14
thou left
|
|||
jnthn was sure he'd implemented the naming stuff. | 14:14 | ||
r: say Positional[Int] | |||
p6eval | rakudo d8e7b6: OUTPUT«Positional()» | ||
jnthn | Hmm | ||
moritz | r: say Positional[Int].^name | ||
p6eval | rakudo d8e7b6: OUTPUT«Positional» | ||
pmichaud | r: my Int @a; say @a ~~ Positional | 14:17 | |
p6eval | rakudo d8e7b6: OUTPUT«True» | ||
pmichaud | r: my Int @a; say @a ~~ Positional[Mu] | ||
p6eval | rakudo d8e7b6: OUTPUT«True» | ||
pmichaud | r: my Int @a; say @a ~~ Positional[Str] | ||
p6eval | rakudo d8e7b6: OUTPUT«False» | ||
pmichaud | r: my @a; say @a ~~ Positional[Str] | ||
moritz | it's... contravariant, iirc | ||
p6eval | rakudo d8e7b6: OUTPUT«False» | ||
pmichaud | r: my @a; say @a ~~ Positional[Mu] | 14:18 | |
p6eval | rakudo d8e7b6: OUTPUT«False» | ||
jnthn | There's another oddity. Since Array already has Positional (unparameterized) mixed in, the typed array now has Positional mixed in twice. :/ | ||
pmichaud | right. That's the part that I'm worried about. | ||
jnthn | s/mixed in/composed | ||
Me too. | |||
pmichaud | I really want Array (and List) to have Positional[::T] already in them. | ||
and not have a composed-in role for some arrays/lists but not for others | 14:19 | ||
moritz | and the obvious solution is to introduce parametric classes | ||
pmichaud | basically, "Array" and "List" should act like "Array[Mu]" and "List[Mu]" | ||
jnthn | Do you want List and Array to not be a role too? | ||
moritz hides from jnthn++'s death glares | 14:20 | ||
pmichaud | I don't minid if List and Array are roles.... but just keep in mind that they're _really_ fundamental types to much of the system. | ||
*mind | |||
as in, we use List and Array directly in the binder | |||
14:20
wtw left
|
|||
jnthn | Well, yeah, parametricism has always created bootstrappy fun. | 14:20 | |
We'd end up doing this with Hash EnumMap too. | 14:21 | ||
*and | |||
pmichaud | r: say Positional[Str] ~~ Positional[Mu] | 14:22 | |
p6eval | rakudo d8e7b6: OUTPUT«True» | ||
jnthn | moritz: The fact that classes are open and roles are closed plays into this. | ||
pmichaud | r: say Positional[Mu] ~~ Positional[Str] | ||
p6eval | rakudo d8e7b6: OUTPUT«False» | ||
pmichaud | very nice (and interesting) :-) | ||
moritz | jnthn: I thought so, yes | 14:23 | |
jnthn | moritz: When you do generic instantiation of a role, it produces a new meta-object to represnet the concrete role. | ||
That gets the stuff copied over. | |||
This goes quite a bit deeper than "just make classes take type parameters" :) | |||
14:23
muixirt joined
|
|||
pmichaud | and in this case "just make bootstrapped classes take type parameters" | 14:24 | |
jnthn | All of this said... | ||
A class is never generic on the invocant. | |||
Ho! | 14:25 | ||
I guess what we really want here is... | |||
That Array is able to claim to implement Positional[Int] or whatever if asked. And the decision is at an *object* level. | 14:26 | ||
moritz | as long as it doesn't make type checking slower... (which we really want to be fast) | ||
jnthn | Not at a type level. | ||
Yes, making this fast is a challenge. :) | |||
pmichaud | shouldn't be | 14:27 | |
a typed array simply creates typed scalars | |||
jnthn | But a solvable one. | ||
moritz | pmichaud: but what does that make of typed lists? | ||
jnthn | pmichaud: I'm more worried about the @foo ~~ Positional[Int] style checks. | ||
pmichaud | jnthn: those have to be fast? | ||
jnthn | pmichaud: Well, they have to be not slow :) | ||
pmichaud: I mean, sub foo(Int @bar) { } # boils down to that | 14:28 | ||
pmichaud | basically, a typed array just has an 'of' method, yes? | 14:29 | |
jnthn | pmichaud: That's the introspection-y way of asking what kind of array it is, yes | 14:30 | |
That method comes from the parametric Positional role. | |||
I think I'm starting to see how something could work out and perform decently. | |||
pmichaud | jnthn: does it work out such that arrays (and lists) don't get a new role composed into them? | 14:31 | |
jnthn | pmichaud: yes. | ||
pmichaud | okay, then I'm happy. | ||
jnthn | pmichaud: Well, it works out such that individual objects contribute to the type check. | ||
pmichaud | what happens if I do .WHAT on those objects? | ||
jnthn | my Int @foo; # It's an Array as a type; under type check it will claim to do Positional[Int] | 14:32 | |
moritz | so | ||
jnthn | pmichaud: Array type object | ||
pmichaud | what about @foo.WHAT ~~ Positional[Int] ? | ||
jnthn | False | ||
moritz | my Int @a; my Str @b; @a.WHAT === @b.WHAT # True | ||
pmichaud | ...and that's okay? | ||
jnthn | That's the downside. | ||
Well, the point of the mixing in is to produce a new type. | 14:33 | ||
Is your problem the mixing in itself, or the visible fallout of doing so? | |||
pmichaud | more the visible fallout, I think (more) | ||
if this were a pure-ish Perl 6 then I'd be declaring class List[::T] does Positional[T] { ... } | |||
and _that's_ what I wish our List would start out as, without any mixing in | 14:34 | ||
jnthn | *nod* | ||
pmichaud | or, more precisely: | ||
class List[::T = Mu] does Positional[T] { ... } | |||
jnthn | Right | 14:35 | |
But that means giving classes type args. | 14:36 | ||
pmichaud | they don't have them now? | ||
jnthn | No. | ||
Only roles are parametric. | |||
pmichaud | oh! | ||
jnthn | It's always been that way. | ||
pmichaud | well, in that case, I'm in favor of our List starting out as a role :-) | ||
moritz | oh oh oh | 14:37 | |
jnthn | :) | ||
moritz | that will be rather confusing, and it will make it much harder to monkey-type with $!storage or whatever it's called from within other classes | ||
jnthn | Indeed. | 14:38 | |
pmichaud | is it? | ||
It just means we use $?CLASS instead of the hard-coded List, yes? | |||
jnthn | Inside the class, yes. | ||
pmichaud | well, outside we shouldn't be monkey-typing with the storage, I don't think. | ||
moritz | oh, and in future we'll have attributes mixed in from a role stored separately | ||
pmichaud: but we do now | 14:39 | ||
pmichaud: for example in Array | |||
jnthn | .oO( Why do I get the impression I'm about to spend a bunch of time re-working roles... ) |
||
moritz | (we mess with List's $!items in Array) | ||
jnthn | pmichaud: Do we declare List and Array in bootstrap? If so, what for? | 14:40 | |
pmichaud | jnthn: I think various parts of the compilation process expect to know about Array | ||
i.e., even when there's not a setting present. | |||
for example: my @a; | 14:41 | ||
I don't have any heartache if List/Array aren't declared in bootstrap, no. | |||
I just think other parts of the compiler might. :) | |||
jnthn | pmichaud: Ah, yeah. | 14:42 | |
moritz | $ ack -w '(List|Array)' src/Perl6/|wc -l | ||
45 | |||
jnthn | You can't partially declare roles really | ||
And until Array is known as a type, you can't write the @ sigil | |||
pmichaud | moritz: the parts where Array monkeytypes with $!items is likely fixable | ||
jnthn | We depend on the openness. | ||
pmichaud | let's step back one moment :-) | 14:44 | |
I have a different question | 14:45 | ||
r: my $l = (3,4,5).list; say $l.WHAT; | |||
p6eval | rakudo d8e7b6: OUTPUT«List()» | ||
pmichaud | good | ||
r: my $l = (3,4,5).list; say $l.of; | |||
p6eval | rakudo d8e7b6: OUTPUT«Mu()» | ||
moritz steps back and decommutes | |||
pmichaud | also good | ||
so how would I use the result of .of to constrain a scalar variable? I.e., something like my ::type = self.of; my type $v; | 14:47 | ||
jnthn | r: sub foo(::T) is rw { my ::T $v }; say foo(Int).VAR.of | 14:48 | |
p6eval | rakudo d8e7b6: OUTPUT«No such method 'of' for invocant of type 'Scalar' in block <anon> at /tmp/qN4wpojw9a:1» | ||
jnthn | r: sub foo(::T) is rw { my ::T $v }; say foo(Int).VAR.type | ||
p6eval | rakudo d8e7b6: OUTPUT«No such method 'type' for invocant of type 'Scalar' in block <anon> at /tmp/IBmi0HXAmt:1» | ||
jnthn | hmm | ||
r: sub foo(::T) is rw { my ::T $v }; say foo(Int) | 14:49 | ||
p6eval | rakudo d8e7b6: OUTPUT«Int» | ||
pmichaud | isn't it my T $v ? | ||
(no colons) | |||
jnthn | d'oh | ||
r: sub foo(::T) is rw { my T $v }; say foo(Int) | |||
p6eval | rakudo d8e7b6: OUTPUT«Int» | ||
jnthn | Yeah; I guess it ignores the colons | ||
r: sub foo(::T) is rw { my ::Te $v }; say foo(Int) | |||
p6eval | rakudo d8e7b6: OUTPUT«Cannot call a method on type variable Te in any find_method at src/gen/Metamodel.pm:282 in method gist at src/gen/CORE.setting:725 in sub say at src/gen/CORE.setting:6975 in block <anon> at /tmp/6YX5jV1k4j:1» | ||
14:50
cognominal left
|
|||
jnthn | Oh heh, and there it declares it with an uninstantiated type var... | 14:50 | |
That should probably not be allowed. | |||
muixirt | hi again, is LWP::Simple known to work? I get a segfault at «use LWP::Simple» | ||
pmichaud | what about my $v of $type ? does that work at all? | ||
tadzik | muixirt: it worked last time I tried | 14:51 | |
muixirt: what Rakudo/LWP are you on? | |||
14:51
cognominal joined
|
|||
pmichaud | r: my $type = Int; my $v of $type; say $v | 14:51 | |
p6eval | rakudo d8e7b6: OUTPUT«===SORRY!===Confusedat /tmp/Q2xy7Va1rr:1» | ||
muixirt | R* 2012.06 | ||
jnthn | pmichaud: Parse error; the of trait expects a type after it. | ||
pmichaud: It's probably easiest to create an op that knows how to create a Scalar based on a certain container descriptor | 14:52 | ||
(Since we only want one of those per array) | 14:53 | ||
pmichaud | ...one of those per array? | 14:54 | |
jnthn | pmichaud: The container descriptor is the thing that holds the rw and type flags for a scalar. | ||
pmichaud | right | 14:55 | |
jnthn | pmichaud: For a given array, all of the scalars we create should really share one. | ||
pmichaud | when I declare a scalr, it doesn't have a type already? | ||
or, put another way: how is my $x different from my Int $x ? | |||
jnthn | The $!descriptor pointed to by Scalar has a different value in $!of | 14:56 | |
The descriptor is the "static bits" of the declaration. | 14:57 | ||
pmichaud | every scalar gets its own descriptor? | ||
jnthn | Yes | ||
Well, to be clear. | |||
Every scalar that statically appears in the source code gets its own descriptor. | |||
muixirt | tadzik: your last try was with R* 2012.06? | 14:58 | |
jnthn | Every instance of Scalar just points to the relevant static one. | ||
pmichaud | so how does my T $v work? | ||
jnthn | It's a bit like how we used to put the type into the prophash. Apart from rather more efficient. :) | ||
The statically created descriptor contains a type variable. | 14:59 | ||
The declaration of the variable causes .instantiate_generic to be called with the current type environment. | |||
tadzik | muixirt: according to tjs.azalayah.net/new.html my last try was at 2012-06-09T11:37:43Z on rakudo 2012.05-221-g0fde4a1 :) | 15:00 | |
jnthn | Which produces a specialized container descriptor. | ||
pmichaud: More specifically, it compiles down to something like | 15:01 | ||
$v := $v.VAR.instantiate_generic($type_env) | |||
pmichaud | okay, that just went beyond my current level of understanding :) | 15:03 | |
jnthn | oops :) | ||
Which bit was confuzzling? :) | |||
pmichaud | well, all of it was at the edge of understanding; that last bit just stepped over the line :) | ||
PerlJam | jnthn: what's a "type environment"? | 15:04 | |
pmichaud | yeah, I think "type environment" threw me. | ||
jnthn | Oh! | ||
Something that you can use to turn a type variable name into the current type. | |||
sub foo(::T) { my T $x } | |||
pmichaud | does it have to be a type variable name, ooc? | 15:05 | |
jnthn | So here, when we compile this, we don't know what T is | ||
pmichaud | I mean, why isn't it simply "turn this thing into the current type" ? | ||
jnthn | When we call foo, we bind T to the type we captured. | ||
Say we did foo(42) | |||
pmichaud | right.... isn't T just an entry in the lexpad? | ||
jnthn | The type environment is like a hash T => Int | ||
pmichaud: At the moment we actually use the lexpad to be the type environment. That is...not the best of ideas it turns out. | 15:06 | ||
PerlJam | jnthn: so, it's kind of like a thunk that maps variables to types (dynamically)? | ||
jnthn | pmichaud: But the code just expects something hash-like. | ||
pmichaud | r: sub foo(::T $x) { say T; }; foo(42) | ||
p6eval | rakudo d8e7b6: OUTPUT«Int()» | ||
pmichaud | the lexpad seems the most logical to me, yes. | ||
jnthn | PerlJam: It's just the map | ||
pmichaud: Well, it breaks down though :( | |||
In a silly way I shoulda seen coming. | 15:07 | ||
15:07
grondilu joined
|
|||
jnthn | sub foo(::T1) { sub bar() { my T1 $x }; bar() } | 15:07 | |
grondilu failed compiling the june edition of rakudo-star | |||
jnthn | lexpad isn't a view down through the scopes. | ||
It's just the current scope. | |||
So, d'oh. I need to fix this thing still. | |||
pmichaud | but when you do the instantiate_generic(...) --- can't the ... just be an expression lookup? | 15:08 | |
in the case of my T1 $x, you just lexically lookup T1 and then use that to instantiate the variable? | |||
jnthn | pmichaud: There's no reason it can't be compiled to .instantiate_generic(nqp::hash('T1', T1)), yes. | ||
That's the fix I'm thinking of. | 15:09 | ||
grondilu: How'd it fail? | |||
pmichaud | I'm wondering why it's not .instantiate_generic(PAST::Op(...)) ? | ||
jnthn | pmichaud: I'm confused. | ||
:) | 15:10 | ||
pmichaud | instantiate_generic is something called at runtime, yes? | ||
jnthn | pmichaud: It may happen at compile time. | ||
pmichaud | in the case of my T1 $x | ||
jnthn | pmichaud: Oh, wait, we may be not quite on the same page... | ||
Yes, that happens at runtime | |||
I was talking about the call that we'd make rather than the code that we emit | 15:11 | ||
pmichaud | and when it's called, it gets passed a type object? | ||
jnthn | What it gets passed today is the lexpad, which it uses to look up T1. | ||
pmichaud | why not have it be passed the type object? | ||
jnthn | Here it is: | 15:12 | |
if %cont_info<bind_constraint>.HOW.archetypes.generic { | |||
$past := QAST::Op.new( | |||
:op('callmethod'), :name('instantiate_generic'), | |||
QAST::Op.new( :op('p6var'), $past ), | |||
QAST::Op.new( :op('curlexpad') )); | |||
} | |||
The whole instantiate_generic thing you see here is replicated in a bunch of places. It's not just about container descriptors. | |||
In | |||
role Foo[::T1, ::T2] { method bar(T1, T2) { } } | 15:13 | ||
When we make that into a concrete role, we pass the lexpad of the role down to instantiate_generic of each of the methods. | |||
So the answer in general is "there may be lots of type objects" | |||
In this *specific* case, yes, we could get away with passing down one type. | |||
pmichaud | okay. | 15:14 | |
jnthn | But really it's just following a more general API. | ||
I also wonder if at some point we may need to handle: | |||
sub foo(::TCont, ::TValue) { my TCont[TValue] $x; } # ouch :) | |||
Oh, that may not be so bad | 15:15 | ||
Oh | |||
The badder one is: | |||
pmichaud | yeah, that's where I feel like it ought to just be lexical lookups, instead of a specialized "type environment" | ||
jnthn | sub foo(::T1, ::T2) { my T1(T2) $x; } # whee, generic coercion types... | ||
pmichaud | I can see T1(T2) being a pain, yes. | ||
jnthn | pmichaud: Well, if you mean "hash build out of lexical lookups"? | 15:16 | |
Type variables are always lexically scoped. So at any point we know which ones are in scope. | |||
So it's be quite easy to handle this. | 15:17 | ||
pmichaud | okay | ||
so, back to my present predicament | |||
Looking at the code again, I don't have any issue with the current role-composition mechanism for typed arrays, as long as | 15:18 | ||
kresike | bye all | ||
pmichaud | (1) I can put it in List instead of Array | ||
15:18
kresike left
|
|||
pmichaud | (2) there's some way for me to create scalar variables that are constrained to an arbitrary type (in this case, the type returned by self.of() ) | 15:18 | |
15:18
thelazydeveloper joined,
cognominal_ joined
|
|||
jnthn | Do you need to create those scalars in List or Array? | 15:19 | |
pmichaud | in Array | ||
jnthn | OK | ||
pmichaud | in List I'll be wanting to type check the bindings, but I can already do that from .of | ||
jnthn | In Array you already ahve a $!descriptor attribute. It should contain a ContainerDesciptor that has the correct type set in it. | 15:20 | |
In container.c we have something called scalar_from_descriptor | |||
pmichaud | I don't think I can use that if we're doing the role mixin, though. | ||
because the role_mixin changes the Array's .of | |||
jnthn | You can always set it to a fresh container descriptor when the array is created. | 15:21 | |
There's already a perl6_create_container_descriptor | |||
pmichaud | I'm sorry, I'm _really_ confused. | 15:22 | |
15:22
cognominal left
|
|||
pmichaud | I think you're implying some level of descriptor sharing that we don't have at present. | 15:22 | |
jnthn | Right. | ||
I'm saying that all of the scalars in a given array want to share a desciptor. | 15:23 | ||
*descriptor. | |||
Creating one for every scalar will be really wasteful | |||
Currently we get that for untyped arrays | |||
15:24
grondilu left
|
|||
jnthn | STORE_AT_POS(\$pos, Mu $v is copy) | 15:24 | |
iiuc, it's the "is copy" that creates a scalar, but since there's statically one $v the descriptor for that $v is shared. | |||
Actually over all arrays. | 15:25 | ||
pmichaud | okay, I get that part. | ||
eventually I was planning for that to become | |||
STORE_AT_POS(\$pos, T $v is copy) | |||
...but that's probably not going to work. | 15:26 | ||
jnthn | At the moment, that'll instantiate the container descriptor every single call and so we get no sharing. | ||
pmichaud | got it. | ||
so, what I really want is | |||
jnthn | We *could* find a way to cache that I guess. | ||
pmichaud | 1. a way for an Array to give me a scalar based on its notion of ".of" | ||
actually, that would be sufficient. I'm fine if it gives me something from its $!descriptor attribute, as long as PARAMETERIZE_TYPE(Mu $t) is also setting that descriptor. | 15:27 | ||
jnthn | Yes, that's what I was (badly) trying to get accross. | 15:28 | |
pmichaud | it doesn't look to me as though the current PARAMTERIZE_TYPE does that. | ||
jnthn | No, it doesn't. | ||
That's what is missing. | |||
Or mroe to the point, what's missing is: 1) PARAMETERIZE_TYPE creating that desciptor. Difficulty: should be fairly easy, there's an op to do it. 2) A way to create a new Scalar with a certain container descriptor from code. | 15:30 | ||
Well, actually, 2 is possible if you use bindattr | |||
Since the descriptor is just an attribute on Scalar | |||
pmichaud | #2 sounds like it needs to be an op also | 15:31 | |
jnthn | All this said, what is even more efficient is that you create a Scalar with the correct descriptor once, bind it somewhere, then just clone it | ||
15:31
am0c left
|
|||
pmichaud | oh, if that's the case, then just make that scalar an attribute of Array | 15:31 | |
jnthn | Right. :) | ||
And at that point you may as well create it in PARAMETERIZE_TYPE | 15:32 | ||
15:32
fhelmberger left
|
|||
jnthn | $!protoscalar := (my T $elem); # done! | 15:32 | |
PerlJam | Couldn't that "prototype" scalar also hold the default for the array? | ||
jnthn | PerlJam: Yes. | ||
pmichaud | PerlJam: and in fact, it does. | ||
when you do a lookup of a non-existent element, you get back the default scalar. It's just that currently that's a simple "my" declaration. | 15:34 | ||
jnthn: "clone a scalar" is just nqp::clone($scalar) ? | 15:35 | ||
jnthn | pmichaud: No, the 6model variant | ||
pmichaud | I don't know the 6model variant | ||
jnthn | pmichaud: See the method clone() in Mu | ||
Don't know if it has an nqp:: op yet. | 15:36 | ||
pmichaud | repr_clone__PP | ||
jnthn | Right | ||
pmichaud | awesome. | ||
jnthn | In the end I hope we can make everything 6model-y and unify these ops... | ||
pmichaud | okay, I think I see where this goes now. | ||
jnthn | ok :) | ||
btw | |||
At the moment the errors you get can contain spurious $v or whatever | |||
BUT | |||
The container descriptor is just an object with a has str $!name or so | |||
pmichaud | got it. | 15:37 | |
jnthn | So you can maybe set it to "array element" so the errors read better :) | ||
pmichaud | does $!protoscalar := (my T $) work? ;-) | ||
jnthn | Probably | ||
But then the errors will just talk about $ :) | |||
pmichaud | anyway, yes, I see how I can muck with the name. | 15:38 | |
jnthn | r: my Int $ = 'lol' | ||
p6eval | rakudo d8e7b6: OUTPUT«Type check failed in assignment to '$'; expected 'Int' but got 'Str' in block <anon> at /tmp/hOn51LTP6T:1» | ||
pmichaud | r: r: say (my Int $).VAR.name | ||
p6eval | rakudo d8e7b6: OUTPUT«===SORRY!===Confusedat /tmp/QipTusEbYW:1» | ||
pmichaud | r: say (my Int $).VAR.name | ||
p6eval | rakudo d8e7b6: OUTPUT«$» | ||
pmichaud | neat. | 15:39 | |
jnthn | We use that in things like | ||
r: my $a; say +$a | |||
p6eval | rakudo d8e7b6: OUTPUT«use of uninitialized variable $a of type Any in numeric context in block <anon> at /tmp/8FJ3jIdkbO:10» | ||
pmichaud | yes; that's where the spurious container names come from :) | ||
okay, thanks for all of the pointers. | 15:40 | ||
jnthn | *you, *are, *welcome :) | ||
pmichaud | I was working on some new List/Array code last night, then ran into spectest fails with typed arrays | ||
and looked at the code and said "Huh? OMG" | |||
jnthn | ;) | ||
jnthn shoulda taken the Pm List and Array tutorial *before* writing that code :) | 15:41 | ||
pmichaud | actually, it's not that bad, but TypeArray shouldn't be overloading at_pos/bind_pos whatever. Array should already know how to do that. | ||
because arrays and lists are already typed | |||
(it's that they default to Mu) | 15:42 | ||
*TypedArray | 15:43 | ||
anyway, I'm about to do some more semi-radical refactors of the List code :-/ | |||
jnthn | .oO( I hpoe the list of semi-radical refactors isn't infinite... ) |
15:44 | |
pmichaud | so far the answer to that is "Mu" | ||
jnthn | :P | ||
pmichaud | but this next refactor should make things somewhat more efficient in memory and speed | 15:46 | |
15:46
JimmyZ_ joined
|
|||
pmichaud | it will also eliminate a few kludges | 15:46 | |
oh! | 15:47 | ||
what's the best way to determine that an object is of an exact type? | |||
in my case, I want to know that a given object is a List | |||
(not a subclass of List) | |||
jnthn | r: say List.WHAT === Array.WHAT | 15:48 | |
p6eval | rakudo d8e7b6: OUTPUT«False» | ||
jnthn | r: say List.WHAT === List.WHAT | ||
p6eval | rakudo d8e7b6: OUTPUT«True» | ||
15:48
JimmyZ left
|
|||
jnthn | so, $obj.WHAT === List | 15:48 | |
pmichaud | ... what if I want to do that from C? ;-) | ||
jnthn | STABLE(obj)->WHAT == LookupListHere | 15:49 | |
I think List is handy | |||
pmichaud | it's available where I need it, yes (the binder, or as an opcode) | ||
jnthn | Rakudo_types_list_get | ||
pmichaud | I'm going to put in an optimization for building Lists from existing Lists | ||
but it only works if the thing you're building from *is* a *List* | 15:50 | ||
jnthn | Right. This'll get you an exact czech. | ||
15:52
JimmyZ_ left
|
|||
TimToady feebly attempts to backlog a week... | 15:52 | ||
phenny | TimToady: 02 Jul 16:46Z <bbkr> tell TimToady that / $. / regexp parsing using STD has some internal error "Use of uninitialized value $x in concatenation in line 66623" leaking and shown before "Unsupported use of $. variable" message (meant to be seen by user). RT 77550 shows that it did not happen in the past, so this is an regression in awesomness :) | ||
TimToady | but re irclog.perlgeek.de/perl6/2012-07-03#i_5781272 I'd say that 'use fatal' must be lexically scoped, not dynamically | 15:53 | |
'no fatal' is the default | |||
jnthn | TimToady: Lexically scoped, but somehow lifted by things like "open"? | 15:54 | |
TimToady | either the caller or the callee has to figure it out; I'd tend to think the caller would have an easier time of it | ||
so more of an implicit // die | 15:55 | ||
though as originally conceived, looking up the call stack from the callee to see what the lexical settings of the caller are | |||
but dynamic will just be a world of painful action at a distance | 15:56 | ||
we can't have the caller setting policy for the callee's lexical scope like that | |||
pmichaud | so, basically CALLER::<$FATAL> or somesuch | 15:57 | |
I understand the point now, yes. | |||
jnthn | pmichaud: The current PAST formulation of exception handlers seems to tie them to blocks. So a block has a set of handlers. While that works out in a sense, I'm looking at the code in MapIter and thinking an nqp:: thing that set up handlers in a more fine-grained way would let us write code like that more easily. | 15:59 | |
Er, I mean, not in PIR :) | |||
15:59
arlinius joined
|
|||
pmichaud | jnthn: I didn't like the "tied to blocks" formulation, fwiw. | 16:00 | |
jnthn | pmichaud: OK, then that's both of us. :) | ||
pmichaud | to me, handlers should be tied to code. | ||
thus the original version of PAST used a :pasttype<try> node for handlers | |||
16:01
brrt left
|
|||
pmichaud | Tene++ tried refactoring the handlers to be a specialized node type.... but it never really worked out. | 16:01 | |
jnthn | As a very first approximation, nqp::some-non-crap-name(code_to_protect(), CATCH => ..., LAST => ...) | ||
That is, we use named parameters on the node to name the different types of handlers. | 16:02 | ||
pmichaud | as a first approximation, that works for me :) | ||
jnthn | Not sure how best to convey the current exception though. | 16:03 | |
Maybe some ops that only make sense in the context of a handling thing | 16:04 | ||
pmichaud | wfm | ||
jnthn | nqp::excpayload(), etc. | ||
pmichaud | well, at some level payload ought to be an attribute of an exception, retrievable with getattr | ||
rather than a specialized op | |||
getting the exception itself can be an op, certainly. | 16:05 | ||
jnthn | I'm not so sure. If we're talking about abstracting away the underlying VM... | ||
The way we'll communicate exceptiony things will be probably quite different. | |||
pmichaud | ... the exception still probably wants to be 6model-y, I hope. | ||
that said, I don't mind too much if we treat exception as a low-level thingy the same way we're doing list and hash | 16:06 | ||
jnthn | Well, the payload (as in, what's actually thrown) probably wants to be. (more) | ||
pmichaud | so in that context, nqp::excpayload would make sense to me. | ||
16:06
Coleoid joined
|
|||
jnthn | But looking at VMs out there, they have their own constraints on what the thing you *actually* throw is. | 16:06 | |
pmichaud | I'd probably just use ::payload, though. | ||
jnthn | For example, Parrot wants it to be something of its Exception PMC type. The CLR wants it to be a subclass of Exception. etc. | 16:07 | |
pmichaud | just like we have ::push and ::pop without having to explicitly say "listpush" and "listpop" | ||
jnthn | It's that low level "container" that I want to abstract away. | ||
+1 to payload | |||
pmichaud | so yes, I'm fine with treating exceptions as low-level vm objects the same way we do lists and hashes | ||
(with corresponding low-level ops) | 16:08 | ||
jnthn | OK | ||
16:09
plobsing left
|
|||
pmichaud | Util: ping | 16:10 | |
jnthn | pmichaud: Is nqp::handle(...) an OK name? I'm trying to think of something short but descriptive...I don't really like this one. | 16:11 | |
pmichaud | jnthn: why not nqp::try ? | ||
jnthn | pmichaud: It carries the implication of Perl 6 "try", but actually may only be considering control exceptions | ||
pmichaud: That's a weak objection though. | 16:12 | ||
"try" is the Perl 6 keyword it's spiritually closest too :) | |||
pmichaud | doesn't a try block with a CONTROL { ... } phaser also handle control exceptions? ;-) | ||
jnthn | True ;) | ||
OK, I go with nqp::try | |||
pmichaud | "try" makes the most sense to me. | ||
with the understanding that nqp::try(protected, ...) that doesn't have a CATCH handler doesn't actually catch things. | 16:13 | ||
I could go for nqp::handle, though. | |||
nqp::handle reads pretty nicely, actually. | 16:14 | ||
nqp::handle(code_to_protect, CATCH => dothis, CONTROL => dothat) | |||
I think I prefer ::handle | |||
jnthn | :) | 16:15 | |
pmichaud | I'm not worried about it being short; it shouldn't be all that common, and no matter how short the name is it'll be "long" because of the need to specify the handlers. | ||
the implication of course is that nqp::handle(code) with no handlers specified ends up not catching anything. | 16:16 | ||
unlike 'try' in Perl 6, which has a default handler. | |||
pmichaud is a little afraid to touch the List code again :-/ | 16:19 | ||
colomon | you should be glad you're not programming in Lisp, *everything* is List code there. ;) | 16:20 | |
pmichaud | colomon: believe me, I'm very glad of that. :) | ||
TimToady | pmichaud: where did your questions end up? I want to think about them while driving to SoCal today... | 16:23 | |
pmichaud | TimToady: we put them into the github issue tracker | 16:25 | |
I'll get the links... one sec | |||
(we can move them back to a file if that's generally more convenient for you.) | |||
generically: github.com/perl6/specs/issues | 16:26 | ||
specific tickets of interest (to me): | |||
github.com/perl6/specs/issues/17 | |||
github.com/perl6/specs/issues/16 | |||
(that's it at the moment) | |||
TimToady | thanks | ||
arnsholt | jnthn: FYI, I derped on the include paths =) | ||
pmichaud | I'll have some list interpolation types of questions, but they're not ready yet. | 16:27 | |
arnsholt | They were right there in plain sight | ||
pmichaud | for lists (to fix the gather/take interpolation bugs) I need to smash a few more atoms together before I can get to the theoretical questions for you :) | ||
16:28
muixirt left,
thou joined
|
|||
pmichaud | for list interpolation and other list issues, I'm planning to create a t/spec/S07-interpolation/mumble.t file where we memoralize the pieces that we know have to work a certain way | 16:28 | |
that way when we come up with a change that might break something, I'll have the list of counter-examples handy :) | 16:29 | ||
(should've done that years ago.) | |||
jnthn | pmichaud++ # good idea :) | ||
Dinner...should have a few QAST exception-y tuits afterwards :) | 16:30 | ||
7 | |||
& | |||
TimToady | ooh, let's call it...Test Driven Deportment, or something like that | ||
pmichaud | 8 | ||
* | |||
TimToady: yeah... I'm a little ashamed to have not thought of doing that before this last go-round. | 16:31 | ||
jnthn | .oO( oh shift... ) |
||
pmichaud | TimToady: btw, very glad to see you back. We missed you. :) | 16:34 | |
TimToady | well, still gonna be offline a bunch this week, commuting to Irvine, Seattle, and Portland... | ||
pmichaud | ...aren't those kind of in opposite directions? ;-) | 16:35 | |
TimToady | but should be better than last week; doing IT at a large quiz meet turns out to be more than a full-time job | ||
but I did a lot of Perl 6 programming there, on the plus side :) | |||
pmichaud | TimToady: niecza? or rakudo? :-P (No, you don't have to answer that.) | 16:36 | |
pmichaud wonders if TimToady has a sekrit Perl 6 environment that none of us know about yet. | |||
TimToady | I generally try to make sure my programs run on both | ||
PerlJam | pmichaud: He may have used the TimToady implementation of Perl 6 | ||
:) | |||
pmichaud | TimToady: You're going to be driving almost the whole of I5... considered making it border-to-border? ;-) | 16:37 | |
TimToady | there is no part of I5 I am not already too familiar with :) | 16:38 | |
pmichaud | I've driven nearly all of I10 -- I'm just missing the part from Lake City FL to Jacksonville. | 16:39 | |
TimToady | even spent part of my honeymoon parked on I5 due to a broken fuel pump | ||
16:39
zhutingting left
|
|||
TimToady | about 12 miles north of Grants Pass | 16:39 | |
pmichaud | anyway, safe travels | 16:40 | |
16:45
fridim_ joined
16:46
thou left
16:53
fridim_ left
16:56
lue left,
REPLeffect left
16:57
dakkar left,
Su-Shee left
16:58
daxim left
17:00
mtk left
17:01
mtk joined
|
|||
arnsholt | jnthn: Any tricks for inspecting the type signature of a P6 routine, or do I just have to do a lot of Parrot_pcc_invoke_*? | 17:07 | |
(Inspecting it from C, that is) | |||
moritz | arnsholt: I'm pretty sure the binder has more direct access | 17:10 | |
17:10
lue joined
|
|||
moritz | arnsholt: search for Rakudo_Parameter in src/binder/bind.* for example | 17:12 | |
and Rakudo_Signature | 17:13 | ||
arnsholt | But that's Rakudo. The dyncall code lives in NQP, unfortunately | ||
17:14
zamolxes left
|
|||
moritz | does all of it have to stay there? | 17:15 | |
pmichaud | how does the dyncall code get its signature information (in NQP) ? | 17:17 | |
moritz | it doesn't need any, afaict | 17:18 | |
pmichaud | I should probably ask a larger question -- like what's the overall goal of the question? (I'm late to the conversation, yes.) | ||
moritz | pmichaud: arnsholt tries to implement callbacks | ||
pmichaud | callbacks from C into rakudo subs? | ||
moritz | yes | ||
17:18
fridim_ joined
|
|||
pmichaud | why would one need to inspect the signature? | 17:18 | |
sorear | good * #perl6 | ||
moritz | intuitively I'd say that it's OK for those to have rakudo-specific parts | 17:19 | |
well, there are two possible approaches | |||
one is to have a marshaller in p6 land that can be invoked with whatever C passes | |||
and that one introspects the signature of the p6 routine and marshalls the argumts | |||
or one can do that directly in C land | 17:20 | ||
pmichaud | I'm missing a piece, in "marshalling the arguments" | ||
does the thing doing the callback know the types of arguments it's sending? | 17:21 | ||
moritz | what do you mean by "doing the callback"? | ||
the C library that invokes the calback has its own expectation | 17:22 | ||
like, (uint64, char*, double*) | |||
and somehow that needs to get mapped to signature like (Int, Str, Array[Double]) or so | |||
17:23
mucker joined
|
|||
moritz | that is, the user probably write the p6 routine with a signature of (Int, Str, Array[Double]) | 17:23 | |
17:23
birdwindupbird left
|
|||
pmichaud | well, presumably an "is native" in there somewhere, too. | 17:23 | |
moritz | or maybe s/Int/unit64/ | ||
presumably, yes | |||
pmichaud | in which case the "is native" handles the translation between the C call and what the sub expects, yes? | 17:24 | |
or... no, I see. | |||
I'm thinking about it backwards. | |||
17:25
REPLeffect joined
|
|||
pmichaud | conceptually, I'd expect Rakudo blocks to have some sort of "callback" method/operation that can inspect the sub and return a pointer to a C-callable-routine that will transform the incoming C args into the corresponding Rakudo types and then do the dispatch. | 17:27 | |
the C-callable-routine is then what gets passed to the library. | |||
alternatively, a C-callable routine gets its arguments and passes them to the Rakudo code object and says "here, you figure them out and invoke them" :-). That's your first option, I guess. | 17:30 | ||
(marshaller in p6 land) | |||
17:30
samlt left
|
|||
moritz | though I guess some of the marshalling can't be easily done in p6 land either | 17:31 | |
"interpret that blob as a pointer to a double" isn't something that's safely done in p6 | |||
arnsholt | Sorry I disappeared | ||
jnthn back | 17:32 | ||
pmichaud | anyway, I understand the problem better now, thanks. I don't have an easy answer; but introspecting the signature from nqp feels wrongish to me. | ||
arnsholt | Yeah | ||
pmichaud | afk for a bit | ||
jnthn | oh, what are we on at the moment? :) | ||
gfldex | magic | ||
arnsholt | The existing code gets the type information from the Perl 6 code in Zavolaj | ||
moritz | introspecting from rakudo C land sounds much saner to me | ||
jnthn: callbacks in zavolaj | |||
arnsholt | Yeah, that makes a lot of sense I think | ||
moritz | especially since NQP and Rakudo signatures aren't the same beasts at all | 17:33 | |
pmichaud | also, nqp is intended to support languages other than Rakudo... so that calls for an API | ||
arnsholt | Quite | ||
pmichaud | afk for a bit | 17:34 | |
jnthn | The nativecall "protocol" is just arrays, hashes and type objects :) | ||
We build those based on the Perl 6 signature. | |||
arnsholt | jnthn: Basically, I need to get the argument and return types from a callback sub | ||
From C | |||
jnthn | arnsholt: Ah, no, that's probably the wrong way to do it :) | 17:35 | |
arnsholt | Right. Let's not do that then =) | 17:36 | |
jnthn | Lemme check something in S06.. | ||
Yeah | |||
There's this syntax: | |||
arnsholt | My basic idea was that a callback sub was just one whose argument and return types were compatible with the NativeCall types | 17:37 | |
jnthn | sub (int $n, &callback:(Str, int, int --> int)) is native { * } | ||
So, the way to do the marshalling of the callback's arguments lives in the signature of the native call declaration. | |||
So | |||
arnsholt | Right! That makes a lot of sense | 17:38 | |
jnthn | sub foo(&x:(int, int)) is native { * } | ||
17:38
fridim_ left
|
|||
jnthn | Would mean a native call to "foo" that takes a callback, and when the callback is invoked we shoudl expect two ints. | 17:38 | |
arnsholt | Yah | 17:39 | |
jnthn | And the protocol I had in mind for specifying this info is even written out at the top of dyncall.ops :) | ||
arnsholt | Oh, right! =) | ||
jnthn | Since we already have logic for mapping things in a signature to array of hashes that it desires... | 17:40 | |
...then that part should (hopefully) just be a not-too-hard refactor away. | |||
gfldex | how would you handle c structs as parameters to c callbacks? | 17:41 | |
jnthn | Anyway, it means that we give all of the info out in one go, rather than having calls back into Rakudo to introspect stuff. | ||
gfldex: Same way we handle C structs as return values today, I should imagine. | |||
arnsholt | Yeah, that's a lot better | ||
gfldex | jnthn: that works already? | 17:42 | |
jnthn | gfldex: It just boils down to having some class written with the "is repr('CStruct')" as the type. | ||
arnsholt | I'll probably have to fiddle a bit with param_hash_for | ||
jnthn | gfldex: Returning a struct? I believe so. | ||
gfldex: github.com/jnthn/zavolaj/blob/mast...6-struct.t has tests for it. | |||
gfldex | nice | 17:43 | |
arnsholt | It doesn't support sized ints yet, so it's a bit limited, but the basics are there | 17:44 | |
17:50
Su-Shee joined
|
|||
jnthn | Oh...one technicality. I'm not sure if we parse the &a:(...) syntax yet. | 17:53 | |
But can probably steal that from STD. Shouldn't be too bad. | |||
arnsholt | Heh, right | 17:56 | |
moritz | r: sub f(&x(Int, Str --> Array)) { } | ||
p6eval | rakudo d8e7b6: ( no output ) | ||
moritz | we seem to parse it | ||
r: sub f(&x(Int, Str --> Array)) { }; say &f.signatures.params[0].perl | |||
p6eval | rakudo d8e7b6: OUTPUT«No such method 'signatures' for invocant of type 'Sub' in block <anon> at /tmp/xp1QEUbN5Y:1» | ||
moritz | r: sub f(&x(Int, Str --> Array)) { }; say &f.signature.params[0].perl | 17:57 | |
p6eval | rakudo d8e7b6: OUTPUT«&x :(Int , Str )» | ||
moritz | woah | ||
17:57
Coleoid left
|
|||
arnsholt | Looks like it works. Cool | 17:57 | |
17:57
samlt joined
|
|||
pmichaud | jnthn: ping | 17:57 | |
jnthn | You missed a colon. | 17:58 | |
pmichaud: pong | |||
But I guess the above way works ;-) | |||
pmichaud | jnthn: is there a (easy) way in the bootstrap code for class List to make sure that every created List has its $!items initialized to an empty RPA ? | ||
jnthn | It's parsed differently though. | ||
pmichaud | (no is an acceptable answer; I'm just getting tired of constantly checking+initializing $!items in every List method.) | 17:59 | |
jnthn | pmichaud: Thinking. | ||
pmichaud: I suspect the answer is "no". | |||
pmichaud | okay. | 18:00 | |
jnthn | At least, I can't think of a way off hand. | ||
pmichaud | I can probably do it in nqp::p6list (which uses the binder function to create lists)... but when I tried it last night there were still some Lists that ended up with uninitialized $!items | ||
so, some Lists are still being created via nqp::create() | |||
(which is somewhat expected.) | |||
jnthn | Well, and then there's the Array case :) | 18:01 | |
pmichaud | ...array case? | ||
jnthn | my @a; | ||
pmichaud | oh, that's probably the one that is doing it, yes :) | ||
jnthn | Yeah. That one works interestingly :) | ||
(It clones whatever is in the static lexpad) | |||
pmichaud | yeah....... | ||
and probably wouldn't (shouldn't) be a deep clone. | 18:02 | ||
jnthn | So if you initialize that one to have a $!items it'll be shared | ||
Right, it's shallow. | |||
pmichaud | okay. | ||
jnthn | I once pondered teaching P6opaque to be more configurable on that. | ||
pmichaud | I *might* make an opcode to do it then. | ||
jnthn | But we got by just fine so far. | ||
18:02
sergot left
|
|||
pmichaud | actually, having an opcode do it would simplify a lot of things. | 18:03 | |
in Array too. | |||
I'm not sure that's a pattern I'd want to see replicated throughout much of the codebase... but for List it might be worthy enough to do. We already have some list-specific opcodes. | 18:04 | ||
18:04
birdwindupbird joined
|
|||
pmichaud | I could do it as a C opcode for now; but it could easily also be managed as a nqp::-pseudoop | 18:05 | |
18:05
sergot joined
|
|||
jnthn | Well, everything should be an nqp:: thing these days. | 18:05 | |
Then it can be replaced in whatever way. | |||
pmichaud | it'd be a nqp:: pseudoop that builds a tree | 18:06 | |
and I'm not sure we can easily parameterize those yet. | |||
18:07
spider-mario joined
|
|||
moritz | r: sub f(&x:(Int, Str --> Array)) { }; say &f.signature.params[0].perl | 18:07 | |
p6eval | rakudo d8e7b6: OUTPUT«===SORRY!===invoke() not implemented in class 'Capture'» | ||
pmichaud | I'll do it as a C op to begin with (with a nqp:: alias in the code). I'm most comfortable with knowing that will work properly. We can generalize a bit later. | ||
18:07
stephenlb joined
|
|||
pmichaud | and right now I have too many other variables that can cause thing to break so I'm wanting to keep the number small-ish :) | 18:08 | |
*things | |||
18:08
spider-mario left
18:09
spider-mario joined
|
|||
pmichaud | Mucking with the list code is always tricky. Of the various experiments I've tried in my branch, about 80% of them cause non-trivial fails :) | 18:09 | |
afk # airport pickup, lunch | 18:22 | ||
arnsholt | jnthn: Current plans for implementing the callbacks | ||
18:22
harmil left
|
|||
dalek | c: 337a4af | moritz++ | lib/glossary.pod: [glossary] explain "invocant" |
18:23 | |
diakopter | moritz: s/that/on which/ | ||
moritz | diakopter: takk | 18:24 | |
dalek | c: fde229c | moritz++ | lib/glossary.pod: [gloassary] grammar fix by diakopter++ |
18:25 | |
arnsholt | Or "called on" | ||
diakopter | no.. | ||
arnsholt | I quite like dangling prepositions | ||
diakopter | moritz: oh, I see what you were saying. now that you did the 'on which', you have to remove one of the 'is called' :) | 18:26 | |
er | |||
NO | |||
sorry I'm wrong | |||
it just looked funny for a second | |||
my reading of what arnsholt said confused me :D | 18:27 | ||
moritz | diakopter: you're welcome to rephrase if you have a better idea :-) | ||
and a commit bit (hint hint :-) | |||
dalek | p/toqast: d11e353 | jnthn++ | src/QAST/Var.nqp: Add QAST::Var.default (not needed for Rakudo, but it's part of what replaces viviself, and NQP will need it). |
18:28 | |
moritz | is the plan to migrate nqp to QAST too? | 18:29 | |
jnthn | moritz: Yeah, but I'll not work on it until I've done Rakudo | ||
moritz: It's just that viviself is gone in QAST, and the above is one place we used it, so I'm just stubbing in the replacement while I think of it :) | 18:30 | ||
Plus it's LHF for any would be QAST::Compiler hacker :) | 18:31 | ||
diakopter | arnsholt: (I see what you were saying now) | ||
18:36
arlinius left,
alvis```` joined
18:37
brrt joined
|
|||
dalek | c: f10aa0d | moritz++ | lib/Complex.pod: start to document Complex |
18:38 | |
18:38
samlt left
18:39
jaldhar left
18:40
jaldhar joined
|
|||
arnsholt | diakopter: Yours is fine as well. Dangling prepositions are largely a question of style, I think | 18:42 | |
18:42
harmil joined
|
|||
diakopter | the dangling preposition, though "wronger", is probably clearer in this case because of the repeated "is called" | 18:43 | |
but I don't have a good idea to reword it to get rid of the repeated "is called" and make it flow nicely | 18:44 | ||
18:45
bluescreen10 left,
bluescreen10 joined
|
|||
[Coke] | (wait, TimToady is gone a week, and has only a SINGLE message from phenny? hurm...) | 18:46 | |
diakopter | folks trust him to backlog so they don't always use phenny | 18:49 | |
18:53
harmil left,
harmil joined
18:54
brrt left
|
|||
moritz | and we've turned some questions into GH issues too | 18:54 | |
18:55
fhelmberger joined,
spider-mario left,
spider-mario_ joined
|
|||
masak | good evening, #perl6 | 18:56 | |
jnthn | masak! \o/ | ||
moritz | \o masak | ||
masak | \o/ | 18:57 | |
sorear | MASAKK! | 18:58 | |
19:06
GlitchMr left,
lichtkind joined
19:08
brrt joined
19:12
samlt joined
|
|||
masak | happiness all around. | 19:13 | |
sjohnson could use some of dat | |||
moritz hugs sjohnson | |||
sjohnson | :3 | ||
moritz | hugme: hug everybody | ||
hugme hugs everybody | |||
masak hugs sjohnson too | 19:14 | ||
sjohnson | ( ° ー°) | ||
i feel better already ! | |||
sorear hugs sjohnson | 19:16 | ||
sjohnson gives back a big #perl6 group hug | |||
colomon | hugs! | 19:18 | |
sjohnson | someday #perl6 might turn into #hugs :) | 19:20 | |
sorear hugs colomon | 19:21 | ||
lichtkind | mass hugging | 19:22 | |
oh man im away :) | |||
19:22
fhelmberger left
|
|||
sjohnson | hugs are contageous | 19:22 | |
masak | wow, there actually is a channel #hugs on freenode. | 19:24 | |
and I'm the 10th nick in there. | |||
lichtkind | masak: im more like gagamel | 19:27 | |
diakopter | masak: maybe hugs refers to the haskell thing? | 19:29 | |
lichtkind | diakopter: i hope so | ||
moritz | lichtkind: there's nothing wrong with hugging :-) | 19:31 | |
lichtkind | moritz: ich war immer schon mit gagamel, hab die schlümpfe gehasst, | 19:32 | |
also mach dich wenn ich vorbeikomm auf das schlimmste gefasst | |||
masak | sjohnson: "We need 4 hugs a day for survival. We need 8 hugs a day for maintenance. We need 12 hugs a day for growth." -- Virginia Satir | 19:37 | |
19:37
MayDaniel joined,
fhelmberger joined
|
|||
lichtkind | masak: that statement is no surprise for someone naming itself satyr | 19:38 | |
19:39
spider-mario_ is now known as spider-mario
|
|||
sjohnson | masak: wise quote | 19:39 | |
masak | lichtkind: wow, I never made that connection, even though I've known the name for years. | 19:40 | |
lichtkind | masak: rumor has it perl atracts language affine people | 19:42 | |
19:43
brrt left
|
|||
masak | lichtkind: aye. | 19:44 | |
masak .oO( what's affine language like you're doing in a place like this? ) | |||
s/you're/you/ | 19:45 | ||
sjohnson | it also attracts hug enthusiasts :) | 19:53 | |
19:53
fgomez left
19:55
fhelmberger left
|
|||
dalek | c: e8502de | moritz++ | lib/Complex.pod: [Complex] add polar; fix "returns" traits |
19:57 | |
colomon just had an out-of-control piece of $work code eat 4+ gigs of real memory... | 19:59 | ||
sorear | ulimit -v is your friend | 20:00 | |
colomon | is there a Windows equivalent? That's where my real problem lies, I managed to get the process under control on the Mac pretty easily. My PC is still going off the rails, though... | 20:04 | |
masak | sjn: hm. I kinda like the name Adventure::World. I'll think a bit about it. | ||
moritz | colomon: I don't know, but maybe there's a setting in the process manager (ctrl+alt+del) to limit it? | 20:06 | |
stackoverflow.com/questions/192876/...mory-limit | 20:07 | ||
masak | moritz: [backlog] I also constantly mistake "visitor pattern" for "tree fold". I think it severely hinders my grokking of it. (along with "so you're saying the language doesn't do that kind of method dispatch? wha'..."_ | 20:08 | |
) | |||
moritz | oh, that reminds me. I wanted to write that visitor :-) | 20:09 | |
masak | mathw: [backlog] check your nearest CPAN. M is there. | 20:10 | |
also, I used to see a use for Mouse, but I don't any more. I'd consider Moo in all of the cases I would have considered Mouse before. | 20:11 | ||
Moo seems to do what Mouse intended, but better in all ways. (goas all the way with "no MOP", is *perfectly* compatible/substitutable with Moose) | |||
sorear | why do people keep making new perl 5 object systems? | 20:12 | |
20:12
kaare__ left
|
|||
masak | sorear: the post-Moose landscape does look difference, in people's defence. | 20:13 | |
moritz | because there isn't one good in core | ||
masak | sorear: Moose has a prohibitive startup cost in some domains. | ||
hoelzro++ # hoelz.ro/blog/another-look-at-perl-6 | 20:15 | ||
hoelzro|away: what's wrong with $*OUT? ;) | |||
20:18
dukeleto joined
|
|||
masak | oh wow. github.com/stevan/p5-mop/blob/mast...-example.t | 20:19 | |
that's awesome. | |||
sorear | aye | ||
20:30
seldon joined
|
|||
sorear | o/ seldon, o/ dukeleto | 20:32 | |
seldon | \o sorear | ||
20:37
samlt left
20:40
vlixes joined
20:41
samlt joined
|
|||
moritz | gist.github.com/3086115 # my mostly general tree folder | 20:41 | |
masak | moritz: nice. | 20:43 | |
moritz: I'm looking at $root and &children, and thinking "refactor parameters into parameter object", though. :) and call it Node. :) | 20:44 | ||
not saying it's necessarily a better factoring. just that that's my first reaction. | |||
masak .oO( refaction ) | |||
moritz | masak: erm, I can't quite imagine how that would look like | 20:45 | |
masak | ok. | ||
moritz | masak: got a short example for me? | 20:46 | |
masak | the &children routine being passed in is just a mapping from parents to children, no? that's why you can keep passing it down. | ||
moritz | right | ||
masak | my proposal is just to ditch that routine and encode the same mapping in an object structure. class Node { has Node @.children } | 20:47 | |
moritz | same for &pre, &post and &assemble actually | ||
masak | nothing more. | ||
well, all those are more obviously part of the *algorithm*. | |||
&children is more obviously part of the data structure. | |||
moritz | masak: but when I have somethiing like a Pod tree, I'd have to recursively walk the whole structure to bring it into the form of Node objects | 20:48 | |
before passing it to &visit, which recursively walks the whole structure | |||
masak | I see what you mean. | 20:49 | |
moritz | that's the point of having it a callback: it makes it usable on structures that don't already fit the pattern exactly | ||
masak | it would be nice if there were "interface adapters" -- things that say "I know you need this, but adapt those things over there on a by-need basis". | ||
moritz | $root could be an integer, and &children returns two divisors | ||
masak | moritz: yeah, I see your use case now. that's pretty neat. | 20:50 | |
interface adapters would do the same but with OO, though. | |||
I wonder if anyone has ever done something like that in a language. | |||
moritz | I bet lisp has :-) | ||
masak | heh :) | ||
20:51
MayDaniel left
|
|||
moritz | well | 20:51 | |
in this case, I could simply add a parameter :$children-method-name | 20:52 | ||
and then do @children = $root."$children-method-name"().map: ... ; | |||
that would be kind of poor man's interface adapter | 20:53 | ||
20:53
thelazydeveloper left
|
|||
masak | yeahbut. yeech. :) | 20:54 | |
now you've soiled your routine with adapter details. | |||
the thing with interface adapter would be that you can keep referring to the "nice" interface inside the routine. and handle all the ugly mapping in the interface adapter scope. | |||
moritz: "If an named argument was passed for C<assemble>...", but the code contains no conditional. | 20:56 | ||
also, s/an/a/ in there. | |||
moritz | well, the "otherwise" case is handled through the default | ||
which just returns Nil | |||
20:58
bruges_ joined
|
|||
masak | oh, true. | 20:58 | |
PerlJam | that "interface adaptor" sounds interesting, but only if it got out of the way. | ||
masak | PerlJam: yeah. I'm a bit fuzzy on how to actually hook it up when invoking the routine. | 20:59 | |
moritz -> sleep | |||
PerlJam | masak: it seems kind of waterbedy to me right now. Like you're just moving the essential complexity | ||
21:00
bruges left
|
|||
masak | sleep well, moritz. dream of turtle-like callables all the way down. | 21:00 | |
PerlJam: I will think about it some more. you may be right. | |||
21:01
birdwindupbird left
21:02
thou joined
21:03
samlt left
21:05
cognominal_ left
21:07
cognominal joined
21:11
crab2313 joined
21:12
skids left
21:16
samlt joined
|
|||
sjn | masak: about naming... I'm kinda keeping the "tell a story with code" idea in mind when coming with that suggestion | 21:18 | |
not sure how feasible it all is, but given that you're kinda creating a story to begin with, I think it would be nice to see if that idea is doable | 21:19 | ||
masak | sjn: if I haven't licensed the code already, consider MIT license to apply. you're free to take story and/or code and do nice things with it according to your wishes. | 21:21 | |
sjn | no worries :) | ||
just throwing some crazy ideas out there | 21:22 | ||
masak | well, I still think your "tell a story with code" idea is interesting. I'd like to see you produce a full-fledged example of it. | 21:23 | |
no-one else is gonna do it for you :) | |||
lol I blogged! \o/ strangelyconsistent.org/blog/july-1...-be-opened | 21:26 | ||
jnthn read it as "can beer opened" :P | 21:27 | ||
21:31
thou left
21:33
Pleiades` left
|
|||
felher | masak++ :) | 21:35 | |
21:35
muixirt joined
|
|||
felher | But that was quite a short one... can i get one of the two '+' back? | 21:36 | |
felher is just teasing :) | |||
seldon | masak+=0.5? | 21:38 | |
lue | good post masak++ | ||
felher | seldon: yeah, something like that :) | 21:39 | |
masak | felher: sorry, '++' is an atomic operation. ;) | ||
lue wonders if +=0.5 actually worked | 21:40 | ||
felher | masak: ... good point :) | ||
seldon | Does ++masak work? | ||
Because I feel much more at home with preincrement, coming from ++C. | |||
21:40
jaldhar left
|
|||
masak | in here, that means "you've promised to do something, there's actual karma in it for you if you do" | 21:41 | |
21:41
Pleiades` joined,
jaldhar joined
|
|||
seldon | Also, what does "work" mean? Does a bot keep score or something? | 21:41 | |
felher | aloha: karma masak | 21:42 | |
aloha | felher: masak has karma of 750. | ||
gfldex | karma masak | ||
aloha | masak has karma of 750. | ||
gfldex | masak+=0.5 | ||
karma masak | |||
aloha | masak has karma of 750. | ||
seldon | Karma can only be portioned out by the cosmos. | 21:45 | |
aloha | can only be portioned out by the cosmos. has karma of 0. | ||
seldon | That bot is a bit on the cheeky side, isn't it? | 21:46 | |
21:46
samlt left
|
|||
jnthn | karma bots that don't know when to shut up | 21:48 | |
aloha | bots that don't know when to shut up has karma of 0. | ||
jnthn | As they should! :P | ||
seldon | karma i can | ||
aloha | i can has karma of 0. | ||
jnthn | *lol* | ||
masak | :P | 21:49 | |
seldon | Hmm... | 21:50 | |
karma++ | 21:51 | ||
21:56
PacoAir left
22:01
spaceships joined
|
|||
pmichaud reads | 22:02 | ||
22:02
stephenlb left
22:07
alester left
22:08
awwaiid left
22:09
awwaiid joined
22:10
Guest96273 is now known as Grrrr
22:13
stephenlb joined
|
|||
sergot | good night ! o/ | 22:16 | |
22:16
sergot left
|
|||
masak | dobranoc, sergocie. | 22:17 | |
lichtkind | i noe see larry stole Q from ruby | 22:19 | |
thats hdeous | |||
lue now hates wordpress (just lost a big post I finished writing because I tried adding a link in fullscreen mode) >:( | 22:22 | ||
masak | lichtkind: isn't it %Q in Ruby, though? | 22:27 | |
also, does Ruby really use the Q form in order to adverb the Q? | 22:28 | ||
pmichaud | I think Q{} actually came from p5's q{} | ||
lichtkind | pmichaud: yes but i was looking for a pun too, and it was just surprising to find it there | 22:29 | |
22:30
muixirt left
|
|||
masak | good night, #perl6 | 22:30 | |
mhasch | good night, masak | 22:31 | |
22:33
bluescreen10 left
22:42
Khisanth left
|
|||
lichtkind | good night fellas | 22:42 | |
o/ | |||
22:42
lichtkind left
22:46
crab2313 left
22:49
majrmovies joined
|
|||
majrmovies | Hi Perl6ers .. | 22:49 | |
If this is the output of the "perl6 -v" command | |||
This is perl6 version 2012.06 built on parrot 4.5.0 revision 0 | |||
How would I require that version in a module? | |||
Because "use Perl:<6.2012.06>;" doesn't work. ;-( | |||
pmichaud | I think version requirment in modules is not yet implemented (NYI) | 22:50 | |
at any rate, it'd be a Rakudo version, not a Perl version. | |||
majrmovies | Ahh... I see. | ||
Thank you Mr. Michaud. | 22:51 | ||
flussence | you'd write "use v6;" | ||
pmichaud | if nobody else is able to give you a better answer here -- feel free to file a bug report (rakudobug@perl.org) with the question, or ask on perl6-users mailing list. | ||
jnthn | 'night, #perl6 | ||
dalek | p/toqast: b6e9580 | jnthn++ | src/QAST/Operations.nqp: Start sketching out various exception related operations. |
||
pmichaud | I'm not even certain that compiler-requirement versions are spec'd. | 22:52 | |
jnthn: later! | |||
jnthn | pmichaud: Didn't get as far as hoped with exception impl today, brain too fuzzy... Maybe tomorrow evenin'. | ||
o/ | |||
pmichaud | jnthn: all progress is good, though. | ||
majrmovies | flussence: but there is a fix in rakudo 2012.06 that is required for this to run ... it will fail in 2012.05 or prior | ||
pmichaud | I'm not as far along as I'd hoped with lists | ||
diakopter is not as far along with qast stuff as I hoped | 22:53 | ||
flussence | write code to spec, not to browsers^Wperl6s | 22:54 | |
pmichaud | someone still might want to provide a useful warning about compiler version. | ||
in fact, we put a version number into one of the dynvars for this... just a sec | |||
(looking) | |||
r: say $*PERL<compiler><ver> | 22:56 | ||
p6eval | rakudo d8e7b6: OUTPUT«2012.06-77-gd8e7b66» | 22:57 | |
pmichaud | r: say $*PERL<compiler>release-number> | ||
p6eval | rakudo d8e7b6: OUTPUT«===SORRY!===Confusedat /tmp/0Oek9TcNct:1» | ||
pmichaud | r: say $*PERL<compiler><release-number> | ||
p6eval | rakudo d8e7b6: OUTPUT«» | ||
pmichaud | r: say %*PERL<compiler>.perl | 22:58 | |
p6eval | rakudo d8e7b6: OUTPUT«Failure.new(exception => X::AdHoc.new(payload => "postcircumfix:<\{ }> not defined for type Failure"))» | ||
pmichaud | r: say %*PERL<compiler>; | ||
p6eval | rakudo d8e7b6: OUTPUT«postcircumfix:<{ }> not defined for type Failure in method gist at src/gen/CORE.setting:9533 in sub say at src/gen/CORE.setting:6975 in block <anon> at /tmp/cC0z7zCpIk:1» | ||
pmichaud | r: say $*PERL<compiler>; | ||
p6eval | rakudo d8e7b6: OUTPUT«("name" => "rakudo", "ver" => "2012.06-77-gd8e7b66", "release-number" => "", "build-date" => "2012-07-09T09:09:42Z", "codename" => "").hash» | ||
pmichaud | hrm. | ||
22:59
Khisanth joined
|
|||
majrmovies | Well $*Perl<compiler><ver> would work for my purposes | 22:59 | |
err $*PERL<compiler><ver> | |||
pmichaud | majrmovies: yes. Just make sure the $*PERL<compiler><ver> gt '2012.06' | ||
er, ge '2012.06' | |||
we should probably provide a proper Version value, too. | 23:00 | ||
I'm not sure what happened to release-number and codename, though. | 23:01 | ||
23:01
fgomez joined
|
|||
pmichaud | majrmovies: anyway, I hope this is good enough for now. I think the spec needs a little more clarification on specifying minimum requirements :-) | 23:02 | |
23:02
spaceships left
|
|||
majrmovies | Thanks for your help! | 23:04 | |
23:05
majrmovies left,
nodmonkey left
23:08
whiteknight joined,
whiteknight is now known as Guest62195
23:10
cognominal_ joined
23:11
Coleoid joined
23:13
cognominal left
23:30
vlixes left
23:37
cognominal_ left
23:38
cognominal_ joined
23:41
zhutingting joined,
spider-mario left
23:57
seldon left
|
|||
Coleoid | Hi, #perl6... | 23:59 | |
I'm trying to get my | |||
Windows Rakudo build going... |