»ö« 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:04
spider-mario left
00:06
kivutar left
00:07
nebuchadnezzar left
00:17
nebuchadnezzar joined
00:22
drbean left
00:40
pjcj left
00:43
leprevost joined,
palakas__ joined
00:44
Targen joined
00:45
palakas_ left
00:47
shinobicl joined
|
|||
shinobicl | rakudo: Date.^methods.say; | 00:51 | |
p6eval | rakudo 6d5dc6: OUTPUT«get-daycount new-from-daycount today truncated-to delta clone succ pred is-leap-year days-in-month daycount-from-ymd ymd-from-daycount day-of-month day-of-week week week-year week-number weekday-of-month day-of-year check-value check-date truncate-parts new WHICH g… | ||
00:56
daniel-s left
00:57
daniel-s joined
01:01
MayDaniel left
01:25
pjcj joined
01:52
Su-Shee_ joined
01:53
Su-Shee left,
zby_home_ left
02:17
cognominal left
02:22
cognominal joined
02:23
FROGGS_ joined
|
|||
diakopter | FROGGS_: `hi | 02:24 | |
02:26
FROGGS left
02:38
mikemol joined
|
|||
stevan_ | hello perl6ers! | 02:50 | |
jnthn: moritz: masak: are you guys going to be at YAPC::EU? | |||
stevan_ is trying to decide if he should come to EU or not | |||
also, how many of the p6ixers are planing to attend YAPC::NA? | 02:56 | ||
diakopter | jnthn plans to | 03:01 | |
03:03
leprevost left
|
|||
stevan_ | excellent | 03:18 | |
swarley | converted most of HLL and QRegex into a ruby parsing grammar.. Working on NQP/Grammar.pm now. | 03:26 | |
timotimo | not long until rakudo can run on ruby as well! | 03:27 | |
swarley | timotimo, I'm working on compiling NQP to YARV bytecode | ||
Well I've just wasted a long tome | 03:30 | ||
time* | |||
timotimo | oh, you are? wow. | 03:31 | |
i didn't even know! :) | |||
yarv is "yet another ruby vm"? | |||
03:32
hulu joined
|
|||
hulu | masak: helo | 03:32 | |
lue | Am I seeing that right? class Panda in lib/Panda.pm is passing more variables to self.bless than it has attributes. | 03:34 | |
timotimo | did you look at Pies, too? | 03:35 | |
Pies has 4 more, with Panda's 5 attributes, it matches perfectly | |||
lue | oh, duh. (I have Pies.pm on screen too, just didn't think of it) | ||
timotimo | is it late at your place, too? ☺ | 03:36 | |
lue | 19:35 right now. | ||
so no :) | |||
What's worse is, I figured out earlier that nextwith and nextsame were referring to Pies methods in Panda.resolve | 03:37 | ||
timotimo | :)) | ||
diakopter | swarley: why wasted? | 03:43 | |
04:01
Ayiko left
04:08
preflex_ joined
04:09
preflex left,
preflex_ is now known as preflex
|
|||
TimToady | grondilu: .chars and * mean the same thing there in .substr, as it happens, and * is less error prone, since it doesn't reference outside the substr again | 04:19 | |
swarley | I lost track of what I wwas doing, and writing QAST for YARV turned into a NQP grammar in ruby | ||
TimToady | grondilu++ for the RC entry, btw | 04:20 | |
swarley | You know, If I can correctly get this to work, NQP would be able to compile code that can access Ruby code | 04:26 | |
\o/ | |||
whoop | |||
I wonder how I can add font-weight: 100000000000px; to "if" on that line.. | 04:27 | ||
timotimo | kind of makes me sad that there's only interop between perl6 and one of the languages, rather than perl6 and more than one other language | ||
TimToady | we have to replace Java or C# before people will be interested in that | 04:28 | |
timotimo | do it like the north korea people: <strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong>if</strong></strong></strong></strong></strong></strong></strong></strong>[...]</strong> | ||
lue | does absent in Pies::Project's State mean "not installed yet"? If so, L68-69 of Pies.pm is confusing me as to how it finds dependencies that need to be installed (unless I'm misinterpreting what the map statement's doing...) | 04:29 | |
timotimo | is there a statement for "installed, but no longer in the ecosystem"? | 04:30 | |
bleh, i should really go to bed | |||
lue | Well, I've so far added a "marked for installation" state, but because I'm bumbling around in code I don't know well, it won't do anything useful yet. :) | 04:32 | |
timotimo | what are you up to? | 04:33 | |
lue | Right now, adding a thing which tells you everything that's about to be installed before installing. Which means rearranging the order panda does things. (I'm working in a fork btw, so I'm not breaking any main code) | 04:34 | |
timotimo | that's cool :) | 04:37 | |
i wish you the best of luck! and good night to anyone whom it might concern ;) | |||
lue | I'd also like to give panda an update to new version of Perl 6 feature, but I have to be careful about that, as I can't just compile rakudo all the time. | 04:38 | |
good knight, timotimo o/ | 04:39 | ||
04:53
cognominal__ joined,
cognominal left
|
|||
swarley | what does this mean? $!name ? | 05:01 | |
lue now sees that the build order is figured completely separate from the dependency resolution | 05:02 | ||
swarley | has str $!name; | ||
lue | $!name is a private attribute in a class or role | ||
TimToady | swarley: that's a private attribute | ||
swarley | ah | ||
so <sigil>! is private? | |||
TimToady | there is also a private attribute $!name lurking behind a public attribute of $.name, which is really an accessor for the private attribute | ||
<sigil>! really means object-local storage, known only to the class | 05:03 | ||
it's the absense of <sigi>. that makes it private from the standpoint of "you can't access it" | 05:04 | ||
but all attributes have the ! form, even if they have a public accessor | |||
well, a synthetic attribute would have only the accessor, I guess | 05:05 | ||
but the point is someone from outside doesn't need to know whether $.name maps directly to $!name or to something else | |||
this preserves the ability to change the implementation without changing the public API | 05:06 | ||
lue | oh, looks like build-order in Panda::Builder is the order to compile files *within* one module. nvm then. | ||
05:12
alec left
05:15
telex left
05:17
telex joined
05:21
xinming left
05:23
xinming joined
05:26
kaare_ joined
|
|||
lue | *headdesk* C<next> means next iteration of loop, *not* next statement in the code. That completely changes the meaning of things. | 05:26 | |
perl6-debug++ | 05:27 | ||
swarley | so, what is this | 05:30 | |
pir::escape__Ss | |||
05:32
alec__1 joined
|
|||
lue | that is a PIR opcode that you can use outside of PIR. The part after the __ describes its arguments and what it returns, but I don't know what they mean. | 05:32 | |
(I *think* s = takes a string and S = returns a string) | |||
swarley | Well I assumed all of that much | 05:33 | |
I was more interested in the escape | 05:34 | ||
Sorry, my computer lost connection and I detached from my BNC, did anyone say anything about my question while I was gone? | 05:40 | ||
TimToady | nope | ||
but we'd all like to escape PIR... :) | 05:41 | ||
06:02
MikeFair left,
benabik left
06:09
benabik joined
|
|||
TimToady | moritz: not, p5 does other compile-time optimizations as well, like turning $a++ into ++$a when in void context, and bypassing nops in the peephole optimizer, and turning @foo[1] into a faster instruction | 06:16 | |
*no | |||
it turns "and not" into "or", and such | 06:18 | ||
06:19
shinobicl left
|
|||
TimToady | it can turn a copying sort into an inplace sort | 06:24 | |
06:25
sevin joined
|
|||
TimToady | similarly can make @a = reverse @a into an inplace reverse | 06:25 | |
it will also optimize iterators and reversed iterators | 06:27 | ||
and that's all just from the peephole optimizer | 06:28 | ||
propagating void context down the tree also suppresses a lot of computation | |||
and at least the propagation part is mostly compile-time, even if the suppression happens at run time | 06:29 | ||
perhaps the most important compile-time optimization is to not copy stuff back and forth when you have a sequence of concats | 06:37 | ||
so it's a lot more than just constant folding | 06:38 | ||
06:45
kaare_ left
|
|||
TimToady | (was a question to nwc10 about p5 that I hijacked) | 06:48 | |
lue | Finally got panda to pretty-print a list of dependencies, but now that's all it does. (I pushed it to my fork ICUC). Anyway, good ♞ #perl6 o/ | 07:35 | |
swarley | bah.. The only only way to do this would would be at least a little slow.. I'm not quite sure how it actually reduces the bytecode down from it's intermediate representation.. | 07:43 | |
07:50
am0c joined
08:08
sevin left
08:09
domidumont joined
08:12
nnunley left
|
|||
pmurias | swarley: you are not sure how QAST is turned into PIR? | 08:30 | |
08:30
domidumont left
|
|||
swarley | No, I'm talking about ruby's ISEQ to YARV | 08:31 | |
08:31
domidumont joined
08:33
sevin joined
|
|||
pmurias | swarley: you could try generating ruby ;) | 08:38 | |
08:47
Liz_ joined
|
|||
pmurias | swarley: or does generating bytecode give you more flexibility? | 08:54 | |
08:54
am0c left
09:01
pmurias left
09:05
Liz_ is now known as lizmat
|
|||
eternaleye | timotimo: For 'installed but no longer in the ecosystem', perhaps 'orphaned' (based on rpm's terminology)? OTOH, some places use that to refer to ENOMAINTAINER | 09:18 | |
The amusing option would be 'pining' | 09:19 | ||
...On second thought, I *really* like 'pining' for that. | 09:20 | ||
Because it's not dead. | |||
09:21
cognominal__ left
09:23
sevin left
09:42
Su-Shee_ is now known as Su-Shee
09:45
Psyche^ joined
09:48
Patterner left,
Psyche^ is now known as Patterner
09:55
PacoAir joined
09:59
spider-mario joined
|
|||
masak | good forenoon, #perl6 | 10:01 | |
hulu: helo | |||
nwc10: I'm going to YAPC::EU. I know jnthn is, too. | 10:03 | ||
jnthn | morning o/ | 10:06 | |
masak: It was stevan_ who asked, not nwc10, I think :) | 10:07 | ||
diakopter | o/ | 10:08 | |
masak | jnthn: oh! yes. | 10:10 | |
stevan_: ^^^^ | 10:11 | ||
10:14
lizmat left
10:18
FROGGS_ is now known as FROGGS
|
|||
masak | so, I've been thinking. | 10:18 | |
FROGGS | hi there | ||
jnthn | uh-oh | ||
masak | especially because of the historical overview lizmat gave yesterday abotu Perl 5 and Perl 6. | ||
but also because of the (unexpectedly) positive feedback I got from my live demo yesterday. | 10:19 | ||
it's like, I've been living in a little echo chamber of my own lately, not realizing how well we're doing on some counts with Perl 6, and how not-well we're doing with others. | |||
so I'm drafting a blog post, and I'd like early feedback on it. any feedback, really. | 10:20 | ||
here's the draft: | |||
gist.github.com/43f95c5ba980dfee8cee | |||
what I'm saying is in no way new. | |||
it's just a distillation of what should be our focus in the next 3-4 years. | |||
FROGGS | jnthn: how can it be that nqp parses /$(1)/ as metachar:sym<nqpvar>($(1)), but under rakudo it will be treated as nqp's metachar:sym<$>($) and metachar:sym<( )>((1)) ? | 10:22 | |
since rakudo's metachar:sym<rakvar> is able to match it | 10:23 | ||
it's a bit frustrating | |||
jnthn | FROGGS: Does one have a longer longest prefix than the other? | 10:25 | |
FROGGS | what is a prefix? | ||
the method name? or stuff like <?before ... | 10:26 | ||
jnthn | What's in the rule | ||
The thing that determines what is called first is LTM | 10:27 | ||
masak: While on threads there's not much spec progress, there's a lot of spec'd features that allow parallelism. | 10:28 | ||
masak: That is to say, it's not like nobody has thought about it in the design at all. | |||
FROGGS | gist.github.com/63fd03de7f3dec132dc9 | 10:29 | |
masak | jnthn: oh. I consider that bit of the spec extremely slushy. | 10:30 | |
jnthn: on the level of "it would be nice if X (but no-one's tried this)" | |||
FROGGS | jnthn: <var> should be the longest token to match, no? | ||
jnthn | FROGGS: Calls to LANG don't participate | 10:31 | |
FROGGS: Thus the "before" stuff | |||
FROGGS | damnit | ||
jnthn | (in nqpvar) | ||
FROGGS | k | ||
learning++ | |||
thank you | |||
jnthn | masak: At the level of "how do we start a thread", "how do we control degree of parallelism of a hyper", etc, it's very slushy. I just meant that >>+<< is already spec'd as parallelizable, feed operators are producer/consumer, the hyper/race context... | 10:32 | |
Even if we don't know the API to the lower level bits, we've various bits of declarative parallelism written into the spec. | 10:34 | ||
masak | jnthn: *nod* | ||
10:34
Liz__ joined,
Liz__ left
|
|||
masak | jnthn: I agree that those three things you mentioned are well-spec'd. I think it's still debatable whether people who will use parallelism in Perl 6 will rely mainly on those constructs. | 10:35 | |
jnthn | masak: Well, it's not the 90s any more so we'd better have a better story than "well, you start a thread then..." :) | ||
masak | jnthn: full ACK. | 10:36 | |
diakopter | HUP | ||
masak | we need the higher-level building blocks. | ||
dalek | p-jvm-prep: 02ad1da | (Gerhard R)++ | Makefile: Fix name of setting rule in Makefile |
||
p-jvm-prep: 34bd10f | jonathan++ | Makefile: Merge pull request #11 from gerdr/master Makefile fix |
|||
masak | I'm just positing that it's hard to predict which ones will be popular/useful. | ||
& | 10:37 | ||
diakopter | fg | ||
jnthn | masak: indeed | 10:38 | |
arnsholt | jnthn: Unless you have any last minute comments, I'll merge my branch into master soonish | 10:55 | |
jnthn | arnsholt: No, I'm happy with it. | 10:59 | |
arnsholt | Excellent. Just gonna have breakfast first =) | 11:00 | |
jnthn | :) | ||
jnthn is mostly tied up with pre-Stockholm-trip errands | 11:01 | ||
arnsholt | Usually good to get those out of the way | 11:04 | |
More teaching next week? | |||
11:05
MayDaniel joined
|
|||
nwc10 | moritz: also, constant folding isn't done by the peephole optimiser :-) | 11:06 | |
FROGGS | jnthn: is the <?before already a token? or do I need to capture things inside? | ||
nwc10 | Perl 5 does it at op construction time. If you ask to build the binary op for +, and give the constructor a constant op for the left argument, and a constant for the right argument, you don't get back an add op. You get back a constant for the result | 11:07 | |
11:10
Su-Shee left
|
|||
jnthn | FROGGS: Things in <?before ...>, provided they are themselves declarative, count as part of the declarative prefix for LTM | 11:11 | |
11:12
Ayiko joined,
Su-Shee joined
|
|||
jnthn | nwc10: I guess that means you don't have the problem of post-declared overloads... :) | 11:12 | |
(we couldn't implement it like that in Perl 6 for that reason...) | 11:13 | ||
nwc10 | I didn't write it that way, and I'm not even aware of post-declared overloads :-) | ||
jnthn | arnsholt: This time a mix of teaching and workshop for a single company, rather than an open classroom session. | 11:14 | |
errand, bbiab | |||
11:18
fgomez left
|
|||
moritz | stevan_: I'm trying to convince my employer to send me to YAPC::EU. I think my chances are 80%. | 11:19 | |
TimToady, nwc10: thanks for the explanations | 11:20 | ||
11:22
sampo joined
11:23
GlitchMr- joined
|
|||
arnsholt | Gah. Updated bootstrap use the old REPR compose stuff, it seems | 11:24 | |
11:27
GlitchMr left
|
|||
arnsholt | jnthn: Halp? | 11:28 | |
11:35
MayDaniel left
11:39
PacoAir left
|
|||
timotimo | good morning | 11:40 | |
ish :) | |||
FROGGS | morningish timotimo :o) | 11:41 | |
timotimo | in my between sleep and wake state, i wondered how hard it would be to build something like ikiwiki. also, how useful it would be to write a piece of perl code that outputs the same thing as pygmentize, but uses the official (or even STD) perl6 grammar for more accuracy whenever you can afford to run an actual perl6 interpreter (with, i guess, the restricted setting, so that BEGIN blocks won't kill you) | 11:43 | |
11:43
sampo left
|
|||
timotimo | hm, would using different Actions prevent evil code from hurting me? | 11:48 | |
jnthn | arnsholt: What's exactly wrong? Both branches did make bootstrap-files? | 11:51 | |
Separately? | |||
arnsholt | No, but since I last merged master, the bootstrap stuff has been updated, and it uses the intermediate REPR compose protocol it seems | 11:53 | |
jnthn | Ah... | ||
arnsholt | I get the "get_pmc_keyed_str() not implemented in class 'ResizablePMCArray'" error | ||
jnthn | Ah, and the updated again version lives in your branch? | 11:54 | |
arnsholt | No, I never updated the bootstrap files | ||
Er, yes | 11:55 | ||
jnthn | Yes, but I mean the updated repr_compose code. | ||
arnsholt | Yeah, yeah | ||
jnthn | OK | ||
arnsholt | That's in my branch | ||
(I misunderstood your question initially) | |||
jnthn | Maybe the best way is to comment out the repr_compose code in master, do make bootstrap-files to get rid of it so everything falls back to the old way. Then merge. | ||
arnsholt | Right. I'll try that | 11:56 | |
jnthn | The bootstrap-files update I did was for unrelated reasons, probably to get some nqp::ops | 11:57 | |
arnsholt | Aha | 11:58 | |
FROGGS | timotimo: what is ikiwiki about? | 12:00 | |
timotimo | FROGGS: it's a wiki engine that transforms markdown into html, at its most basic. it is usually backed by a VCS like git and most people deploy it with a cgi script that allows creating/editing/commenting. it has many neat plugins and special ikiwiki plugin syntax | 12:05 | |
timotimo just found out how to teach vim to treat $foo-bar as one keyword: set the iskeyword string to include -, too | |||
and that's all there is to it :) | 12:06 | ||
FROGGS | I like the wikimedia wiki... we use it at work too | 12:07 | |
jnthn | Add ' too ;) | ||
timotimo | ah, it's already in the perl6.vim ftplugin in the vim-perl repo | ||
FROGGS | I should fiddle with the scite language files some day | ||
timotimo | r: my $foo-bar'jnthn' = 10; | ||
p6eval | rakudo 6d5dc6: OUTPUT«===SORRY!===Two terms in a rowat /tmp/Pv1pJtSQf0:1------> my $foo-bar'jnthn⏏' = 10; expecting any of: scoped declarator constraint postfix infix or meta-infix infix stopper … | ||
timotimo | ah, well, not at the end obviously | ||
r: my $foo-bar'jnthn = 10; | 12:08 | ||
p6eval | rakudo 6d5dc6: ( no output ) | ||
FROGGS | right | ||
timotimo | i don't really think the iskeyword string encodes that difference, though | ||
arnsholt | jnthn: Thanks for the help. Looks like things are back on track | ||
jnthn | \o/ | ||
arnsholt | Or not. Hmm | ||
FROGGS | r: my $o-'O'-o = "yay" | 12:09 | |
p6eval | rakudo 6d5dc6: OUTPUT«===SORRY!===Preceding context expects a term, but found infix = insteadat /tmp/Eb7OZh7JxM:1------> my $o-'O'-o =⏏ "yay"» | ||
jnthn | /o\ | ||
FROGGS | ohh | ||
r: my $o-o'O'o-o = "yay" | |||
jnthn | std: my $o-'O'-o = "yay" | ||
12:09
PacoAir joined
|
|||
p6eval | rakudo 6d5dc6: ( no output ) | 12:09 | |
std 7deb9d7: OUTPUT«===SORRY!===Preceding context expects a term, but found infix = instead at /tmp/QCfQMr8jkm line 1:------> my $o-'O'-o ⏏= "yay"Parse failedFAILED 00:00 43m» | |||
jnthn | hm, I thought STD may do a better error :) | ||
FROGGS | but it is cool to have ' too | ||
FROGGS .oO( class Cat { * }; class Cat's-Ball { * } ) | 12:10 | ||
jnthn tries to read that class name the innocent way | 12:11 | ||
FROGGS | hehe | 12:12 | |
12:22
MayDaniel joined
|
|||
FROGGS | jnthn: is there a trick to debug LTM? | 12:26 | |
12:27
Targen left
|
|||
hulu | my @scores = 'Ana' => 8, 'Dave' => 6, 'Charlie' => 4, 'Beth' => 4; why not %scores | 12:27 | |
timotimo | well, what you have there is an ordered list of pairs | 12:28 | |
a hash wouldn't be ordered, would it? | |||
r: my @scores = 'Ana' => 8, 'Dave' => 6, 'Charlie' => 4, 'Beth' => 4; say @scores.perl; say @scores.hash.perl | 12:30 | ||
p6eval | rakudo 6d5dc6: OUTPUT«Array.new("Ana" => 8, "Dave" => 6, "Charlie" => 4, "Beth" => 4)("Ana" => 8, "Dave" => 6, "Charlie" => 4, "Beth" => 4).hash» | ||
jnthn | Hash order is not reliable,no. | ||
hulu | timotimo: what's means of "Perl 6’s precedence rules state that the in x => operator binds its arguments more tightly than the in x , operator, which in turn binds more tightly than the = assignment operator." | ||
jnthn | FROGGS: Not really...you could try writing a small grammar with the kinds of things you're trying to do in and see how it works. | ||
FROGGS: Grammars written in Rakudo that do LTM use the same engine as NQP uses for the Perl 6 grammar itself. | 12:31 | ||
timotimo | hulu: it means that if you write something like $x = "foo" => 1, "bar" => 2 it will be parenthesized like this: ($x) = (("foo" => 1), ("bar" => 2)) | 12:32 | |
hulu | 优先级 | ||
timotimo | compare that with regular maths. = is like =, => is like * and , is like + | ||
$x = "foo" * 1 + "bar" * 2 ← same "structure" | 12:33 | ||
hulu | i c | ||
thx | |||
timotimo | np :) | ||
arnsholt | jnthn: Think I understood what I was actually supposed to do this time around | 12:34 | |
Making sure Rakudo isn't broken now | |||
Which, in fact, it is | 12:37 | ||
timotimo | moritz: in 5-to-6, it says "The answer is that Rakudo doesn't do longest token matching yet, but matches sequentially." in the XML example, that could use an update ;) | 12:41 | |
(am i just stating the obvious?) | |||
12:42
vividsnow joined
12:45
Targen joined,
not_gerd joined
|
|||
jnthn | gotta head up to Stockholm & | 12:49 | |
hulu | timotimo: thx | 12:51 | |
12:53
kaare_ joined
12:55
kivutar joined
|
|||
masak | hulu: yes, 优先级 is "precedence". which thing gets evaluated first. | 13:01 | |
13:03
Chillance joined
|
|||
sjn | masak: How's the Ada room? :) | 13:05 | |
timotimo | gentlemen, you can't code in here, this is the programming room! | 13:08 | |
sjn | timotimo: surely a scripted response, if I ever heard one! :) | 13:11 | |
13:23
not_gerd left
|
|||
moritz | timotimo: updated | 13:24 | |
good afternoon, #perl6 | |||
13:24
vividsnow left
|
|||
timotimo | cool, moritz :) | 13:24 | |
13:28
tokomer joined,
Chillance left,
hulu left
13:29
Chillance joined
|
|||
timotimo | so, i've asked in #pypy if python bytecode would be a sensible target for nqp. fijal said it'd be easier to write a whole new VM in rpython than to try to shoehorn perl6 into python bytecode | 13:47 | |
he also says when we target the jvm, we'll have to abstract away so much of the perl6 semantics, that we're basically "compiling to a garbage collected C" and performance will suck | |||
moritz | garbage collected C is perfect. | 13:48 | |
shachaf | I hear the JVM is pretty awful as a compilation target for things that aren't Java. | ||
timotimo is really not the right person to do that discussion | 13:49 | ||
13:49
kivutar left
13:53
fijal joined
|
|||
fijal | hi | 13:53 | |
timotimo | there he is :) | ||
moritz: do you know enough about nqp-jvm and parrot to explain/argue properly? i sure don't. | |||
and at just that moment, my modem decides to go belly-up | 13:55 | ||
so, fijal, your argument is that jvm has the absolute wrong semantics, so that mapping perl6 to jvm is a dumb idea and performance will suffer to a ridiculous degree, right? | 13:56 | ||
fijal: and that it would be easier to create a new, custom VM to run perl6 that uses, for example, pypys tracing jit generator technology to get good performance | 13:57 | ||
moritz | timotimo: not really | ||
(I don't really know enought about nqp-jvm) | |||
fijal | it's definitely easier than on top of JVM | 13:58 | |
or comparabl;e | |||
but it'll run faster | |||
Su-Shee | well ruby and python managed to put themselves onto the jvm and clojure took it even further so I don't see why Perl6 can't do it. | ||
moritz | fwiw we tried the approach with our own VM (parrot) | ||
and it kinda works, but not fast | |||
arnsholt | From what jnthn has blogged, JVM doesn't seem to be too much trouble so far | ||
moritz | no good JIT compiler, for example | 13:59 | |
fijal | Su-Shee: well | ||
Su-Shee: pypy is massively faster | |||
Su-Shee: if you care | |||
Su-Shee | I totally don't care. I want the clojure concept which means you have your favorite language AND can incoporate all kinds of existing java libraries which is insanely practical.. so speed? yeah, later. | 14:00 | |
arnsholt | From a pub conversation with jnthn I think he's at least in partial agreement that the best of all worlds would be a VM specifically tuned for Perl 6 and its special things | 14:01 | |
But making a VM, including proper fast GC, JIT compilation and all the bells and whistles is a massive, massive undertaking | |||
timotimo | (except with pypy you get the GC and JIT for free) | 14:02 | |
spider-mario | how hard do you think it would be to use JNI to make Perl 5 modules available to Perl 6-on-JVM? | ||
arnsholt | spider-mario: Good question. There was a module that embedded a Perl 5 in Parrot, but can't remember the name off hand | 14:03 | |
moritz | blizkost | ||
arnsholt | Right, blizkost | ||
fijal | arnsholt: pypy is not python-specific | ||
that'\s a difference | |||
arnsholt | I know pypy isn't Python specific | ||
fijal | Su-Shee: JVM libraries kinda suck, but yeah | ||
arnsholt | How much typing does pypy do? | ||
fijal | arnsholt: as in? | 14:04 | |
spider-mario | well, JVM libraries are often designed for Java | ||
Su-Shee | fijal: not having any sucks even more ;) | 14:05 | |
fijal | Su-Shee: sure | ||
arnsholt | fijal: Types of the "this variable is of type X" kind | ||
moritz | static type information that the optimizer can use | ||
14:05
vividsnow joined
|
|||
fijal | arnsholt: it happens automatically | 14:06 | |
14:06
b1rkh0ff left
|
|||
timotimo | no type annotations are written, only assertions. the whole program is globally type-inferred | 14:06 | |
arnsholt | Cause Python isn't really typed as such, isn't it? | ||
fijal | arnsholt: you don't leave hints in the interpreter | ||
timotimo: stop confusing people ok? | |||
timotimo | i'll shut up | ||
fijal | arnsholt: so you write an interpreter in RPython (a language) | ||
that part is statically typed | |||
arnsholt | Right | 14:07 | |
fijal | just like Java | ||
however, the program you're interpreting is not statically typed at all | |||
but the JIT is able to pick up the types | |||
(and other information) | |||
arnsholt | I see | ||
fijal | pretty much the same as JVM will do escape analysis | 14:08 | |
except we are obviously more geared towards the use cases that are more common in writing interpreters | |||
so we'll have the frame support that JVM lacks | |||
does perl6 have frame support? | |||
like "give me all local variables" | |||
or so? | |||
masak | sjn: Ada room was an interesting mixture of mundane and fascinating. :) | 14:09 | |
moritz | fijal: yes | ||
you can introspect lexical pads | |||
masak | I'm battery-bound here, but I have to dump a few things here from the "What's new in Ada 2012" talk :) | ||
fijal | moritz: that kills JVM performance | ||
because you cannot prove it does not escape usually | |||
masak | first, nice to see that Ada is stealing the junction syntax for or junctions. (in a very delimited, statically-desugarable context, but still.) | ||
(also, this has happened before. Java 7 does the same for exceptions, IIRC) | 14:10 | ||
moritz | fijal: well, in general lexicals have to be compiled to heap objects | ||
masak | second, there is a thing that I would like Perl 6 to steal from Ada: subtype defaults. I hadn't really realized how much I had missed this. | ||
moritz | (because of closures etc.) | ||
masak | at first opportunity, I will spec subtype defaults. feel free to protest loudly before or after. I believe it will be a definite improvement. | 14:11 | |
semantically, unassigned variables and unbound parameters of a subtype will get the default. | |||
arnsholt | fijal: It's a shame jnthn isn't here. He's the one who actually knows these aspects of the compiler the best | 14:12 | |
masak | proposal: 'subset Odd of Int where { $_ % 2 } default 1' | ||
I also propose that defaults be optional, and that the default default be the default of the parent type. | 14:13 | ||
fijal | arnsholt: ok, you can find me on #pypy if you want | ||
timotimo | fijal: assuming someone were to write a VM using rpython so that nqp could translate rakudo to that VM and rakudo could emit that-vm-bytecode, would the jit still be able to get good performance, or would most of the compiler have to be in rpython, too? | ||
14:13
vividsnow left
|
|||
masak | the only thing I'm not sure of is whether to die at parse time if the default is not provided and the default default doesn't comply -- like with Odd above. | 14:13 | |
moritz | masak: on a related topic, I once tried to implement $var = Nil resetting to the default. In the end the problem was that we don't store the default value, and some variables are typed Mu but default to Any | 14:14 | |
fijal | timotimo: jit does not particularly care where did you take your bytecode from | ||
timotimo: obviously if the parser and compiler is in perl too, you need more time to compile stuff | |||
but of course you can serialize it too | |||
masak | moritz: I'm too unfocused to analyze these things right now. consider me in dump mode, and I'll contemplate later. ;) | ||
moritz: but yes, that's interesting to hear. | 14:15 | ||
moritz | masak: so we might need to store some defaults somewhere. But I'm not sure if it's per container or per type | ||
timotimo | well, it's in nqp, so maybe nqp could be translated into rpython-compliant python bytecode? | ||
masak | listening to the Ada talk, it was clear to me that we are missing defaults on subtypes. | ||
also, an interesting mini-insight on pre/postconditions: if a precondition fails, it's someone else's fault -- the user's or some consumer library's. if a postcondition fails, it's your fault. | 14:16 | ||
obvious but a nice way to phrase it. | |||
it shows how they're kinda different beasts. | |||
moritz | that's well known in the DBC community :-) | ||
masak | suspected that :) | ||
fijal | timotimo: what's rpython-compliant python bytecode? | 14:17 | |
timotimo: why do you insist on python bytecode? | |||
how is compiling anything to python bytecode easier than implementing it? | |||
I fail to understand that | |||
timotimo | you're right, there would still have to be the other VM, too. | ||
the thought was to put the resulting code into the rpython translation toolchain, too | 14:18 | ||
fijal | why would you do that? | ||
I think you're confusing various layers | |||
timotimo | i probably am | ||
fijal | you write code in RPython that interprets perl | ||
this is simpler than you write a compiler from perl to JVM | |||
or at least not worse | 14:19 | ||
yes, you have to make a bytecode format, but it's nothing special | |||
this is not the hard part | |||
the hard part is getting all the details of the semantics right | |||
timotimo | the format itself is less the problem than what bytecodes there should be and what they do | ||
yes | |||
fijal | and it's easier with interpreter than compiler | ||
14:19
b1rkh0ff joined
|
|||
fijal | especially if the language was designed with the interpreter in mind | 14:20 | |
masak | so, I've been to a Java talk, a Smalltalk talk, an Ada talk, and now I'm waiting for a SpiderMonkey talk. I feel very eclectic today. ;) | ||
fijal | masak: :) | 14:21 | |
masak: what is it? | |||
tadzik | eclanguic | ||
masak | fijal: I'm at FOSDEM. | ||
fijal: dictionary.com says "eclectic" means "selecting or choosing from various sources" | 14:22 | ||
(just like Perl) :P | |||
timotimo | i interpreted it as "what spidermonkey talk are you going to attend" | ||
masak | it's the same root as for "select" and "elect". | ||
timotimo: oh! | |||
fijal | masak: cool, I wish I was there | 14:23 | |
masak | it's about SpiderMonkey GC in Firefox. | ||
fijal | masak: ask them if they managed to fix the leak if you have a cycle between JS and DOM objects | ||
(evil laugh) | |||
masak | dude, that was IE6 :P | ||
fijal | masak: no, chrome was leaking such stuff recently | 14:24 | |
and ffox | |||
masak | really? do you have an URL to back that up? | ||
that sounds awful. | |||
fijal | well, how do you deal with it? | ||
you have reference-counted C++ objects | |||
masak | (and I'd very much like to troll the speaker that way) :) | ||
fijal | and a real GC in the JS | ||
moritz | GC | ||
masak | fijal: surely Firefox doesn't do refcounting still? | ||
tadzik | well, the talk is about GC, so... | 14:25 | |
masak | or do you mean the DOM needs to do refcounting? | ||
fijal | masak: in C++? | ||
14:25
sizz left
|
|||
masak still feels this would be so much easier to talk about with an URL to the incident | 14:25 | ||
a URL* | 14:26 | ||
14:26
sizz joined
|
|||
fijal | masak: you can just ask him what happens if you have a reference to a DOM object from JS that references back to JS object | 14:26 | |
masak | I found this: stackoverflow.com/questions/6478864...in-firefox | ||
fijal: ok. will do. | |||
fijal | it's kinda hard to find a reference | ||
timotimo | fijal: tell me if i'm confusing layers again: if i were to write a VM using rpython and have NQP target that VM, would that be sensible performance-wise? this way, a rakudo could be compiled down to that VM at least. | ||
fijal | timotimo: what's NQP? | 14:27 | |
tadzik | -_- | ||
timotimo | it's kind of rpython-but-perl6 | ||
simpler syntax, fewer built-ins, only := (binding) instead of = (assignment) | |||
fijal | as in, is it statically typed perl or so? | ||
masak | oh, this resource looks better: stackoverflow.com/questions/3750797...javascript | ||
timotimo | not really | 14:28 | |
masak | fijal: it's a bootstrapping subset of Perl 6. | ||
fijal: desugared lowish-level base components to build a Perl 6 compiler. | |||
fijal | stackoverflow.com/questions/1009261...ence-issue | ||
masak: | |||
masak | thank you. :? | ||
:> | |||
fijal | timotimo: you can compile it to the VM of your choice, yeah | 14:29 | |
especially if it helps you bootstrap | |||
14:29
clkao left
|
|||
masak | fijal: that makes the issue much clearer. now I can troll with good conscience :) | 14:29 | |
timotimo | oh, that's probably what you meant with "focus on the interpreter" all the time | ||
to use an existing compiler to target that VM+interpreter | 14:30 | ||
fijal | timotimo: we actually moved pieces of pypy source code from RPython to Python | ||
because it can be specialized better | |||
14:30
GlitchMr- left
|
|||
fijal | masak: so IE6 is bad because it never does it | 14:30 | |
timotimo | i suppose in my head there was a bit of left-over concepts from when "interpreter" means "source code goes in, behavior comes out", rather than "bytecode goes in, behavior comes out" | ||
fijal | masak: while chrome/ffox keeps it as long as you keep the website open | 14:31 | |
which is still bad, I keep my gmail open whole day | |||
masak | fijal: right. | ||
fijal | timotimo: oh ok | ||
masak | I had no idea things are still this bad. for shame, browsers. | ||
fijal | masak: I like trolling those people because they're so full of themselves and they have an awesome PR | ||
masak | ok, battery low & | ||
timotimo | ciao masak! | 14:32 | |
fijal | if you ask a random dude, v8 is definitely by far the fastest thing | ||
timotimo | fijal: surely that problem would be better using a browser implemented completely in javascript, no? | ||
fijal | timotimo: that precise one, yes | ||
arnsholt | An all-JS browser would have to be careful to not let website JS modify the browser state, though | 14:33 | |
tadzik | and files on the filesystem, for example | 14:34 | |
timotimo | you should be able to handle that | ||
an interpreter/app level divide should be doable | |||
tadzik | as in, a JS browser must be able to read and write stuff to disk | ||
and you can end up with funny situation, like on the KIndle | |||
timotimo | well, you can certainly do that with node.js! | ||
14:35
SunilJoshi joined
|
|||
timotimo | anyway, i know 0 about VM/interpreter design. | 14:36 | |
it would certainly be better if someone with lots of experience with parrot came up with a more fitting VM design for perl6 | 14:39 | ||
or maybe we'll just wait and see how potion turns out. | |||
*or* implement the backend for potion and just steal potion bytecode + semantics and implement that with rpython | 14:40 | ||
endless possibilities are endless. | |||
hell, even implementing a parrot bytecode compatible VM could give performance improvements when using rpython. who knows? | 14:42 | ||
14:42
shinobicl joined
14:43
am0c joined
14:44
SunilJoshi left
14:51
GlitchMr joined
|
|||
moritz | nqp: nqp::say(nqp::isinvokable(sub () { }) ) | 14:58 | |
p6eval | nqp: OUTPUT«1» | ||
14:59
clkao joined
|
|||
masak | ok, back up. found an outlet :) | 15:00 | |
I did troll the speaker. he mumbled that they had some thing that would shuttle information from the GC to the C++ refcounter. | |||
didn't sound ideal. | |||
moritz | so, has the problem been solved? | 15:01 | |
masak | more like subdued or ameliorated, seemedlike. | ||
after this talk, I'm left with this thought: why the heck do we GC on the process level? why not just institute an OS-wide GC, and have a good API into it? | |||
moritz | loose coupling | 15:02 | |
masak | yeah, that's another thing. Firefox now has write barriers all over the place. | ||
that's hardly loose coupling. the whole application has to dance according to the music of the GC. | 15:03 | ||
geekosaur | because an OS-wide GC forces everything to use the same GC strategy, when GC is unlikely to be one size fits all. there's a paper out there which examined an OS-wide GC relative to the JVM, IRC | ||
masak | hrm, good point. | 15:04 | |
moritz | masak: there are very few cross-process pointers, so there's not much gain in having a cross-process GC | ||
also virtual memory makes such stuff decidedly non-trivial | |||
geekosaur | and they were able to tune it so it worked about as well as the current behavior, but it took some work because even just considering the JVM different machines may have different needs | ||
fijal | masak: we have the same | 15:06 | |
masak: but we don't write it by hand | |||
masak: the problem is C++ is too low level | |||
masak | *nod* | 15:07 | |
any time you leave the cozy GC'd world of your scripting language to bridge/interface with C or C++, I guess you run into this. | 15:08 | ||
fijal | well | ||
bridge/interface is fine | |||
because there are well defined semantics | |||
of C | |||
the problem is if you *write* your stuff in C | |||
you end up needing to have a write barrier everywhere | |||
it's a nightmare | |||
masak | aye. | ||
cf Parrot. | |||
I'm currently in love with RIAA and C#'s IDisposable/using pattern. | |||
fijal | RIAA is good | 15:09 | |
but solves 90% of the problem | |||
10% is still ugly | |||
masak | granted. | ||
but as percentages go, 90% is pretty good going. | |||
fijal | meh | ||
masak | I'm saying it's something to consider. | ||
fijal | masak: you know how we do it? | ||
masak | not really. | ||
we currently do it with LEAVE, and mumble about macros to fold even those in. | 15:10 | ||
fijal | we insert write barriers programatically | ||
while compiling RPython | |||
masak | makes sense. | ||
fijal | essentially an equivalent of a non-sucky GCC plugin | ||
masak | then you just need to get the codegen right :) | ||
15:10
benabik left
|
|||
fijal | this is the whole reason of RPython existance | 15:10 | |
yeah | |||
but there is one place | |||
which is maybe hard, but limited in size | |||
not a bit everywhere | |||
it's much easier to reason about | |||
15:11
benabik joined
|
|||
masak | aye. | 15:11 | |
fijal | I'm too dumb to remember to put write barrier everywhere | ||
masak | "keep things together that belong together." | ||
fijal | it's already hard enough in tests for the insertion :) | ||
masak | keeping single concerns from being scattered -- one of the mantras of AOP :) | ||
fijal | we have this and a handcoded assembler fast path | ||
which is a bit ugly I agree | |||
but very hard to do better | 15:12 | ||
masak | *nod* | ||
fijal | (wb ends up being 2-3 instructions in the good case) | ||
masak | nice. | ||
fijal | the same way malloc ends up being <1 cycle on average | ||
timotimo: ok, I think I understand this now | 15:17 | ||
timotimo: you would want an NQP interpreter on top of RPython | 15:18 | ||
should be even relatively trivial to pull off | |||
timotimo | i think the same bytecode that's used for the nqp interpreter must also be able to do all the things that rakudo-perl6 would want to emit, though, but i'm not quite sure :( | 15:22 | |
masak: can you help lift my confusion? | |||
fijal: in what way do you consider it "relatively trivial"? | 15:24 | ||
fijal | as in, much easier than compiling to JVM | ||
or implementing in C | |||
since you have quite a few cool data structures etc. | |||
(like strings!) | |||
timotimo | i understand why it would be easier to do than C :) | 15:25 | |
masak | timotimo: yes, basically Perl 6 doesn't do anything fundamentally new compared to nqp on the QAST level. | 15:26 | |
timotimo | well, that's a relief | ||
masak: you've got some insight into QAST. how complicated does a theoretical new just-for-perl6 VM have to become to be able to host nqp effectively? | 15:27 | ||
15:28
SunilJoshi joined
|
|||
masak | I'm not sure what you're asking. | 15:30 | |
I've touched QAST, yes. it seems a nice technology. | 15:31 | ||
nqp doesn't have very high demands on the VM, really. | |||
that's one of the nice things about it. | |||
of course, things like stack-based or register-based will affect how it's all implemented. | |||
timotimo | i have absolutely no frame of reference in which to evaluate "no very high demands" | ||
masak | what I mean is that nqp is quite a small language, with not too high demands on the VM. | 15:32 | |
time to down scope again. gotta leave this room :) | |||
& | |||
timotimo | have fun! :) | ||
timotimo imagines masak as a little submarine | |||
15:39
daniel-s left
|
|||
moritz has a too vivid mental image of masak as a person to imagine masak a submarine | 15:39 | ||
but I can easily imagine a small submarines where all the masak clones travel together | |||
timotimo | so, would the hypothetical vm have to supply lexical mechanisms? closures closing over things? classes? multiple dispatch? type checking? signature binding? tuples/lists/strings/hashes? | 15:41 | |
fijal | timotimo: who else? | 15:42 | |
timotimo | who else does what? | ||
moritz | well, it's possible for the generated code (and not the VM) to do that | 15:43 | |
timotimo | fijal hinted that sometimes it's better for the generated code to do that when using rpython | ||
so, is going with the "bare minimum" a good choice? it would probably make the qast-hypoVM backend quite a bit bigger, isn't that right? | 15:44 | ||
fijal | timotimo: who else implements that? | ||
timotimo | oh, you meant my list of features? i don't really know | 15:45 | |
fijal | someone has to | ||
timotimo | uh, i think i don't understand what you mean | 15:46 | |
15:46
kaare__ joined
|
|||
fijal | who implements a tuple? | 15:47 | |
yuo have to write it at some point | |||
timotimo | of course. the VM's interpreter would have to, i imagine | ||
15:47
kaare_ left
|
|||
timotimo | same as python, it has a create_tuple bytecode. i thought of that kind of thing | 15:47 | |
fijal | well | ||
that's just a bytecode | |||
there is a W_TupleObject | 15:48 | ||
which is the actual implementation | |||
timotimo: I suggest you walk around example_interpreter on the pypy's bitbucket website | |||
timotimo | i'll have a look | ||
benabik | You don't have to have create_tuple. You can have 'new Tuple' instead. | ||
15:49
MayDaniel left
|
|||
fijal | yeah whatever | 15:49 | |
FROGGS | yay, $(<code>) within regexes works now \o/ | ||
timotimo | right. all you need is a lambda and then you can make cons^H^H^H^Hintegers and cons cells | 15:50 | |
bleh. my internet connection is getting flaky | |||
benabik would not want to create REPRs in the pure lambda calculus. | 15:51 | ||
timotimo | fijal: it does seem somewhat simple, yes | 15:56 | |
16:07
fgomez joined
|
|||
timotimo | FROGGS: what does that do? | 16:07 | |
16:13
tokomer left
|
|||
FROGGS | nr: sub abc($x) { $x * 2 - 1 }; say "1234" ~~ /$(abc("12").substr(1))/ | 16:13 | |
p6eval | rakudo 6d5dc6: OUTPUT«===SORRY!===Non-declarative sigil is missing its nameat /tmp/D_wI2jx_SH:1------> abc($x) { $x * 2 - 1 }; say "1234" ~~ /$⏏(abc("12").substr(1))/ expecting any of: postfix infix or meta-infix infix … | ||
..niecza v24-18-gaf64300: OUTPUT«#<match from(2) to(3) text(3) pos([].list) named({}.hash)>» | |||
FROGGS | it is a contextualizer | ||
nr: sub abc($x) { $x * 2 - 1 }; say "1234" ~~ /$( abc("12") )/ | |||
p6eval | niecza v24-18-gaf64300: OUTPUT«#<match from(1) to(3) text(23) pos([].list) named({}.hash)>» | ||
..rakudo 6d5dc6: OUTPUT«#<failed match>» | |||
FROGGS | need to clean up, but then I can push to nom | 16:14 | |
n: say "abcd" ~~ / \w ** $( 1+1 ) / | 16:15 | ||
p6eval | niecza v24-18-gaf64300: OUTPUT«Potential difficulties: Unsupported use of atom ** $( 1+1 ) as separator; nowadays please use atom+ % $( 1+1 ) at /tmp/sFZNl1U74R line 1:------> say "abcd" ~~ / \w ** $( 1+1 )⏏ /#<match from(0) to(1) text(a) pos([].list) named({}.ha… | ||
FROGGS | hmmm, dunno I this is supposed to work | ||
std: say "abcd" ~~ / \w ** $( 1+1 ) / | 16:16 | ||
p6eval | std 7deb9d7: OUTPUT«Potential difficulties: Unsupported use of atom ** $( 1+1 ) as separator; nowadays please use atom +% $( 1+1 ) at /tmp/uWQaSi4GGr line 1:------> say "abcd" ~~ / \w ** $( 1+1 ) ⏏/ok 00:00 44m» | ||
timotimo | what? :) | 16:17 | |
FROGGS | you can put variables inside a regex, and it will match | ||
nr: my $x = "cd"; say "abcd" ~~ /$x/ | |||
p6eval | rakudo 6d5dc6: OUTPUT«「cd」» | ||
..niecza v24-18-gaf64300: OUTPUT«#<match from(2) to(4) text(cd) pos([].list) named({}.hash)>» | |||
FROGGS | but to insert code there, you need to wrap it inside <{ }> or $( ) | 16:18 | |
Celelibi | I suppose that the C written modules are not compatible at all between perl5 and perl6. Right? | ||
timotimo | oh okay | ||
FROGGS | Celelibi: right, even if you could pure perl5 modules directly atm, perlxs modules wont work | 16:20 | |
Celelibi | k | ||
16:20
fijal left
|
|||
FROGGS | there is NativeCall and Inline::C for that reason (to be able to port them) | 16:20 | |
timotimo | FROGGS: good work :) | 16:22 | |
FROGGS | timotimo: thanks | 16:24 | |
dunno what exactly you mean tbh | 16:25 | ||
timotimo | to be honest | ||
FROGGS | TimToady: is that supposed to work? say "abcd" ~~ / \w ** <{ 1+1 }> / or say "abcd" ~~ / \w ** $( 1+1 ) / | 16:26 | |
timotimo: "good work" <-- what do you mean? | 16:27 | ||
timotimo | it's good that you did that :) | 16:29 | |
16:30
cognominal joined,
SunilJoshi left
|
|||
FROGGS | k :o) | 16:35 | |
16:36
PacoAir left
16:52
cognominal__ joined
16:53
am0c left
16:54
cognominal left
|
|||
nwc10 | is the levenshtein code that's tweaked to run under NQP-JVM available anywhere? | 17:04 | |
17:08
SunilJoshi joined
17:10
pmurias joined
17:13
kaare__ is now known as kaare_
17:18
shinobicl left
|
|||
pmurias | timotimo: re creating yet another custom VM, I think it would be better to focus effort on existing nqp backends then create yet another one | 17:19 | |
timotimo | nwc10: it was a literal 1:1 copy of the levenshtein sub from World.pm in rakudo | 17:21 | |
the only changes were to turn nqp::join into ~ and to turn the <= into < for the switch-letters code at the bottom | |||
pmurias: the pypy tracing jit and pluggable GC technology is darn nice, though. | 17:25 | ||
swarley | Alright, just finished the Nodes for YARV QAST | 17:27 | |
pmurias | swarley: do you have that commited somewhere? | 17:29 | |
swarley | No, but it's pretty much the same as nqp-jvm's | ||
Except without the opcodes | |||
And it uses a YARV iseq skeleton subroutine at the bottom | 17:30 | ||
which should just be a constant now that i think about it | |||
well, does nqp/perl6 have something like dup in ruby? | 17:31 | ||
Duplicates the object so that you don't modify the original | |||
pmurias check how nqp::clone works | 17:32 | ||
* checks | |||
17:34
MikeFair joined
|
|||
pmurias | swarley: there is pir::repr_clone__PP($obj) | 17:37 | |
swarley: what do you want to clone? | |||
17:37
SunilJoshi left
|
|||
TimToady | nqp: say(42.WHAT); say((42 but Real).WHAT) | 17:38 | |
p6eval | nqp: OUTPUT«Confused at line 2, near "say((42 bu"current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)» | ||
TimToady | I guess nqp doesn't do "but"? | ||
masak | correct. | 17:39 | |
nwc10 | Mmm, that's interesting. I get different answers when running under NQP and NQP-JVM | 17:40 | |
pmurias | swarley: once you have something (semi) working I would be very interested at look at your code to see what approach are you using ;) | 17:41 | |
swarley | No, I don't really have anything working yet, I'm working on setting up the toplevel node right now. If I declare a nqp::hash() can I access it like a normal p6 hash, or do I use nqp methods? | 17:44 | |
pmurias | you mean my $foo := nqp::hash()? | 17:45 | |
swarley | yes | 17:46 | |
pmurias | nqp: my $foo := nqp::hash();$foo<bar> := 123;say($foo<bar>); | ||
p6eval | nqp: OUTPUT«123» | ||
swarley | oh good | ||
pmurias | swarley: have you seen t/nqp in the nqp repo? | 17:47 | |
swarley | I haven't looked at it really | ||
pmurias | it can be used for examples of what's valid in nqp ;) | 17:50 | |
swarley | I'll give the Nodes.nqp file out once I've finished RAST::Root | 17:53 | |
But like I said, I basically retyped jnthn's Nodes.nqp | 17:54 | ||
RAST::Root is the first thing I've really had to code myself | |||
but then again, after retyping everything, i believe there are only a few ways to do what was done | 17:55 | ||
17:59
MikeFair left
18:00
swarley| joined
18:03
MikeFair joined
|
|||
jnthn | o/ from Stockholm | 18:09 | |
timotimo | hey jnthn | ||
arnsholt | \o | ||
timotimo | i bugged fijal from the pypy team to come over and rant about jvm a bit, hope you'll enjoy the backlog :) | ||
18:10
swarley- joined
|
|||
jnthn | Yes, I kinda followed. | 18:11 | |
From the irclog on the train :) | |||
timotimo | oh, OK | ||
jnthn | I think anybody considering porting NQP needs to remember that this involves (a) 6model, (b) the bounded serialization stuff, and (c) the grammar engine. :) | 18:12 | |
timotimo | i was afraid of that, especially the grammar engine part. | 18:13 | |
arnsholt | I seem to recall a conversation from the Oslo hackathon where you said something to the effect that Perl 6 ideally wants a VM with a bit less typing than JVM/CLR, but more than Perl/Python usually operate with | ||
That right? | |||
18:13
swarley| left
|
|||
jnthn | arnsholt: Something like. Really it boils down to, "understands 6model". | 18:13 | |
arnsholt | True, true | ||
stevan_ | jnthn: howdy | ||
18:13
swarley| joined
|
|||
benabik has pondered welding together 6model + libgc + llvm. | 18:14 | ||
benabik in his copious spare time... :-/ | |||
18:14
swarley- left
|
|||
stevan_ | jnthn: I recall at one point looking at an NQP implementation of 6model, but I can't seem to find it (at least not in the NQP repo), can you point me to the right place (assuming it still exists)? | 18:14 | |
arnsholt | The current NQP 6model is mostly in C, I think | ||
src/6model/* | 18:15 | ||
moritz | it's teh metamodel that's written in NQP | ||
stevan_ | yeah, thats what I found, but I know I saw one in NQP at one point when I was starting on the p5-mop project | ||
moritz: yeah, that :) | |||
moritz | rakudo's metamodel is in src/Perl6/Metamodel/*.pm | 18:16 | |
in the rakudo repo. obviously :-) | |||
stevan_ | ah, thanks | ||
was looking in the entirely wrong place :) | |||
moritz | and NQP's metamodel (which is much simpler) is in the nqp repo in src/how/*.pm | ||
jnthn | stevan_: src/how/ in the NQP repo | ||
moritz | where "how" stands for "higher order workings" or so :-) | 18:17 | |
jnthn | stevan_: The very core bootstrap is done in C (or Java on the JVM) | ||
stevan_ | k | ||
jnthn | stevan_: Where "the very core" is...very primitive. :) | ||
pmurias | or js on nqp-js (which is currently bitrotten) ;) | ||
jnthn | src/how/ is where we then implement classes and roles. | ||
pmurias: You'll be glad to know that src/how/ is just about free of pir:: these days :) | 18:18 | ||
pmurias: Gimme another week or so and it'll be free of the v-table stuff too. | |||
OK, I should go join a copule of cow orkers for dinner... :) | |||
be back later on o/ | |||
arnsholt | jnthn: Speaking of NQP, I failed at fixing the bootstrap stuff. I got NQP compiling, but got some weird failure in Rakudo instead | 18:19 | |
moritz | \o | ||
arnsholt | I'll give it another whack tomorrow | ||
benabik | .oO( How do you ork a cow? ) |
||
pmurias | jnthn: nice, I'll get to work on nqp-js in a week or so after my exams end | 18:20 | |
nwc10 | jnthn: NQP-JVM bug: | 18:21 | |
$ nqp nqp-jvm-cc.nqp -e 'nqp::say(nqp::substr("ABC", 2, 1));' | |||
output is just a newline | |||
not C | |||
18:32
palakas_ joined
18:33
palakas__ left
18:35
MikeFair__ joined,
MikeFair left
|
|||
nwc10 | jnthn: Fix, I believe: pasta.test-smoke.org/429 | 18:38 | |
timotimo: I think you had to replace <= with < due to a bug in substr3 in Ops.java | 18:39 | ||
timotimo | not quite | 18:41 | |
it was a bug in my code that was obscured by how substr3 works | |||
nwc10 | OK, I tried it with < and got a Java exception. Screenfuls about (I think) stack exhausted | 18:42 | |
I think nqp::substr is buggy. I think I've fixed it locally. | |||
With that, I can run with <= | 18:43 | ||
but, if it's acutally a bug in your code, that's sort of interesting | |||
but it's nice, as it found a bug in the JVM bootstrap code | |||
timotimo | it was a thinko i believe | ||
feel free to double check | 18:44 | ||
moritz | if you get "javac: invalid source release: 1.7" on debian wheezy, install openjdk-7-jre and run update-alternatives --config javac and configure it to use the openjdk-7 one | ||
timotimo | iirc i off by one'd that part | 18:46 | |
moritz | nqp nqp-jvm-cc.nqp --setting=NULL --target=classfile --output=nqp-mo.class nqp-src/nqp-mo.pm | ||
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/perl6/nqp/jast2bc/JASTToJVMBytecode : Unsupported major.minor version 51.0 | |||
grrr | |||
masak | nwc10: nice catch. | 18:50 | |
nwc10 | I hope I'm correct. | 18:51 | |
masak | nwc10: my first thought was that Java's .substring takes and 'end' parameter, not a 'length' parameter. but that doesn't seem to be the cause, given your fix. | ||
an* | |||
nwc10 | And I utterly slack, in that I didn't write (more) tests | ||
masak | ;) | ||
nwc10 | The fine documentation at docs.oracle.com/javase/6/docs/api/j...,%20int%29 says The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex. | 18:54 | |
masak | aye. | ||
that was what I was referring to. | |||
whereas in Perl, we do $start, $length | |||
moritz | I think I have implemented Perl 6 substr (or parts of it) at least twice, and usually had an offby1 bug somewhere | 18:57 | |
masak .oO( "offby1 bu" ) | 18:58 | ||
benabik | "offby1 bug\0" ? | 18:59 | |
huf | "offby2 bug" and repeat ad Inf | ||
moritz | though I should add that the test suite usually caught them before I committed them | 19:02 | |
swarley | nqp: my @ary = ["foo","bar","baz"]; say(nqp::push(ary, "foobarbaz")) | 19:03 | |
p6eval | nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 2, near " [\"foo\",\"b"current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)» | ||
swarley | nqp: my @ary := ["foo","bar","baz"]; say(nqp::push(ary, "foobarbaz")) | ||
p6eval | nqp: OUTPUT«push_pmc() not implemented in class 'NQPMu'current instr.: '' pc 107 ((file unknown):62) (/tmp/nN3E9L6AVT:1)» | ||
swarley | nqp: my @ary := ["foo","bar","baz"]; say(nqp::push(@ary, "foobarbaz")) | ||
p6eval | nqp: OUTPUT«4» | ||
swarley | all sorts of typos | ||
masak | swarley: you can make private experiments with p6eval by using /msg | ||
swarley | Yeah, I just expected it to be a quick one | 19:05 | |
I would have queried it otherwise | |||
moritz | happens to me too, occasionally | 19:09 | |
masak too | |||
moritz | std: my ::&a &a | 19:11 | |
p6eval | std 7deb9d7: OUTPUT«ok 00:00 45m» | ||
moritz doesn't even want to know how that's parsed | |||
swarley | o-o | 19:12 | |
what the hell is that supposed to be | |||
std: say "foo" | 19:13 | ||
p6eval | std 7deb9d7: OUTPUT«ok 00:00 42m» | ||
19:13
Vlavv left
|
|||
moritz | std just parses | 19:13 | |
swarley | oh | ||
masak | moritz: it's not so strange. you can post-declare & vars (and subs). | ||
which is what you're doing there. | 19:14 | ||
r: &foo(); sub foo { say "OH HAI" } | |||
p6eval | rakudo 6d5dc6: OUTPUT«OH HAI» | ||
moritz | but aren't that two terms in a row? | ||
masak | no, the first one is a type, methinks. | ||
moritz | unless the ::&a is somhow parsed as a type constraint | ||
masak | aye. | ||
that's how I read it :) | |||
moritz | std: my ::&a $foo; | ||
p6eval | std 7deb9d7: OUTPUT«===SORRY!===Two terms in a row at /tmp/KtH3T7dr8a line 1:------> my ::&a ⏏$foo; expecting any of: constraint infix or meta-infix infixed function initializer statement modifier loop traitParse | ||
..failedFAILED 00:00 45m… | |||
masak | and since you never run the thing, you don't get into trouble for it ;) | ||
hm. | 19:15 | ||
but there you didn't declare &a... | |||
moritz | if it were a type, that would work for any variable | ||
masak | std: my &a; my ::&a $foo | ||
p6eval | std 7deb9d7: OUTPUT«===SORRY!===Illegal redeclaration of routine 'a' (see line 1) at /tmp/Vdu3MPTJq_ line 1:------> my &a; my ::&a⏏ $fooTwo terms in a row at /tmp/Vdu3MPTJq_ line 1:------> my &a; my ::&a ⏏$foo expecting any… | ||
masak | hrm. | ||
maybe it acts as a type capture...? | |||
in which case I'd expect a redeclaration error from STD. | |||
moritz | and I'd expect it work with a $-variable too | 19:16 | |
masak | *nod* | 19:17 | |
something is rotten in the STD of Denmark. | |||
swarley | nqp: say(qw[foo bar]); | 19:20 | |
p6eval | nqp: OUTPUT«Confused at line 2, near "say(qw[foo"current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)» | ||
flussence | rn: sub a { b }; sub b { warn 'c' }; my $*ERR = Nil; say a(); | 19:21 | |
p6eval | niecza v24-18-gaf64300: OUTPUT«c at /home/p6eval/niecza/lib/CORE.setting line 1287 (warn @ 5)  at /tmp/36cBSGbmYV line 1 (b @ 4)  at /tmp/36cBSGbmYV line 1 (a @ 4)  at /tmp/36cBSGbmYV line 1 (mainline @ 6)  at /home/p6eval/niecza/lib/CORE.setting line 4218 (ANON @ 3)  at /ho… | ||
..rakudo 6d5dc6: OUTPUT«c in sub b at /tmp/ZnzWwyF4He:10» | |||
flussence | I want to screw around with $*ERR lexically but it won't let me :( | ||
swarley | nqp: say(< a b >) | ||
p6eval | nqp: OUTPUT«2» | ||
swarley | oh alright | ||
What is the difference between +< ... > and < ... ? | 19:22 | ||
? | |||
err < ... > | |||
because in the tests i see | 19:24 | ||
ok( < a > eq 'a', 'spaces around individual element stripped'); | |||
ok( +< a b > == 2, 'angle quotes correctly produce list'); | |||
moritz | the + forces numeric context | ||
just like | |||
masak | <a> is just a weird way to write a string 'a'. | ||
pmurias | nqp: my $a := <foo bar baz>;say($a[1]); | 19:25 | |
p6eval | nqp: OUTPUT«bar» | ||
moritz | r: my @a = 'a', 'b', 'c'; say +@a | ||
p6eval | rakudo 6d5dc6: OUTPUT«3» | ||
masak | <a b>, however, is a list of strings. | ||
r: say <a b>.^name | |||
p6eval | rakudo 6d5dc6: OUTPUT«Parcel» | ||
masak | or a Parcel, whaddevuh. | ||
swarley | o-o '^'? | ||
moritz | .^method calls a method on a meta class | ||
pmurias | meta class instance | 19:26 | |
swarley | Oh | ||
masak | .^methods, even | ||
swarley | Also, does < > interpolate? | ||
masak | no. | ||
<< >> does | |||
moritz | nr: say so any(1,2) ~~ Int | ||
p6eval | rakudo 6d5dc6, niecza v24-18-gaf64300: OUTPUT«False» | ||
swarley | alright | ||
masak | just like with ' and ", or q[] and qq[] | ||
strangely consistent ;) | |||
swarley | Is it better to use the guillettes or the "texas" version? | 19:27 | |
err, sorry I may be using the wrong word | |||
xABxBB | |||
Those | |||
moritz | it's mostly a matter of style and keyboard configuration | ||
.u » | |||
phenny | U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK (») | ||
19:27
cognominal__ left
|
|||
masak | swarley: "better" is ill-defined in your question. | 19:28 | |
moritz | n: say (1|2).Str ~~ Str | 19:29 | |
p6eval | niecza v24-18-gaf64300: OUTPUT«True» | ||
masak | dinner & | 19:31 | |
swarley | left pointing guillemet | ||
that's what it's called | |||
alright | |||
Well, by better I mean, which is prefered style wise | |||
masak | how do you mean? :) | 19:32 | |
19:32
sevin joined
|
|||
masak | who's doing the preferring here? | 19:32 | |
swarley | I suppose you all, since if something breaks i'll be crying somewhere and it seems that no one else but you all can help ;p | ||
japhb | swarley, our only big preference right now is "Though shalt not put non-ASCII in the Rakudo setting", because that makes it compile really slowly. And it's already one of the slowest parts of a Rakudo build. :-/ | 19:35 | |
19:35
sizz left
|
|||
swarley | Well, I'm dealing with nqp right now | 19:36 | |
japhb | People work around that by just specifying any needed Unicode by explicit codepoint, rather than putting the above-ASCII character directly in the code. | ||
19:36
sizz joined
|
|||
swarley | I'll just use << >> | 19:36 | |
japhb | swarley: grep the existing source tree. ;-) | ||
swarley | Since vim syntax hilights it anyway | ||
japhb | That's usually safest when you aren't sure. | 19:37 | |
swarley | it doesn't get the double angle | ||
19:44
sizz_ joined,
sizz left
19:52
sizz joined,
sizz_ left
19:54
adu joined
19:57
pterygota joined
19:58
sizz_ joined,
fijal joined
|
|||
fijal | hi | 19:58 | |
so who's doing perl6 these days? | 19:59 | ||
19:59
sizz left
|
|||
moritz | well, folks :-) | 20:01 | |
adu | hi moritz | ||
moritz | ih adu, fijal | ||
adu | Perl6 is so beautiful | ||
lue | hello o/ | 20:02 | |
arnsholt | fijal: Pretty good, I think =) | ||
moritz | arnsholt: "who" not "how" :-) | ||
arnsholt | Oh. Reading comprehension fail *facepalm* | 20:03 | |
moritz | unless I'm mixing up hvor and hvordan and whatever again :-) | ||
arnsholt | =D | ||
dalek | ast: b19c74d | moritz++ | S03-junctions/misc.t: RT #112392: Junction.Str should return a, well, Str |
20:04 | |
20:04
pterygota left
|
|||
fijal | heh | 20:07 | |
who's working on it | |||
and also what are the directions | 20:08 | ||
like, is parrot still the holy grail? | |||
adu | fijal: the TODO? | ||
fijal: from what I hear, ppl are becoming increasingly unsatisfied with parrot | 20:09 | ||
moritz | fijal: well, sorear and colomon are working on niecza, and jnthn, masak, timotimo, FROGGS, me and a few others are working on rakud (most of us on and off, jnthn rather constantly) | 20:10 | |
fijal | what's niecza? | ||
or should I just read some docs? | |||
adu | fijal: perl6 impl on CLI | ||
moritz | fijal: and others like [Coke] are working on the tests, and occasinally patch some of the compilers to | ||
fijal | oh ok | ||
why do people believe in JVM/CLI so much? | 20:11 | ||
moritz | and pmurias works on rakudo-in-javascript | ||
adu | fijal: I don't believe in CLI, I believe in JVM tho | ||
moritz | fijal: because quite some work has gone into them, and people hope to benefit from that work | ||
fijal: and people want to be able to run Perl 6 on their phones, for example :-) | |||
20:12
sevin left
|
|||
swarley | \o/ alright, if anyone is interested i just finished the code for the YARV root | 20:12 | |
pmurias | link to the repo? | ||
swarley | Let me just gist the snippit, i don't have a full repo up yet | 20:13 | |
arnsholt | One interesting thing with JVM/CLI is language interop, which is something we want to do as well | ||
20:13
spider-mario left
|
|||
swarley | pastebin.com/WfNviez9 | 20:13 | |
20:13
spider-mario joined
|
|||
adu | was there a plan to support JVM? | 20:14 | |
maybe it was just my plan | |||
arnsholt | And as jnthn pointed out a little while back, no matter which backend we target, there's gonna be a whole pile of implementing to do (6model, metamodel, grammar engine) | ||
moritz | adu: you should read planetsix.perl.org/ :-) | ||
swarley | I can't believe that there is no perl6 hilighting for gist.github.com | ||
arnsholt | s/metamodel/bounded serialization/ actually | ||
swarley | but that there is on pastebin | ||
20:15
sevin joined
|
|||
adu | swarley: Perl6 is difficult to highlight | 20:15 | |
pmurias | swarley: how do you plan to feed that into ruby? | ||
moritz | swarley: hoelzro|away is working on Perl 6 syntax hilighting in pygments, which is what github uses | ||
swarley | pmurias, MRI ruby has a new feature in 2.0 to load the data structure as an iseq | ||
RubyVM::InstructionSequence.load(iseq_structure).eval | 20:16 | ||
arnsholt | fijal: But if what you really want to know is why noone's doing it with Pypy, I'm not sure there's a very good answer beyond "noone went and did it" | ||
adu | moritz: so jnthn is working on JVM | 20:17 | |
moritz | maybe one reason is that there isn't a particularly known track record of pypy used for languages other than python | 20:18 | |
*being used | |||
fijal | arnsholt: oh I'm sure there is a bunch of good answers | 20:21 | |
arnsholt: I can provide you with a few if you're missing some | |||
arnsholt: but seriously "cross language compatibility" and "access to JVM libs" seems very legit to me | |||
tadzik | and the current Perl 5 experimentations are also happening around JVM | 20:22 | |
pmurias | fijal: a lot of the people | 20:23 | |
fijal | arnsholt: also RPython is an atrocious language | ||
(still beats C++ though) | |||
pmurias | fijal: seems to be interested in rakudo-jvm are using a lot of jvm stuff | 20:24 | |
fijal | pmurias: for example in python world jython has seen 0 interest from python people | 20:25 | |
(but quite a bit from java people) | |||
20:25
domidumont left
|
|||
pmurias | fijal: re inspections of lexicals I think we can easily statically analyse that in Perl 6 | 20:26 | |
swarley | Anyone have any comments on my code where it needs to be changed or fixed? | ||
20:28
MikeFair__ is now known as MikeFair
|
|||
pmurias | swarley: seems ok, but I have zero YARV knowledge | 20:29 | |
fijal | pmurias: ok | ||
pmurias: you can't do it in python or ruby | |||
without cheating | |||
adu | what's YARV? | ||
fijal | the JVM and CLI implementations cheat | ||
pmurias | adu: ruby vm | 20:30 | |
fijal | so is parrot seeing any development? | ||
swarley | pmurias, I'm following the the output of RubyVM::InstructionSequence.compile("") exactly | ||
adu | fijal: that last I heard was "slow" | ||
pmurias | adu: it's much faster than the old one | 20:31 | |
adu | fijal: it's also in transition | ||
fijal | from what to what? | ||
adu | fijal: and while it's in transition, the documentation can appear out of date in some places | ||
fijal: from NQP to NQP | |||
pmurias | adu: ? | ||
adu | pmurias: perhaps I should explain myself better | 20:32 | |
FROGGS | adu; you're mixing up rakudo and parrot | ||
adu | the compilers and libraries which are required to experiment with parrot, still use an older version of NQP, which makes it difficult to follow some parrot docs, such as the "getting started" docs | 20:34 | |
FROGGS: how am I mixing them up? | |||
20:35
denisboyun_ joined
|
|||
pmurias | fijal: there seem to be commits to the repo | 20:35 | |
FROGGS | adu: you answered that nqp is in transition, but the question was about parrots development state | 20:36 | |
pmurias | fijal: but one of the more active guys has started his own VM ;) | ||
(for Perl 5 and 6) | |||
masak | are you referring to fglock's perlito? | 20:37 | |
moritz | rurban and potion, I think | ||
pmurias | moritz: yes | ||
FROGGS | there will be parrot 5.0 (or maybe is already released), so there is something going on, dont how how many devs are active | ||
pmurias: another VM? | 20:38 | ||
pmurias | perl11.org/p2/ | 20:39 | |
FROGGS | can somebody please rum t/spec/S05-metasyntax/litvar.t and tell me if the array tests are ok? I'm not sure if I broke something or not | ||
adu | FROGGS: my point is that many Parrot tools depend on NQP, the previous one, and so until it depends on the new NQP, Parrot is also in transition | 20:40 | |
moritz | FROGGS: no, it doesn't even parse | ||
FROGGS: it's not run by 'make spectest' | |||
FROGGS | moritz: I know that :o) | ||
masak wonders if he has met the anonymous coward in the comments of 6guts.wordpress.com/2013/02/02/a-lo...ss-update/ | |||
FROGGS | okay, so I maybe stash and uncomment the unparseable tests | 20:41 | |
or maybe ... | |||
nr: my @var = <a b c>; say "a" ~~ /@var[0]/ | 20:42 | ||
p6eval | niecza v24-18-gaf64300: OUTPUT«Potential difficulties: Apparent subscript will be treated as regex at /tmp/TUY2_0gp7v line 1:------> my @var = <a b c>; say "a" ~~ /@var⏏[0]/Match()» | ||
..rakudo 6d5dc6: OUTPUT«#<failed match>» | |||
fijal | thanks guys | ||
20:42
fijal left
|
|||
FROGGS | adu: I didnt know that there are parrot tools which need nqp, that explains it | 20:44 | |
adu | FROGGS: just read the Parrot "Getting Started" document: docs.parrot.org/parrot/devel/html/d...d.pod.html | 20:45 | |
FROGGS | I see | 20:46 | |
adu | but that's just an example of it in documentation, I recall from past experience that you can't build parrot without it's nqp | ||
dalek | kudo/nom: 935c90c | moritz++ | / (2 files): Calculate each year's Rakudo releases also fill up the dates for 2013. |
||
FROGGS | pmurias: potion sounds good, but I tend to only believe stuff that I see ;o) | 20:47 | |
20:47
sizz joined,
sizz_ left
20:54
sizz left,
sizz joined
|
|||
swarley | nqp: class Foo { has @.bar; method setup() { @.bar := [1,2,3] } }; say(Foo.new().setup().bar); | 20:58 | |
p6eval | nqp: OUTPUT«Unable to parse expression in blockoid; couldn't find final '}' at line 2, near "has @.bar;"current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)» | ||
swarley | nqp: class Foo { has @.bar; method setup() { @!bar := [1,2,3] } }; say(Foo.new().setup().bar); | 20:59 | |
p6eval | nqp: OUTPUT«Unable to parse expression in blockoid; couldn't find final '}' at line 2, near "has @.bar;"current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)» | ||
swarley floats to a query | 21:00 | ||
21:01
sizz_ joined
21:02
sizz left
|
|||
swarley | nqp: class Foo {has @.array}; say(Foo.new(:array([1,3,3])).array) | 21:03 | |
p6eval | nqp: OUTPUT«Unable to parse expression in blockoid; couldn't find final '}' at line 2, near "has @.arra"current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)» | ||
swarley | r: class Foo {has @.array}; say(Foo.new(:array([1,3,3])).array) | ||
p6eval | rakudo 6d5dc6: OUTPUT«1 3 3» | ||
swarley | Why doesn't it work in nqp? | ||
moritz | swarley: nqp doesn't support generation of accessors | ||
swarley | oh | ||
moritz | swarley: you can use private attributes with 'has @!bar;' | 21:04 | |
swarley | Why not? That doesn't seem like that advanced of a feature | ||
moritz | and writing your own method bar() { @!bar } as an accessor | ||
swarley | Well that's what I have now, i was just trying to clean it up | ||
21:06
jasonmay joined
|
|||
swarley | how would you say that a method requires at least one argument but can take many more? | 21:06 | |
*@args would allow for zero, i think | |||
masak | swarley: the invocant is counted as a parameter to a method. | 21:08 | |
swarley | invocant? | ||
masak | the object on which the method was called. | ||
swarley | oh | 21:09 | |
masak | r: class C { has $.name; method foo { say self, " is the invocant" }; method gist { $.name } }; C.new(:name<Philip>).foo | ||
p6eval | rakudo 935c90: OUTPUT«Philip is the invocant» | ||
masak | r: class C { has $.name; method foo($usually-hidden-invocant: ) { say "$usually-hidden-invocant is the invocant" }; method gist { $.name } }; C.new(:name<Philip>).foo | 21:10 | |
p6eval | rakudo 935c90: OUTPUT«C<-45509055> is the invocant» | ||
masak | o.O | ||
swarley | wat | ||
masak submits rakudobug | |||
r: class C { has $.name; method foo($x: ) { say "$x is the invocant" }; method gist { $.name } }; C.new(:name<Philip>).foo | |||
p6eval | rakudo 935c90: OUTPUT«C<1645388291> is the invocant» | ||
masak | .gist... stops working... when the method takes an explicit invocant!? | 21:11 | |
pmurias | swarley: re why not? because accessor are rw methods in Perl6 and nqp doesn't support assignment | 21:12 | |
swarley | ohh | 21:13 | |
masak | oh! notabug. | ||
since when things are interpolated in a string, .Str is called, not .gist | 21:14 | ||
if you ask me, I think we got one method too many there in the end :/ | |||
r: class C { has $.name; method foo($x: ) { say "$x is the invocant" }; method Str { $.name } }; C.new(:name<Philip>).foo | |||
p6eval | rakudo 935c90: OUTPUT«Philip is the invocant» | ||
swarley | nqp: say(nqp::unshift([1,2,3], 0).join(' ,') | 21:18 | |
p6eval | nqp: OUTPUT«Confused at line 2, near "say(nqp::u"current instr.: 'panic' pc 13207 (src/stage2/gen/NQPHLL.pir:4680) (src/stage2/gen/NQPHLL.pm:328)» | ||
swarley | nqp: say(nqp::unshift([1,2,3], 0).join(' ,')) | ||
p6eval | nqp: OUTPUT«Method 'join' not found for invocant of class 'ResizablePMCArray'current instr.: '' pc 74 ((file unknown):47) (/tmp/V3PG7wCUYk:1)» | ||
swarley | o-o | ||
swarley floats back to query | |||
pmurias | query? | 21:19 | |
masak | reply. | ||
enthusiastic reply! | |||
FROGGS | nqp: say(nqp::join(', ' ,nqp::unshift([1,2,3], 0))) | ||
p6eval | nqp: OUTPUT«0, 1, 2, 3» | ||
21:19
fijal joined
|
|||
fijal | oh | 21:19 | |
and one more thing | |||
swarley | yeah, i just figured that out | ||
fijal | if you guys are moving to JVM, what about 1-liners? | 21:20 | |
masak | fijal: what about them? | ||
fijal | well | ||
startup is a mess | |||
21:21
aindilis joined
|
|||
pmurias | fijal: we can use rakudo-js for 1-liners ;) | 21:21 | |
fijal: or a persistent interpreter | |||
swarley | are we using v8 for rakudo-js? :p | ||
arnsholt | Well, we're not ditching Parrot | ||
fijal | uh | ||
see | |||
swarley | there is an interesting project called HotRuby | 21:22 | |
fijal | pmurias: is the JS for the web? | ||
swarley | it's a ruby interpreter using ActionScript and JavaScript | ||
fijal | how well it works? | ||
swarley | it's fairly shitty | ||
fijal | ok | ||
swarley | Neat proof of concept though | ||
Ruby embedded into html | 21:23 | ||
fijal | there is like a billion of those for Python | ||
swarley | where the user actually has python on their end? | ||
yes, there are plenty of ruby embedders, but no others that allow for web browsers to evaluate the code themselves that i'm aware of | 21:24 | ||
fijal | yeah | 21:25 | |
python interpreter in JS, python-to-JS translator, pick your poison | 21:26 | ||
mostly shitty | |||
pmurias | swarley: yes, I'm using v8 (through node) | ||
swarley | sweet | ||
I love v8 lol | |||
pmurias | github.com/pmurias/rakudo-js but it's a bit bitrotten atm | 21:27 | |
swarley | I'm rewriting my Nodes right now that I have a better grasp on what I'm doing | 21:28 | |
arnsholt | fijal: Oh, one pretty awesome thing we have (I'm biased though), is the FFI module: github.com/jnthn/zavolaj/ | 21:29 | |
swarley | Interesting | ||
21:29
PacoAir_ joined
|
|||
fijal | arnsholt: have you seen cffi? ;-) | 21:30 | |
arnsholt: how do you deal with macros? | |||
arnsholt | We don't deal with macros. Which is really annoying when dealing with ncurses | 21:31 | |
I've not looked a lot at other FFIs, but did look at a Common Lisp one (Allegro CL, if you care) | 21:32 | ||
Allegro's FFI was quite similar to Zavolaj, TBH | |||
fijal | arnsholt: we have soemthing that's based on luajit ffi + verifier | 21:34 | |
(which essentially elevates ABI to API) | |||
arnsholt | Cool. Linky? | 21:35 | |
fijal | cffi.readthedocs.org/en/latest/ | ||
arnsholt | (Regarding macros, I have something resembling a plan, but no code yet) | 21:37 | |
21:37
pmurias left
|
|||
masak | I love it when a plan but no code yet comes together. | 21:38 | |
fijal | arnsholt: we essentially invoke C compiler | 21:39 | |
to figure out details | |||
(you can do it on the setup step) | |||
arnsholt | That works | 21:40 | |
We synthesise it from the subroutine signatures and use libdyncall to do the heavy lifting | |||
fijal | ok | 21:41 | |
I think we use libffi | |||
but we can use the JIT too | 21:42 | ||
(libffi - not recommended) | |||
arnsholt | star: use NativeCall; sub printf(Str) is native { * }; printf("Greetings from C") # Like so | 21:43 | |
p6eval | star 2012.12: OUTPUT«Greetings from C» | ||
fijal | cool | 21:44 | |
masak | \o/ | ||
star: use NativeCall; sub printf(Str) is native { * }; printf("%d", 42) | 21:45 | ||
swarley | Alright, I'm rewriting Nodes.nqp. Partial file is here. Tell me if you guys see any blatant errors, if you could. github.com/swarley/nqp-yarv/blob/m.../Nodes.nqp | ||
p6eval | star 2012.12: OUTPUT«===SORRY!===CHECK FAILED:Calling 'printf' will never work with argument types (Str, Int) (line 1) Expected: :(Str )» | ||
masak | star: use NativeCall; sub printf(Str, Int) is native { * }; printf("%d", 42) | ||
p6eval | star 2012.12: OUTPUT«42» | ||
arnsholt | jnthn++ implemented the hard parts, and then I've added more functionality | ||
masak | star: use NativeCall; sub printf(Str $format, *@args) is native { * }; printf("%d", 42) | ||
p6eval | star 2012.12: OUTPUT«Unknown type Positional used in native call.If you want to pass a struct, be sure to use the CStruct representation.If you want to pass an array, be sure to use the CArray type. in sub type_code_for at /home/p6eval/star/lib/parrot/4.10.0/languages/perl6/lib/Nati… | ||
arnsholt | Yeah, varargs isn't implemented yet | ||
masak | just testing :) | 21:46 | |
step at a time. :) | |||
arnsholt | Indeed | ||
Not entirely sure how to do it, TBH. Have to see if there's something special for it in dyncall, or maybe I just pretend it's a normal sig | 21:47 | ||
swarley | break out your handy dandy assembly ;p | ||
pop the stack \o/ | |||
arnsholt | dyncall has taken care of the assembly, thankfully | 21:48 | |
I've never programmed in assembly, believe it or not =) | |||
swarley | it's not fun | 21:49 | |
lol | |||
believe me | |||
github.com/swarley/ZerOS/tree/master/src/string | |||
And I did most of that incorrectly, I'm sure | |||
21:50
kaare_ left
|
|||
arnsholt | Sleepytime now, I think | 21:50 | |
o/ | |||
arnsholt & | 21:51 | ||
lue has no aversion to assembler | 21:53 | ||
21:55
cognominal joined
21:58
denisboyun_ left
21:59
spider-mario left
22:05
cognominal left
|
|||
[Coke] | nwc10++ | 22:06 | |
22:12
Subterra joined
22:13
PacoAir_ left,
Ayiko left
22:16
cognominal joined
|
|||
jnthn | That was more beer than expected... :) | 22:17 | |
EBEERLIKINGCOWORKER :) | |||
22:18
fijal left
22:20
shinobicl joined
22:22
FROGGS left
22:30
shinobicl left
22:52
renormalist left,
renormalist joined
22:54
adu left
22:58
renormalist left,
renormalist joined
22:59
sevin left
23:04
sevin joined
23:11
vmspb joined
|
|||
jnthn | sleep...will probably bee offline until tomorrow evening & | 23:12 | |
*be | |||
masak | bzzz well, jnthn. | 23:13 | |
'night, #perl6 | |||
23:14
cognominal left
|
|||
lue | are repo-url and source-url synonyms? | 23:15 | |
(in META.info files, that is) | |||
23:19
cognominal joined
23:35
cognominal left,
cognominal__ joined
23:39
shinobicl joined
23:45
Pleiades` left
23:49
shinobicl left
23:50
Pleiades` joined
|