Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-02-22

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:19 dalek rakudo-star-daily: 4164a58 | coke++ | log/ (11 files):
00:19 dalek rakudo-star-daily: today (automated commit)
00:19 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/4164a58a90
00:21 xiaomiao joined #perl6
00:40 kjs_ joined #perl6
00:57 aborazmeh joined #perl6
00:57 aborazmeh joined #perl6
01:12 aborazmeh joined #perl6
01:12 aborazmeh joined #perl6
02:35 fernan___ joined #perl6
02:46 ilbot3 joined #perl6
02:46 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
02:47 aborazmeh joined #perl6
02:47 aborazmeh joined #perl6
02:50 fernand__ joined #perl6
03:16 timotimo turns out the optimizer was only optimizing op "call", never op "callstatic"
03:18 timotimo i was trying to find out why the simple comparison ops weren't inlined, but they are no-prob
03:18 Patterner joined #perl6
03:22 timotimo oh, callstatic is what the optimizer itself sets
03:22 timotimo so it shouldn't have to know about that op beforehand ...
03:34 colomon joined #perl6
03:36 timotimo well, the optimizer can constant-fold if both arguments are compile-time-known :\
03:36 timotimo so it's at least getting near that part
03:36 * timotimo goes to bed for today
03:43 masak 'night, #perl6
03:44 Mouq 'night masak, timotimo
03:46 aghbas joined #perl6
03:47 skids joined #perl6
03:51 fernand__ joined #perl6
03:52 colomon joined #perl6
03:56 noganex joined #perl6
04:32 rmgk_ joined #perl6
04:33 myp joined #perl6
04:55 fernand__ joined #perl6
05:57 fernand__ joined #perl6
06:02 vendethiel joined #perl6
07:05 xfix joined #perl6
07:18 fernand__ joined #perl6
07:21 davido___ joined #perl6
07:26 wicope joined #perl6
07:32 vendethiel joined #perl6
07:41 gfldex joined #perl6
07:53 diana_olhovik_ joined #perl6
08:05 prime joined #perl6
08:14 darutoko joined #perl6
08:19 fernand__ joined #perl6
08:19 pierrot joined #perl6
08:25 vendethiel joined #perl6
08:37 Kristien joined #perl6
08:41 jack_rabbit_ joined #perl6
08:50 virtualsue joined #perl6
08:53 rurban joined #perl6
08:55 moritz \o
08:55 raydiak o/
08:58 moritz p: say 42
08:58 camelia rakudo-parrot 114659: OUTPUT«42␤»
08:58 moritz oh, it seems to have never cleaned out the install dir
08:58 moritz I'll leave it in until it breakds
09:04 moritz b: say 42
09:05 jack_rabbit_ joined #perl6
09:05 camelia joined #perl6
09:06 dalek evalbot: 51f48fb | moritz++ | evalbot.pl:
09:06 dalek evalbot: remove "b" target (pre-nom rakudo)
09:06 dalek evalbot:
09:06 dalek evalbot: it is not available right now, and I am not feeling inclined to build a
09:06 dalek evalbot: pre-historic rakudo version
09:06 dalek evalbot: review: https://github.com/perl6/evalbot/commit/51f48fb439
09:07 camelia b : OUTPUT«Can't chdir to '/home/camelia/rakudo/': No such file or directory at lib/EvalbotExecuter.pm line 166.␤       EvalbotExecuter::_auto_execute(HASH(0x3521420), "say 42", GLOB(0x3c4d940), "/tmp/nb66AbgHQ2", "b") called at lib/EvalbotExecuter.pm line 114␤   EvalbotExecuter::_fork_…»
09:08 FROGGS[mobile] m: use NativeCall; say nativesizeof long
09:08 camelia rakudo-moar 114659: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ltrbdFwCNY␤Undeclared routine:␤    nativesizeof used at line 1␤␤»
09:08 FROGGS[mobile] :o(
09:08 dalek evalbot: 8eb832b | moritz++ | evalbot.pl:
09:08 dalek evalbot: Remove some cruft
09:08 dalek evalbot: review: https://github.com/perl6/evalbot/commit/8eb832b10b
09:10 FROGGS[mobile] m: say $*PERL.compiler.build-time
09:10 camelia rakudo-moar 114659: OUTPUT«No such method 'build-time' for invocant of type 'Compiler'␤  in block <unit> at /tmp/z8vyDrJIGP:1␤␤»
09:10 FROGGS[mobile] m: say $*PERL.compiler
09:10 camelia rakudo-moar 114659: OUTPUT«rakudo (2015.2.1.g.1146597)␤»
09:11 moritz seems to be stuck 3 days ago
09:11 FROGGS[mobile] yeah :o)
09:11 FROGGS[mobile] maybe because of --backends=parrot?
09:11 moritz Unknown option: gen-parrot
09:11 FROGGS[mobile] ahh
09:11 FROGGS[mobile] or that
09:13 vendethiel joined #perl6
09:16 FROGGS[mobile] m: say $*PERL.compiler.build-date
09:16 camelia rakudo-moar 114659: OUTPUT«2015-02-19T21:36:18Z␤»
09:17 dalek evalbot: 24c0e57 | moritz++ | / (2 files):
09:17 dalek evalbot: Be birdless
09:17 dalek evalbot:
09:17 dalek evalbot: also add non-yet-working, experimental profiling target
09:17 dalek evalbot: review: https://github.com/perl6/evalbot/commit/24c0e5744c
09:17 FROGGS[mobile] we need suggestions for typo'd method names
09:19 dalek rakudo/nom: bc386e1 | moritz++ | docs/release_guide.pod:
09:19 dalek rakudo/nom: Release guide: sign the release tags
09:19 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/bc386e19bd
09:19 rindolf joined #perl6
09:24 pierrot joined #perl6
09:28 spider-mario joined #perl6
09:35 Kristien Can a class contain classes?
09:35 Kristien m: class A { class B { } }; say A.new.B.new
09:35 camelia rakudo-moar 114659: OUTPUT«No such method 'B' for invocant of type 'A'␤  in block <unit> at /tmp/g81K8fr9eY:1␤␤»
09:35 Kristien :(
09:36 raydiak m: class A { class B { } }; say A::B.new
09:36 camelia rakudo-moar 114659: OUTPUT«B.new()␤»
09:38 fernand__ joined #perl6
09:39 Kristien m: class A { method m { }; class B { method n { $.m } } }; say A::B.new.n
09:39 camelia rakudo-moar 114659: OUTPUT«No such method 'm' for invocant of type 'B'␤  in method n at /tmp/CDsXcXIb9h:1␤  in block <unit> at /tmp/CDsXcXIb9h:1␤␤»
09:39 nine_ .tell TimToady why not use a Junction to define the valid keys/indices for hashes and (multi dimensional) arrays? my int @array[1|2, 3|4]; That would free up the comma for separating dimensions. I saw even you using comma instead of semicolon quite a few times. How are mere mortals supposed to get accustomed to that?
09:39 yoleaux nine_: I'll pass your message to TimToady.
09:39 coffee` joined #perl6
09:41 virtualsue joined #perl6
09:46 rurban you usually use arrow or assign for that. lua: int array[1 = 2, 3 = 4]; perl =>
09:49 Rounin joined #perl6
09:50 vendethiel "(deprecated since 1994!)" now now, reading perl changelogs is fun. The deprecation is (probably) older than I am
09:51 Kristien vendethiel: you are deprecated
09:51 vendethiel nice.
09:51 vendethiel I sure hope there's a better version of me in another branch...:-)
09:52 rurban1 joined #perl6
09:59 * moritz squash-merges vendethiel
10:03 pierrot joined #perl6
10:17 Kristien Does Perl 6 have $[?
10:18 moritz Kristien: iirc there is something unimplemented about shaping arrays (so custom indexes ranges per array)
10:18 moritz but nothing global like p5's $[
10:18 Kristien cool
10:21 vendethiel joined #perl6
10:23 Kristien http://ideone.com/FVaqLy :(
10:24 mj41 joined #perl6
10:28 FROGGS joined #perl6
10:30 FROGGS m: use NativeCall; say nativesizeof long # moritz++
10:30 camelia rakudo-moar bc386e: OUTPUT«8␤»
10:30 FROGGS it's up to date /o/
10:30 moritz FROGGS: I've added the --profile-file option to nqp, and it worked there
10:30 moritz FROGGS: but it's not working on rakudo
10:31 moritz Illegal option --profile-file
10:31 moritz FROGGS: but --profile seems to be only set up in nqp, not in rakudo separately
10:31 moritz FROGGS: any idea what's wrong there?
10:32 dalek ecosystem: 543224b | raydiak++ | META.list:
10:32 dalek ecosystem: Add Inline::Lua
10:32 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/543224b7bb
10:32 moritz huh, doesn't seem to work in nqp either :(
10:33 moritz either it broke, or I was delusional yesterday night
10:33 FROGGS moritz: do you mean --profile-filename ?
10:34 * moritz headdesks
10:34 FROGGS *g*
10:34 FROGGS moar coffee#
10:34 FROGGS -#
10:39 virtualsue joined #perl6
10:39 fernand__ joined #perl6
10:39 moritz ... and it seems I broken profiling in rakudo
10:39 moritz Too few positionals passed; expected 3 arguments but got 2
10:39 moritz and no routine name, even with --ll-exception
10:41 moritz oh, I see why
10:42 FROGGS make the $filename optional
10:43 moritz ... or pass it along
10:44 * moritz tests a fix
10:46 laouji joined #perl6
10:47 FROGGS moritz: and please add the $filename param to jvm/parrot also
10:50 moritz FROGGS: jvm has a --profile too?
10:50 FROGGS aye
10:51 dalek nqp: 4526709 | moritz++ | src/vm/moar/HLL/Backend.nqp:
10:51 dalek nqp: Unbreak profiling in rakudo
10:51 dalek nqp: review: https://github.com/perl6/nqp/commit/4526709f37
10:51 FROGGS method run_profiled($what) {
10:51 FROGGS nqp::printfh(nqp::getstderr(),
10:51 FROGGS "Attach a profiler (e.g. JVisualVM) and press enter");
10:51 FROGGS I even did that once
10:51 moritz FROGGS: and how would I process the file name there?
10:52 FROGGS you dont... but right now you cannot even call it
10:52 FROGGS but you are always passing it, undef in this case
10:54 moritz so if I make it optional, JVM will be unbroken?
10:54 FROGGS yes, that's what I think
10:55 FROGGS add $filename as an optional param to all three run_profile methods
10:55 moritz right
10:55 dalek nqp: 0e62590 | moritz++ | src/vm/ (2 files):
10:55 dalek nqp: Unbreak --profile on parrot, JVM
10:55 dalek nqp: review: https://github.com/perl6/nqp/commit/0e625906a7
10:55 moritz FROGGS++
10:56 FROGGS m: class Foo is repr<CStruct> { has buf8 $.bar } # that's what I am up to now...
10:56 camelia rakudo-moar bc386e: OUTPUT«===SORRY!===␤CStruct representation only handles int, num, CArray, CPointer and CStruct␤»
10:57 dalek rakudo/nom: 9fc66ca | moritz++ | tools/build/NQP_REVISION:
10:57 dalek rakudo/nom: Bump NQP_REVISION to get profiling fixes
10:57 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/9fc66caecc
10:58 fhelmberger joined #perl6
10:59 dalek evalbot: c0a1331 | moritz++ | evalbot.pl:
10:59 dalek evalbot: make prof-m target work
10:59 dalek evalbot: review: https://github.com/perl6/evalbot/commit/c0a1331e75
10:59 * moritz learned about rssh today
11:03 camelia joined #perl6
11:05 dalek evalbot: 0ee2458 | moritz++ | build-scripts/rebuild-rakudo.pl:
11:05 dalek evalbot: Only rebuild the moar backend
11:05 dalek evalbot:
11:05 dalek evalbot: parrot is sleeping, and we cannot run the JVM efficiently in the bot context anyway
11:05 dalek evalbot: review: https://github.com/perl6/evalbot/commit/0ee2458004
11:06 moritz niecza: say 42
11:06 camelia niecza v24-109-g48a8de3: OUTPUT«(signal ABRT)Stacktrace:␤␤  at <unknown> <0xffffffff>␤  at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_string (intptr,intptr,int) <0xffffffff>␤  at (wrapper alloc) object.AllocString (intptr,int) <0xffffffff>␤  at string…»
11:07 nwc10 I assume that http://perl6.org/compilers/features will be updated in some way now that parrot support is suspended. Would it be a good idea to make Rakudo MoarVM the leftmost column?
11:07 nwc10 given that it's slightly more green than Rakudo on the JVM
11:14 telex joined #perl6
11:14 dalek features: 16d1ec1 | moritz++ | features.json:
11:14 dalek features: Be birdless.
11:14 dalek features:
11:14 dalek features: also remove outdated notice about argument type coercion.
11:14 dalek features: move r-m column to the left, nwc10++
11:14 dalek features: review: https://github.com/perl6/features/commit/16d1ec10f0
11:19 Kristien joined #perl6
11:20 * nine_ learned about rssh just now
11:20 nine_ thanks moritz :)
11:20 moritz m: say 42
11:20 camelia rakudo-moar 9fc66c: OUTPUT«42␤»
11:21 moritz prof-m: Date.today for ^100; say "done"
11:21 camelia prof-m 9fc66c: OUTPUT«done␤»
11:21 camelia .. Prof: http://p.p6c.org/453bbe
11:21 moritz look, automagic profiling!
11:22 moritz that's what I used rssh for: set up an account on www.p6c.org so that camelia can scp the profile files into it
11:23 [ptc] moritz++
11:23 nine_ wow!
11:23 [ptc] that's awesome!
11:24 moritz let's see how brittle it turns out to be
11:26 moritz currently it uses a hard-coded output file, because I didn't want to modify camelia more than necessary+
11:28 FROGGS moritz++ # \o/
11:28 FROGGS that's awesome!
11:29 moritz ... and I think FROGGS++ had the idea originally :-)
11:29 FROGGS err, no :o)
11:29 moritz no? was it timotimo++?
11:29 FROGGS that's more likely
11:30 moritz FROGGS: keep your ++ and do something awesome with it :-)
11:31 moritz like repr-based (un)pack
11:31 FROGGS ohh, good idea
11:43 [ptc] moritz: how up to date is http://perlgeek.de/en/article/5-to-6 compared to http://doc.perl6.org/language/5to6 ?
11:43 [ptc] moritz: should http://perl6.org/documentation/ maybe point to the doc.perl6.org location?
11:47 nine_ [ptc]: it already does
11:47 nine_ [ptc]: oh you mean redirect not link?
11:48 [ptc] nine_: actually, I meant the 5to6 stuff specifically
11:49 [ptc] wow, haven't seen this error before "Internal error: invalid thread ID in GC work pass"
11:50 [ptc] nine_: I'm wondering if it's worthwhile consolidating some of the documentation
11:51 [ptc] nine_: e.g. extending the doc.perl6.org/language/5to6 doc to match that discussed in http://perlgeek.de/en/article/5-to-6 and then pointing the link to the docs.perl6.org site
11:52 [ptc] nine_: this would give new users the feeling that all documentation comes from one official site
11:52 nine_ [ptc]: which is all the more important considering that there's so much outdated information out there
11:53 [ptc] nine_: exactly
11:54 [ptc] nine_: that would also help give users the impression that the project *is* up to date and consistently moving forward
11:54 vendethiel moritz: I sure hope you didn't squash me too much
11:54 nine_ I usually look on doc.perl6.org first, search for advent calendar postings, have a look at the synopsis and disregard everything else
11:56 nine_ Though I find less and less reason to go beyond doc.perl6.org. It's already amazingly useful and I can't overstate how important this is.
11:57 [ptc] agreed.  That's one of the reasons why I'm getting my teeth stuck into the docs :-)
11:58 colomon +1
12:04 dalek doc: 2fc99dd | paultcochrane++ | lib/Type/Mu.pod:
12:04 dalek doc: Document Mu.WHERE
12:04 dalek doc: review: https://github.com/perl6/doc/commit/2fc99dd3b0
12:04 dalek doc: b525111 | paultcochrane++ | util/missing-methods.p6:
12:04 dalek doc: Escaping qualified method names in missing-methods.p6
12:04 dalek doc:
12:04 dalek doc: This is so that special characters don't get interpreted by the shell when
12:04 dalek doc: running the command through qqx{}.
12:04 dalek doc: review: https://github.com/perl6/doc/commit/b5251110f1
12:04 dalek doc: e01b995 | paultcochrane++ | util/missing-methods.p6:
12:04 dalek doc: Hyphenate variable names in missing-methods.p6
12:04 dalek doc: review: https://github.com/perl6/doc/commit/e01b99501e
12:04 dalek doc: f8522bf | paultcochrane++ | lib/Type/Mu.pod:
12:04 dalek doc: Document Mu.WHY
12:04 dalek doc: review: https://github.com/perl6/doc/commit/f8522bf327
12:08 dalek perl6.org: ebdea56 | paultcochrane++ | source/documentation/index.html:
12:08 dalek perl6.org: Point to doc.perl6.org Perl 5 to 6 introduction
12:08 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/ebdea56dda
12:09 fernand__ joined #perl6
12:10 Kristien joined #perl6
12:11 abraxxa joined #perl6
12:12 FROGGS_ joined #perl6
12:13 dalek perl6.org: f47cdf9 | paultcochrane++ | source/index.html:
12:13 dalek perl6.org: Point 5to6 link to doc.perl6.org from main perl6.org page
12:13 dalek perl6.org:
12:13 dalek perl6.org: Missed this one when updating the one from the "documentation" page.
12:13 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/f47cdf9641
12:17 lizmat m: sub f(Int() $a is rw) { say $a.WHAT; $a = 42 }; my Str $b = "65"; f $b; say $b  # this should be a compile time error
12:17 camelia rakudo-moar 9fc66c: OUTPUT«(Int)␤Cannot assign to an immutable value␤  in sub f at /tmp/H_jIYuc1EZ:1␤  in block <unit> at /tmp/H_jIYuc1EZ:1␤␤»
12:17 lizmat mixing a coercion with "is rw" should fail at compile time
12:18 lizmat m: sub f(Int() \a) { say a.WHAT; a = 42 }; my Str $b = "65"; f $b; say $b   # same for sigilless
12:18 camelia rakudo-moar 9fc66c: OUTPUT«(Int)␤Cannot modify an immutable Int␤  in sub f at /tmp/3s0rKR2IQX:1␤  in block <unit> at /tmp/3s0rKR2IQX:1␤␤»
12:18 lizmat I think this is a rakudobug?  do others agree ?
12:20 zakharyas joined #perl6
12:32 kjs_ joined #perl6
12:33 dalek perl6-examples: abaff30 | paultcochrane++ | 99-problems/P08-eric256.pl:
12:33 dalek perl6-examples: Skip P08-eric256 on Niecza
12:33 dalek perl6-examples:
12:33 dalek perl6-examples: This is because this backend doesn't yet implement FIRST.
12:33 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/abaff30f17
12:33 dalek perl6-examples: 167a424 | paultcochrane++ | 99-problems/P08-eric256.pl:
12:33 dalek perl6-examples: Replace hard tabs with spaces in P08-eric256
12:33 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/167a424736
12:33 dalek perl6-examples: a8ab4f5 | paultcochrane++ | 99-problems/P08-eric256.pl:
12:33 dalek perl6-examples: Add vim coda in P08-eric256
12:33 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/a8ab4f58a0
12:34 moritz [ptc]: 5-to-6 is pretty up-to-date (last updated in December or so)
12:34 [ptc] moritz: ok
12:34 moritz [ptc]: and I'm not opposed to merging it into doc.perl6.org, as long as the motivation (documenting the "why", not just the "how") remains in tact
12:35 [ptc] moritz: ah, that's good to know
12:35 [ptc] moritz: I noticed that the first example was dated 2008, and I was wondering how up to date everything was
12:36 vendethiel "doesn't YET implement"...ha!
12:37 nwc10 moritz: probaby also http://perl6.org/ needs updating. Currently it says "Rakudo, a compiler running on Parrot, MoarVM, and the JVM."
12:37 [ptc] moritz: I got a comment recently on Twitter that the docs should remove anything dated, and I started to wonder about how old some of the user-facing docs are
12:38 [ptc] the thing is, I *know* that things are quite up to date, however it's not always obvious that that's the case
12:39 [ptc] vendethiel: well, that's an accurate statement, isn't it?  If not, I can update the note in the example file
12:40 vendethiel [ptc]: Niecza is not going to get anything new any soon, i believe :)
12:42 [ptc] vendethiel: ah.  I don't know much about the status of that backend; it's hard to keep up sometimes!
12:42 vendethiel [ptc]: right :-).
12:44 masak good afternoon, #perl6
12:44 vendethiel \o, masak
12:45 [ptc] hi
12:49 dalek doc: bc6acd0 | paultcochrane++ | lib/Type/IO/Path.pod:
12:49 dalek doc: Remove extra 'to'
12:49 dalek doc: review: https://github.com/perl6/doc/commit/bc6acd004b
12:49 rurban1 joined #perl6
12:57 Kristien is there a guide on slangs?
12:58 FROGGS_ m: say buf8.REPR # why is that?
12:58 camelia rakudo-moar 9fc66c: OUTPUT«Uninstantiable␤»
12:58 Ven joined #perl6
12:59 FROGGS_ m: say Buf[uint8].REPR; say Buf[uint8].new.REPR # so, it need to be punned into a class
12:59 camelia rakudo-moar 9fc66c: OUTPUT«Uninstantiable␤VMArray␤»
13:01 dalek perl6-examples: 75a0e1b | paultcochrane++ | bin/run-all-examples.pl:
13:01 dalek perl6-examples: Add a script to run all examples
13:01 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/75a0e1b62b
13:01 vendethiel Kristien: not yet, but you can look at FROGGS_++'s modules like Slang::Tuxic
13:01 vendethiel or tony's lang::sql (can't remember the exact name tho)
13:01 Kristien I want to be able to embed AWK code. :P
13:02 vendethiel "embed" might be a *tad* too strong, but that seems possible
13:02 FROGGS_ Kristien: then perhaps clone my v5 and strip it down to your needs :o)
13:02 vendethiel LOL
13:02 Kristien vendethiel: well have it invoke AWK
13:02 FROGGS_ because v5 has a port of nqp's operator precedence parser that we also use for Perl 6's grammar
13:03 FROGGS_ Kristien: you still have to parse its syntax to know where the block ends within AWK is valid
13:03 Kristien it'd basically be { use awk; … } where it just counts the curly braces and passes the text to awk
13:04 FROGGS_ Kristien: then look at slang::tuxic
13:04 Kristien ok :3
13:06 Kristien At work I work in Python and often have the urge to invoke perl, awk, find etc from Python but it just feels like an ugly hack.
13:06 Kristien Well, not find anymore, since Python _finally_ got recursive glob.
13:06 lizmat perhaps the other way around is cleaner ?
13:07 Kristien nah it's for little things, the Python system is rather large and is run by a web server (gunicorn)
13:21 dalek perl6-examples: c33ca94 | paultcochrane++ | 99-problems/P (66 files):
13:21 dalek perl6-examples: Use consistent vim coda in 99-problems example set
13:21 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/c33ca94de5
13:21 dalek perl6-examples: d586464 | paultcochrane++ | 99-problems/README:
13:21 dalek perl6-examples: Wrap paragraphs in 99-problems README
13:21 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/d5864647bc
13:21 dalek perl6-examples: cbe4bc6 | paultcochrane++ | 99-problems/README:
13:21 dalek perl6-examples: Correct typo in 99-problems
13:21 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/cbe4bc631d
13:21 dalek perl6-examples: 73e1d6c | paultcochrane++ | 99-problems/99-problems.pod:
13:21 dalek perl6-examples: Wrap paragraphs consistently
13:21 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/73e1d6c6d8
13:21 dalek perl6-examples: c460cff | paultcochrane++ | 99-problems/ (18 files):
13:21 dalek perl6-examples: Purge trailing whitespace in 99-problems
13:21 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/c460cffc02
13:37 vendethiel Kristien: have you seen that video where the guy runs python and php on the same VM, interleaving both (+ html) in a single page?
13:37 * vendethiel thinks he's talked about it before
13:37 Kristien no
13:37 Kristien but it sounds like a nightmare
13:39 * vendethiel probably won't be able to find it anyway...
13:40 fernand__ joined #perl6
13:44 Sysaxed joined #perl6
13:45 Sysaxed m: my $c = * * * * *; say $c(2, 3, 4);
13:45 camelia rakudo-moar 9fc66c: OUTPUT«24␤»
13:45 Sysaxed haha :D
13:45 mohij joined #perl6
13:46 Kristien :(
13:53 diana_olhovik joined #perl6
13:53 vendethiel *g*
13:53 vendethiel m: say (****)(3, 3)
13:53 camelia rakudo-moar 9fc66c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/40E33WXYQ_␤Bogus statement␤at /tmp/40E33WXYQ_:1␤------> 3say (****7⏏5)(3, 3)␤    expecting any of:␤        prefix or term␤        prefix or meta-prefix␤»
13:53 vendethiel m: say (*****)(3, 3)
13:53 camelia rakudo-moar 9fc66c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/SRT6Q7EoSx␤Multiple HyperWhatevers and Whatevers may not be used together␤at /tmp/SRT6Q7EoSx:1␤------> 3say (*****7⏏5)(3, 3)␤»
13:54 Kristien OTOH parsing AWK isn't very hard
13:54 vendethiel heh.
14:01 locsmif joined #perl6
14:28 zakharyas joined #perl6
14:30 Kristien I like how parsing C++ requires being able to interpret C++ code.
14:38 vendethiel Kristien: *interpret*?
14:39 vendethiel sure you need a table of symbols and whatnot, ambiguities exist (and the most vexing parse as well) but interpret?
14:39 Kristien You can't parse C++ code without being able to call constexpr functions at compile-time.
14:39 Kristien You can for example create a syntax error by having a constexpr function return an odd number.
14:40 Kristien auto x = f<g()>(y); can mean different things depending on the return value of g()
14:41 vendethiel ah yeah, didn't think of constexprs as template arguments
14:42 Kristien http://coliru.stacked-crooked.com/a/7b1c0c5ff55e02ca
14:42 Kristien change line 21 to return a non-prime
14:42 vendethiel doesn't seem to load here.
14:42 vendethiel oh transient coliru error
14:43 vendethiel hahahha that's true, template specialize a template with true, will SFIAE if the function returns false
14:47 vendethiel not even SFIAE. it's a syntax error :o)
14:57 Kristien What is SFIAE?
14:57 Kristien Substitution failure is an error?
14:57 Kristien I think you mean SFINAE.
14:58 dolmen joined #perl6
15:04 vendethiel it was indeed substituion failure is an error, and I did not mean SIFNAE... :P
15:05 vendethiel m: sub foo{%(do for ^10 -> $a, $b { $a => $b })}; say foo.perl
15:05 camelia rakudo-moar 9fc66c: OUTPUT«("0" => 1, "6" => 7, "8" => 9, "4" => 5, "2" => 3).hash␤»
15:05 vendethiel m: sub foo{hash do for ^10 -> $a, $b { $a => $b }}; say foo.perl
15:05 camelia rakudo-moar 9fc66c: OUTPUT«("4" => 5, "0" => 1, "6" => 7, "8" => 9, "2" => 3).hash␤»
15:08 masak moritz++! # http://irclog.perlgeek.de/perl6/2015-02-22#i_10156401
15:10 fernand__ joined #perl6
15:14 masak |Tux|++ # RT submit spree
15:17 tadzik moritz :O
15:17 tadzik dat profiling
15:17 tadzik awesome
15:19 dalek perl6.org: 738c157 | moritz++ | source/documentation/index.html:
15:19 dalek perl6.org: Link to both my 5-to-6 and the one on doc.perl6.org
15:19 dalek perl6.org:
15:19 dalek perl6.org: as long as the resources are not joined, there is value in having both
15:19 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/738c15787d
15:22 masak tadzik: imagine this: someone decides to implement a new language on top of Moar. (or an existing language.) we provide a bot that they can dump on their channel that gives them (a) code eval and (b) profiling. out of the box.
15:23 masak heck, doesn't even have to be a programming language. it can be any data format and any transformation.
15:23 moritz ... except that they'd still need NQP
15:23 masak package that up in the right way, give it a Web 2.0 home page, and there's your killer app.
15:24 masak moritz: seems like a fair deal to me.
15:24 tinita_ joined #perl6
15:24 d^_^b joined #perl6
15:24 d^_^b joined #perl6
15:24 Grrrr joined #perl6
15:24 cxreg joined #perl6
15:24 jschulz joined #perl6
15:24 DrForr_ joined #perl6
15:24 hoelzro_ joined #perl6
15:24 osfameron joined #perl6
15:24 PerlJam joined #perl6
15:24 timotimo joined #perl6
15:24 jtpalmer joined #perl6
15:24 Exodist joined #perl6
15:24 Juerd joined #perl6
15:24 muraiki joined #perl6
15:24 gargamel joined #perl6
15:24 Kristien joined #perl6
15:24 sorear joined #perl6
15:25 mtj joined #perl6
15:25 dsm joined #perl6
15:35 espadrine joined #perl6
15:36 dolmen joined #perl6
15:39 brrt joined #perl6
15:40 ruoso Aha! I finally understood why I was failing in the Slang...
15:40 ruoso only QAST types can be returned by the actions, not arbitrary hashes
15:40 ruoso and by return I mean "make"
15:41 masak seems right.
15:41 moritz well, you can make() whatever you want, as long as you don't hand it to the QAST compiler in the end :-)
15:42 ruoso let me try something to confirm that
15:43 ruoso ah, you're right... in my randomly tested permutations I didn't try that
15:46 ruoso Does NQPMatch have any stringification form?
15:50 laouji joined #perl6
15:51 ruoso I mean any that brings up the structured tree, not the matched text
15:51 pmurias joined #perl6
15:53 ruoso aha... dump
15:53 pmurias nqp is supposed to use uncuddled else, like "if {}\nelse {}\n"
15:55 ruoso hmm... my slang is being matched by not captured
15:55 pmurias by nqp I mean the code in the nqp repo?
15:59 virtualsue joined #perl6
16:01 ruoso hmm... ok, I think I found another souce of confusion... when a slang delegates to another grammar, it goes fom NQPMatch to Match, and then it fails to be able to include a regular Match object as part of the NQPMatch tree
16:01 FROGGS_ pmurias: yes and no
16:02 FROGGS_ pmurias: I mean, I don't like so dont do it :P
16:02 FROGGS_ pmurias: but yes, there are places where you can see cuddling elses
16:07 lestrrat joined #perl6
16:08 * skids wonders if there are such a thing as else-cuddling code trolls.  1.) Cuddle elses on rosettacode to upset people 2.) ... 3.) Profit!
16:10 BenGoldberg joined #perl6
16:12 pmurias I haven't seen much people outside of perl who don't cuddle elses
16:12 kjs_ joined #perl6
16:12 huf else cuddling code troll sounds like imperialist pigdog or something :)
16:13 pmurias GNU uses uncuddled elses too
16:13 pmurias but they are at best crazy
16:14 skids "else cuddling" does have that invective feel ;-)
16:14 * ruoso just has another "aha!" moment... the match itself is not exposed, but the wrapping in FOREIGN_LANG exposes .made which does allow me to get the result of my external grammar!
16:16 pmurias FROGGS_: what would be best is to be consitent one way or the other
16:16 FROGGS_ pmurias: it is enough for me if it it consistent within the same file
16:17 pmurias we need someone to write nqptidy, so that our machine slaves can take care of such trifle matters as code formatting
16:18 brrt joined #perl6
16:19 dalek nqp/js: 490c9c7 | (Pawel Murias)++ | src/vm/js/QAST/Compiler.nqp:
16:19 dalek nqp/js: Refactor rules compilation.
16:19 dalek nqp/js: review: https://github.com/perl6/nqp/commit/490c9c7f33
16:21 dalek nqp/js: 04230e6 | (Pawel Murias)++ | src/vm/js/QAST/Compiler.nqp:
16:21 dalek nqp/js: Document some of the variables used in regex matching.
16:21 dalek nqp/js: review: https://github.com/perl6/nqp/commit/04230e66a6
16:24 timotimo o/
16:26 nwc10 good *, pmurias
16:27 pmurias nwc10: hi
16:31 Ovid_ joined #perl6
16:32 MadcapJake joined #perl6
16:39 * flussence grumbles at not being able to start a p5 script with "#!/usr/bin/env perl -T"
16:41 fernand__ joined #perl6
16:47 dalek doc: 4172cb1 | moritz++ | lib/Language/objects.pod:
16:47 dalek doc: Role punning, parameterized roles
16:47 dalek doc: review: https://github.com/perl6/doc/commit/4172cb1c64
16:48 Kristien joined #perl6
16:51 laouji joined #perl6
16:55 MadcapJake joined #perl6
16:58 MadcapRusso joined #perl6
17:06 TimToady vv because junctions are not sets
17:06 yoleaux 09:39Z <nine_> TimToady: why not use a Junction to define the valid keys/indices for hashes and (multi dimensional) arrays? my int @array[1|2, 3|4]; That would free up the comma for separating dimensions. I saw even you using comma instead of semicolon quite a few times. How are mere mortals supposed to get accustomed to that?
17:15 grondilu semicolon are a quite common in languages supporting multidimensional arrays (octave, for one)
17:15 moritz (where octave = Matlab, from a language perspective)
17:16 grondilu true, but I tend to favor FOSS :)
17:16 Ovid__ joined #perl6
17:17 * grondilu notices there is no FOSS in S99, can he add it?
17:18 moritz +0.5
17:20 rurban1 joined #perl6
17:20 pmurias what would I need to do to get camelia to support nqp-js?
17:21 Kristien I like how in Go looping over a map starts at a random element.
17:21 Kristien To prevent you from thinking there is any ordering.
17:21 geekosaur rakudo used to do something like that
17:21 geekosaur (well, not with map, but with some other things(
17:21 moritz yes, wit >> iirc
17:22 moritz m: say <a b c d e>>>.say
17:22 camelia rakudo-moar 9fc66c: OUTPUT«e␤c␤a␤d␤b␤True True True True True␤»
17:22 moritz pmurias: I'll look into setting up
17:22 moritz *it up
17:24 moritz pmurias: if you want to help, you could write a small shell or perl5 script that rebuilds it
17:24 moritz see https://github.com/perl6/evalbot/tree/master/build-scripts for inspiration
17:24 moritz it'll be checked out in ~/nqp-js/
17:25 perl6_newbee joined #perl6
17:25 perl6_newbee hi all
17:25 moritz \o perl6_newbee
17:25 perl6_newbee :-)
17:26 perl6_newbee I asked google for croak in perl6 but found nothing. Is there such a thing like croak?
17:27 moritz no
17:27 perl6_newbee OK
17:27 moritz I wonder how it should be implemented
17:28 geekosaur doesnt perl 6 already provide useful backtraces?
17:28 moritz maybe as an attribute for Backtrace, indicating where the backtrace should start
17:28 geekosaur (that being the original reason for it, since perl 5 doesn't do backtraces at all)
17:28 moritz geekosaur: I hope :-)
17:30 perl6_newbee I could die in my class, but to show the user always an backtrace is ugly, I think
17:31 moritz well, if it's meant for the end user, no backtrace or line number at all should be shown
17:31 moritz if it's for the programmer who uses your library, a backtrace sounds fine to me
17:32 perl6_newbee off course. But I cannot change the die behavour, can I?
17:32 dalek doc: 48505c0 | moritz++ | lib/Language/functions.pod:
17:32 dalek doc: Document coercion types
17:32 dalek doc: review: https://github.com/perl6/doc/commit/48505c016e
17:35 moritz perl6_newbee: no
17:36 perl6_newbee ah, I die in the class and catch it in my script. Then I can just say a error to the user or throw the exception again, right
17:36 perl6_newbee ?
17:36 grondilu oh, FOSDEM videos!
17:37 grondilu oh no, talked to fast.
17:37 perl6_newbee hey cool
17:37 grondilu there's a directory tree but no file
17:37 grondilu http://video.fosdem.org/2015/
17:37 perl6_newbee shouldn't take too long. I am also waiting for the vids
17:39 timotimo i'm waiting for the vids as well
17:42 dalek doc: 5f45075 | moritz++ | util/update-and-sync:
17:42 dalek doc: Remove --no-inline-python
17:42 dalek doc:
17:42 dalek doc: just tried it an interactive session, and it worked fine.
17:42 dalek doc: Keep the fingers crossed!
17:42 dalek doc: review: https://github.com/perl6/doc/commit/5f4507546b
17:43 moritz pmurias: the makefile generated by perl Configure.pl --backends=moar,js is a bit borked
17:44 moritz pmurias: when I run 'make' multiple times, it keeps rebuilding some files over and over
17:44 moritz pmurias: (tested on the opensuse box where camelia runs)
17:46 dalek evalbot: 86206cb | moritz++ | evalbot.pl:
17:46 dalek evalbot: add nqp-js target (with nqp-q as alias)
17:46 dalek evalbot: review: https://github.com/perl6/evalbot/commit/86206cb01a
17:46 timotimo nqp-q?
17:46 camelia joined #perl6
17:47 moritz 'q' seems to be a common pre- or postfix for js stuff
17:47 timotimo oh? i didn't know that
17:48 moritz masak++ mentioned that a while ago
17:48 timotimo OK
17:48 moritz nqp-js: say('pmurias++')
17:48 camelia nqp-js: OUTPUT«pmurias++␤»
17:48 moritz it's not rebuilt automatically
17:49 [ptc] $n = 5; gather for (2, 3, *+2 ... * > $n) -> $k { $k.say }
17:49 [ptc] m: $n = 5; gather for (2, 3, *+2 ... * > $n) -> $k { $k.say }
17:49 camelia rakudo-moar 9fc66c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/5JQbPgb_fZ␤Variable '$n' is not declared␤at /tmp/5JQbPgb_fZ:1␤------> 3$n7⏏5 = 5; gather for (2, 3, *+2 ... * > $n) ␤    expecting any of:␤        postfix␤»
17:49 [ptc] m: my $n = 5; gather for (2, 3, *+2 ... * > $n) -> $k { $k.say }
17:49 camelia rakudo-moar 9fc66c: OUTPUT«Unhandled exception: No exception handler located for warn␤   at src/gen/m-CORE.setting:785  (/home/camelia/rakudo-inst-2/languages/perl6/runtime/CORE.setting.moarvm:warn:29)␤ from src/gen/m-CORE.setting:781  (/home/camelia/rakudo-inst-2/languages/perl…»
17:50 [ptc] m: sub pf(Int $n) { gather for (2, 3, *+2 ... * > $n) -> $k { $k.say } }; pf(5)
17:50 camelia rakudo-moar 9fc66c: OUTPUT«Unhandled exception: Cannot call 'infix:<>>'; none of these signatures match:␤:(Any $?)␤:(Any \a, Any \b)␤:(Real \a, Real \b)␤:(Int:D \a, Int:D \b)␤:(int $a, int $b)␤:(Num:D \a, Num:D \b --> Bool)␤:(num $a, num $b --> Bool)␤:(Rational:D \a,…»
17:50 dalek evalbot: e3a593d | moritz++ | build-scripts/rebuild- (6 files):
17:50 dalek evalbot: Remove some outdated rebuild scripts
17:50 dalek evalbot: review: https://github.com/perl6/evalbot/commit/e3a593df19
17:51 dalek perl6-examples: edbe7bd | paultcochrane++ | bin/run-all-examples.pl:
17:51 dalek perl6-examples: Add --example-dir option
17:51 dalek perl6-examples:
17:51 dalek perl6-examples: Which allows a given example set to be run instead of running all of them.
17:51 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/edbe7bd2b6
17:51 dalek perl6-examples: 1218283 | paultcochrane++ | 99-problems/P17-topo.pl:
17:51 dalek perl6-examples: Convert Parcel to List in input args
17:51 dalek perl6-examples:
17:51 dalek perl6-examples: 'a' xx 20 creates a Parcel, which is immutable and thus can't be shift-ed.
17:51 dalek perl6-examples: Converting the Parcel to a List allows the example to run correctly again.
17:51 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/1218283603
17:51 kjs_ joined #perl6
17:51 brrt joined #perl6
17:53 [ptc] moritz: sorry for effectively removing your 5to6 docs from the website; you're right: before the two documents are merged, it's most certainly worthwhile to link to both
17:59 raydiak good morning #perl6
18:02 diana_olhovik_ joined #perl6
18:05 pmurias moritz: I'll have to look into the Makefile (make--)
18:06 [Sno] joined #perl6
18:08 pmurias moritz: thank you for setting up nqp-js in the evalbot
18:11 fernand__ joined #perl6
18:16 smls joined #perl6
18:16 smls Hi all
18:16 dalek nqp/js: 063ee2d | (Pawel Murias)++ | src/vm/js/QAST/Compiler.nqp:
18:16 dalek nqp/js: Implement scan.
18:16 dalek nqp/js: review: https://github.com/perl6/nqp/commit/063ee2d66c
18:16 dalek nqp/js: 2aaebda | (Pawel Murias)++ | src/vm/js/QAST/Compiler.nqp:
18:16 dalek nqp/js: Remove a debugging leftover.
18:16 dalek nqp/js: review: https://github.com/perl6/nqp/commit/2aaebdae65
18:16 dalek nqp/js: 9dd6440 | (Pawel Murias)++ | tools/build/Makefile-JS.in:
18:16 dalek nqp/js: Revert "Make sure nqp-m is built before trying to build MoarVM files"
18:16 dalek nqp/js:
18:16 dalek nqp/js: This reverts commit f9660d032d9841d785ec37eb4aac0a0fbe56d03e.
18:16 dalek nqp/js: review: https://github.com/perl6/nqp/commit/9dd6440e50
18:17 pmurias moritz: the reverted commit should fix the problem
18:18 smls In Perl 5, a sub could be called with the  &foo;  syntax to use the caller's @_, and with  goto &foo;  to replace the caller in the stack.
18:18 smls Does Perl 6 have an equivalent for that?
18:21 rindolf joined #perl6
18:21 Kristien I thought it turned off prototypes.
18:22 smls &foo(...) turns off protoypes in Perl 5.
18:22 smls (without goto, and with parens)
18:23 smls i.e. they're three different syntactical forms, in addition to the normal  foo(...)  syntax.
18:24 smls So yeah, it's a good thing Perl 6 didn't carry over that mess, but at least the  goto &foo;  form was useful, because it effectively gave Perl tail-call optimiation.
18:25 vendethiel smls: `foo(|@_)` should work
18:25 smls vendethiel: you mean to replace  &foo;  ?
18:25 vendethiel yes
18:25 moritz smls: it just has callsame() for calling the next candidate in a dispatch chain with the same arguments
18:25 raydiak smls: callsame, nextsame, etc do those things including tail call optimization
18:26 moritz m: say Routine.^can('callsame')
18:26 camelia rakudo-moar 9fc66c: OUTPUT«␤»
18:26 smls but waht if you *don't* want to call the same sub?
18:26 moritz doesn't exist as a method, though I think the design docs talk about that
18:31 smls moritz: Imagine a program (say, a game with different game states) that wildly jumps back and forth between a few subroutines
18:31 smls and never return, unless th program ends
18:32 smls in Perl, you'd use  goto &foo;  for those jumps so the call stack don't overflow :)
18:32 raydiak it seems to be NYI, but you should be able to say "&foo.nextsame' or something along those lines
18:32 raydiak the next variants specifically enforce tail-call optimization like you're talking about
18:33 smls ah, ok
18:33 raydiak same is for the same params, with is "with other params"
18:33 smls thanks
18:33 raydiak you're welcome :)
18:36 smls_ joined #perl6
18:39 moritz smls_: one could also structure it so that the routines return with the information about where to jump next, and an outer runloop dispatching that
18:39 smls_ right, it was not a good example i guess
18:40 moritz which is how most software interpreters work
18:40 smls_ as you'd probably prefer to build a proper state machine for such a game
18:40 japhb moritz: There are *many* ways to do interpreteres.  The one you described is actually the inner loop of perl5, IIRC.
18:40 laouji joined #perl6
18:40 moritz japhb: iirc parrot had a similar design
18:41 pmurias smop had something like that only with a polymorphic method call
18:41 japhb Not surprised there.  It's an easy design with a pretty tight main loop.  :-)
18:45 khisanth_ joined #perl6
18:48 fernand__ joined #perl6
18:51 noganex_ joined #perl6
18:55 Kristien I wish I could write more Perl code.
18:56 Kristien I should see how I can neatly rewrite my log colorer from AWK in Perl 6.
18:58 fernand__ I think there's something wrong on array named parameters on MAIN...
18:58 vendethiel Kristien: is it in python atm?
18:58 fernand__ sub MAIN (:@requires! where {require $^module}, :@resources!) {
18:58 Kristien AWK
18:58 vendethiel ohhhh i'm sorry for being blind. hahaha
18:58 fernand__ perl6 ResourceManager.p6 --requires=ClassifiedResources.pm6 --requires=ClassifiedResources.pm6 --resources=Ad --resources=User
18:58 fernand__ Could not find file 'ClassifiedResources.pm6 ClassifiedResources.pm6' for module ClassifiedResources.pm6 ClassifiedResources.pm6
18:58 Kristien I did write a Python stack trace highlighter, to make it possible to actually find what I'm looking for: https://github.com/rightfold/tools/blob/master/pytrace.awk
18:59 vendethiel try using "--" to tell perl6 it's not file arguments? uhm
18:59 Kristien It highlights the stack frames that are actually relevant.
18:59 fernand__ vendethiel: like this?
18:59 vendethiel what's $1 and $2? is it like "split($current_line, default_separator=' ')"?
18:59 fernand__ $ perl6 ResourceManager.p6 --requires=ClassifiedResources.pm6 --requires=ClassifiedResources.pm6 --resources=Ad --resources=User --
18:59 fernand__ sorry...
19:00 vendethiel fernando___: I thought "perl6 file.p6 -- --arguments" but not sure
19:00 Kristien vendethiel: AWK splits each record, and $n returns the nth field
19:00 japhb fernand__: the where that you have there is getting the entire @requires, not each element separately
19:00 ruoso I am now getting really close to a working version of https://github.com/ruoso/Grammar-EBNF/blob/master/t/004_slang.t ... The thing I'm missing now is the corect QAST tree to declare a new grammar and to declare the named rule. I already can produce the QAST::Regex for that particular test case...
19:00 vendethiel waht's the default field separator, Kristien?
19:00 Kristien whitespac
19:00 Kristien and default record separator is newline
19:00 fernand__ but -- means that after that there are no more named parameters, right?
19:01 vendethiel ha, that might apply to your scripts, not to perl6... :P
19:01 japhb fernand__: Yes, but you have two elements of @requires, and you are trying to require them both at once
19:01 fernand__ japhb: yes, looks like that...
19:01 fernand__ ruoso: Daniel Ruoso?
19:02 japhb perhaps: sub MAIN (:@requires! where { require $_ for $^module }, ...
19:02 japhb er
19:02 vendethiel Kristien: for lines { my ($file, $tohl) = .split(' '); if $file == 'File' && $tohl.index-of(@ARGV[0]) >= 0 { say ... } }
19:02 ruoso fernand__: yep
19:02 japhb perhaps: sub MAIN (:@requires! where { require $_ for @^modules }, ...
19:02 fernand__ japhb: but is that what shuold it do?
19:02 Kristien vendethiel: /\s+/ not ' '
19:02 Kristien But that works, since Python uses a single space, yes.
19:03 japhb fernand__: The where is on the entire parameter; it doesn't unpack collections unless you explicitly ask it to.
19:03 japhb fernand__: for example, you might say: sub foo(@list where *.elems < 10)
19:04 fernand__ but when I do Int @nums, it means that each element on @nums is a Int...
19:05 japhb fernand__: I can't help but think you're attempting to do too much in the binding of MAIN ... for example, if it fails the where { require ...} you're going to get a binding failure, which is LTA when you were expecting a require failure.
19:05 fernand__ since the where {...} means a sub type... shouldn't it means that each element should pass that constraint?
19:07 japhb fernand__: Actually 'Int @nums' doesn't mean each element is an Int, more precisely it means that you can't bind something to nums that doesn't satisfy the Role constraint Positional[Int].
19:07 dalek Heuristic branch merge: pushed 33 commits to rakudo/cpp by FROGGS
19:07 japhb Which is fine if you're doing normal code, but it's a recipe for heartache with MAIN magic.
19:08 colomon rakudo/cpp ?
19:08 japhb The DWIM can only go so far before it converts to WAT
19:08 FROGGS_ colomon: aye
19:08 japhb colomon: C++ support for NativeCall
19:08 colomon ooooooooo
19:08 japhb Which is OMG AWESOME for my workplace
19:08 colomon japhb++
19:08 FROGGS_ :P
19:08 japhb Nonono, FROGGS_++
19:08 japhb japhb-- # undeserved
19:08 colomon FROGGS_++
19:08 FROGGS_ :o)
19:08 colomon everyone++
19:09 fernand__ so, if I add another constraint: Int @nums where {$^num < 10}, it should have the same behavior, right?
19:09 ruoso FROGGS_: is it assuming g++ ABI?
19:09 colomon FROGGS_: do you actually anticipate having it working at some point?
19:09 masak JavaScript has QUnit. they couldn't call it JUnit, because that's Java's xUnit lib. I have no idea why they chose 'Q'. I don't know of any other JS library that has a 'Q' for that reason.
19:09 colomon because that has the potential to be pretty killer for my $work, too
19:09 japhb The where is still a constraint on the entire parameter, not its elements.
19:09 FROGGS_ ruoso: atm, yes
19:09 japhb fernand__: to get what you want, do the subtype:
19:09 japhb subtype Small of Int where * < 10;
19:10 japhb Small @nums
19:10 fernand__ shouldn't both be the same?
19:10 FROGGS_ colomon: some stuff works already... I am binding Box2D while I do the implementation
19:10 japhb But *still* you're going to run into the fact that in binding, 'Small @nums' will check whether the argument passes does Positional[Small], it will *not* check if it does Positional and all elements happen to be Small.
19:11 * colomon doesn’t mean to disparage FROGGS_++’s programming skills at all, just curious whether rakudo/cpp is raw experimentation or practical implementation
19:11 japhb IT's a vast difference in default performance, fernand__ :-)
19:12 japhb fernand__: For an array of size N, the current implementation does O(1) work in the binding, but your requested behavior would do O(N) work *for every call*
19:12 FROGGS_ colomon: feels to be more than an experiment :o)
19:13 colomon FROGGS_: AWESOME!!!!
19:13 japhb I am really, really hoping FROGGS_ succeeds.  Massively good vibes flowing his way on this one.  :-)
19:13 FROGGS_ hehe
19:13 Kristien masak: jQuery!
19:13 japhb Also nine_++ yet again for Inline::(Python,Perl5).
19:14 masak Kristien: :P
19:14 masak Kristien: maybe if it was called qQuery...
19:14 japhb qq:uery
19:14 Kristien masak: http://en.wikipedia.org/wiki/Jake_Weary
19:15 fernand__ japhb: ok... but, that this should work, right?
19:15 fernand__ sub MAIN (:@requires! where {require all($^module)}, :@resources!) {
19:16 fernand__ or: sub MAIN (:@requires! where {require all(@^module)}, :@resources!) {
19:16 japhb fernand__: Hmmm, I'm actually not sure how that would junction-thread during binding.  That one I'd have to try.
19:17 pmurias can we manage C++ interop without parsing headers?
19:17 ruoso pmurias: for simple stuff probably
19:17 ruoso as long as the library has a sane API
19:17 japhb pmurias: For things that aren't completely specified by crazy template magic, I would assume so; same way we do with C bindings, just more complex
19:18 fernand__ https://gist.github.com/anonymous/1c8f251561934824e7da
19:18 ruoso it's mostly about doing the name-mangling of the function call
19:19 ruoso of course if any of those functions take a std::vector<foo> then you don't need just a parser, you actually need a C++ compiler
19:19 japhb fernand__: I'm not entirely surprised that didn't work.  Try the loop like I suggested.
19:19 japhb AFK
19:19 ruoso although, you could probably assume that a template referenced by a method signature would already be instantiated in the library
19:19 fernand__ japhb: but shouldn't work?
19:22 pmurias can we assume that portably?
19:23 dalek rakudo/cpp: 2f34483 | FROGGS++ | t/04-nativecall/11-cpp.t:
19:23 dalek rakudo/cpp: test the size of the C++ structures
19:23 dalek rakudo/cpp: review: https://github.com/rakudo/rakudo/commit/2f344838c5
19:23 erere joined #perl6
19:23 erere ...
19:24 masak ...
19:25 erere ;D
19:25 * masak winks, smiling widely
19:25 erere hi ! just wanted to know that is anyone online or not
19:25 masak nope.
19:26 masak no-one here... :)
19:27 erere :d
19:27 nwc10 what he said.
19:27 FROGGS_ silence...
19:27 erere yep i can see
19:28 Kristien Something I'd really love to see is better interop with other languages.
19:29 erere should i learn perl 5 or wait for perl 6?
19:29 FROGGS_ erere: you dont have to wait for Perl 6
19:29 Kristien erere: depends on what you want to do.
19:29 FROGGS_ it there... downloadable... rakudo.org
19:29 FROGGS_ it's*
19:30 Kristien If you want to maintain shitloads of existing code bases you should learn Perl 5.
19:30 Kristien If you are more interested in Perl 5 you should also learn Perl 5.
19:30 erere tnx! well i want to use it for securty stuff!
19:30 Kristien Otherwise you should learn Perl 6.
19:30 erere i know python
19:30 Kristien If it's for security stuff you should wait for a stable release.
19:31 erere but its not bad to have perl with it!
19:32 erere well when we will have a stable release?
19:32 diana_olhovik___ joined #perl6
19:33 brrt joined #perl6
19:33 flussence m: class Table { has Int $.legs where * > 0; }
19:33 camelia rakudo-moar 9fc66c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/epKoFikUe5␤Post-constraints on variables not yet implemented. Sorry. ␤at /tmp/epKoFikUe5:1␤------> 3class Table { has Int $.legs where * > 07⏏5; }␤    expecting any of:␤        constraint␤»
19:34 fernand__ why is it running twice? https://gist.github.com/anonymous/7852b78093311f618625
19:34 flussence did something significant happen to make that line ^ stop working?
19:35 masak flussence: says it's NYI.
19:36 flussence yeah... but it wasn't NYI last week. :/
19:36 vendethiel uhm... yes it was :o)
19:36 [Coke] Ovid++
19:36 masak pretty sure it was.
19:36 slavik joined #perl6
19:36 vendethiel "where"s are my bread and butter in perl6, and I remember hitting this one for as long as I remember
19:37 timotimo right. you can declare a subtype outside the class, though
19:37 timotimo and put the where clause on that
19:37 masak yes.
19:37 masak this NYI might even be LHF :P
19:38 FROGGS_ erere: this year
19:38 flussence s/last week/2 weeks ago/, my bad
19:39 masak flussence: may I politely suggest that you are mistaken on it working, ever?
19:40 timotimo erere: what kind of security stuff are you talking about?
19:41 masak flussence: this one is from early last year: https://rt.perl.org/Ticket/Display.html?id=122109
19:41 kjs_ joined #perl6
19:43 dalek perl6-roast-data: bdc4d50 | coke++ | / (4 files):
19:43 dalek perl6-roast-data: today (automated commit)
19:43 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/bdc4d50bb8
19:43 flussence masak: I'm probably mistaken, but on the other hand it didn't cause this code I have to abort and fail all its tests when I committed it earlier this month :)
19:44 erere tnx ! I AM talking about expolites and pentesting tools  like scanners etc
19:44 flussence ...which means it evidently needs more tests
19:48 rurban1 joined #perl6
19:48 jack_rabbit_ joined #perl6
19:52 raiph joined #perl6
19:52 telex joined #perl6
19:53 hoelzro joined #perl6
19:53 ruoso pmurias: nothing about C++ is portable
19:54 moritz well, you can port code from C++ to perl... :-)
19:54 ruoso there's no ABI specification... even within a single OS, different compilers may produce incompatible ABIs
19:54 Kristien C++ is great. I should implement a lisp interpreter as a C++ template metaprogram.
19:55 ruoso and it actually gets even more extra ridiculous, if you are in SunOS, for instance, using the Sun Studio compiler, you have different options on which runtime library to use
19:55 dalek joined #perl6
19:56 pnu joined #perl6
19:56 geekosaur joined #perl6
19:56 lsm01 joined #perl6
19:56 Kristien lol, C++ compilers other than clang and GCC
19:56 ruoso and if you happen to load two libraries built with different runtimes in the same process, even if they never talk to each other, the process will immediately segfault
19:57 flussence sounds a lot like GCC's new C++ ABI fun...
19:57 mohij joined #perl6
19:57 arnsholt Kristien: Off the top of my head there's the Intel C++ compiler
19:57 ruoso oh, no... g++ managed to restrict the incompatibility to direct calls between libraries in the two modes
19:57 arnsholt And MSVC++
19:57 ruoso the SunStudio situation is much more terrible
19:57 flussence oh, nvm then
19:58 ruoso but in infinite time, there will only be clang
19:58 ruoso the C++ standard is getting closer and closer to being "the clang standard"
19:58 tardisx joined #perl6
19:58 Kristien arnsholt: MSVC is a joke. It implements not even all of C++14.
19:59 Kristien Intel's compiler is something I don't know much about other than that it's insanely good at optimising.
19:59 ruoso I'm somewhat sure clang is pretty much the only compiler close to implementing C++14
19:59 arnsholt Apparently it's (Intel, that is) got a very good math library as well
19:59 Kristien uh I mean C++11
19:59 ggherdov joined #perl6
19:59 fernando___ joined #perl6
20:00 ruoso in any case, going with the g++ ABI is probably the only reasonable approach to this probllem
20:01 moritz arnsholt: ... when run on Intel chips. It intentionally cripples  performance on AMD chips
20:01 Kristien nice
20:01 moritz cow-orkers had "fun" with that
20:02 mephinet joined #perl6
20:08 lumimies joined #perl6
20:08 fernand__ I cant use "require" on "where"?
20:08 fernand__ https://gist.github.com/anonymous/65b390fef7ca3e6808c0
20:09 nyuszika7h joined #perl6
20:09 smls joined #perl6
20:12 yogan joined #perl6
20:14 [Coke] looks like the trickiest thing in setting up the daily runs for all the NQP backends is that I don't have "test_summary" for nqp.
20:14 [Coke] will at least get something running shortly that will run moar, moar-jit, jvm, parrot, and js and capture the "make test" output.
20:15 timotimo so it seems like the inlining mechanism is working right in the nqp::rand_n(1e0) <= 0e5 case, but it doesn't seem to get the return type of rand_n?
20:15 timotimo not 100% sure about that yet
20:18 fernand__ m: sub MAIN (:@requires! where *.grep({!require $^mod}) == 0, :@resources!) {say "OK"}
20:18 camelia rakudo-moar 9fc66c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/TZt9x9euCc␤Undeclared routine:␤    require used at line 1␤␤»
20:18 masak flussence: maybe the NYI error is new.
20:18 flussence well if it didn't actually work before, that's an improvement!
20:20 masak flussence: yep -- https://github.com/rakudo/rakudo/commit/4bab4886
20:20 smls In Perl 5, «defined &foo» could be used to check if a named subroutine is defined, and «undef &foo;» to remove a named subroutine.
20:20 smls How would you do those things in Perl 6?
20:21 smls m: say if defined &foo { say 'yep' }
20:21 camelia rakudo-moar 9fc66c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Bws6clvjlU␤Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument␤at /tmp/Bws6clvjlU:1␤------> 3say 7⏏5if defined &foo { say 'yep' }␤    …»
20:21 smls m: if defined &foo { say 'yep' }
20:21 camelia rakudo-moar 9fc66c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/joFr4C9ulp␤Undeclared routine:␤    &foo used at line 1␤␤»
20:23 arnsholt moritz: Oh yeah, I'd forgotten about that
20:26 smls m: sub foo { 42}; say foo; &foo = Nil; say &foo
20:26 camelia rakudo-moar 9fc66c: OUTPUT«42␤Cannot modify an immutable Sub␤  in block <unit> at /tmp/75A6_dxDQR:1␤␤»
20:26 Kristien smls: names are resolved at compile-time, but defined is evaluated at runtime
20:26 moritz m: my &foo = Nil; foo() if defined &foo;
20:26 camelia rakudo-moar 9fc66c: ( no output )
20:26 moritz m: my &foo = sub { say 42 }; foo() if defined &foo;
20:26 camelia rakudo-moar 9fc66c: OUTPUT«42␤»
20:26 moritz so yes, defined works
20:27 smls heh
20:27 smls but only if the subtoutine was declared
20:27 moritz well
20:28 rjbs Is there a Plack6? :)
20:28 moritz you can always do a dynamic lookup too
20:28 rjbs Plackdo maybe?
20:28 moritz rjbs: https://github.com/supernovus/perl6-psgi/
20:28 rjbs thanks much
20:28 smls moritz: how?
20:28 smls In Perl 5, «defined &foo»  works on a name that was never declared
20:29 moritz m: my $name = 'sqrt'; my &foo = &::($name); say foo(9) if defined \&foo
20:29 camelia rakudo-moar 9fc66c: OUTPUT«3␤»
20:29 moritz m: my $name = 'sqrt'; my &foo = &::($name); say foo(9) if defined &foo
20:29 camelia rakudo-moar 9fc66c: OUTPUT«3␤»
20:29 moritz m: my $name = 'wrong'; my &foo = &::($name); say foo(9) if defined &foo
20:29 camelia rakudo-moar 9fc66c: OUTPUT«Type check failed in assignment to '&foo'; expected 'Callable' but got 'Failure'␤  in block <unit> at /tmp/qGr4sVtc9Y:1␤␤»
20:29 moritz m: my $name = 'wrong'; my $foo = &::($name); say $foo(9) if defined $foo
20:29 camelia rakudo-moar 9fc66c: ( no output )
20:29 moritz m: my $name = 'sqrt'; my $foo = &::($name); say $foo(9) if defined $foo
20:29 camelia rakudo-moar 9fc66c: OUTPUT«3␤»
20:29 moritz smls: ^^
20:30 smls m: say defined &::("foo")
20:30 camelia rakudo-moar 9fc66c: OUTPUT«False␤»
20:30 smls say defined &::<foo>  # curious
20:30 smls m: say defined &::<foo>  # curious
20:30 camelia rakudo-moar 9fc66c: OUTPUT«===SORRY!===␤MVMArray: Index out of bounds␤»
20:32 moritz bug.
20:32 moritz m: say defined &::('foo')
20:32 camelia rakudo-moar 9fc66c: OUTPUT«False␤»
20:33 smls m: say defined GLOBAL::("foo")
20:33 camelia rakudo-moar 9fc66c: OUTPUT«False␤»
20:33 masak smls: please submit rakudobug.
20:33 smls ok
20:33 ruoso So, while building the QAST tree in a Slang... I am managing to generate the regex nodes, but I'm kind of failing to find out how to represent the grammar itself with the named tokens... does anyone have a pointer on code examples or docs that would help?
20:34 smls are & and GLOBAL supposed to be the same?
20:34 smls or is there another named form for &::
20:34 fernand__ how can I get a type object from a scala with it's name?
20:35 smls also, looks like the fosdem videos have finally been uploaded: http://video.fosdem.org/2015/
20:35 masak \o/
20:35 masak smls++
20:35 smls hm no
20:35 lizmat smls: I only see empty directories ?
20:35 smls just a directory structure?
20:35 Ovid__ Perl dev room’s emtpy
20:35 smls :(
20:35 smls smls--
20:36 * masak .oO( here's how the videos *would* be structured... ) :P
20:36 masak Lisp had a devroom? cool.
20:36 moritz temp @directories = gather { ... }
20:37 vendethiel they're all empty :(
20:38 grondilu FOSDEM's guys surely now how to tease their audience :)
20:38 grondilu s/now/know/
20:38 * ruoso .oO( maybe the QAST tree should be a repesentation of the MOP operations with GrammarHOW )
20:38 brrt \o
20:39 dalek rakudo/cpp: 16f80fe | FROGGS++ | lib/NativeCall.pm:
20:39 dalek rakudo/cpp: add typed Pointer role to NativeCall
20:39 dalek rakudo/cpp:
20:39 dalek rakudo/cpp: Pointer defaults to Pointer[void], and is needed to correctly mangle C++ symbols.
20:39 dalek rakudo/cpp: Pointer[void] mangles down to Pv, Pointer[int16] down to Ps, etc.
20:39 dalek rakudo/cpp: review: https://github.com/rakudo/rakudo/commit/16f80fe483
20:39 brrt grondilu: yeah
20:39 brrt i was all excited as well
20:39 grondilu it's almost a practical joke, frankly.
20:39 brrt anyway, does anybody renember the bug with moarvm copying no large than 2gb?
20:40 smls m: sub foo { 42 }; say defined $_ for $::("foo"), MY::<foo>, OUR::<foo>, CORE::<foo>, OUTER::<foo>
20:40 camelia rakudo-moar 9fc66c: OUTPUT«False␤False␤False␤False␤False␤»
20:40 masak brrt: https://rt.perl.org/Ticket/Display.html?id=123796
20:40 smls ^^ which pseudo-package are normal subs supposed to be in?
20:40 [Coke] pmurias: ping.
20:40 brrt masak++
20:41 moritz smls: MY, but with sigil
20:41 moritz smls: either &MY::<foo> or MY::<&foo>
20:41 [Coke] how does one "ack -1" in ack2?
20:41 [Coke] er.
20:41 [Coke] how does one "ack -a" in ack2?
20:41 moritz [Coke]: it's default
20:42 smls m: sub foo { 42 }; say defined $_ for &::("foo"), MY&::<foo>, MY::<&foo>
20:42 camelia rakudo-moar 9fc66c: OUTPUT«True␤True␤True␤»
20:42 smls m: sub foo { 42 }; say defined &MY::<foo>
20:42 camelia rakudo-moar 9fc66c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/2TYVENaAKL␤Undeclared routine:␤    &MY used at line 1␤␤»
20:43 [Coke] moritz: is it really searching all files, or just all known files?
20:43 moritz m: m: sub foo { 42 }; say defined &MY::('foo')
20:43 camelia rakudo-moar 9fc66c: OUTPUT«True␤»
20:43 moritz [Coke]: all, except those excluded by default (.git dirs, .svn etc.)
20:43 [Coke] moritz: danke.
20:45 moritz [Coke]: bitteschön
20:46 [Coke] failure building nqp-js for daily runs on hack.p6c.org - https://gist.github.com/coke/631cd667d10360e1741d
20:47 [Coke] s/building/running tests for/
20:50 * raydiak had another creative seizure yesterday and started Inline::Lua which is going surprisingly smoothly so far...feedback, contributions, etc. welcome :)
20:51 moritz npm WARN This failure might be due to the use of legacy binary "node"
20:53 [Coke] there appears to be logic in the config step to look for node.
20:53 [Coke] er, vs. nodejs
20:54 moritz [Coke]: yes, I've added that; but I haven't yet figured out how to make nqp-js actually *use* that information :(
20:54 [Coke] oh.
20:55 vendethiel m: say 1.numerator
20:55 camelia rakudo-moar 9fc66c: OUTPUT«No such method 'numerator' for invocant of type 'Int'␤  in block <unit> at /tmp/T4h4ZMP7T3:1␤␤»
20:55 ruoso Is there a documentation anywhere of all the dynamic variables during the parsing? e.g.: $*PACKAGE, $*DECLARAND...
20:56 [Coke] let's see, nqp-js invokes nqp-m ... don't see anywhere where node is actually invoked. digging
20:57 moritz [Coke]: src/vm/js/HLL/Backend.nqp
20:57 moritz calls nqp::shell("node $tmp_file", ...)
20:58 [Coke] ok. I can use the script that runs the daily to force that to nodejs until we can fix it.
20:58 [Coke] testing...
20:58 [Coke] gotta run. laters.
20:59 moritz m: say nqp::pid()
20:59 camelia rakudo-moar 9fc66c: OUTPUT«===SORRY!===␤No registered operation handler for 'pid'␤»
21:00 moritz m: say nqp::getpid()
21:00 camelia rakudo-moar 9fc66c: OUTPUT«19798␤»
21:00 moritz nqp-m: say('tmp.js' ~ nqp::getpid())
21:00 camelia nqp-moarvm: OUTPUT«tmp.js19916␤»
21:01 dalek nqp/js: 1246cf6 | moritz++ | src/vm/js/HLL/Backend.nqp:
21:01 dalek nqp/js: Include PID in temporary file name
21:01 dalek nqp/js: review: https://github.com/perl6/nqp/commit/1246cf63d9
21:03 fernand__ if I have $a = "Int", how can I get the Int object type from $a?
21:03 moritz fernand__: ::($a)
21:03 fernand__ thanks!
21:03 smls r: say defined $::<foo>
21:03 camelia rakudo-moar 9fc66c: OUTPUT«===SORRY!===␤MVMArray: Index out of bounds␤»
21:03 smls p: say defined $::<foo>
21:04 bjz joined #perl6
21:04 smls camelia only uses Moar now?
21:04 moritz camelia: yes
21:04 moritz and std, and nqp-js, and perlito
21:05 masak and prof.
21:05 moritz I never managed to get the rakudo-j evalserver running reliably, and startup is too slow in standalone mode
21:05 moritz and parrot is ... resting
21:05 smls i don't have a parrot/jvm rakudo installed locally either
21:06 smls wonder what they say instead of the MVMArray error
21:07 skids smls: VMArray: Index out of bounds
21:07 skids But my rakudo-j is old, and running on openjdk.
21:07 smls thanks
21:08 moritz I don't think that code was touched recentl
21:08 moritz y
21:09 dolmen joined #perl6
21:09 rurban joined #perl6
21:16 smls m: say defined &MY::<foo>
21:16 camelia rakudo-moar 9fc66c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/g6c4wxNwrV␤Undeclared routine:␤    &MY used at line 1␤␤»
21:16 raydiak r-j from a few days-weeks ago says ===SORRY!===␤VMArray: Index out of bounds␤
21:16 smls moritz: what about this ^^ form, is that supposed to work?
21:17 moritz smls: I'm not sure; it would be consistent at least
21:17 moritz smls: maybe grep the design docs?
21:18 skids $::<foo>:exists  also throws out-of-bounds
21:19 dalek rakudo/nom: 80a5135 | lizmat++ | src/core/Str.pm:
21:19 dalek rakudo/nom: Make substr() a lot faster, make substr-rw() work
21:19 dalek rakudo/nom:
21:19 dalek rakudo/nom: Highlights:
21:19 dalek rakudo/nom: - substr("foo",1)       2.5x faster
21:19 dalek rakudo/nom: - substr("foo",1,2)     6x faster
21:19 dalek rakudo/nom: - substr("foo",*-2)     1.5x faster
21:19 dalek rakudo/nom: - substr("foo",0,*-2)   1.5x faster
21:19 dalek rakudo/nom: - substr-rw() now accepts the same range of parameters as substr()
21:19 dalek rakudo/nom:
21:19 dalek rakudo/nom: substr() is now a multi, with 4 candidates.
21:19 dalek rakudo/nom:
21:19 dalek rakudo/nom: The same was attempted with substr-rw(), but apparently the Proxy overhead
21:19 dalek rakudo/nom: drowns out any efficiency gains.  And the one sub was fixed some todo tests
21:19 dalek rakudo/nom: for substr-rw, so I left it at one and only candidate for substr-rw().
21:19 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/80a5135980
21:20 vendethiel lizmat++ # amazing string manipulation improvements for the Perl
21:20 smls moritz: http://design.perl6.org/S02.html#Symbol_tables  shows only examples with $ not &
21:20 masak \o/
21:21 smls ack '&MY'  in specd dir shows no results
21:21 lizmat expect some more improvements as soon as natives ints land properly
21:21 lizmat *native
21:26 FROGGS_ lizmat++
21:27 Mouq joined #perl6
21:27 El_Che I wonder if someone here has tried the perl6 support in padre. I am migrating te code (on a github fork) to use Moose. That made me wonder what the state is of perl6 there
21:28 dalek rakudo/nom: d850a9a | lizmat++ | src/core/ (2 files):
21:28 dalek rakudo/nom: substr(Str:D,...) is faster than Str:D.substr(...)
21:28 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d850a9a544
21:28 moritz smls: S02 has examples like PROCESS::<$IN>
21:29 moritz smls: and since we extend the TABLE::<$THING> support to $TABLE::('THING'), it just makes sense to also support $TABLE::<THING>
21:31 vendethiel lizmat: good ol' sub vs method :P
21:32 skids lizmat++  yet another achievment.  All I've maaged to do so far today is strike black gold, which in these parts means, "I can see my driveway!"
21:32 smls moritz: S02 does mention  $::<foo>  just not  &::<foo>
21:33 bjz joined #perl6
21:34 Kristien $* variables can also be in packages I hope?
21:35 Kristien hmm
21:35 * raydiak wonders how hard it might be to convert the pygments p6 support to a Grammar: https://bitbucket.org/birkenfeld/pygments-main/src/943cb8da8444b832804f6cebf9679305b22f8b15/pygments/lexers/perl.py?at=default#cl-209
21:35 Kristien how are they different from regular variables actually?
21:35 FROGGS_ Kristien: they are dynamically scoped
21:35 Kristien since you still have to use temp keyword
21:35 FROGGS_ so they are visible along the callchain
21:36 FROGGS_ temp?
21:37 Kristien m: my $*x = 1; sub g { temp $*x = 1; say $*x; }; sub f { temp $*x = 2; g(); say $*x }; f()
21:37 camelia rakudo-moar 9fc66c: OUTPUT«1␤2␤»
21:37 Kristien this isn't any different when writing $x instead of $*x
21:37 Kristien or is the only difference that it's accessible through CALLER?
21:38 FROGGS_ m: sub foo { say $*FOO; bar }; sub bar { say $*FOO }; { my $*FOO = 42; foo }; bar
21:38 camelia rakudo-moar 9fc66c: OUTPUT«42␤42␤Dynamic variable $*FOO not found␤  in method gist at src/gen/m-CORE.setting:14920␤  in sub say at src/gen/m-CORE.setting:17683␤  in sub bar at /tmp/V2A1XredxS:1␤  in block <unit> at /tmp/V2A1XredxS:1␤␤»
21:38 FROGGS_ see?
21:38 FROGGS_ m: sub foo { bar }; sub bar { say "bar " ~ $*FOO.defined }; { my $*FOO = 42; foo }; bar
21:38 camelia rakudo-moar 9fc66c: OUTPUT«bar True␤bar False␤»
21:39 Kristien oh
21:39 Kristien so they're not namespaced :(
21:39 Kristien thought they were more like ^:dynamic in Clojure
21:39 Kristien or DynamicVariable in Scala
21:40 FROGGS_ I dunno what that means actually
21:40 moritz the * is for dynamic variables, yes
21:40 moritz use ordinary lexicals if you don't want that :-)
21:41 Kristien I was hoping for lexically scoped variables that require you to use temp for setting them.
21:41 Kristien I don't see how dynamically scoped variables can possibly be useful if they all share the same namespace.
21:42 FROGGS_ they are used to propagate information along the callchain, nothing else
21:42 FROGGS_ which does not happen to lexicals
21:42 Kristien When would that be useful?
21:42 FROGGS_ look at Perl6's grammar :o)
21:43 vendethiel also, look at say and stuff :-)
21:43 vendethiel if you need your application code to output to somewhere else instead of STDOUT, just $*OUT =... (or temp it) and yeehee
21:44 FROGGS_ like the statementlist rule sets up $*BLOCK, and every declaration rule that is called via different (in)direct ways can push to $*BLOCK
21:44 Kristien Just saying that it's a nightmare if you use two libraries that happen to set dynamic variables with the same name.
21:44 FROGGS_ Kristien: they probably do not call into each other
21:45 FROGGS_ but yes, dynamic variable kinda pollute your call chain
21:45 FROGGS_ variables*
21:45 moritz and there's a reason we use lexicals for nearly everything
21:45 Kristien I'll avoid them and use temp instead. :)
21:45 vendethiel (also, scala's DynamicVariable is a completly broken hack, much like what was introduced at that time, like for lazyness or Application etc)
21:46 masak Kristien: there's nothing to prevent you from using a poor man's namespace: variable prefixes.
21:46 Kristien and threadlocal
21:46 skids m: package foo { our sub foo {$*bar::f.say} }; my $bar::f = 42; foo::foo; # not sure what that should do, actually.
21:46 camelia rakudo-moar d850a9: OUTPUT«Dynamic variable $*f not found␤  in method gist at src/gen/m-CORE.setting:14967␤  in sub say at src/gen/m-CORE.setting:17730␤  in method say at src/gen/m-CORE.setting:1162␤  in sub foo at /tmp/yz88biCyu3:1␤  in block <unit> at /tmp/yz88biCyu3:1…»
21:46 masak Kristien: at least then, you'll be protected from everybody else's dynamicals.
21:46 Kristien vendethiel: what is broken about it?
21:46 vendethiel Kristien: initialization order bugs all over the place, iirc
21:46 vendethiel would need to find the si-ticket
21:49 Kristien their implementation is under 20 LOC though
21:49 mohij joined #perl6
21:51 moritz "it's easy to get the wrong answer in 20 LOC" :-)
21:51 Kristien and it looks totally fine
21:51 Kristien the gist of it is a thread-local variable and { val old = current; current = new; try thunk finally current = old }
21:52 dalek roast: 5dd29d5 | lizmat++ | S32-str/substr-rw.t:
21:52 dalek roast: Unfudge now passing substr-rw() tests
21:52 dalek roast: review: https://github.com/perl6/roast/commit/5dd29d54b1
21:52 vendethiel I'm trying to look for a ticket, but there are so many scala bugs reported it's unreal
21:54 pmurias [Coke]: pong
21:56 Kristien Coke pong? Beer pong!
22:00 fernand__ joined #perl6
22:10 moritz silly pong!
22:18 laouji joined #perl6
22:30 dalek rakudo/cpp: cb9b608 | FROGGS++ | / (3 files):
22:30 dalek rakudo/cpp: allow typed pointers in attrs and as return type
22:30 dalek rakudo/cpp:
22:30 dalek rakudo/cpp: So we can do: `class Foo { has Pointer[long] $.bar }; my $long = $foo.bar.deref`;
22:30 dalek rakudo/cpp: review: https://github.com/rakudo/rakudo/commit/cb9b608f56
22:35 dalek rakudo/cpp: fc0b8ec | FROGGS++ | lib/NativeCall.pm:
22:35 dalek rakudo/cpp: fix typed pointers when mangling names for C++
22:35 dalek rakudo/cpp: review: https://github.com/rakudo/rakudo/commit/fc0b8ec6b3
22:36 BenGoldberg joined #perl6
22:41 Kristien I should implement pong in AWK.
22:48 MilkmanDan joined #perl6
22:48 MilkmanDan joined #perl6
22:50 MilkmanDan joined #perl6
22:54 jnthn evening, #perl6
22:54 masak jnthn! \o/
22:55 raydiak \o jnthn
22:55 pmurias jnthn: hi
22:56 bolangi joined #perl6
23:03 Vlavv_ joined #perl6
23:04 timotimo ~hi jnthn
23:04 timotimo :)
23:07 timotimo so many nqp::sayfh(nqp::getstderr(), ...) calls in rakudo now %)
23:08 ruoso jnthn: hi... if you have some time, I think I need some help... I'm trying to implement a Slang for EBNF grammars, and tho I got a lot of progress, I am kind of stuck in figuring out the QAST tree that I'm supposed to return in order to make rakudo compile it as a grammar... the code I have so far is at https://github.com/ruoso/Grammar-EBNF , the test with my immediate target is https://github.com/ruoso/Grammar-EBNF/blob/master/t/004_slang.t
23:08 jnthn timotimo: Oh?
23:09 jnthn ruoso: QAST is about execution, not declaration. Declarations are done by the compiler constructing meta-objects
23:10 timotimo jnthn: i'm hunting down why in nqp::rand_n(1e0) <= 0.5e0 the infix:«<=» isn't being compile-time-inlined
23:10 timotimo turns out the optimizer doesn't understand that rand_n returns a num
23:10 ruoso jnthn: oh, so I should just build closures and use the MOP directly in that case?
23:10 jnthn ruoso: That'd be one way to go, for sure
23:10 timotimo and calling .returns(num) on the node doesn't help right away because the next step is the optimizer checking nqp::istype($the_thing_that_is_num, $!symbols.Mu)
23:10 timotimo which i believe doesn't hold ... right?
23:11 jnthn ruoso: Rakudo and NQP do a relatively intricate dance wiring up QAST and meta-objects
23:11 jnthn ruoso: In no small part 'cus it has to support BEGIN time.
23:11 jnthn And everything that happens at BEGIN time.
23:11 jnthn timotimo: nqp::istype(num, Mu) should come out true
23:11 timotimo OK
23:11 jnthn timotimo: Oh, but you're setting NQP's num on it there...
23:12 timotimo so i'll spread out more debug outputs
23:12 timotimo yes, that's right
23:12 jnthn timotimo: Should probably be $!symbols.num
23:12 timotimo OK
23:12 jnthn Which may not exist yet
23:12 jnthn So yeah, that may be the issue you're seeing.
23:12 timotimo thanks, i hadn't thought of using $!symbols to get a proper num
23:14 ruoso jnthn: that clarifies a lot... is there any special incantation for programatically creating a grammar and registering tokens within that grammar? Can I use the regex object as a code ref? Or is there a specific protocol for the code in tokens/rules?
23:14 jnthn ruoso: GrammarHOW really is just a subclass of ClassHOW that overrides the choice of default parent class
23:15 jnthn ruoso: And we .^add_method the Regex code objects
23:15 jnthn Regex code objects have an NFA on them.
23:15 ruoso cool...
23:15 jnthn Which is used to do all the fancy stuff
23:15 * ruoso back to coding
23:25 timotimo hum
23:26 timotimo annotating ops ending in _n with "returns num" gets me an "unable to call accepts" when optimizing stuff, because it ends up reporting an inevitable bind failure in ACCEPTS
23:28 timotimo the backtrace is ... peculiar
23:29 timotimo https://gist.github.com/timo/40d630e20e0de3e72e70 - anything obvious stick out to your eye, jnthn?
23:31 ruoso jnthn: oh, one other bit, how do I bind the grammar I created into a package name that I have the string for?
23:32 jnthn ruoso: Hm, not entirely sure I grok what you're after...I typically do type generation-y stuff by populating EXPORT::DEFAULT with the stuff and then having it imported...
23:33 jnthn http://jnthn.net/papers/2015-fosdem-static-dynamic.pdf slide 52 onwards may help
23:34 ruoso my slang looks like: "ebnf-grammar Foo::Bar { ... }"
23:34 jnthn timotimo: Not right off, I'm agraid...
23:34 ruoso at the end of this, I expect Foo::Bar to be a GrammarHOW
23:34 jnthn *afraid
23:35 timotimo jnthn: i should be able to get the line number of the op i'm working on by looking at its .node property and using HLL::Compiler.lineof on it?
23:35 jnthn ruoso: Oh... If you're doing it through the EXPORTHOW mechanism and having it fall out of the normal package_def rule to some degree then that should be taking care of it
23:35 jnthn ruoso: See my OO::Monitors module for how I get monitor Foo::Bar { ... } doing the right thing.
23:35 [Coke] pmurias: did you see my gist? trying to add nqpjs to the daily runs.
23:35 [Coke] (along with all the other nqps)
23:36 jnthn timotimo: Not sure...we don't .node every single thing.
23:36 ruoso jnthn: oh, ok, I suspected that not using pacakge_def was incorrect.... will look at your code
23:36 timotimo mhhh
23:37 ruoso jnthn: my search-fu is failing, do you have a more concrete link?
23:37 pmurias [Coke]: I'm looking
23:38 jnthn ruoso: It's in the module ecosystem
23:38 jnthn ruoso: https://github.com/jnthn/oo-monitors/blob/master/lib/OO/Monitors.pm is the file you want
23:38 pmurias [Coke]: it seems you need to install node
23:38 pmurias [Coke]: instead of nodejs
23:39 fernand__ Im sorry keep asking dumb questions... but: how can I know if a given obj type is a role?
23:39 ruoso jnthn: thanks...
23:39 ruoso fernand__: $obj ~~ role;
23:39 timotimo jnthn: i've tried a dumb hack and annotate _n ops with ".returns(...Num)" instead; that doesn't cause the error but it also doesn't make nqp::rand_n(1e0) <= 0.5e0 inline the <=
23:40 [Coke] ah. based on the error message, I thought it was just a different name.
23:40 timotimo whereas having my num $foo; $foo <= 0.5e0 will inline it properly
23:40 fernand__ thaks, I tried $obj ~~ Role...
23:41 pmurias [Coke]: it's debian renaming node.js
23:41 fernand__ *thanks
23:41 pmurias [Coke]: things out of my control don't tolerate that
23:41 ruoso jnthn: right, so now that reminds me of why I was not using package_def... I couldn't find how to hook a different syntax for package_def
23:42 jnthn fernand__: Wait, did you mean check if an object does a role, or given a type object check if it corresponds to a role?
23:42 fernand__ 2nd alternative
23:43 pmurias I think I should just detect nodejs and tell people to install a proper node
23:44 jnthn fernand__: Hm, there's more than one answer depending on what exactly you care about
23:45 jnthn m: say Numeric.HOW.archetypes.composable;
23:45 camelia rakudo-moar d850a9: OUTPUT«1␤»
23:45 jnthn m: say Int.HOW.archetypes.composable;
23:45 camelia rakudo-moar d850a9: OUTPUT«No such method 'gist' for invocant of type 'NQPMu'␤  in sub say at src/gen/m-CORE.setting:17734␤  in block <unit> at /tmp/vbrdUbGAeL:1␤␤»
23:45 jnthn m: say so Int.HOW.archetypes.composable;
23:45 camelia rakudo-moar d850a9: OUTPUT«No such method 'Bool' for invocant of type 'NQPMu'␤  in sub prefix:<so> at src/gen/m-CORE.setting:4879␤  in block <unit> at /tmp/Oz165C3oX4:1␤␤»
23:45 jnthn Heh
23:46 jnthn Well, can always
23:46 jnthn m: for Int, Numeric -> $t { say so try $t.HOW.archetypes.composable }
23:46 camelia rakudo-moar d850a9: OUTPUT«No such method 'Bool' for invocant of type 'NQPMu'␤  in sub prefix:<so> at src/gen/m-CORE.setting:4879␤  in block <unit> at /tmp/XodKsm42r9:1␤␤»
23:46 fernand__ jnthn: I am looping throw a class attributes and want to know if the $attr.type is a role
23:46 jnthn gah
23:46 jnthn fernand__: Oh...but...
23:46 jnthn Oh, that type...
23:47 jnthn Anyway, what I should is one way.
23:47 jnthn *showed
23:47 jnthn .HOW.archetypes.composable returns a true value if you've got a role
23:48 fernand__ jnthn: like this: https://gist.github.com/anonymous/fc9b1965a61f5aa51725
23:48 dalek nqp/js: 7c23582 | (Pawel Murias)++ | Configure.pl:
23:48 dalek nqp/js: Detect lack of node.js or node.js incorrectly installed as nodejs.
23:48 dalek nqp/js: review: https://github.com/perl6/nqp/commit/7c23582245
23:48 jnthn You can't say ~~ role
23:48 pmurias moritz, [Coke]: Configure.pl will now detect nodejs and tell users they have to install node
23:49 jnthn That's probably a syntax error
23:49 jnthn Try if $atrr.type.HOW.archetypes.composable
23:49 jnthn Given you're then feeding it to "does", that's probably the right check.
23:50 pmurias [Coke]: You might want to try: https://github.com/joyent/node/wiki/installing-node.js-via-package-manager
23:51 [Coke] ok. I cheated and linked /usr/bin/node to /usr/bin/nodejs - but we should probably be able to figure that out and invoke node or nodejs correctly.
23:52 fernand__ jnthn: working code: https://gist.github.com/anonymous/029a0d26422198e7947e
23:52 pmurias [Coke]: no
23:53 pmurias [Coke]: the problem is that modules don't install correctly on nodejs
23:53 jnthn fernand__: Yes, that's "check if an object does a particular role"
23:54 masak 'night, #perl6
23:54 masak oh, before I leave, three questions:
23:55 jnthn Yes. Green. Clouds.
23:55 jnthn .oO( If that answers them, I'll be amazed :P )
23:55 masak 1. are we writing our Perl 6 grammars (including STD.pm6) in a less extensible way than we could? (extensible wrt macros and slangs)
23:56 masak 2. if "no" to question 1, what is it about grammars (and actions) that make them inherently non-extensible? is there some sense in which the "grammars are like classes and extension is like inheritance" doesn't quite get us where we want in terms of extensibility?
23:56 masak 3. is there a better set of tools we could provide instead of grammars and actions that would be more extensible?
23:56 masak really 'night
23:57 jnthn 'night, masak
23:57 pmurias are classes that aren't written with extensibility in mind really that extensible?

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo