Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-10-19

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:10 silug joined #perl6
00:18 jack_rabbit joined #perl6
00:24 Hor|zon joined #perl6
00:38 araujo joined #perl6
00:42 timotimo it seems kind of like I have been relying on software rendering all this time
00:43 timotimo that would explain why rendering took longer than calculating movement and collisions
00:48 Mouq joined #perl6
01:10 Mouq pmichaud: re: http://irclog.perlgeek.de/perl6/2014-10-17#i_9525946 that actually makes more sense with the spec'd semantics of [*] and [**], where the former is every element of one layer and the latter is more like every single element
01:25 TimToady but I don't think ** loses the structure, which is the opposite of flattening
01:36 jimgnosis joined #perl6
01:39 Mso150 joined #perl6
01:48 Mso150 joined #perl6
02:20 Mouq joined #perl6
02:24 Mouq TimToady: True..
02:25 kurahaupo_ joined #perl6
02:25 Hor|zon joined #perl6
02:26 Mouq masak++: re: your latest blug, I don't know if it's been talked about, but how would the regex supplied to `is parsed` access the P6 grammar?
02:26 Mouq masak: I suppose one option would be to mixin to the regex
02:27 Mouq masak: But another might be a special slangy regex declarator
02:28 Mouq .oO( m:perl:s { } ? )
02:28 Mouq I guess that would be s/m/rx/
02:30 Mso150_u joined #perl6
02:32 aborazmeh joined #perl6
02:50 noganex_ joined #perl6
02:58 cognome joined #perl6
03:14 mauke_ joined #perl6
03:23 ezra1 joined #perl6
03:27 aborazmeh joined #perl6
03:49 flaviusb joined #perl6
04:08 cognome joined #perl6
04:17 chenryn joined #perl6
04:18 raiph joined #perl6
04:26 Hor|zon joined #perl6
04:45 ggoebel11111114 joined #perl6
04:50 yeahnoob joined #perl6
05:16 ezra1 joined #perl6
05:21 chenryn joined #perl6
05:21 Mso150 joined #perl6
05:38 kaare_ joined #perl6
06:15 anaeem1_ joined #perl6
06:20 virtualsue joined #perl6
06:21 kurahaupo joined #perl6
06:27 Hor|zon joined #perl6
06:34 molaf joined #perl6
06:39 rindolf joined #perl6
06:44 gfldex joined #perl6
07:03 itz m: Any ~~ "Foo"
07:04 camelia rakudo-moar 09a84c: OUTPUT«use of uninitialized value $other of type Any in string context  in block <unit> at /tmp/DGRy3MZoCL:1␤␤»
07:05 Mso150 joined #perl6
07:09 molaf_ joined #perl6
07:10 itz m: "Foo" ~~ Any
07:10 camelia rakudo-moar 09a84c: ( no output )
07:19 darutoko joined #perl6
07:30 itz m: "Foo" ~~ Any
07:30 camelia rakudo-moar 09a84c: ( no output )
07:31 itz s: "Foo" ~~ Any
07:48 masak morning, #perl6
07:55 anaeem1_ joined #perl6
08:01 moritz \o
08:05 timotimo o/
08:11 moritz m: say "Foo" ~~ Any # for itz
08:11 camelia rakudo-moar 09a84c: OUTPUT«True␤»
08:29 Hor|zon joined #perl6
08:46 Ven joined #perl6
08:51 nine_ timotimo: and people thought force_gc() wasn't useful except maybe for my tests in Inline::Perl5 :)
08:57 spider-mario joined #perl6
09:07 rylo joined #perl6
09:09 lasse joined #perl6
09:11 Mso150_c joined #perl6
09:18 rmgk_ joined #perl6
09:20 noganex joined #perl6
09:26 * Mouq really wants some kind of return-if in core
09:37 nebuchadnezzar joined #perl6
09:42 haroldwu joined #perl6
09:55 dalek std: 14ad63b | (Elizabeth Mattijsen)++ | STD.pm6:
09:55 dalek std: s/winner/earliest/
09:55 dalek std: review: https://github.com/perl6/std/commit/14ad63b636
09:56 ezra1 joined #perl6
09:56 lizmat good *, #perl6!
09:57 lizmat Mouq: not sure what you mean
09:58 abraxxa joined #perl6
09:59 ezra1 joined #perl6
09:59 Mouq Well.. I just can't find an idiomatic way to write my $ret = ...; return $ret if $ret
10:00 Mouq if ... -> $ret { return $ret } seems so clunky
10:03 * abraxxa installs rakudo-star-2014.09
10:03 mauke what would that look like as a macro?
10:04 abraxxa i'm wondering why class attributes are accessed with $!varname and not $.varname as the exclamation mark is not
10:04 abraxxa 'not' in my mind for almost all languages and '.' is the OO class and attr/method separator in most
10:04 ezra1 joined #perl6
10:04 mauke wasn't ! private or something?
10:04 abraxxa yes
10:05 moritz yes, ! is private in OO context
10:05 moritz $.thing is really a method call
10:05 abraxxa that exists too?
10:05 abraxxa i've only come in contact with p6 OO in DBIish
10:05 abraxxa the DBDish modules all use private vars
10:05 moritz m: class A { method foo { 42 }; method bar { say $.foo } }; A.new.bar
10:05 camelia rakudo-moar 09a84c: OUTPUT«42␤»
10:06 moritz and if you say 'has $.thing', then the accessor method is generated for you
10:06 abraxxa ah, so $. does exist, great!
10:06 abraxxa why was ! chosen for the private ones?
10:07 moritz m: class A { has $.a; method foo { say $.a; say $!a } }; A.new(a => 42 )
10:07 camelia rakudo-moar 09a84c: ( no output )
10:07 mauke as for reading ! as "not", try working in ocaml or haskell for a few weeks :-)
10:07 moritz m: class A { has $.a; method foo { say $.a; say $!a } }; A.new(a => 42 ).foo
10:07 camelia rakudo-moar 09a84c: OUTPUT«42␤42␤»
10:07 abraxxa i don't know ocaml nor haskell
10:07 moritz abraxxa: maybe because the negation thing can interpreted as "access denied" from the outside
10:07 abraxxa only Pascal, Perl, Python, a little bit of C# and C
10:08 mauke ocaml uses ! for deref
10:08 abraxxa moritz: ok, that might help remembering it
10:08 mauke haskell uses ! for array indexing and strictness annotations
10:08 huf it's a . with a bar on top, denying access :)
10:08 mauke nice
10:08 abraxxa so when I want to define an attribute I have to use 'has Str $varname;' or 'has Str $.varname;'?
10:14 lizmat abraxxa: either $.var or $!var, depending on whether you want an accessor made for you
10:14 abraxxa lizmat: thanks!
10:14 lizmat if you want to have an attribute accessible from the outside but populated lazily
10:15 lizmat has $!foo; method foo { $!foo //= some calculation }
10:16 ezra1 joined #perl6
10:17 chenryn joined #perl6
10:25 abraxxa i'm still looking for a way to have a default value on a test file that gets evaled in other test files that should be able to override it's value
10:26 abraxxa lizmat: i have attributes that are required to be set an instantiation time and are immutable
10:26 abraxxa DBDish currently solves this using private attributers and a submetho BUILD
10:26 lizmat that sounds about right ?
10:27 moritz if it's a value type, you don't have to fear modifications from the outside, even if you expose it
10:27 dalek rakudo/nom: 52c224b | (Elizabeth Mattijsen)++ | src/core/IO/Path.pm:
10:27 dalek rakudo/nom: Introduce faster IO::Path creator for abs paths
10:27 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/52c224b49c
10:27 abraxxa lizmat: ok
10:27 moritz has Int $.plan = die 'Attribute "plan" is required'
10:27 vendethiel joined #perl6
10:28 abraxxa moritz: yes, i tend to that solution as well
10:29 moritz lizmat: and reason not to call it new-from-absolute-path?
10:29 moritz lizmat: new-fap sounds kinda obscure to me
10:29 lizmat I guess I had my inspriation from new-fp in bags and so
10:29 lizmat I guess I should rename them as well...  :-)
10:29 Hor|zon joined #perl6
10:30 moritz aye :-)
10:30 ecocode joined #perl6
10:33 abraxxa anyone familiar with DBDish::Pg?
10:33 moritz is there already a branch for GLR?
10:33 abraxxa it seems Oracle requires the SQL placeholder ? quoted and the grammar in Pg seems to do that
10:33 moritz abraxxa: I think I wrote it originally
10:33 abraxxa https://github.com/abraxxa/DBIish/blob/master/lib/DBDish/Pg.pm6#L453
10:33 lizmat moritz: no, don't think so
10:34 abraxxa moritz: that does the grammer starting at line 147 do?
10:35 mauke basic tokenizing, it looks like
10:35 ezra1 joined #perl6
10:35 mauke and not handling comments
10:35 * abraxxa reads http://doc.perl6.org/type/Grammar
10:35 moritz abraxxa: it replaces ?, ? by $1, $2 etc
10:35 abraxxa ah, because Pg doesn't use ? as placeholder in SQL?
10:35 moritz abraxxa: trying to not substitute ? inside quotes
10:36 mauke the \'\' case seems redundant
10:36 mauke without it, 'foo''bar' would simply be parsed as two single-quoted chunks
10:36 abraxxa moritz: what would you recommend to do when I only want to substitute ? with '?'
10:37 mauke wait, if a DB treats '?' as a placeholder, how do you write an actual string containing a question mark?
10:37 moritz abraxxa: you basically need the same tokenization effort, because otherwise you don't know which question marks to escape
10:37 abraxxa mauke: http://www.techonthenet.com/oracle/errors/ora00911.php
10:37 moritz mauke: also it doesn't handle the $delim$...$delim$ syntax
10:38 abraxxa currently when I try to execute INSERT INTO nom (name, description, quantity, price) VALUES ( ?, ?, ?, ? ) I get an ORA-00911
10:38 mauke abraxxa: what
10:38 abraxxa it seems because of option #3 in the linked article
10:38 mauke using '?' wouldn't make it use placeholders
10:39 abraxxa i have a hard time trying to find out what Perl 5s DBD::Oracle does
10:39 mauke according to your link it would simply insert "?"
10:40 dalek rakudo/nom: b450e9b | (Elizabeth Mattijsen)++ | src/core/IO/Path.pm:
10:40 dalek rakudo/nom: s/new-fap/new-from-absolute-path/  moritz++
10:40 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b450e9bb7d
10:40 dalek rakudo/nom: 42c9a55 | (Elizabeth Mattijsen)++ | src/core/ (9 files):
10:40 dalek rakudo/nom: s/new-fp/new-from-pairs/   moritz++
10:40 dalek rakudo/nom:
10:40 dalek rakudo/nom: Since this is a purely internal method, no deprecation cycle appears to be
10:40 dalek rakudo/nom: needed.
10:40 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/42c9a55b84
10:40 abraxxa mauke: you mean i might get this error because I haven't bound a value to the placeholder and still execute it?
10:41 kjs_ joined #perl6
10:41 mauke well, I don't know what syntax oracle uses for its placeholders
10:41 mauke maybe it needs :param instead of ?
10:43 mauke ooh, DBD::Oracle turns ? into $1
10:44 abraxxa mauke: in which file and line number?
10:45 mauke still looking
10:45 mauke but the documentation says so :-)
10:51 mauke documentation is lying
10:52 abraxxa Oracle has multiple ways to bind: OCIBindByPos()   OCIBindByName()   OCIBindObject()   OCIBindDynamic()   OCIBindArrayOfStruct()
10:52 abraxxa mauke: hihi
10:52 mauke it rewrites ? into :p1, :p2, etc
10:52 mauke and :1 into :p1
10:53 ezra1 joined #perl6
10:53 mauke abraxxa: dbd_preparse in dbdimp.c
10:53 abraxxa wonderful SQL standard...
10:53 abraxxa mauke: thanks, looking
10:55 abraxxa as the input from a user to DBIish is always the same regardless of DBD used the grammer for parsing it should be shareable
10:56 abraxxa it might even make sense to put it in a separate dist
10:56 ecocode joined #perl6
10:57 abraxxa i think I just found a read after end of string issue in dbdimp.c line 1463: if ((*src == '-' && *(src+1) == '-') || (*src == '/' && *(src+1) == '*'))
10:57 abraxxa it doesn't check if src+1 is still contained in src
10:58 ecocode left #perl6
11:00 kurahaupo abraxxa: is the string null terminated at that point?
11:00 abraxxa kurahaupo: good question, I don't know
11:07 rindolf joined #perl6
11:07 Ven joined #perl6
11:16 timotimo Mouq: return my $foobar if $foobar = 1 + 4
11:18 abraxxa what is the Perl6 equivalent of make test?
11:19 timotimo abraxxa: if you generate a makefile with ufo, you can straight up use "make test"
11:19 abraxxa what ufo?
11:20 abraxxa i abuse panda install . at the moment for it
11:20 timotimo github.com/masak/ufo
11:20 anaeem1 joined #perl6
11:20 timotimo (which may currently be in a non-working state due to changes to rakudo and module installation stuff )
11:30 dalek rakudo/nom: 6556770 | (Elizabeth Mattijsen)++ | src/core/ (5 files):
11:30 dalek rakudo/nom: Use IO::Path.new-fap where possible
11:30 dalek rakudo/nom:
11:30 dalek rakudo/nom: This should give about a 4% gain in startup time and module load times.
11:30 dalek rakudo/nom: Spectest seems to go from 176 -> 169 seconds, which sort of confirms this also.
11:30 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6556770f70
11:31 timotimo ah, that looks like a good idea
11:36 dalek rakudo/nom: 5f2cea3 | (Elizabeth Mattijsen)++ | docs/ChangeLog:
11:36 dalek rakudo/nom: Some ChangeLog updates
11:36 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5f2cea3058
11:37 timotimo getting easy access to an OpenGL-accelerated cairo drawing thingie on gtk is going to be available in march next year ...
11:39 lizmat cycling&
11:40 abraxxa lizmat: have fun!
11:41 breinbaas bon courage (strong wind & rain)
11:41 abraxxa where can i read about grammars? http://doc.perl6.org/type/Grammar is a bit sparce and learnxinyminutes doesn't cover grammars
11:42 ghostlines joined #perl6
11:46 abraxxa http://perl6advent.wordpress.com/2009/12/21/day-21-grammars-and-actions/ is quite good as starting point
11:46 Ven joined #perl6
11:50 timotimo everything that applies to regexes also applies to grammars
11:50 timotimo so that's a "starting point" on its own
11:51 timotimo http://doc.perl6.org/language/grammars - have you looked at this?
11:51 timotimo it's quite short, sadly
11:53 abraxxa no, haven't thanks
11:54 abraxxa this alone is such a powerful Perl 6 feature
11:54 timotimo aye
11:54 abraxxa i want to parse my syslog messages with it
11:54 timotimo http://doc.perl6.org/language/regexes - this one is much less small
11:54 timotimo why not use an approach like journald that already allows you to build structured log messages?
11:54 timotimo that's much, much saner than parsing log messages
11:55 abraxxa is a token TOP required?
11:55 timotimo if you supply a :rule to the Grammar.parse, then no
11:55 abraxxa timotimo: tell that Cisco ;)
11:55 timotimo :rule("NOT_TOP") would allow parsing to start at a token NOT_TOP
11:55 timotimo otherwise, TOP is the default starting point
11:55 timotimo for parse and subparse and parsefile
11:55 abraxxa i see, thanks
11:57 abraxxa it's confusing to list the object on which the method is called as the first param: http://doc.perl6.org/language/grammars#method_parse
11:57 timotimo you mean the invocant?
11:57 abraxxa as p6 has native classes and the method keyword it's an implementation detail that the object a method is called on is passes as the first param
11:58 timotimo that's right, it's kind of surprising when you're not used to it
11:58 timotimo hm, is that actually how we do it internally?
11:58 abraxxa and as you don't unpack @_ like in p5 I guess the user doesn't care as there is a special variable to access $self
11:58 Mouq abraxxa: It's not the first param
11:58 timotimo if you have a *@_, it won't have self in the first slot
11:58 timotimo that much i know
11:59 timotimo i don't know exactly how we handle all of that internally
11:59 abraxxa so the docs are wrong
11:59 Mouq abraxxa: It looks like it, but the signature is actually (Grammar:D \self : $str ...)
11:59 timotimo the docs are not wrong
11:59 timotimo just surprising to a non-experienced perl6 person
11:59 Mouq The term before the ":" describes the invocant
11:59 timotimo yes, that's the key point
11:59 abraxxa what does Grammar:D: mean?
11:59 timotimo the : doesn't seem helpful at all
12:00 timotimo especially if you don't know what :D is
12:00 timotimo the :D and : just kind of bunch up together into a single "what the fuck is this" thing if you don't know it yet
12:00 Mouq abraxxa: A defined Grammar object, e.g., something derived from Grammar that's been called .new on
12:00 abraxxa the code in DBDish::Pg does PgTokenizer.parse($statement), so $str is the first param
12:01 abraxxa seeing something before it in the docs is confusing
12:01 timotimo i agree
12:01 timotimo it's confusing and it should be changed, but it's not "wrong"
12:01 abraxxa Mouq: what sense does it make to call GrammarA.parse($grammarbobj, ... )?
12:01 timotimo that's not how you do that
12:01 timotimo you would GrammarA.parse($grammarobj: $string, ...)
12:02 timotimo (there's the : again)
12:02 abraxxa what would that do?
12:02 timotimo it marks the $grammarobj as "the thing to be passed as the invocant"
12:03 abraxxa the description of the parse method doesn't mention Grammar:D: at all
12:03 Mouq timotimo: Pretty sure that's NYI
12:03 abraxxa why not write that as $grammarobj.parse($string, ...)?
12:03 Mouq std: Str.test("foo": "bar")
12:03 timotimo it may have to be GrammarA.^find_method("parse")(...)
12:03 camelia std 14ad63b: OUTPUT«(timeout)»
12:04 timotimo true, we parsefail that apparently
12:04 Mouq timotimo: If it's even correct %)
12:05 Mouq abraxxa: You don't explicitly pass the invocant, like that, in general
12:05 abraxxa looks like somebody tried to restore Perl's "you can't read it" cliche very hard when designing Perl 6...
12:05 Mouq abraxxa: The purpose of including the invocant in the signature is to put type constraints on it
12:05 timotimo if invocants in signatures is the only thing that makes you say that, we're at a pretty good spot with perl6 in general :)
12:05 abraxxa how is "foo" an object?
12:05 Mouq m: Grammar.parse("foo")
12:05 Mouq abraxxa: It's an object of type Str
12:05 timotimo it's a string, strings are objects
12:05 camelia rakudo-moar 09a84c: OUTPUT«(timeout)»
12:06 abraxxa so is "bar"
12:06 abraxxa why would I want to pass in a type when i pass in the object of that type anyway?
12:06 abraxxa what's the use case?
12:06 chenryn joined #perl6
12:06 Mouq And if you wanted to specify that you wanted to operate on only defined Strs and not `Str`, you'd write Str:D $param
12:07 timotimo if you have a method as an object
12:07 timotimo for higher-order-programming for example
12:07 timotimo and you can put more specific constraints onto your invocant in a signature, do some unpacking, give it a different name
12:08 abraxxa i could do that by subclassing and overriding parse or adding another method which gets called instead of parse and calls parse internally
12:09 timotimo that's not a sensible argument to make, IMO
12:09 timotimo you could also say "what do i need multiple dispatch for? i can do that with a single method that inspects the passed argument on its own and just has a list of candidates to match on"
12:10 Mouq abraxxa: Wait, you mean, why would you want to pass in a type to .parse?
12:10 abraxxa so Grammar:D: is no param hence why no comma between it and $str but something optional to be specified when passing in  $str
12:10 abraxxa Mouq: yes
12:11 abraxxa timotimo: yes, but with the difference that multiple dispatch is something that might be useful way more often to validate as a core feature
12:11 timotimo FWIW, i'd actually use a grammar's type object for the .parse .subparse and .parsefile methods
12:11 Mouq Yeah, the doc's *are* wrong there
12:11 abraxxa p5 guys would oppose and thell you to write a module for it ;)
12:11 abraxxa are the docs autogenerated?
12:11 Mouq src/core/Grammar.pm: method parse($target, ...)
12:11 Mouq abraxxa: Nope
12:11 timotimo parts of it, yes, not nearly all of it
12:12 abraxxa timotimo: the signatures?
12:12 timotimo the docs
12:12 Mouq Well, a lot of it is autogenerated from other parts of the doc, but nothing comes from outside, unfortunately
12:12 timotimo oh, you mean that part
12:12 abraxxa yes
12:12 timotimo i'm going to change these signatures in the grammars.pod now
12:13 * abraxxa waits what it looks like afterwards
12:13 abraxxa 'Grammar' means the Class, but what does the :D: mean?
12:13 timotimo :D means defined
12:14 timotimo : after that means "the left side of this is the invocant"
12:14 abraxxa that's usually a smily
12:14 Mouq abraxxa: https://github.com/rakudo/rakudo/blob/nom/src/core/Grammar.pm#L2
12:14 abraxxa will be fun when people have emoticons turned on in their irc clients
12:14 Mouq abraxxa: :)
12:14 dalek doc: a3852b7 | (Timo Paulssen)++ | lib/Language/grammars.pod:
12:14 dalek doc: remove wrong invocant parameter to Grammar's parse methods
12:14 dalek doc:
12:14 dalek doc: they are not only confusing to beginners, but also wrong
12:14 dalek doc: (as in: i use parse with a Grammar type object all the time)
12:14 dalek doc: review: https://github.com/perl6/doc/commit/a3852b7407
12:14 timotimo ^- looks good?
12:15 timotimo abraxxa: that's the Type Smiley
12:15 timotimo "A Type Smiley"
12:15 timotimo there's also :T and :U iirc
12:16 abraxxa timotimo: but now you don't what that a type can be passed too as well?
12:16 timotimo yeah
12:16 timotimo m: Grammar Foo { }; Foo.parse("hi")
12:16 camelia rakudo-moar 09a84c: OUTPUT«(timeout)»
12:18 abraxxa so can you pass a type or not?
12:18 timotimo yes, you can
12:18 timotimo the signature in that document was wrong
12:18 abraxxa because from the code Mouq linked to I can't see that
12:18 timotimo https://github.com/rakudo/rakudo/blob/nom/src/core/Grammar.pm
12:19 abraxxa yes, but there is just $target
12:19 timotimo yeah
12:19 abraxxa can you pass a type to every parameter in Perl 6?
12:19 Mouq abraxxa: Yeah, the invocant isn't specified in that -- there's no need to if you're not changing what you call it or making sure you type check
12:20 timotimo if a method doesn't rely on self being defined, it's no problem
12:20 Mouq abraxxa: Yeah
12:20 Mouq abraxxa: If camelia wasn't timing out, it'd be easy to show
12:20 abraxxa like when you specify the signature of a method with method foo ( Str $string ) ?
12:21 timotimo that is correct, in that case you could supply Str itself as $string
12:21 abraxxa ok
12:25 abraxxa what does the . mean here https://github.com/abraxxa/DBIish/blob/master/lib/DBDish/Pg.pm6#L153?
12:25 abraxxa is it just a regular 'any-single-character' regex?
12:26 timotimo no, it's a "don't capture this" marker
12:26 timotimo "call double_quote_normal, but don't make a named capture"
12:27 anaeem1_ joined #perl6
12:27 abraxxa and the ( | | | ) are a list of possible tokens?
12:28 abraxxa i just wonder why a | is in front of the first one and not just inbetween the possible tokens like a regular or
12:28 timotimo because it looks nicer
12:28 timotimo | is not like perl5's |
12:28 timotimo perl5's | is now called ||
12:28 timotimo | gives you "longest token matching" semantics
12:31 Hor|zon joined #perl6
12:32 Mouq m: say "aaaaa" ~~ /aa|aaaa/
12:32 camelia rakudo-moar 09a84c: OUTPUT«「aaaa」␤␤»
12:32 Mouq m: say "aaaaa" ~~ /aa||aaaa/
12:32 camelia rakudo-moar 09a84c: OUTPUT«「aa」␤␤»
12:34 raiph joined #perl6
12:38 abraxxa yay ORA-01008: not all variables bound
12:38 abraxxa i wonder why a grammar is used to detect and replace placeholders but not for quoting
12:39 abraxxa the gammar should be moved to DBDish and each DBDish module should define a action class
12:42 Mouq That grammar looks questionable.. if you type 'a literal '' here' it'll produce "a literal '' here" instead of "a literal ' here" as far as I can tell
12:43 Mouq Oh, wait
12:43 Mouq It doesn't even matter, cause everything is just joined back together?
12:43 kjs_ left #perl6
12:43 Mouq Just evidence I rarely actually know what's going on :9
12:43 kjs_ joined #perl6
12:46 kaare_ joined #perl6
12:48 anaeem1_ joined #perl6
13:07 vendethiel in DBIsh, if you commit while in auto-commit, it warns. Seems okay. But I think rolling back should die.
13:28 abraxxa how do I know if a Str is defined or not in p6?
13:29 abraxxa i could use chars as Oracle doesn't differentiate between an empty string and null
13:34 Mouq m: say Str.defined
13:34 Mouq m: say "foo".defined
13:35 camelia rakudo-moar 09a84c: OUTPUT«(timeout)»
13:35 camelia rakudo-moar 09a84c: OUTPUT«(timeout)»
13:35 Mouq True
13:35 Mouq False
13:35 Mouq Eff
13:35 Mouq *err
13:35 Mouq say "foo".defined # True
13:35 Mouq say Str.defined # False
13:36 abraxxa the error message 'Unsupported use of ?: for the conditional operator; in Perl 6 please use ??!!' could use some polishing
13:36 abraxxa to show that the construct ? $something : is meant
13:37 abraxxa i was looking for literal ?: in my code and couldn't find it
13:43 grondilu maybe 'ternary conditional operator' instead of just 'conditional operator'
13:43 mauke Unsupported use of X ? Y : Z ... please use X ?? Y !! Z
13:45 TimToady didn't it give a good line number?
13:46 TimToady unfortunately there's no good way to spell that operator that won't be misleading to someone
13:48 TimToady it's mostly "ternary operator" in the literature, but I actually kind of hate that usage, since it's not the only possible ternary operator
13:48 TimToady maybe ? : and ?? !! would be clearer than leaving the space out
13:49 TimToady or even '? and :' vs '?? and !!'
13:52 abraxxa mauke: yes, something like that
13:52 abraxxa TimToady: the call has 10 parameters and in one of them i used it. the error message reported the line number where the call starts
13:53 TimToady maybe we could do better on operator locations
13:53 abraxxa TimToady: i'm not a native English speaker and 'ternary' does mean nothing to me
13:53 bonsaikitten abraxxa: it's a pretty well-defined term in mathematics and programming
13:54 TimToady which doesn't preclude it from being a form of cultural imperialism :)
13:55 bonsaikitten if I'm not completely confused it's them frenchies at work again ;)
13:55 bonsaikitten should be a latin root
13:55 chenryn joined #perl6
13:56 TimToady certainly the parser knows which line the operator is on, so ought ot be able to report it
14:01 mst TimToady: call one of them a noddy operator? according to wikipedia, it's a type of Tern
14:02 mst of course, given wikipedia, I could've been gulled ... but it only claims gulls to be closely related rather an an isa relationship
14:05 TimToady if it's so difficult to fish for, perhaps we should call it the trout operator
14:09 dalek rakudo/nom: 02f1e55 | TimToady++ | src/Perl6/Grammar.nqp:
14:09 dalek rakudo/nom: improve LTA message on ?: for abraxxa++
14:09 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/02f1e556ba
14:10 abraxxa TimToady++ #thanks!
14:10 guru joined #perl6
14:11 TimToady as for the line number, that does seem to be correct already
14:13 BenGoldberg joined #perl6
14:13 abraxxa as i say the call goes over multiple lines
14:14 TimToady but it does seem to point to the line containing the ?
14:14 TimToady at least for my test
14:14 abraxxa no the method call
14:15 abraxxa sorry, my bad, yes it does
14:15 abraxxa i need to pass a pointer to a value to OCI
14:15 abraxxa the value can be an int or a string
14:15 * TimToady is not blaming abraxxa for the clunky interface :)
14:16 abraxxa I've defined the param as CArray[int] and now need to convert the Perl 6 value to a bytestring
14:16 abraxxa nah, i should have scrolled back to the error before
14:16 abraxxa depending on the type I also need to set an additional parameter
14:16 abraxxa what's the best way of doing that?
14:17 abraxxa using ACCEPTS?
14:22 abraxxa have to leave now, bye
14:22 cognome joined #perl6
14:28 anaeem1_ joined #perl6
14:29 rindolf joined #perl6
14:32 Hor|zon joined #perl6
14:34 zakharyas joined #perl6
15:09 rindolf joined #perl6
15:13 rurban joined #perl6
15:13 gtodd joined #perl6
15:18 vendethiel joined #perl6
15:19 Ven joined #perl6
15:22 flaviusb joined #perl6
15:27 vendethiel joined #perl6
15:29 Ven joined #perl6
15:32 Sandy joined #perl6
15:33 Sandy left #perl6
15:34 [Sno] joined #perl6
15:39 vendethiel joined #perl6
15:41 chenryn joined #perl6
15:41 Ven joined #perl6
15:45 mattp_ joined #perl6
15:50 guru joined #perl6
15:51 dalek Perlito: a4f5c34 | (Flavio S. Glock)++ | / (3 files):
15:51 dalek Perlito: Perlito5 - js - add "wantarray" context to regex emitter
15:51 dalek Perlito: review: https://github.com/fglock/Perlito/commit/a4f5c34c00
15:58 dalek Perlito: 72be83f | (Flavio S. Glock)++ | / (2 files):
15:58 dalek Perlito: Perlito5 - command line - patch for -I, contributed by shlomif++ - https://github.com/fglock/Perlito/issues/21
15:58 dalek Perlito: review: https://github.com/fglock/Perlito/commit/72be83f2a0
15:58 dalek specs: 9282235 | TimToady++ | S06-routines.pod:
15:58 dalek specs: start revising the highly maligned macro specs :-)
15:58 dalek specs: review: https://github.com/perl6/specs/commit/928223546f
15:59 rindolf fglock++
16:00 rmgk joined #perl6
16:07 Ven m:  say Tainted
16:08 camelia rakudo-moar 42c9a5: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/Q2XFcKVXhLâ�¤Undeclared name:â�¤    Tainted used at line 1â�¤â�¤Â»
16:08 lizmat m: say NYI
16:08 camelia rakudo-moar 42c9a5: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/OJQRAMXw2Câ�¤Undeclared name:â�¤    NYI used at line 1â�¤â�¤Â»
16:10 BenGoldberg m: X::NYI.new("Tainted").throw;
16:10 camelia rakudo-moar 42c9a5: OUTPUT«Default constructor for 'X::NYI' only takes named arguments␤  in method new at src/gen/m-CORE.setting:926␤  in block <unit> at /tmp/jAD4XHzitZ:1␤␤»
16:11 dalek Perlito: c68d5aa | (Flavio S. Glock)++ | html/perlito5.js:
16:11 dalek Perlito: Perlito5 - remove html/perlito5.js - as discussed at https://github.com/fglock/Perlito/issues/21
16:11 dalek Perlito: review: https://github.com/fglock/Perlito/commit/c68d5aad36
16:26 dalek rakudo/nom: 5730d74 | (Elizabeth Mattijsen)++ | src/core/ (3 files):
16:26 dalek rakudo/nom: Make some .pick()/.roll() situations ~15% faster
16:26 dalek rakudo/nom:
16:26 dalek rakudo/nom: By providing a MMD candidate without parameters
16:26 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5730d74bdb
16:26 dalek rakudo/nom: 2587462 | (Elizabeth Mattijsen)++ | src/core/Cool.pm:
16:26 dalek rakudo/nom: Make Cool.round also about 15% faster
16:26 dalek rakudo/nom:
16:26 dalek rakudo/nom: By providing a MMD candidate
16:26 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/2587462d14
16:26 dalek rakudo/nom: 987ce8e | (Elizabeth Mattijsen)++ | src/core/ (4 files):
16:26 dalek rakudo/nom: Remove unneccesary default initializations
16:26 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/987ce8e71d
16:28 dalek Perlito: bd8a88e | (Shlomi Fish)++ | src5/lib/Perlito5/Javascript2/.Emitter.pm.swp:
16:28 dalek Perlito: Remove a temporary vim file.
16:28 dalek Perlito: review: https://github.com/fglock/Perlito/commit/bd8a88e64f
16:28 dalek Perlito: ba4e482 | (Shlomi Fish)++ | .gitignore:
16:28 dalek Perlito: Add generated files to .gitignore.
16:28 dalek Perlito: review: https://github.com/fglock/Perlito/commit/ba4e4821c9
16:28 dalek Perlito/JavaScript_proper_case: b89e750 | (Shlomi Fish)++ | / (6 files):
16:29 dalek Perlito/JavaScript_proper_case: Correct the capitalisation of "JavaScript".
16:29 dalek Perlito/JavaScript_proper_case: review: https://github.com/fglock/Perlito/commit/b89e750421
16:30 vendethiel erm, at that point, should perlito still get logged in here?
16:32 lizmat Fwiw, I don't think Flavio cares either way
16:33 Hor|zon joined #perl6
16:38 raydiak good morning #perl6
16:41 b2gills m: pi.Rat.perl
16:42 lizmat m: say pi.Rat.perl
16:42 camelia rakudo-moar 42c9a5: OUTPUT«(timeout)»
16:42 camelia rakudo-moar 42c9a5: OUTPUT«(timeout)»
16:42 lizmat .oO( camelia is sleepy )
16:42 raydiak what's the story with camelia lately?  timeouts are all I've gotten for like 2 days
16:43 lizmat the new host08 seems to be underpowered for handling camelia and other (jvm) stuff
16:43 lizmat a new server is being set up, afaik
16:43 raydiak ah
16:43 b2gills pi.Rat.perl says 335/113 which is nowhere near 3.14
16:45 raydiak 3.14159292...isn't near?
16:45 raydiak oh, you got 335
16:45 raydiak locally it gave me a numerator of 355
16:46 geekosaur I wonder if that was a typo...
16:46 b2gills oops sorry
16:46 geekosaur (355/113 is one of the classic ratios approximating pi, ftr)
16:47 BenGoldberg m: say 'ok';
16:47 camelia rakudo-moar 42c9a5: OUTPUT«(timeout)»
16:47 BenGoldberg std: say 'ok';
16:47 camelia std 14ad63b: OUTPUT«(timeout)»
16:48 b2gills sometimes it is hard for me to tell which character is repeating, and many times it is repeating
16:48 BenGoldberg Is std done using perl5 or perl6?
16:48 moritz BenGoldberg: it's perl 6 compiled to perl 5
16:50 grondilu > say pi.FatRat.perl
16:50 BenGoldberg This isn't the best workaround, but maybe camelia should detect the cpu usage of the machine it's on, and set a longer timeout when the machine is loaded?
16:50 grondilu FatRat.new(355, 113)
16:50 * grondilu was expecting a different, more accurate approximation here
16:51 grondilu (though 355/113 is pretty good already)
16:54 TimToady .oO(LazyRats)
16:55 TimToady a real LazyRat would of course be attached to a pi spigot...
16:56 TimToady as opposed to a Garfield which would be attached to a pizza spigot
16:58 BenGoldberg A real LazyRat would be some sort of continued fraction.  Then you could have pi spigots, e spigots, etc
16:59 grondilu A LazyRat would actually be an accurate representation of a real number, for real numbers are defined as limits of sequences of rational numbers.
17:01 grondilu one issue being that such representation is not unique, making it a bit difficult to use in a computer language.
17:05 TimToady detailsese̅s̅
17:06 TimToady huh, gnome-term does the overlines right, but firefox screws 'em up here...
17:08 Mso150_c joined #perl6
17:08 mst I had a FatRat and a LazyRat once
17:08 Mouq TimToady: Might have something to do with the font
17:08 mst the LazyRat was insane, a dope fiend, and tried to eat the cat
17:10 Mso150_c_r joined #perl6
17:23 BenGoldberg The bigger issue with an infinitely long rat is not the lack of uniqueness, but that some operations can take an infinitely long time, depending on the representation.  I recall a continued fraction library, where getting the integer portion of sqrt(2)**2 would go into an infinite loop.
17:33 masak salutationes, #perl6
17:34 masak so, earlier this week I was toying around with `my @.things` inside classes and roles. felt pretty clever about the whole design.
17:34 masak until I wrote my second unit test.
17:35 vendethiel boom!1
17:35 masak the input data from my first unit test interfered with the input data from my second one. why? because all the `my @.foo` things were essentially globals.
17:35 masak we keep talking about how "unit tests promote/encourage/induce a testable architecture, making everybody win"
17:36 masak this was the most violent and somehow ironic case I have experienced.
17:36 masak it gave me a new dis-appreciation of the singleton pattern, as I now more clearly see the structure of its badness.
17:37 masak choosing Singleton means saying "I stake my architecture on the fact that there will ever only be one universe in which this particular data set can exist... contrary to the norm"
17:37 bloonix joined #perl6
17:37 grondilu joined #perl6
17:37 woolfy joined #perl6
17:38 sorear joined #perl6
17:38 nickpatch joined #perl6
17:38 hobbs joined #perl6
17:38 Mso150_c_r joined #perl6
17:38 dylanwh joined #perl6
17:38 zakharyas joined #perl6
17:38 mst masak: my view is 'the Singleton is a pattern invented by java developers to fake global variables'
17:38 xfix joined #perl6
17:38 mst masak: in a language which actual global variables, using one tends to be an  improvement
17:39 masak so I'm now migrating over to an architecture where I have an outermost `$db` object, and all the things that were effectively singletons are defined as attributes on `$db`.
17:39 mst right, precisely where I try and send people
17:39 masak mst: what bit me here was using class attributes (as opposed to instance attributes). so, essentially globals.
17:39 vendethiel masak: did you not *expect* them to be globals??
17:40 mst yes. I actively discourage the use of class attributes in M* perl5 code
17:40 mst specifically because it's basically a magic global variable, except really easy for people to forget
17:40 masak vendethiel: yes, sure. but I didn't mind until the second test bit me.
17:40 ggherdov joined #perl6
17:40 vendethiel I actually think php's global variables are a better solutions than singletons
17:40 masak vendethiel: I even started down the path of manually "resetting" all the data between the first and the second test. but then I went "this is stupid, I'm doing extra work because the architecture is wrong".
17:40 mst vendethiel: realising the consequences of their being globals seems to be much harder to do when it's a class attribute and doesn't "look" like a global
17:41 vendethiel maybe I've actually been bit by this bug in other languages and I know how terrible it is, so I just know NOT TO use them now :p
17:41 masak for me it was more of a case of "welcoming the consequences" :)
17:41 BenGoldberg Sounds a bit like Perl5's CGI.pm
17:42 vendethiel masak: I for one welcome our new my twigil overlords.
17:42 masak vendethiel: I honestly didn't see the problem, even though I know globals/singletons are bad. I share it here because I believe communities grow by sharing stories about failure :)
17:43 BenGoldberg It pretends to be OO, but there're heaps of hidden globals.
17:43 vendethiel masak: I'd probably have the same reaction if I didn't get the very same issue doing so much js
17:43 masak my JavaScript programming these days leans heavily on a style of "clusters of objects", all instances, no classes.
17:43 kurahaupo BenGoldberg: does anyone in their right mind use CGI.pm other than to instantiate a request object?
17:43 vendethiel masak: sure, but still - PROTOTYPES!1
17:43 mst nobody in their right mind has used CGI.pm for a decade at all
17:43 vendethiel I still use classes for performance reasons
17:44 mst masak: right, the interesting thing is that the term 'class attribute' seems to magically make it so people who'd normally find it obvious don't foresee the problems
17:44 vendethiel making it easy for your JS engine to see the classes is a nice perf imp. when you're js-bound
17:44 mst masak: I really can't work out why, but I've seen it repeatedly
17:44 masak mst: I'm struggling to work out why I fell for it, too.
17:45 masak mst: part of it is that it really felt like a good solution, until I tried to unit test it.
17:45 masak mst: that is, the concept of class variables triggers neither the "globals" neurons nor the "singleton" neurons.
17:45 masak it should, but it doesn't.
17:45 mst right
17:45 masak next time this happens, I'm sure it will :>
17:46 mst that's why I jumped in and gave the spiel
17:46 mst because I've seen sooo many people fall for it :)
17:46 masak mst: re your "nobody in their right mind" above -- you're fortunate to know a whole lot of people who keep in touch with the Perl community, and update their module usage... :)
17:47 masak I know some who do neither. I would consider them to be "in their right mind"... just very out of date.
17:47 masak I wonder how they would react to hearing SawyerX talk about killing CGI.pm.
17:47 mst masak: "running screaming from CGI.pm" was one of the major contributors to my joining the perl community in the first place.
17:49 dalek rakudo/nom: dcd32e5 | (Elizabeth Mattijsen)++ | src/core/Baggy.pm:
17:49 dalek rakudo/nom: Make Bag.pick/roll/grab ~2x as fast
17:49 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/dcd32e5583
17:49 masak another nice thing that fell out from getting a $db object to contain it all, is that this object can now soak up some of the "algebra" of my domain.
17:49 masak lizmat++
17:50 kurahaupo CGI.pm seemed an awful mash-up 17 years ago, mixing up html constructors, http requests, and http responses
17:50 ajr_ masak: " I believe communities grow by sharing stories about failure " You are absolutely right; that's why aviation has become so much safer in the last 50 years; examining and confronting failures.
17:52 masak ajr_: one day I will give a talk about all the kinds of opposition that are good and make us better. most games people play are zero-sum, because that creates the most interesting dynamics. bug reports are all about the disconnect between desires and reality. I would much rather hear the story about a failed project than a successful one. good designs arise in the forge of massive forces acting on them from all directions, and a balance being found.
17:52 yogan joined #perl6
17:53 kurahaupo "sharing failures" is probably the fastest way a community can make progress, by spending effort on new failures instead of old ones. :)
17:53 masak in some sense, avoiding some repetition of other communities' failures is impossible.
17:53 masak but it's worth trying.
17:54 masak I remember some of my early interaction with the Perl 5 people while developing Web.pm -- they quite clearly said "please don't make the mistakes we made -- make new, more interesting ones!"
17:55 masak actually, it's interesting to think about the Perl 5 and Perl 6 communities from this angle. both communities have kind of a "fingerprint", a set of preferred failures.
17:56 kurahaupo For me the archetypal "improvement by sharing failures" is "how did the indigeous Mãori people here discover that the lethally toxic Karaka berries could be edible if subjected to a 4-step process?"
17:59 kurahaupo It certainly puts the cost of software development into perspective
18:01 BenGoldberg Discovering that something poisonous can be made edible probably happens as follows: "I've got this poison, and I want to kill such-and-such type of animal with it.  But those animal *know* it's poison; how can I treat the stuff to disguise it." followed by "The animal ate it, but didn't die!  Why not?  Is the stuff somehow not poisonus anymore?"
18:01 vendethiel kurahaupo: hahahaha nice one!
18:01 _slade_ joined #perl6
18:02 masak kurahaupo: I read about the steps here: http://rsnz.natlib.govt.nz/volume/rsnz_04/rsnz_04_00_002360.pdf -- yeah, it's quite a discovery. but the steps do make a certain sense, at least after the fact. they're not just random.
18:02 masak kurahaupo: they're of the kind where you can go "ok, what do I need to do to de-poison these berries?"
18:02 masak ...or what BenGoldberg said. that's ingenious.
18:03 masak what's the software development equivalent of testing your maybe-poisonous berries on wild animals? having good unit tests, I guess.
18:06 kurahaupo masak: I have to admit, the option of animal testing in prehistoric times hadn't occurred to me
18:06 masak it probably occurred to the prehistoric people.
18:06 kurahaupo however the only native mammals here are bats
18:07 masak though the question is how similar the animals need to be for the results to apply to humans.
18:08 kurahaupo Another option is that *weaponized* berries sometimes failed
18:09 masak sounds more like end-to-end tests.
18:10 masak though maybe that is taking the analogy too far :)
18:11 * geekosaur would have thought *that* would be those coffee beans that need to go through the GI tract of a civet cat...
18:13 kurahaupo masak: berry testing on wild animals would be like having good unit tests with some randomized real-world inputs
18:13 kurahaupo geekosaur: rofl
18:13 breinbaas wikipedia says maori imported dogs
18:14 molaf joined #perl6
18:14 kurahaupo wikipedia would be wrong then, or at least, not clear on the timeline
18:15 breinbaas oh wait it says 1250. that's a bit lateish
18:16 kurahaupo They imported rats, but they're a bit tricky to catch *living* so you can feed them berries
18:17 kurahaupo and the rats are smart enough to share failures too: timmy ate those yummy looking berries and curled up his tail; I don't think I'll bother
18:17 Ben_Goldberg joined #perl6
18:18 anaeem1_ joined #perl6
18:19 kurahaupo what's the software equivalent of an uncooperative test subject?
18:20 masak geekosaur: on my latest visit to .cn I was "fortunate" enough to get to try a kind of tea the had been through the digestive tract of some insect or other.
18:20 masak geekosaur: it had the exactly-what-it-says-on-the-tin name "bug poop tea".
18:21 geekosaur kurahaupo: anything with a bug :)
18:22 jack_rabbit joined #perl6
18:24 kurahaupo more like, software that has extra inputs to detect the mood of the operator, so it can adapt its perversity to their frustration
18:26 * kurahaupo has actually encountered timing bugs that were triggered by the relaxed "I've fixed all the bugs" operator's typing patterns, and suppressed by the anxious operator's typing timing
18:27 kurahaupo that was a hellish weekend
18:28 cognome joined #perl6
18:28 ivanshmakov joined #perl6
18:30 cognominal joined #perl6
18:31 cognominal joined #perl6
18:33 * moritz spontaneously caramelized cashews today. Quite tasty!
18:34 Hor|zon joined #perl6
18:34 vendethiel I read "cashier"...
18:38 mst kurahaupo: that's ... wow
18:39 lizmat I wonder whether there is a faster way to create a clone of a list of Pairs than doing list.map: { (.key => .value) }
18:40 lizmat moritz: something with nqp::clone maybe ?
18:43 moritz lizmat: that's shallow, so it would have to  list.map: { nqp::clone($_) ]
18:47 * masak .oO( how dare you call my idea shallow! ) :P
18:48 kurahaupo masak: thanks for the link on the preparation of Karakine
18:48 masak np. I found it out of self-interest :)
18:49 kurahaupo mst: it got more consistent as fatigue set in
18:50 lizmat moritz++
18:52 vendethiel kurahaupo: I don't even understand what you said :p
18:52 amkrankruleuen joined #perl6
18:58 masak moritz: where can I learn more about caramelization of foods?
18:58 kurahaupo vendethiel: the timing bug got more obvious as the operator became fatigued
18:59 vendethiel ooh. that kind of operator hahahaha
19:01 mauke EXOI http://www.oocities.org/hanson_c/haha/assembler.txt
19:01 mauke hmm, wrong list. doesn't have BBW
19:02 mauke http://svr-www.eng.cam.ac.uk/~trn/OpCodes.html this one does
19:04 vendethiel ZEOW
19:05 timotimo hmm
19:05 timotimo fuzzing is a kind of test that feels like testing with an uncooperative test subject
19:06 timotimo though I may have test subject and tester switched
19:10 ezra1 joined #perl6
19:11 slavik joined #perl6
19:15 Exodist joined #perl6
19:17 Mouq https://gist.github.com/Mouq/c4be050479e563c71408
19:18 virtualsue joined #perl6
19:18 kurahaupo timotimo: when working in large corporates, I've sometimes planted deliberate "bugs" to see if the testers are awake
19:23 timotimo hah
19:27 ezra1 question about use of perl6 on the jvm
19:27 timotimo go ahead
19:27 ezra1 ive setup libgdx imported the proper jar and classes in p6
19:28 ezra1 how would i do something like public class MyGdxGame extends ApplicationAdapter
19:28 leont joined #perl6
19:28 * timotimo doesn't actually know >_<
19:29 ezra1 me either?
19:29 ezra1 tried "is" but thats not really the case
19:31 ezra1 guess ill bang my head on it for a few days
19:35 anaeem1_ joined #perl6
19:36 vendethiel Mouq: https://gist.github.com/Mouq/c4be050479e563c71408#file-a1-p6-L42 is that 0-safe?
19:37 timotimo m: say "".substr(* - 1)
19:37 timotimo Start argument to substr out of range. Is: -1, should be in 0..0
19:37 camelia rakudo-moar 42c9a5: OUTPUT«(timeout)»
19:38 vendethiel m: say "a".index("a")
19:38 timotimo hm, actually
19:38 camelia rakudo-moar 42c9a5: OUTPUT«(timeout)»
19:38 timotimo "foobar".index("") gives you
19:38 timotimo 0
19:38 timotimo so it would return out of the sub before it'd hit that substr call
19:38 timotimo i don't understand what this code is even supposed to do
19:39 timotimo the output (or is that input?) at the bottom doesn't tell me anything
19:39 ezra1 joined #perl6
19:54 Mso150_c_r joined #perl6
20:14 Mouq joined #perl6
20:15 _slade_ joined #perl6
20:16 Mouq timotimo: Err, yeah, I just kind of dropped that link and walked away. It stitches together text from fragments. The input that came with the problem produces: all is well that ends well
20:18 lizmat .oO( spending ~hour on an obscure setting bug is no fun )
20:19 lizmat I'm getting a Cannot invoke this object (REPR: Null, cs = 0) on simple code as $pair.value
20:19 Mouq lizmat++ that's the worst :(
20:19 Mouq (not that bug in particular)
20:20 * lizmat is glad the settings build in <1 minute
20:20 lizmat but it stays annoying nonetheless
20:21 raydiak thanks to everyone helping with all my questions the last few days, I'm starting to make real progress: https://gist.github.com/raydiak/6fb0016cf397bf1420f5
20:22 * woolfy goes over to lizmat and pat her on her back and hug her because she needs it (I think)...
20:23 carlin m: class Foo { has @.drinks; method drink { @.drink.push: 'water'; } }; Foo.new.drink; # that typo causing an infinite loop was annoying to track down
20:23 * lizmat feels better  :-)
20:23 camelia rakudo-moar 02f1e5: OUTPUT«(timeout)»
20:23 woolfy :-)
20:24 woolfy raydiak++
20:24 woolfy "everyone"++
20:25 raydiak everyone++ indeed.  have a round of ++s on my tab!  :)
20:28 Araq joined #perl6
20:29 lizmat it would seem the problem can be solved by *not* using private methods
20:30 lizmat .tell jnthn I think there is some codegen issue with private methods, contact me for an example
20:30 yoleaux lizmat: I'll pass your message to jnthn.
20:31 lizmat .tell jnthn I would not be surprised if this would be the source of a lot of flappines, specifically in async modules
20:31 yoleaux lizmat: I'll pass your message to jnthn.
20:31 masak raydiak: that looks interesting. what is it?
20:32 masak lizmat: reminds me of https://rt.perl.org/Ticket/Display.html?id=120919
20:32 masak maybe related? probably not...
20:33 avuserow joined #perl6
20:33 lizmat feels related to me
20:33 lizmat in one of my tests, I also got the typecheck error
20:33 vendethiel- joined #perl6
20:33 raydiak masak: I'm sure you educated folk have names for it, but it parses math equations and expressions, turns them in to trees, and am now working on the part where it can manipulate or solve them
20:34 lizmat well, an error in the error reporting of a typecheck error:
20:34 lizmat No such method 'item' for invocant of type '$?CLASS'
20:34 moritz raydiak: a computer algebra system?
20:34 raydiak moritz: sounds apt :)
20:35 Hor|zon joined #perl6
20:35 moritz looking forward to seeing it
20:35 masak ooh, reminds me of my old https://en.wikipedia.org/wiki/TI-92_series
20:35 masak I used to love the CAS in that one
20:35 masak it was definitely smarter than I was :)
20:35 moritz raydiak: I've long wanted to implement one, but always shyed away from the complexity
20:36 raydiak masak: nice...I had an 82, 83, 86, and 89 at various points in my life...wrote a raytracer on the 89 lol
20:36 raydiak moritz: yeah it's been nagging at me a long time too
20:37 moritz raydiak: remind me some day to send you a patch for derivation
20:37 raydiak moritz: this is what my weird regex interpolation question yesterday was about
20:37 moritz I'm sure that's *much* easier than integration :-)
20:37 raydiak moritz: thanks!  will do
20:38 Araq left #perl6
20:39 masak moritz: it... is, yes.
20:39 masak still some interesting special cases even in derivation.
20:39 masak in other news, it's been a long journey, but I'm finally warming up to using the Unicode set operators in my own code.
20:40 masak I just wrote the line `$!games ∪= $game;`
20:40 masak 's nice
20:40 raydiak sweet...
20:44 Mouq raydiak: I did see that one gist -- have you seen how Rakudo's grammar does new terms? Something like `role Circumfix[$left, $right] {...}; self does Circumfix["<", ">"]`
20:45 raydiak Mouq: no, that looks like something I should learn more about...this is my first serious usage of grammars, so I've been taking it all in in peices at a time
20:47 raydiak the grammar is generated from an array of syntax components, so I'm probably procedurally hacking around my own ignorance in places :)
20:49 Mouq raydiak: Haha, well you're obviously doing a pretty good job. But here's the start of what I was talking about https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Grammar.nqp#L4178
20:50 avuserow joined #perl6
20:50 raydiak oh yes looks like I definitely need to learn more about that... Mouq++
20:53 masak ho boy, did the design ever come out better after I stopped doing that class attribute silliness!
20:54 masak on the way, I was mildly surprised that I can't just do $set>>.method
20:54 masak ...but I was also delighted that I can have a set in an attribute $.things, and then just loop over @.things (rather than $.things.list)
20:55 Mouq raydiak: Best of luck! :)
21:02 raydiak Mouq: thanks! I appreciate the encouragement...positive community is one of the most important aspects of perl 6 for me
21:02 timotimo
21:04 raydiak timotimo: how goes the game?
21:04 timotimo annoying
21:05 timotimo i'm going to have to restructure it a lot in order to get any better performance
21:05 timotimo getting a gl-backed piece of cairo rendering is surprisingly difficult unless you're willing to ignore portability
21:06 raydiak hm
21:06 raydiak I've never used cairo
21:06 pochi joined #perl6
21:07 timotimo cairo is pretty nice
21:07 timotimo the GtkDrawingArea widget gives you a callback that it calls with a properly initialized cairo context
21:07 timotimo but it only does software rendering
21:08 timotimo it'll never give you opengl-backed cairo :(
21:08 _sri joined #perl6
21:08 raydiak that does sound like a pain...
21:09 timotimo yes
21:09 timotimo i'm going to switch over to sdl2 instead
21:09 raydiak I was just asking myself what I would do, and that's what I came up with too :)
21:10 timotimo yeah
21:10 timotimo i'm probably going to just pre-render all my littl eenemy sprites for all directions into a sprite set and then use sdl2 to compose the scene for me
21:13 yogan joined #perl6
21:14 raydiak too bad...that's really easier than getting a cairo gl context yourself w/o the gtk callback?
21:14 kjs_ joined #perl6
21:15 timotimo well, if you want to do that, you'll need GLUT/GLFW/SDL/XGL/WGL/CGL/EGL/...
21:15 erkan joined #perl6
21:15 erkan joined #perl6
21:16 raydiak oh right, I see
21:16 araujo joined #perl6
21:16 timotimo and even if you use sdl2, it can "MakeCurrent" for you, but in order to create a pixmap for cairo to render onto, you'll need a proper call from the right API still - though i'm expecting i can get SDL to do that for me, too
21:16 timotimo only very little example code can be found on-line
21:17 timotimo https://github.com/cubicool/cairo-gl-sdl2/blob/master/src/sdl-example.cpp#L51 - this should really be replacable with something else
21:20 raydiak sounds like you've been concentrating too much on the fiddly stuff
21:21 timotimo only for a day ;(
21:22 raydiak I spent a day golfing one bug recently :)
21:23 timotimo did you play my game yet? :)
21:23 timotimo if you have a beefy machine, the software rendering isn't that terrible actually
21:23 raydiak no, but I should give it a shot...haven't played anything besides Skyrim recently
21:25 raydiak heh, I don't think it's going to work very well in this ssh session I just used to clone your game
21:27 kurahaupo joined #perl6
21:27 timotimo my game doesn't quite compare to skyrim
21:27 timotimo in terms of graphics fidelity or gameplay ...
21:28 raydiak oh of course not...I guess I meant "a non-serious diversion might be fun"
21:29 raydiak once I figure out which of these mint packages I have to install to get gtk3...
21:29 timotimo oh, is this on a mac?
21:29 timotimo oh, *mint*
21:29 timotimo yeah, that's fine
21:31 raydiak hrm, why do I not see libgtk3...
21:31 raydiak oh I see why
21:31 timotimo 32bit vs 64bit?
21:32 raydiak there is something weird about the way this system searches for shared libs, sometimes I have to go manually make aliases in lib dirs to make stuff work
21:35 timotimo huh.
21:37 timotimo http://cgit.freedesktop.org/cairo/tree/src/cairo-gl.h - it seems like i don't have to handle glx and stuff
21:38 timotimo oh, damn
21:38 timotimo i *do* have to create a cairo_device_t
21:39 raydiak okay, got gtk::simple working...now to see if cairo cooperates more easily
21:39 timotimo cool :)
21:40 pochi joined #perl6
21:41 raydiak sweet, it runs :)
21:41 raydiak it reminds me of quickbasic games I used to make with my friend as a kid :)
21:42 timotimo i did something similar when i was smaller :)
21:43 raydiak unfortunately, even though I just bought this laptop a few months ago, it's a 3-yr-old budget machine
21:43 timotimo and it runs on software rendering, too ;(
21:44 raydiak are you drawing each star seperately?
21:45 raydiak I mean, I don't see a whole lot on the screen, it's hard to believe rendering is the bottleneck, even if it is software
21:46 raydiak oh right, cairo is a vector lib
21:47 timotimo that's right
21:47 timotimo the stars are pre-rendered onto a surface
21:48 timotimo oh hold on
21:48 timotimo it may be that your current version has a broken star field
21:48 timotimo does it do parallax scrolling?
21:49 raydiak yes, looks like 3 layers?
21:49 timotimo try a git pull
21:49 timotimo ah, ok
21:49 timotimo the new version may be a bit more performant; the star background seems to be a noticable chunk of render time, sadly
21:49 * raydiak goes to comment it out and try to play again :)
21:51 timotimo and try a git pull, too
21:55 raydiak yeah commenting out the stars helps
21:55 timotimo damn
21:55 timotimo i was proud of how smartly i front-loaded the calculation to make the stars
21:55 raydiak collision detection needs a sweep algorithm so it doesn't fail when my shot jumps from in front to behind an enemy in 1 frame
21:55 timotimo since i created a "memoize path" thingie, i may just render "just the stars" every frame
21:56 timotimo yes, indee
21:56 timotimo the game doesn't like having too long frames
21:58 timotimo another thing i could do for the sdl2 stuff is just render the vector graphics "in software" onto a gl texture and i won't have to do anything with glx api and crap like that
21:58 raydiak I like how it feels though...the way the enemies turn when hit and bounce off the sides and such is neat...and the star-zooming-out death screen is sharp
21:59 timotimo thanks :)
22:32 avuserow joined #perl6
22:36 Hor|zon joined #perl6
23:00 vendethiel joined #perl6
23:23 dalek ecosystem: 58158f3 | ugexe++ | META.list:
23:23 dalek ecosystem: Add P6TCI module
23:23 dalek ecosystem:
23:23 dalek ecosystem: P6TCI is an empty module with a .travis.yml that can be used as an example for testing perl 6 modules on travis-ci.org. The module will likely turn into a .travis.yml generator once configuration options are figured out.
23:23 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/58158f3c6d
23:24 tadzik nice :)
23:26 timotimo that sounds cute
23:26 timotimo tadzik: do you think the c part of steroids is still needed?
23:27 timotimo except maybe for performance?
23:28 amkrankruleuen joined #perl6
23:28 tadzik timotimo: I wrote it for the laziness
23:29 tadzik also to avoid some complicated nativecall stuff that works sometimes
23:29 tadzik it may work more consistently nowadays :)
23:29 tadzik but the primary reason was my partial distrust towards nativecall
23:29 tadzik I didn't want to stress it too much
23:30 timotimo OK
23:31 tadzik as for performance things, we could gain a lot by avoiding copying
23:31 tadzik potentially avoid (almost) all GC runs
23:31 tadzik I experimented with binding a bit, in examples where in theory no garbage collection should occur, but it still did
23:33 timotimo with the profiler you can see where what types of things get allocated
23:34 timotimo my game usually has very quick GC runs which end up promoting 0kb and keeping 0kb around
23:34 timotimo that's pretty neat.
23:35 timotimo your use of lists of names for things ... i prefer enums to be honest :)
23:37 tadzik hm?
23:38 tadzik what kind of names?
23:39 timotimo @button_names
23:39 timotimo doesn't matter
23:40 timotimo i may end up building more sdl binding stuff myself
23:43 ezra1 joined #perl6
23:52 vendethiel joined #perl6
23:55 avuserow joined #perl6

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

Perl 6 | Reference Documentation | Rakudo