»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
sorear now I've picked out a new strategy for char classes and other random bits 00:10
if only I had a reasonably complete Unicode Character Database accessible from C#!
oh hey, Mono finally has General_Category data available for the astral planes 00:14
in master
but I need _all_ the properties for :Foo<Bar>
sorear o/ benabik 00:29
benabik o/ sorear
sorear mode -b $a:clairvy 00:45
TimToady sorear: I'd suggest stealing the tables from Perl 5 01:35
sorear TimToady: are you suggesting stealing the .txt files, or trying to port maketables? 01:38
dalek odel: 2941d14 | diakopter++ | lua/ (2 files):
more attempts at optimization
01:43
TimToady I'm suggesting having maketables spit out P6 instead of P5 01:48
but whatever is easiest 01:49
P5 has the best Unicode support of any language out there currently, and only ICU is comparable in coverage
TimToady it's probably worth talking to Karl Williamson [email@hidden.address] who maintains the Unicodey bits of P5 01:52
whoops, didn't mean to post the address...
TimToady decomputing & 01:55
sorear wah? khwilliamson.com points to a domain squatter 02:11
dalek odel: 6fc09fa | diakopter++ | lua/ (3 files):
more optimization attempts
02:50
sorear sent a probably horrible mail to Karl Williamson 03:12
dalek ast: 48af882 | moritz++ | S32- (2 files):
refudge encode.t for rakudo
05:31
moritz good morning 05:32
sorear o/ moritz 05:35
dalek kudo/nom: c0b2e3a | moritz++ | / (3 files):
enable "UTF-8" as encoding name, as well as a few aliases for ISO-8859-1; run encode.t
sorear TimToady: I've already gotten a responce back from Karl 05:54
TimToady: 1. he doesn't know anything about P6 2. he thinks modification shouldn't be too hard 3. but he said mktables' raison d'etre is gone now that UCD-XML exists and if I'm going to make significant changes I should just use that instead 05:55
sorear is reading UAX#42 now
sorear thinks that the Unicode names list could be very effectively compressed by Huffman-coding with words as the symbol level 05:59
LATIN SMALL LETTER A WITH OGONEK ... not much entropy here! 06:00
sorear sleep 07:26
moritz nom: '(a)' ~~ / '(' ~ ')' <alpha> / and say $<alpha> 09:07
p6eval nom c0b2e3: OUTPUT«Any()␤»
moritz nom: '(a)' ~~ / <alpha> / and say $<alpha> 09:08
p6eval nom c0b2e3: OUTPUT«=> <a>␤␤»
jnthn morning, #perl6 09:21
moritz good morning jnthn
moritz jnthn: fwiw I've done a quick grep of nqp::\w_i ops in the src/core/ and implemented the _I variants of all of them (I think :-) 09:26
erm, \w+_i of course
moritz so apart from floating point conversion the bigint stuff should be feature complete 09:27
jnthn moritz: nice! 09:29
moritz: I'll try and get the last 6model change needed in place today. 09:30
moritz jnthn: one more thing, I'm pondering what to do about integer exponentation 09:32
moritz tommath offers a mp_pow(mp_int, mp_digit) 09:32
moritz so that works for up to $N ** (2 ** 31) or so, and I don't think we want to handle higher numbers anyway 09:33
so I'm pondering something along these lines:
1) a special case when the exponent is 0 or 1 09:34
2) if the exponent is < 0, delegate to the pow_n opcode
3) if the exponent doesn't fit into an mp_digit, return +-Inf
4) otherwise, use mp_pow 09:35
does that sound sane?
or over-engineered?
masak morning, #p6 09:43
moritz perl6: say (-3) ** -1 09:44
p6eval niecza v11-22-gbebf7a0: OUTPUT«-1/3␤» 09:45
..rakudo c0b2e3: OUTPUT«-0.333333333333333␤»
..pugs b927740: OUTPUT«*** ␤ Unexpected "-"␤ at /tmp/aqCjROpWag line 1, column 13␤»
moritz perl6: say (-3) ** (-1)
p6eval niecza v11-22-gbebf7a0: OUTPUT«-1/3␤»
..rakudo c0b2e3: OUTPUT«-0.333333333333333␤»
..pugs b927740: OUTPUT«-0.3333333333333333␤»
moritz perl6: say (-3) ** (-2)
p6eval niecza v11-22-gbebf7a0: OUTPUT«1/9␤»
..rakudo c0b2e3: OUTPUT«0.111111111111111␤»
..pugs b927740: OUTPUT«0.1111111111111111␤»
moritz perl6: say 0 ** 0 09:48
p6eval pugs b927740, rakudo c0b2e3, niecza v11-22-gbebf7a0: OUTPUT«1␤»
jnthn moritz: Sounds like it covers the various cases sanely. 09:56
moritz: Though it means that infix:<**> for Ints may not give you an Int back 09:57
Guess there's precedent for that though.
And the negative ones really can't...
moritz right
jnthn So, seems fine.
moritz jnthn: should the op also take the type object of the Float type to box into?
otherwise we'd have to return a parrot Float 09:58
jnthn ah, good question
Guess it probably has to
jnthn Until I do the 6model language interop stuffs. 09:59
masak yeah, expecting infix:<**> to return an Int doesn't feel that important. 10:08
moritz perl6: say (3**4).WHAT 10:15
p6eval pugs b927740: OUTPUT«Rat␤» 10:16
..rakudo c0b2e3, niecza v11-22-gbebf7a0: OUTPUT«Int()␤»
moritz Int certainly DWIMs more
... at least when it can
masak blog post! \o/ strangelyconsistent.org/blog/macro-...t-accepted 10:34
(a short one)
flussence wtf, if I have "#Regex :$word-break = /\s/," (commented out) in a sub signature Niecza throws some error about an invocant 12:31
if I take the comment out and leave it in the sub body or wherever, it works fine 12:32
colomon masak: I'd argue that it's pretty important that Int ** Int gives you an Int back, since the accuracy / range of an Int is so much greater than the range of a Num. 12:33
perl6: say 9 ** 1000
p6eval niecza v11-22-gbebf7a0: OUTPUT«1747871251722651609659974619164660570529062487435188517811888011810686266227275489291486469864681111075608950696145276588771368435875508647514414202093638481872912380089977179381529628478320523519319142681504424059410890214500500647813935818925701905402605… 12:33
..rakudo c0b2e3: OUTPUT«-9223372036854775808␤»
..pugs b927740: OUTPUT«17478712517226516096599746191646605705290624874351885178118880118106862662272754892914864698646811110756089506961452765887713684358755086475144142020936384818729123800899771793815296284783205235193191426815044240594108902145005006478139358189257019054026054840981379…
masak colomon: good point. 12:45
colomon: I guess it's sort of part of the bigint "contract". 12:46
[Coke] p5p thread "Requesting permission for a new pragma named "here"" looks vaguely like START {} 13:41
felher masak: i'll read your post later but congratulations :) 13:46
masak thanks. it's basically what the URL says ;) 13:52
smash hello everyone 13:57
masak hi smash! 14:03
colomon o/ 14:04
flussence got an interesting regex problem while getting Text::Wrap to work: I'm grabbing chunks of text up to an output line length $n by doing rx/ (\N ** {0..$n-1}) ($line-break) | (\N ** $n) ($line-break)? /; ... the problem is $n=0 is a valid input (because of this module's weird indent functionality) and it blows up when that happens :( 14:06
(I guess the right way to fix it is separate the indenting stuff from the wrapping stuff somehow...) 14:07
masak nom: my $x = 1; say so "foo" ~~ /^ f ** {0..$x} / 14:13
p6eval nom c0b2e3: OUTPUT«Bool::True␤»
masak nom: my $x = 2; say so "foo" ~~ /^ f ** {0..$x} / 14:14
p6eval nom c0b2e3: OUTPUT«Bool::True␤»
masak nom: my $x = 0; say so "foo" ~~ /^ f ** {0..$x} /
p6eval nom c0b2e3: OUTPUT«Bool::True␤»
benabik nom: say so "foo" ~~ /^ f ** 0..0 /
p6eval nom c0b2e3: OUTPUT«Bool::True␤»
masak well, that works. so there's probably something bigger going on.
flussence the -1 part
masak it's a bit weird, by the way, that infix:<**> binds tigher than infix:<..> in Perl 6, but the other way around in the regex slang. 14:15
benabik nom: my $x = -1; say so "foo" ~~ /^ f ** {0..$x} / 14:16
p6eval nom c0b2e3: OUTPUT«Bool::True␤»
flussence perl6: say ("foo" ~~ /^ f ** 0..-1 /) 14:17
p6eval niecza v11-22-gbebf7a0: OUTPUT«===SORRY!===␤␤Malformed range at /tmp/d4fKCS6epL line 1:␤------> say ("foo" ~~ /^ f ** 0..⏏-1 /)␤␤Parse failed␤␤»
..pugs b927740: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤ unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.20111008/blib6/pugs/perl5/lib';␤ eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HAND…
..rakudo c0b2e3: OUTPUT«===SORRY!===␤Only integers or '*' allowed as range quantifier endpoint at line 1, near "-1 /)"␤»
flussence perl6: say ("foo" ~~ /^ f ** {0..-1} /)
p6eval rakudo c0b2e3: OUTPUT«=> <f>␤␤»
..pugs b927740: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤ unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.20111008/blib6/pugs/perl5/lib';␤ eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HAND…
..niecza v11-22-gbebf7a0: OUTPUT«#<match from(0) to(0) text() pos([].list) named({}.hash)>␤»
pmurias awwaiid: hi 14:57
awwaiid hi 14:58
pmurias awwaiid: i'm adding a gdb backend to Devel::ebug, and i need a way to plug it in 14:59
awwaiid ok 15:00
pmurias the backend currently is hardcoded into a custom copy of Devel::ebug and accepts the same protocol (yaml) as the perl one 15:01
awwaiid I put devel::ebug up on github in case you didn't see it, btw
so let's see. what were you thinking - maybe a parameter to Devel::ebug to tell it what backend it is talking to? Or will they be pretty compatible? 15:03
pmurias it's currently fully compatible 15:03
is supposed to be
most of the commands are not implemented yet 15:04
awwaiid ok
where does the hard-coding currently come in?
awwaiid and what sort of plug in need are you thinking? 15:04
pmurias awwaiid: the name of the program that is executed
not sure
maybe run an ebug_backend_gdb executable?
awwaiid yeah, that would work to start -- see ebug_server vs ebug_client for example 15:05
pmurias and Devel::ebug would have a backend attribute? 15:06
awwaiid I factored out a chunk of ebug_client last night 15:06
awwaiid well the main thing I think Devel::ebug should care about is how to talk to the backend, ie port, protocol, etc 15:06
pmurias awwaiid: can i have a commit bit to the github repo or do you prefer pull requests? 15:07
awwaiid pull requests are more my style if that's ok 15:08
pmurias ok
awwaiid: so Devel::ebug will have a backend attribute and ebug will take a --backend option? 15:13
should ebug automatically determin what sort of backend is needed for a given executable?
that is debug native programs with the gdb backend, perl5 ones with the current one and perl6 ones with the niecza one? 15:14
awwaiid if it can guess automatically then it should, but it should be overrideable with --backend and Devel::ebug should take a backend attribute which might affect how it talks to the backend 15:15
but if the backends are compatible enough, only the ebug binary will care about how to start up the backend, Devel::ebug itself probably wouldn't care at all
pmurias Devel::ebug does the starting up 15:19
awwaiid oh. well then. 15:20
awwaiid I think that needs to be refactored a bit. Before my patch yesterday (and even with it kinda), the ebug_client actually overrode that functionality of Devel::ebug to stop it 15:20
but yeah, it can remain in Devel::ebug somewhere 15:21
pmurias awwaiid: how do we call the current perl5 backend? 15:25
ebug_backend_perl?
awwaiid sounds good to me 15:29
pmurias how can i portable find the executable from the tests? 15:32
awwaiid you mean because of the slashy? the executable will be in the bin directory. you can do File::Spec->catfile('bin','ebug_backend_perl'). that's what I've done in the tests so far, anyway (I'm open to suggestions) 15:35
I haven't worked on testing this in windows yet (some tests failing because of issues like that I think) 15:36
pmurias doesn't windows accept both forms?
awwaiid sometimes :)
pmurias starts virtualbox 15:37
awwaiid oh maybe for executing that is fine. the test I fixed is what $trace->filename returns
pmurias awwaiid: you changed #!perl to #!/usr/bin/perl 15:37
pmurias in ebug 15:37
awwaiid ah. not very nice of me
awwaiid esp since lately I've been using '#!/usr/bin/env perl' to make perlbrew work easily 15:38
hm. ebug still has #!perl. I don't know what is correctest. 15:39
pmurias #!/usr/bin/perl and #!perl seemd to get corrected by Build at install 15:40
awwaiid hm. interesting
pmurias #!/usr/bin/env perl doesn't
maybe we should switch the discussion to #perl? 15:42
awwaiid sure
sorear hello. 15:51
masak hai. 15:52
sorear is not very hopeful that Devel::ebug can have interchangable backends that are any good
TimToady ⟅ö⟆
sorear TimToady: did you see my reply at 21:54 PST? 15:53
TimToady yes
sorear .o( a bot that can turn date --rfc-822 output into clog links might be useful) 15:54
fsergot hi #perl6 o/
TimToady ö⟆
pmurias sorear: why the doubt? 15:55
sorear pmurias: significant differences in underlying data model 15:56
.u ⟆
phenny U+27C6 RIGHT S-SHAPED BAG DELIMITER (⟆)
awwaiid isn't it all what line am I on, what line am I going to, when should I stop? :) 15:58
anyway, let's try it and see
sorear TimToady: how much would it hurt completeness to use ucd-xml instead of mktables? 16:00
TimToady dunno; if Karl recommends it, it's probably a pretty good idea 16:01
pmurias sorear: so we won't be able to display things in a pretty enough way?
sorear maybe 16:04
TimToady sorear: though maybe you want to change it to a more compact format as a first step
sorear more compact and more searchable 16:08
TimToady and for performance you you might want to bring in the information lazily, like P5's swatches do
sorear it seems P5 doesn't support unihan properties
TimToady though those are tuned for UTF-8, so I wouldn't use the design directly
sorear I'll follow this lead, it shrinks the db nicely :p 16:09
TimToady unihan has properties now, does it? sugoi... 16:09
sorear yeah... / \p{kMandarin=san} / os so 16:10
or so
TimToady well, / <:kMandarin<san>> / in P6 spec-land 16:14
sorear TimToady: had you any thoughts on efficient implementation of <:name(/^LATIN\ LETTER.*P$/)> and <:Nv(0 ^..^ 1)> or do we expect those to be calling back to ACCEPTS when characters are matched? 16:20
I guess memoization would help, at least for alphabetic texts 16:22
moritz if somebody does that... doctor, it hurts
sorear heads off 16:23
moritz: both of those examples are from S05. 16:24
moritz sorear: well, the spec sometimes shows extreme examples more than usual examples 16:25
masak rakudo: Inf.S 16:40
p6eval rakudo c0b2e3: OUTPUT«Method 'S' not found for invocant of class 'Num'␤ in block <anon> at /tmp/NURxxzq1oO:1␤ in <anon> at /tmp/NURxxzq1oO:1␤»
masak rakudo: class A { has Int $.S = 0 }; say (A.new, A.new, A.new).min(*.S)
p6eval rakudo c0b2e3: OUTPUT«Method 'S' not found for invocant of class 'Num'␤ in whatevercode <anon> at /tmp/Pw1sTakJR9:1␤ in method reify at src/gen/CORE.setting:4007␤ in method reify at src/gen/CORE.setting:3914␤ in method reify at src/gen/CORE.setting:3914␤ in method gimme at src/gen/…
masak I think the former is what's happening in the latter.
masak submits rakudobug
Inf is nice and all, but I think the above shows that the value Inf is not enough in the .min method (because we don't want to call Inf.S) -- rather, we need to special-case the initial value of the accumulator variable somehow. 16:42
TimToady: this would be a case of using an in-band value and wishing it were out-of-band, I guess :)
masak put differently, you can't both have Inf in that algorithm, and arbitrary closures that invoke on the smallest-value-found-so-far. 16:45
moritz well 16:46
what you can do is default the return value to Inf
but take the first value without comparison, and only compare to that in subsequent cases
masak right.
that's what I meant by 'special-case' above.
masak we're then using Inf as an out-of-band value rather than an in-band value. 16:47
dalek ecs: 7b498ac | larry++ | S06-routines.pod:
de-sigil the |capture and \parcel params
16:57
masak "if you don't like sigils, just use these backslashes" 17:00
PerlJam TimToady: you always scare me with stuff like that.
TimToady sorear: re efficient properties, note that both of those are resolvable at compile time, if we assume the Unicode tables are relatively immutable
masak: and only on the declaration :)
masak right.
I think the patch looks nice and clean. but the sigil-less bit at the end is crazy. I hope no-one ever programs in that style. 17:01
TimToady predicts that masak will someday program in that style :)
masak ;)
moritz surely will... while writing setting code
masak I'm fine with the spec having bits that I don't like. just don't... expect me to like them. :) 17:02
PerlJam so ... | is a "capture sigil" and \ is a "parcel sigil" :-) 17:03
TimToady call it the 𝑖, 𝑗, 𝑘 style :) 17:03
moritz .u �
phenny U+0020 SPACE ( )
U+FFFD REPLACEMENT CHARACTER (�)
moritz .u .. 17:04
phenny U+0020 SPACE ( )
U+0021 EXCLAMATION MARK (!)
U+0022 QUOTATION MARK (") [...]
moritz hm
the browser shows it correctly in the IR clogs
TimToady someone needs to drag irssi out of the stone age, maybe
moritz but I can't seem to copy&paste it to putty
daxim let me guess, astral characters? 17:05
moritz surreal characters
TimToady mathematical, which is much the same thing
daxim lots of software is still borken vav this 17:05
PerlJam TimToady: what does args get in sub foo ($blah, |args, @goober) { ... } ? 17:06
benabik Hm. It appears some bit of unicode causes Colloquy to start eating memory. That's fascinating. 17:07
TimToady a snapshot of the capture after $blah has been removed
PerlJam okay, that's what I thought
TimToady that's how jnthn++ has already implemented, iiuc
*it
TimToady sorear: of course, if someone writes :prop($foo .. $bar) then it's back to DIHWIDT, though caching is still a possible strategy, assuming we can determine the identity of a pattern more efficiently than just redoing the match 17:13
PerlJam TimToady: since \ introduces a term, is that a useful shortcut for macro placeholders? (at least for that category) 17:16
(assuming there's a way to get at the AST-end of it :) 17:18
dalek ecs: da0c71f | larry++ | S06-routines.pod:
include ability to have non-identifier aliases
17:19
TimToady you mean for quasi-unquoting? I think it doesn't help the ambiguity as much as a real AST sigil would 17:20
TimToady still kinda likes ¤ for that 17:21
it's very much a what-the-heck-is-that?!? character
masak .u ¤ 17:22
phenny U+00A4 CURRENCY SIGN (¤)
ashleydev TimToady: you like that better than the square in a circle one?
PerlJam currency sign? 17:23
masak PerlJam: it never really took off.
TimToady and as you may have noticed, the design criteria changed a bit between Perl 1 and Perl 6, so that we are now more likely to want to surprise people than to pander to their cultural preconceptions
masak PerlJam: turns out people have no great need to talk about amounts in an abstract currency. 17:23
TimToady masak: you mean it just hasn't been specced yet :P
oh, you mean the currency sign :)
masak TimToady: no, I was talking about the cu... yeah.
TimToady loves abandoned symbols 17:24
masak I'm not going to argue against spec'ing it, because I don't think I'll be able to say anything I didn't say last time.
TimToady ASTs are the abstract fungibles of a compiler :)
masak I think it's a bad idea to introduce more non-ASCII into core Perl 6. 17:25
PerlJam TimToady: would you be amenable to ¤(...) as a shortcut for ¤term:(...) ?
masak currencies aren't fungible.
TimToady that would seem useful
they are if you leave them out in the damp :)
masak: ¤ and ¢ are sneaky ways of tricking people into learning Unicode, so it's good for 'em in the long run 17:28
masak I just see it as bad for Perl 6 in the short run.
TimToady is trying to optimize for the long term more than the short term, as you may have noticed... 17:29
masak std: my $a; term:($a) 17:30
p6eval std be1f10e: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'term' used at line 1␤Check failed␤FAILED 00:01 123m␤»
masak std: my $a; sub term {}; term:($a) 17:31
p6eval std be1f10e: OUTPUT«ok 00:01 123m␤»
masak hm, that seems to parse as something already.
TimToady odd 17:32
masak actually, I find it a bit strange to have 'term' at all inside of the quasi. I'd much rather have it in the macro signature.
TimToady oh, it's term() :($a)
as an adverb
masak right.
if $a is a term, I'll never be tempted to write infix:($a). and I might use $a several time in the quasi. 17:33
TimToady std: term:[$a]
p6eval std be1f10e: OUTPUT«===SORRY!===␤Variable $a is not predeclared at /tmp/AfmA6NtP6x line 1:␤------> term:[⏏$a]␤Undeclared routine:␤ 'term:[$a]' used at line 1␤Check failed␤FAILED 00:01 120m␤»
masak every time I have to use 'term:'.
TimToady std: term:[42]
p6eval std be1f10e: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'term:[42]' used at line 1␤Check failed␤FAILED 00:01 119m␤»
masak so it seems like the wrong place to put that information.
PerlJam masak: but you'll never have to use term: because it'll just be ¤($a) :-) 17:34
TimToady PerlJam: that's a hack
PerlJam so far I get the impression that masak only cares about terms, so it may be a hack, but one that's extremely useful to him. 17:35
masak no, I was just using 'term' as an example. 17:36
because that's what's been used the most so far in these discussion.
PerlJam okay.
masak my point isn't anything about 'term', it's that the grammatical category is placed on the wrong hook. 17:37
TimToady is trying to decide if masak++'s factoring has merit; it kinda depends on the extent to which a given AST can be used in various different contexts, tagmemically speaking
masak preferably, the caller should specify the context. but that's too late. :) 17:37
masak if you want two contexts for the same AST, declare two params with the latter defaulting to the former. 17:38
PerlJam TimToady: when would you ever use the same AST in term and non-term position (for instance) within the same macro body?
TimToady oh, that's trivial, how 'bout you want $a in both a declaration and as an rvalue later 17:39
jnthn reads the spec changes
TimToady they're mostly what we discussed already
jnthn TimToady: std updated yet? ;) 17:40
TimToady nope, he sez proudly 17:40
masak & 17:42
TimToady is an American, so hypocrisy is protected as a form of free speech
jnthn TimToady: OK. I probably wait for that so I don't have to come back and re-sync later... 17:44
TimToady is now thinking about parameterized ASTs, like parameterized roles...
dalek odel: 3c55146 | diakopter++ | lua/ (15 files):
more optimization attempts
17:48
TimToady masak: "my blogging plans are to ambitious" 17:50
moritz is disappointed by the lack of HPMoR updates 17:53
jnthn moritz: So, for bigint we're just missing the coercion to Num? 17:55
moritz jnthn: aye
jnthn moritz: OK. Too bad the lib is missing that... 17:56
colomon Should be pretty easy to hack, no? 17:57
at least, is there a log10 available for bigint? 17:59
moritz colomon: the lib stores an array of unsigned long digits 18:01
colomon so it's base 2**64, in effect?
moritz it should be possible (but fiddly) to use the first $n bits as mantissa, and the number of bits after that as exponent
colomon: yes
(sign and number of digits stored separately) 18:02
colomon just convert the first int64 non-zero bits to a Num, then multiply by the appropriate power of two?
moritz that would reproduce numbers around 2**65 very badly 18:03
colomon would it?
moritz because the first int64 would be around one bit
so even if you write 2**65 + 2**64, it would return 2**65 18:04
colomon no, no, "non-zero bits"
moritz ah right
yes, that's basically what I meant
colomon yeah, I was just thinking of it in terms of math operations rather than directly hacking the Num representation. 18:05
moritz needs a bit more care though, regarding overflow, producing denormalized floats etc. 18:05
dalek p/bigint: 102de40 | jnthn++ | src/6model/sixmodelobject.h:
Add one more function to the REPR table (should be the final missing one for REPR API 2).
18:06
p/bigint: 006974d | jnthn++ | src/6model/ (2 files):
Tag the REPR function table with the ID the REPR gets, so it's conveniently available.
moritz colomon: your contribution in that area would be very welcome, since I'm rather bad at low-level math and at C hackery
colomon moritz: I'm trying to figure out how you gracefully get the first int64 non-zero bits... 18:08
moritz colomon: probably using the built-in bit shift ops in some way 18:10
colomon built-in to ?
moritz libtommath 18:11
colomon ah
hmmm 18:12
moritz they aren't called bitshift in the API, but division and multiplication by 2**n
mp_div_2d and mp_mul_2d 18:13
benabik libtommath does appear to have a function that returns an array of bytes that you can then manipulate as you please. 18:14
moritz well, you can operate on mp_int->dp, mp_int->used and mp_int->sign 18:16
jnthn graphics.stanford.edu/~seander/bithacks.html is an awesome page of bit manipulation, but don't see anything that immediately suits our case...
colomon is there an easy place to find the specs of libtommath? 18:18
moritz colomon: github.com/libtom/libtommath/blob/.../tommath.h 18:19
there's also a .pdf, but it's more wordy without providing much more informaton
benabik The PDF is more about the algorithms used. 18:20
colomon mp_cnt_lsb? 18:22
tadzik o/ 18:27
dalek p/bigint: 6d52f98 | jnthn++ | src/6model/ (2 files):
Get dynamic repr registration to return the ID given to the representation.
18:35
p/bigint: 965804c | jnthn++ | src/6model/reprs/ (8 files):
Add get_boxed_ref functions; P6opaque one needs filling out more fully.
p/bigint: 1b2781c | jnthn++ | t/nqp/60-bigint.t:
Fix typo in test.
moritz colomon: note that "digit" in tommath lingo means "64bit word" 18:39
moritz it doesn't give you a bit boundary 18:40
fsergot nom: say *,"a", *; 19:12
p6eval nom c0b2e3: OUTPUT«*a*␤»
fsergot nom: say "a" ¬¬ *,"a", *;
p6eval nom c0b2e3: OUTPUT«===SORRY!===␤Confused at line 1, near "say \"a\" \x{ac}\x{ac}"␤»
fsergot nom: say "a" ~~ *,"a", *; 19:13
p6eval nom c0b2e3: OUTPUT«Bool::Truea*␤»
colomon moritz: mp_cnt_lsb talks about lsbs and bits, not digits. I suspect we want the msb rather than the lsb, alas. But the C code ought to be similiar....
moritz uhm, it looks like only DIGIT_BIT = 60 bits are stored per word by default 19:35
TimToady I suppose that lets you unroll a few additions without worrying about overflow every time 19:38
moritz probably
TimToady two numbers plus a carry is three right there
moritz ah right, C doesn't make the carry flag available to the pained lib developer
dalek odel: a8c8822 | diakopter++ | lua/ (3 files):
minor fixes
19:40
odel: 862ce02 | diakopter++ | lua/ (15 files):
Merge branch 'master' of github.com:diakopter/6model
odel: 3ac97e3 | diakopter++ | lua/compiler/profiler.lua:
Add profiler.lua
diakopter example profiler output gist.github.com/1348913 19:45
masak TimToady: thanks; fixed. 19:48
TimToady: quasis *are* parameterized ASTs :) 19:49
masak but I guess you mean along some other dimension. 19:49
jnthn diakopter: Is that output for the integer loop? 19:56
masak moritz: I'm toying with the idea of emailing LessWrong and expressing my interest in more HPMoR updates. I'm just not sure it would have net positive utility. 20:00
masak rakudo: multi foo(Any $x) { say "general" }; multi foo(Int $x) { say "specific"; nextwith("") }; foo(42) 20:09
p6eval rakudo c0b2e3: OUTPUT«specific␤general␤»
tadzik who wants to answer stackoverflow.com/questions/8056404...-in-perl-6 ? 20:27
masak no, it's not possible. some unknown force prevents us from implementing Lisp in Perl 6. ;) 20:28
masak ah, person doesn't want to implement Lisp, but embed it. 20:29
colomon masak: it's not unknown -- Perl 6 simply isn't Turing-complete. ;) 20:30
either that or it just doesn't support enough parentheses. 20:31
dalek odel: 9cd77d6 | diakopter++ | lua/runtime/Runtime/MultiDispatch/DispatchCache.lua:
off-by-one; jnthn++ for spotting
20:32
jnthn nom: say (((((((((((((((((((('oh hai'))))))))))))))))))))
p6eval nom c0b2e3: OUTPUT«oh hai␤»
moritz composes an answer 20:34
moritz answer composed. 20:43
dalek odel: b1a90ab | jnthn++ | dotnet/runtime/Metamodel/KnowHOW/KnowHOWBootstrapper.cs:
Get KnowHOWs to publish a method cache. ~9% performance improvement in 'loop up to 10 million' benchmark.
20:50
masak moritz++ 20:51
dalek odel: f7dcbc2 | diakopter++ | lua/runtime/Metamodel/KnowHOW/KnowHOWBootstrapper.lua:
Get KnowHOWs to publish a method cache. ~25% performance improvement in 'loop up to 1 thousand' benchmark. jnthn++
21:01
odel: 90de12b | diakopter++ | dotnet/runtime/Metamodel/KnowHOW/KnowHOWBootstrapper.cs:
Merge branch 'master' of github.com:diakopter/6model
moritz gist.github.com/1349237 <-- first shot at mp_int -> double conversion 21:09
colomon, jnthn: ^^
put in libtommath, and compile with gcc -I. -lm -o double mp_get_double.c *.o 21:11
*put it into the libtommath dir
colomon Ah, so you take the top two DIGITs? clever way of avoiding worrying about the shifting. 21:13
moritz yes :-)
I figured it was easier not to do off-by-one errors that way :-)
though I guess the double use of pow() might be costly
colomon maybe I'm being dense, but I don't get the d *= pow(2.0, DIGIT_BIT * i); bit
what is DIGIT_BIT? 21:14
jnthn that gets the exponent right, iiuc?
colomon oh, number of bits in a digit.
moritz number of bits in a DIGIT
colomon okay, I do get it.
moritz jnthn: exactly
colomon i is the number of digits left, right?
moritz yes
colomon I would hope that pow(2.0, whatever) would be blazingly fast. but I might be wrong about that. 21:15
moritz I just noticed that we probably need the other way round too :(
[Coke] does diakopter's work on 6model mean rakudo is running on lua? 21:17
(or just nqp? or just 6model?)
moritz -> sleep
masak 'night, moritz. dream of avoided off-by-one errors. 21:18
moritz avoids accidental complexity... unless by accident
jnthn [Coke]: It means some of nqp and 6model is now running on lua :) 21:19
[Coke]: So, first step in getting Rakudo there.
moritz note that rakudo has still quite some parrot specific code
jnthn aye 21:20
moritz for example all the exceptions stuff
and I guess lexicals too
jnthn Yeah, and the ops and multi-dispatcher
I just tend to expect those bits to need porting per platform.
Multi-dispatch and binding are too performance sensitive to try and put abstraction layers in the way.
moritz -> really sleep 21:25
masak -> sleep
[Coke] in any case, diakopter++ ! 21:33
[Coke] ponders doing similar JVM work.
jnthn [Coke]: mberends++ did a bunch of that already
[Coke] yay. 21:34
dalek p/bigint: 2395763 | jnthn++ | src/6model/reprs/P6opaque. (2 files):
Implement get_boxed_ref in P6opaque.
21:36
p/bigint: d6c0f7b | jnthn++ | src/ops/nqp_bigint.ops:
Make bigint ops also capable of working when we have a bigint flattened into another type, such as will be the case with Perl 6's Int.
p/bigint: 39c6bcd | jnthn++ | t/nqp/60-bigint.t:
Tests for the flattened in bigint case.
dalek kudo/nom: 1985138 | jnthn++ | src/binder/bind.c:
Fix :U/:D and junction interaction.
21:50
dalek odel: ea903a6 | diakopter++ | lua/ (2 files):
optimize try/catch/finally some; 40% overall speedup.
22:15
donaldh Is anyone hacking on a JVM implementation of Perl6 ? 22:18
dalek kudo/bigint: d2d14a2 | jnthn++ | src/Perl6/SymbolTable.pm:
Load nqp_bigint ops, ensure they get set up.
22:19
kudo/bigint: dd61d0e | jnthn++ | src/binder/sixmodelobject.h:
Bump to latest 6model API.
kudo/bigint: 88d4129 | jnthn++ | src/Perl6/Metamodel/BOOTSTRAP.pm:
Switch Int to use bigint. Note that we didn't switch to any of the bigint ops yet, though since bigint knows how to box/unbox native ints, we largely get away with it. New failures are confined to tests that have some clear relation to numerics, and even then the fallout doesn't immediately seem too bad.
jnthn phenny: tell moritz I created the bigint branch in Rakudo. It needs the bigint branch of NQP installed. It's ready to start switching to use the new ops and triaging. 22:20
phenny jnthn: I'll pass that on when moritz is around.
colomon jnthn: is that to use bigint exclusively, or only if you overflow int64? 22:21
well, int?
donaldh I've found 6model/java which looks untouched since the start of the year.
jnthn colomon: Int is always using P6bigint
colomon: Which for now always delegates to libtommath
colomon: We can do some other upgrade semantics later if needed.
colomon: int is always native (CPU) integer. 22:22
colomon jnthn: understood 22:22
donaldh I'm interested in contributing to a Java Perl6 project. 22:23
jnthn donaldh: Yeah, it got to the point of passing some of the nqp test suite.
donaldh jnthn: is it a good place to start then? 22:24
jnthn donaldh: It means not starting from scratch, and it's 6model based (if a little behind) so it's on the right path in that sense. 22:25
donaldh: It works in terms of generating Java code, just for prototyping purposes 22:26
donaldh jnthn: Yes, I've managed to figure out that 6model is where it's at!
jnthn donaldh: IIRC, it stalled because Java has no goto ;)
donaldh: So next was trying to get code gen to just emit either JASM as a stepping stone to bytecode.
Or bytecode itself
Probably the first is easier 22:27
donaldh: All of (nqpjava, nqplua, nqpclr) are relatively closely related.
donaldh I see.
jnthn The idea is to achieve convergence between them and the nqp that runs on Parrot. 22:28
donaldh what's the relationship between 6model (the git repo) and nqp (the git repo) ?
jnthn Actually nqpclr was there 6model was first explored/prototyped/designed
donaldh: 6model repo is more for prototyping and exploration.
donaldh: Eventually the various NQP backends, with their implementations of 6model core, should end up in the nqp repo. 22:29
jnthn donaldh: But I'm not totally sure how that should look yet, so it's just been easier to explore in another repo. 22:29
donaldh Okay, so if I want to hack on this then I should start with 6model/java 22:30
jnthn Yes
diakopter jnthn: reimplementing try/catch/finally got a 75% speedup 22:38
jnthn diakopter: whoa. Guess it was quite a bottleneck. 22:39
dalek odel: c14bd69 | diakopter++ | lua/ (2 files):
reimplement try/catch/finally entirely.
22:40
jnthn diakopter: yeah, feels faster 22:48
jnthn tries to quantify it
nom: say 27.48 / 327.3 22:52
p6eval nom 198513: OUTPUT«0.0839596700274977␤»
jnthn diakopter: ^ is nqpclr vs nqplua now
(for the benchmark up to 10 million)
diakopter better
jnthn yeah 22:53
fwiw, today's Rakudo cranks through it in 46.37s 22:55
Though it has the benefit of an optimizer and the most carefully tuned 6model implementation so far.
Plus a decent boolification protocol
Give nqpclr those and it probably gains a bit. 22:56
tadzik wut, only 2 times slower than clr?
jnthn tadzik: Only 2 times slower than nqpclr
tadzik yeah, that's what I meant 22:57
jnthn But yeah
It shows how far Rakudo has come
That difference used to be epic.
tadzik mlkshk.com/r/6AE0
jnthn :)
ok, rest time...$onsite-dayjob tomorrow 23:03
dalek odel: 3997d21 | diakopter++ | lua/ (3 files):
cleanup
japhb gjb6809e 23:10