»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:00 labster joined 00:02 RabidGravy left 00:05 pdcawley_ joined 00:07 pdcawley left 00:08 woodruffw left, woodruffw joined, woodruffw left 00:09 tmch left, woodruffw joined, tmch joined 00:11 perlawhirl left 00:14 ggoebel16 left, woodruffw left
dalek kudo/nom: b243a96 | timotimo++ | src/Perl6/Metamodel/ (2 files):
"setdebugtypename" lives in metamodel Naming now instead of ClassHOW
00:26 SCHAAP137 left 00:27 BenGoldberg joined
rudi_s sortiz: Sorry for the late reply. Awesome, thank you. our works just fine. 00:30
Btw. is there a way to ignore the "is export" from a module. Like perl5's use Foo::Bar (); ?
00:30 musca` is now known as musca 00:34 rindolf left, pdcawley joined
sortiz rudi_s, That is the difference between 'use' and 'need': 'use' imply 'need' *and* 'import' 00:35
rudi_s sortiz: Just to be sure. need Foo::Bar in perl6 works like use Foo::Bar () in perl5? 00:36
sortiz rudi_s, Exactly. 00:37
00:37 pdcawley_ left
rudi_s sortiz: Perfect, thank you. - I didn't realize this when reading the docs and was confused that such an important could be missing, but now it's pretty clear (and I've no idea how I could miss that). 00:39
sortiz rudi_s, yw
00:41 spider-mario left 00:45 cbk joined, ggoebel16 joined 00:48 dfcarpenterak left 00:53 skids joined 00:59 dfcarpenterak joined 01:06 labster left, yeahnoob joined 01:07 dfcarpenterak left 01:09 labster joined
timotimo i think it'd probably be easier to write the "dump all QAST nodes to json" as a single method on QAST::Node that knows all about the individual nodes we have and such 01:18
rather than splitting it out into multiple methods like the rest of the code already does, with its "dump extra info" and such
individual nodes, but especially individual roles
which is, i assume, where the majority of the complexity comes from
01:29 yeahnoob left 01:31 yeahnoob joined, ZhangGong|2 joined, yeahnoob left 01:42 justine joined 01:52 kid51 left 01:53 Actualeyes joined 01:59 snarkyboojum joined 02:05 snarkyboojum left 02:07 kalkin-_ joined 02:11 kalkin- left 02:24 vendethiel joined 02:31 arcetera left 02:32 arc__ joined 02:33 arc__ is now known as arcetera
zostay m: my $c = -1; (4 * [+] (1, 3 ... *)[0 .. 100_000].map({ ($c = -$c) / $_ })).say; # happy approximately pi day 02:33
camelia rakudo-moar b243a9: OUTPUT«3.14160265348972␤»
02:33 arcetera left, arcetera joined 02:34 arcetera left 02:35 arc__ joined, arc__ is now known as arcetera, arcetera left, arcetera joined 02:45 ilbot3 left 02:47 ilbot3 joined
MadcapJake` how can I do the FILE C type in nativecall? 02:47
02:49 vendethiel left
BenGoldberg class FILE is repr('CPointer') { }; 02:52
02:52 TimToady left 02:53 TimToady joined
BenGoldberg Note that in C, FILE is a struct, and you'd be using pointer-to-FILE all over the place, whereas 'class FILE ...' creates a class which behaves like a pointer... it's more like a c-level pointer-to-FILE. 02:54
02:57 BenGoldberg left 03:03 toddr joined
toddr Hi, so perl6 doesn't have . in INC right? 03:04
03:07 toddr left
skids not by default 03:09
Juerd I keep wishing that . or ./lib was in there
Or at least ~/.lib
(Or something like it)
skids Better than having things hijacked because you didn't notice a .pm file in ./ IMO. 03:11
03:14 toddr joined
Juerd I guess 03:15
But what would be the reason not to have any homedir based thing in there by default?
toddr I missed the answer when my IRC client crashed didn't I? 03:16
Juerd Yes. The answer was yes.
Or, actually: <skids> not by default
There's PERL6LIB=. or perl6 -I. or use lib '.'; 03:17
toddr So I'm putting a presentation together. I'm wondering if there's any documentation on why this decision was made
Juerd <skids> Better than having things hijacked because you didn't notice a .pm file in ./ IMO.
MadcapJake` is that how it works in Perl 5?
toddr don't get me wrong. I applaud it.
skids I could see a subdir of homedir. Probably just NYI given the state of package installers, different systems have different conventions e.g. ~/.local 03:18
geekosaur yes, perl5 doesn't include . in @INC
toddr ?
geekosaur or ~ or any subdir thereof, by default
toddr no . is at the end of @INC in perl5
Juerd MadcapJake`: No, . is in @INC in Perl 5.
geekosaur sighs, too tired... 03:19
skids It is on my system.
Juerd MadcapJake`: And metacpan.org/pod/local::lib is sort-of popular. I wish something somewhere in ~ was in Perl6's include paths by default 03:20
Speaking of this. What is that array called in Perl 6?
MadcapJake` I'm guessing it has to do with CUR 03:21
skids hrm. So that's why I couldn't find the precomps in ~/.local where I thought I put them with --prefix. Hardcoded to ~/.perl6 apparently or something. 03:23
MadcapJake` Seeing as technically modules are located in a separate precomped/mangled directory, it's more about maintaining true cross-platform unicode support
yeah precomps does not follow a make --prefix flag 03:24
skids is there a corresponding flag?
MadcapJake` skids, github.com/rakudo/rakudo/blob/nom/...ompilation 03:25
skids huh. But my hacked-up rakudobrew should be setting NQPs --prefix as well. 03:29
MadcapJake` --prefix wasn't properly passing to nqp until recently, i believe 03:30
skids nqp --show-config | grep prefix shows moar::prefix=/home/me/.local, but my precomps are still in ~/.perl6. 03:31
03:33 lostinfog left
MadcapJake` prefix only handles installs, precomp doesn't honor it 03:34
nqp dir only deals with prefix inside Configure.pl (iiuc) 03:35
03:35 geekosaur left
MadcapJake` I think the only way you can adjust precomp location is with RAKUDO_PREFIX 03:36
skids Then I don't get github.com/rakudo/rakudo/blob/nom/...try.pm#L69 03:37
03:37 geekosaur joined 03:38 cognominal left, noganex_ joined
MadcapJake` maybe RAKUDO_PREFIX is being set somewhere? I'm really an NQP noob but a glance at Configure.pl doesn't really show prefix going anywhere special (must be wrong though...) 03:39
03:39 cognominal joined
skids well, it's not in my shell's env. Too tired to figure this out now though. 03:40
timotimo github.com/rakudo/rakudo/blob/nom/...Config.nqp - could this be interesting?
MadcapJake` maybe it's this: github.com/perl6/nqp/blob/master/C...ure.pl#L93 03:41
03:41 noganex left
MadcapJake` yeah i think it's that and then it's stored here: github.com/perl6/nqp/blob/master/C...#L235-L239 03:43
(for MoarVM)
oi, makefiles are totally brick walls for me :P 03:44
03:44 toddr left
MadcapJake` honestly it looks like prefix is just used there to install to the right location, I'm not really understanding how nqp::backendconfig attains its data 03:45
skids It looks like the 'home' repo doesn't have a configurable to alter it. 03:50
03:52 cognominal left, buharin joined 03:53 cognominal joined 03:54 justine left 04:06 cpage_ left 04:07 cpage_ joined 04:28 wamba joined 04:29 skids left 05:09 buharin left 05:10 yqt left 05:12 khw left, buharin joined
saaki is there a nicer way to write the following? (2..22).grep({not $_ % 6}).say 05:31
basically want to skip values in a range 05:33
05:43 cpage_ left
Hotkeys m: say (2..22).grep(*!%%6) 05:43
camelia rakudo-moar b243a9: OUTPUT«(2 3 4 5 7 8 9 10 11 13 14 15 16 17 19 20 21 22)␤»
Hotkeys Like that saaki ?
m: say (2..22).grep(*!%6) 05:44
camelia rakudo-moar b243a9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/NXsrKJ38xo␤Cannot negate % because multiplicative operators are not iffy enough␤at /tmp/NXsrKJ38xo:1␤------> 3say (2..22).grep(*!7⏏5%6)␤ expecting any of:␤ infix␤ infix stoppe…»
Hotkeys Okay
So yeah the first one
I assume
05:45 cpage_ joined 05:46 Cabanossi left
saaki p6: (2..22).grep({not $_ % 6}).say 05:46
camelia rakudo-moar b243a9: OUTPUT«(6 12 18)␤»
05:47 tmch left
saaki Hotkeys: not the right sequence :| 05:48
05:50 Cabanossi joined
go|dfish p6: (2..22).grep(* %% 6).say 05:50
camelia rakudo-moar b243a9: OUTPUT«(6 12 18)␤»
saaki let's say i want values in increments of 1_000_000, just doesn't make sense to use grep on a sequential range. guess the range class doesn't have a provision for skipping 05:51
maybe a gather-for-take i guess 05:53
05:55 adeeb joined
adeeb Hello guys I am adeeb. I need help in extracting email address along with first name and lastname using perl software from any given website. I would be grateful to y99ou 05:57
05:57 ZhangGong|2 left 05:58 darutoko joined
Hotkeys saaki: oh 05:58
saaki i gave a bad example on the range side since i don't care about 2
jdv79 adeeb: maybe p5 is better at this task. i think there may be some cpan modules to so stuff like that already. 05:59
Hotkeys m: say (6, 12 ... 100) # all multiples of 6 to 100
camelia rakudo-moar b243a9: OUTPUT«(6 12 18 24 30 36 42 48 54 60 66 72 78 84 90 96)␤»
Hotkeys Like that?
jdv79 s/so/do/
Hotkeys if you want more general
adeeb thank you can you guide me a link 06:00
jdv79 ask in #perl
saaki Hotkeys: perfect!
Hotkeys m: say {($^a, * + $a ... $^b)}(1_000_000, 10_000_000) 06:01
camelia rakudo-moar b243a9: OUTPUT«(1000000 2000000 3000000 4000000 5000000 6000000 7000000 8000000 9000000 10000000)␤»
Hotkeys There's essentially an anonymous function for multiples of a up to b
06:01 adeeb left, ZhangGong|2 joined
Hotkeys If you want the first n numbers 06:02
saaki Hotkeys: cool. also, i missed out on the *
Hotkeys m: (6, 12 ... *)[^10] 06:03
camelia ( no output )
Hotkeys er
saaki Inf
Hotkeys m: say (6, 12 ... *)[^10]
camelia rakudo-moar b243a9: OUTPUT«(6 12 18 24 30 36 42 48 54 60)␤»
Hotkeys First 10
* is hard to explain
saaki i see
Hotkeys It means 'whatever'
And does different things in different contexts
Like here's the Fibonacci sequence 06:04
m: say (0, 1, * + * ... 100)
camelia rakudo-moar b243a9: OUTPUT«(0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 63245986 102334155 165580141 267914296 433494437 70140…»
Hotkeys Well I did that poorly
But you get the gist
saaki yes, thanks 06:05
Hotkeys In a sequence like that * + * acts like $^a + $^b
But at the end of a sequence it basically acts as inf
Unless you make it a conditional
like ?p6> say (1,2,4 ... * > 30) 06:06
Wrong command
And no new line
It does what it looks like it does
saaki can't seem to find those uses of * in docs 06:07
Hotkeys design.perl6.org/S02.html#The_Whatever_Object 06:08
Here's some from the spec
saaki really like the docs for the most part, just tough to find some of these cool little patterns there 06:09
Hotkeys yeah 06:10
the docs aren't perfect but they'll improve with time
jdv79 you could grep the setting for * and Whatever maybe 06:11
Hotkeys Anything you can't find in the docs you can probably find in the specs with a little elbow grease
saaki have managed to dig up some things from design.* via google, bit surprising sometimes. should probably just read them through. 06:12
Hotkeys lol
be aware not everything in the spec is implemented yet
but whatevers implemented is probably in the spec
if that makes sense :p 06:13
saaki it does
would like to contribute, seems nqp needs some work 06:17
06:31 billj joined
billj p6: say 3; 06:32
camelia rakudo-moar b243a9: OUTPUT«3␤»
saaki may resolve to docos
06:35 billj left 06:51 jack_rabbit joined 06:57 ufobat joined 07:02 domidumont joined 07:05 jack_rabbit left 07:06 domidumont left 07:07 domidumont joined 07:09 FROGGS joined 07:23 sjoshi joined 07:26 abaugher left 07:27 abaugher joined 07:29 jack_rabbit joined 07:33 ChoHag_ is now known as ChoHag 07:35 CIAvash joined 07:36 atweiden joined 07:38 firstdayonthejob joined 07:39 nakiro joined 07:41 st_iron joined 07:42 el_amigo joined, st_iron left
masak morning, #perl6 07:43
atweiden in rakudo source, in the case of `multi sub infix:<eqv>(FatRat, FatRat)`
is this the intended behavior?
m: my FatRat $f = FatRat(989898988898989898980909090939838302233848473393040383234234509484.3489523478234723847238432423); say $f eqv FatRat(989898988898989898980909090939838302233848473393040383234234509484.3489523478234723847238432423); say $f eqv FatRat(989898988898989940247844191134641988224436627880004840480824357399.83933482381524942767485346932);
camelia rakudo-moar b243a9: OUTPUT«True␤True␤»
atweiden or this
m: my FatRat $f = FatRat(989898988898989898980909090939838302233848473393040383234234509484.3489523478234723847238432423); say $f eqv FatRat(989898988898989898980909090939838302233848473393040383234234509484.3489523478234723847238432423); say $f == FatRat(989898988898989940247844191134641988224436627880004840480824357399.83933482381524942767485346932);
camelia rakudo-moar b243a9: OUTPUT«True␤False␤»
07:44 el_amigo is now known as st_iron, jack_rabbit left
masak ...no? :) 07:45
seems they should only be == or eqv if they're numerically equal
which is a pretty clear-cut notion 07:46
07:46 AlexDaniel left
atweiden masak: good morning to ya :) i was thinking about writing a new multi sub handling FatRat 07:48
masak ok :) 07:49
ufobat good morning :)
07:49 fireartist joined
atweiden should the eqv sub go in rakudo/src/core/Rat.pm ? 07:50
i haven't tested but it's possible Rat is affected by this too 07:51
07:52 st_iron left
atweiden any thoughts on rewriting the existing one in Numeric.pm 07:53
masak I'd say go for it; see whether the result is better 07:54
this ought to be measurable in absolute passing-tests numbers
the above evals are obviously suspicious and a strike against the current implementation 07:55
08:12 pierrot left 08:14 cpage left 08:21 buharin left 08:22 papayaman joined
papayaman mst: hey man, i know you said on twitter that you don't like perlmaven. why don't you submit PRs or issues to its github repo ? github.com/szabgab/perlweekly/issues 08:23
mst: it's not going to fix itself you know..
unless there's some telepathy going on between you and gabor.. 08:24
moritz papayaman: does this discussion belong into #perl6?
08:25 papayaman left
moritz wow, /quit'ing after leaving such a message isn't the best thing you can do to emphasize your point 08:26
08:28 zakharyas joined
tweakism trouble in paradise? 08:29
[Tux] test 21.717
test-t 13.739
csv-parser 49.050
08:36 RabidGravy joined
Hotkeys moritz: you mean joining specifically to say your message and then immediately leaving isn't the way to do things??? 08:37
08:39 firstdayonthejob left
RabidGravy marning! 08:42
08:45 wamba left, salv0 joined
masak moritz: I agree it wasn't on-topic... but everytime such a thing happens, I understand a bit better the lightning-rod role mst has taken on in the p5 community. 08:45
it's like... people who won't ever rise above ad-hominem anyway, end up thinking that mst is the cause of all their worries. (and so other people can get on with being productive.) 08:47
08:49 abraxxa joined 08:53 Actualeyes left
stmuk_ the best solution for the large minority of people who find mst toxic is to attempt to ignore him 08:56
Hotkeys Idk who mst is 08:57
08:57 Actualeyes joined
El_Che ah perl6-js grant? \o/ 08:57
Hotkeys Yeah we'll take over the web soon 08:58
And then the world
El_Che and after some years, we'll still be big in Japan! 09:00
09:04 dakkar joined
RabidGravy sorry, I've taken over the world already, I've just been subtle about it 09:11
masak you're the fifth person this month to come in and say that 09:13
El_Che RabidGravy: if that's the case, can you "fix" a few parking tickets I have, you know as master of the world
09:16 cpage_ left
masak I still find it interesting that python3 will not only fail on removed 2.x syntax (like circumfix:<` `> and infix:<< <> >>), but do so in a way that gives no indication it ever worked 09:16
it's like the total opposite of the Perl 6 approach
jast El_Che: that wouldn't be very subtle, now would it
09:17 cpage_ joined
Hotkeys masak: its hard when people think of perl 5 -> 6 like they think of python 2 -> 3 09:17
Like perl 6 is brand new
tweakism masak: I think their goal is to make a clean-break and shed what they consider to be mis-features
Hotkeys Well 09:18
Its a long time in the making
But brand new kind of
tweakism that doesn't forego helpful errors, but it explains why they break backwards compatibility
Hotkeys In the sense that it isn't p5
tweakism masak: backwards-compat is valuable, but it can also be a great burden sometimes. 09:19
masak oh, agree in general
09:20 daxim left
masak but here it just feels like a missed opportunity to put in the minimal amounts of code to recognize-but-flag-as-gone the old syntax 09:20
they do in the case of `print "hi"` vs `print("hi")`, thankfully
tweakism heh, it would be kindof amusing if you could import from past 09:21
from past import print_statement
09:21 cpage_ left 09:27 bjz joined
masak well, you can always do like the JavaScript community, and compile your private dialect of python3 to standard python3 :) 09:28
tweakism lol. 09:30
I do that in JavaScript too, because the dialects that are actually available where I need to run are broken and braindead in various ways.
09:30 ZhangGong|2 left
RabidGravy I'll just mention that I really don't like coffeescript at all 09:38
gregf_ hi, is there a way to list all methods of an instance? 09:43
like so, class Foo { method bar() { } method baz(){} }; and then my $f = Foo.new; print $f.methods or something along those lines 09:44
jnthn m: class Foo { method bar() { } method baz(){} }; say Foo.^methods 09:46
camelia rakudo-moar b243a9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/NgJveNd_F9␤Strange text after block (missing semicolon or comma?)␤at /tmp/NgJveNd_F9:1␤------> 3class Foo { method bar() { }7⏏5 method baz(){} }; say Foo.^methods␤ expecting any of:␤ i…»
jnthn m: class Foo { method bar() { }; method baz(){} }; say Foo.^methods
camelia rakudo-moar b243a9: OUTPUT«(bar baz)␤»
jnthn Can do it on an instance too
gregf_ jnthn: cheers 09:47
09:54 virtualsue joined, cognominal left
RabidGravy if I have a CStruct and I apply a role to it with an attribute will that mess up the representation in native-land? 09:56
jnthn RabidGravy: Compile-time composition, or mix-in? 09:58
09:58 cognominal joined
jnthn role Foo { has int32 $.x }; class C is repr('CStruct') does Foo { } # this should be fine since the attributes are flattened into the role, so it's no different from CStruct's point of view 09:59
afaik, anyways :)
09:59 rindolf joined
RabidGravy either really, in portaudio there is a struct DeviceInfo but everywhere else in the API it is reference by an "index" 09:59
so it would be nice to store the index in the class somehow but not make that appear to the native struct 10:00
jnthn Oh...
I'd probably solve that with delegation 10:01
RabidGravy yeah, that was the next option
jnthn class WrapperThingy { has TheCStructType $.foo handles *; has $.index; }
Hotkeys What does handles do
I haven't seen that one before 10:02
Is it a native thing
RabidGravy it makes the methods of the attribute appear as methods of the object
no not native
m: class Foo { method bar() { say "bar" } }; class Baz { has Foo $.foo handles <bar> = Foo.new }; Baz.new.bar 10:03
camelia rakudo-moar b243a9: OUTPUT«bar␤»
Hotkeys Neat 10:04
RabidGravy the * in jnthn's example is "gimme everything"
Hotkeys Right
I assumed as much
I've gotten good at guessing what whatever does
RabidGravy you can also do it with a hash which is their-name => my-name
Hotkeys Oh so like 10:05
You could map bar to qux
And then call qux
RabidGravy yeah
gregf_ m: class Foo { method bar() { print "Bar"; } }; class Baz { has Foo $.f handles *; method yay(){ self.bar(); } };Baz.new.yay(); #<== something like that i would imagine
camelia rakudo-moar b243a9: OUTPUT«Bar»
RabidGravy m: class Foo { method bar() { say "bar" } }; class Baz { has Foo $.foo handles bar => 'bap' = Foo.new }; Baz.new.bap 10:06
camelia rakudo-moar b243a9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/d1OfTI0aH_␤Cannot modify an immutable Str␤at /tmp/d1OfTI0aH_:1␤»
Hotkeys Handles in my mind brings up memories of when I had to do VB.Net in high school
And handles did evenets
RabidGravy m: class Foo { method bar() { say "bar" } }; class Baz { has Foo $.foo handles (bar => 'bap') = Foo.new }; Baz.new.bap
camelia rakudo-moar b243a9: OUTPUT«Method 'bap' not found for invocant of class 'Baz'␤ in block <unit> at /tmp/SV50oUkceS line 1␤␤»
RabidGravy or even the other way around
m: class Foo { method bar() { say "bar" } }; class Baz { has Foo $.foo handles (bap => 'bar') = Foo.new }; Baz.new.bap
camelia rakudo-moar b243a9: OUTPUT«bar␤»
gregf_ other way i would imagine, as thats how its in Moose :| 10:07
FROGGS .tell azawawi I'd like to extend your Selenium::WebDriver to support BlackBerry devices... and I think I'd need guidance on how to setup Firefox testing. Would be nice if we could chat a little
yoleaux FROGGS: I'll pass your message to azawawi.
10:08 cognominal left
jnthn Yes, it points from the name you expose to the name it'll map into 10:09
RabidGravy I always have to look
I also have to not use a '*' in about half of cases as it doesn't like some kinds of members 10:10
FROGGS jnthn: can you tell me if this patch is just rubbish or sensible? github.com/rakudo/rakudo/commit/80...9e3cddd7bc
jnthn Makes no sense 10:11
$s is already a native string
So it'll code-gen a box just so it has one to throw away :P
10:13 pmurias joined
RabidGravy aga do do do 10:14
FROGGS jnthn: so my gut feeling was right... we got a Heisenbug here 10:16
maybe... if I'd add a serialize function to NativeRef, I'd dump its value and maybe get a clue what it is 10:17
FROGGS wants Data::Dumper in C 10:18
10:18 cognominal joined
ilmari gdb ;) 10:18
ilmari p my_struct
FROGGS well, I could potentially add a breakpoint... 10:19
yes, will try that
10:27 espadrine joined 10:30 TEttinger left 10:31 espadrine_ joined 10:32 espadrine left 10:36 pierrot joined 10:38 virtualsue left 10:39 profan left 10:41 profan joined 10:42 cpage_ joined 10:44 atweiden left, espadrine joined 10:46 daxim joined 10:48 espadrine_ left
masak m: try 1e0 / 0e0; say $!.^name 10:54
camelia rakudo-moar b243a9: OUTPUT«X::Numeric::DivideByZero␤»
colomon is looking at the FatRat / Rat eqv patch and trying to figure out what it is meant to be doing. 10:55
10:59 pmurias_ joined 11:02 pmurias left
gregf_ m: class Foo { method bar($a) { }; method baz($a, $b) { } }; print Foo.^methods.map(*.arity) 11:04
camelia rakudo-moar b243a9: OUTPUT«2 3»
gregf_ should'nt this be printing 1 2?
ah nevrmind, prolly self is included :| 11:05
11:06 mls_ joined 11:08 cognominal left, cognominal joined
jnthn gregf_: self is included; we don't consider self special. If you wanted to call the method as a code object directly you'd have to pass something to fill the invocant slot. 11:09
11:10 mls left 11:11 mls joined 11:12 mls_ left 11:13 musiKk_ joined 11:17 kid51 joined 11:23 cognominal left, cognominal joined
gregf_ oh - ok 11:23
so Foo.^methods[0].(Foo.new, 10) #or whatever 11:24
Woodi do self/this thingies are realy necesarry ? it's "how it works" currently but you do not pass car somewhere so there car can start engine... currently objects "use" methods in the classes so method need to know which object called it but can it be another way ? objects "slurps" method from class storage and call it ? 11:25
hi today :)
tweakism Woodi: a method isn't necessarily called on an instance of the class that defines it. 11:27
11:27 labster left
Woodi tweakism: but that is special case of OO system you have 11:27
tweakism other languages provide a keyword like 'this', but I like the explicit-self-parameter style personally. 11:28
Woodi: I don't think 'allows inheritence' is very special among OO implementations, is it?
Woodi tweakism: no idea what is allow inheritance system... 11:29
tweakism Woodi: Vehicle defines wheels(). Car inherits from Vehicle. somecar.wheels() calls Vehicle.wheels() on an instance of Car. (assuming Car doesn't override wheels()) 11:30
11:31 Praise left
Woodi tweakism: and what is *popular* in industry is not important at all. what's is better is. 11:31
tweakism *shrug* 11:32
gregf_ Woodi: self/this are not mandatory afaik
Woodi at the end you will hit valit range of specialisations usefull in particular cases :)
gregf_ for example in this case: self 'is' needed:
Woodi gregf_: but it's like current OO implementations work internally. i wonder what about something else :) 11:33
gregf_ class Foo { def bar;end }; class Bar < Foo; def baz; self.class.superclass.instance_method(:bar).bind(self).();end; end <== in ruby
Woodi : even in Java 'this' is not mandatory 11:34
Woodi gregf_: but it is there, i think. syntax isn't important 11:35
tweakism ultimately, they are just different syntaxes for the same thing, I think. not entirely certain, but I think.
the car object *does* get "passed" to the start_engine method in either case; making it an explicit parameter makes it easy to reason about. 11:36
Woodi gregf_: what this Ruby thing do ? you have variable bar in Foo but later use method bar...
tweakism some languages make a real mess w/ this (JavaScript).
Woodi tweakism: yes. but maybe something other have sense too ? and maybe it can be better in some cases ? 11:37
gregf_ Woodi: its a mental way by which a specific class calls a different method from the generic/parent class :| #ofcourse s/{//;
RabidGravy right off out for a bit 11:39
Woodi gregf_: it's make sense. why clone methods into *every* object, would be waste. but this system just use objects like varibles...
tweakism Woodi: so you're saying design a language that requires neither a self parameter nor a self/this keyword?
Woodi tweakism: trying things (or just thinking) is like science works :) 11:40
jnthn Woodi: You might find CLOS interesting :)
Woodi jnthn: I need to learn Lisp first probably... :) 11:41
jnsso it's already invented ??
using objects is indirection via pointer :) 11:42
jnthn Woodi: Well, they have a different way of looking at objects/methods is all. Objects don't have methods, and the "methods" can have multiple invocants
jast so you're thinking about a system to reference objects wihout referencing them?
jnthn Actors are also intereting to look at, and probably closer to the original thinking of OO. 11:43
Woodi jast: I think not. objects just take methods from class and use it on fields
11:43 RabidGravy left, kid51 left
jast depends. not all implementations of object orientiation even *have* classes... 11:43
jnthn The trouble with OO naming wise is it puts the focus on objects, whereas the interesting thing is the messages. 11:44
ilmari like javascript, to take random example
jnthn found OO design a lot easier when he started desining message first, then grouping them by invariants to discover the objects, rather than trying to work out what objects should exist 11:45
Woodi jnthn: discover ? you mean paper-pencil-design ? 11:46
colomon m: say (989898988898989898980909090939838302233848473393040383234234509484.3489523478234723847238432423).nude
camelia rakudo-moar b243a9: OUTPUT«(9898989888989898989809090909398383022338484733930403832342345094843489523478234723847238432423 9999999999999999583119736832)␤»
colomon is trying to figure out how that makes any sense
moritz a simplistic approach to OO design that works surprisingly well is to start with a bunch of subroutines, and see what data they need in common and pass around everywhere
jast I take a data-centric view, too, usually 11:47
moritz then you can start putting the common data into one or several related objects, using Common Sense[tm]
jnthn Woodi: For many design tasks I use pen/paper or a whiteboard at first, but I quickly move to sketching in code instead.
jast what's almost never a good idea is starting with tons of base classes and building up a huge hierarchy
ilmari premature generalisation is the root of much mess 11:48
jnthn Woodi: But I mostly just mean that I found that "what classes should I have" and "what fields to they need" tend to come later than "what behaviors should the system have" for me.
ilmari you don't know what the general patterns are until you've implemented/designed several similar things
jast I quite like composition like with P6's roles
tweakism people want to inherit because you can, but has-a relations seem to usually be more appropriate, yes?
11:49 wamba joined
dalek p: d811340 | (Pawel Murias)++ | src/vm/js/HLL/Backend.nqp:
[js] Switch from uglifyjs to js-beautify.
p: 4e1979c | (Pawel Murias)++ | src/vm/js/nqp-runtime/ (2 files):
[js] Move up serialization format to version 18.
11:51 pmurias_ is now known as pmurias
pmurias jnthn: are there any ways to determine if a given closure needs to be serializable? 11:52
11:52 tmch joined 11:53 cognominal left 11:54 cognominal joined
timotimo generally develops dada-centric 11:59
pmurias jnthn: if I store lexicals using js lexicals it's more efficent but makes it hard to extract them for serializing closures :/
12:00 spebern joined
jnthn pmurias: I'm pondering, but...I don't really have a good answer. 12:02
pmurias: Rakudo will get much more aggressive at lexical -> local lowering
dalek p: 6f3aa41 | (Pawel Murias)++ | src/vm/js/nqp-runtime/serialization.js:
[js] Fix typo, ilmari++.
12:02 spebern left
jnthn pmurias: So it may become less of a problem than today 12:03
12:03 spebern joined
jnthn pmurias: But yeah, potentially any closure might be serialized and the demand to do so may even come from a totally separate compilation unit. 12:03
12:04 wamba left
pmurias I could generate both a serializable and unserializable version and just switch to the latter once we know that no serialization will happen, but it seems like something that would just end up adding to much complexity 12:06
jnthn Plus you can't know so easily...
pmurias yes, it would require user "pragmas" or some other things, and compiling Perl 6 is when we care about NQP speed the most 12:07
more and more I'm coming to the conclusion that I should have a seperate analysis pass before actually compiling to js 12:08
colomon m: say Rat.new(9898989888989898989809090909398383022338484733930403832342345094843489523478234723847238432423, 10000000000000000000000000000) 12:09
camelia rakudo-moar b243a9: OUTPUT«989898988898989898980909090939838302233848473393040383234234509484.348952347823472397436717074015␤»
pmurias which could determine things like "this sub is never rebound and only called with named parameters from those 2 places and doesn't care about dynamic variable" 12:10
12:10 spebern` joined
pmurias jnthn: would SPESH benefit from being preseeded with facts, like if I could statically infer what the type of a given variable is 12:12
jnthn pmurias: Not epsecially. The problem comes down to proof.
pmurias: That is, a bunch of what spesh does is throw out checks and virtualization 12:13
pmurias: But it has to know it's safe to do that
pmurias: We can in various cases generate simpler code from static analysis. 12:14
12:14 jolts left
pmurias jnthn: I'm thinking about stuff like "my class Foo {...}; my $foo := Foo.new; # we know what type $foo is once we close the classes" 12:17
12:17 Skarsnik joined
pmurias mere guess seem of very little value to SPESH as it runs at runtime and can just check the type 12:18