»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend! | feather will shut down permanently on 2015-03-31 Set by jnthn on 28 February 2015. |
|||
00:06
larion left
00:12
virtualsue left
|
|||
J-L | I'm gonna log off now. Thanks for all your help! | 00:18 | |
timotimo | you're welcome :) | ||
00:18
J-L left
00:24
laouji joined
00:39
laouji left
00:40
laouji joined
00:43
tinyblak joined
00:44
laouji left
00:46
cognominal left,
coffee` joined
00:47
dayangkun joined
00:48
laouji joined
|
|||
ugexe | is it possible for test reports to replace /home/user with ~,%home%, or something? or is that information important to have? | 00:53 | |
00:54
mrf left
|
|||
TimToady | m: my grammar G { regex foo { } } | 00:56 | |
camelia | rakudo-moar 2f7d46: OUTPUT«5===SORRY!5===Null regex not allowedat /tmp/VT0JrJKePO:1------> 3my grammar G { regex foo {7⏏5 } }Unrecognized regex metacharacter (must be quoted to match literally)at /tmp/VT0JrJKePO:1------> 3my grammar G { regex foo {7…» | ||
TimToady | somewhere there's a try that's collecting the first typed_panic and inadvertently making it continue parsing | 00:57 | |
00:58
adu left
01:04
laouji left
01:07
laouji joined
01:08
Ben_Goldberg left,
Ben_Goldberg joined
|
|||
dalek | kudo/nom: 1d21058 | TimToady++ | src/Perl6/World.nqp: only move the eject, not the actual cursor, duh |
01:12 | |
kudo/nom: c8b81a3 | TimToady++ | src/Perl6/ (3 files): [minor] fix tab damage |
|||
TimToady | that fixes the exceptions test | 01:13 | |
01:15
adu joined
01:54
dayangkun left
02:01
DrForr_ left
02:03
diana_olhovik_ left
02:15
coffee` left
02:16
Vlavv left
02:29
Vlavv joined
03:14
laouji_ joined
03:18
laouji_ left
03:20
simcop2387 left
03:29
noganex joined
03:32
noganex_ left
03:49
laouji left
03:50
laouji joined
03:54
laouji left
04:02
FROGGS__ joined
04:05
FROGGS_ left
04:16
anaeem1 joined
04:43
laouji joined
04:53
Ben_Goldberg left
05:27
diana_olhovik_ joined
05:52
KCL_ joined
|
|||
dalek | pan style="color: #395be5">perl6-examples: cefd99f | paultcochrane++ | categories/shootout/k-nucleotide.p6.pl: [shootout] convert hard tabs into spaces |
06:02 | |
perl6-examples: 06a92fc | paultcochrane++ | categories/shootout/k-nucleotide.p6.pl: | |||
perl6-examples: [shootout] add initial docs about k-nucleotide example | |||
06:02
dalek left,
dalek joined,
ChanServ sets mode: +v dalek
|
|||
dalek | ecs: 512a0b7 | TimToady++ | S02-bits.pod: typo |
06:07 | |
06:14
diana_olhovik_ left,
adu left
06:15
atweiden joined
06:28
dalek left,
dalek joined,
ChanServ sets mode: +v dalek
06:51
laouji_ joined
06:54
anaeem1 left
06:56
laouji_ left
|
|||
[Tux] | Inline::Perl5 still incredibly slow compared to two days ago | 07:07 | |
07:11
gfldex joined
07:12
telex left
07:13
tinyblak_ joined,
diana_olhovik joined
07:14
telex joined,
Rounin joined
07:16
tinyblak left
07:20
anaeem1_ joined
07:27
gfldex left
07:30
wicope joined
07:43
atweiden left
07:44
MadcapJake left
07:46
zby_home joined,
zby_home left
07:57
raiph left
07:58
[particle]1 joined,
Ven joined
08:00
Foxcool joined,
[particle] left
08:02
Ven left
08:03
prime left
08:05
prime joined,
oetiker_ joined
08:06
oetiker_ left,
oetiker left,
oetiker joined
08:08
salva left
08:11
[Sno] left
08:12
Ven joined
|
|||
Ven | o/,#perl6 | 08:12 | |
08:12
darutoko joined
08:15
eli-se joined
|
|||
eli-se | hi | 08:15 | |
moritz | \o | 08:16 | |
nwc10 | good *, * | 08:26 | |
moritz | * *, nwc10 | 08:27 | |
=== SORRY ===\nTwo stars in a row | |||
nwc10 | is that why there is a compiler release between each star release? :-) | 08:28 | |
moritz | aye :-) | ||
08:33
salva joined
08:40
eli-se left
|
|||
masak | good morning, #perl6 | 08:42 | |
Ven | \o, masak | 08:43 | |
masak | m: * * * # three stars in a row! | ||
camelia | ( no output ) | ||
08:45
zakharyas joined
|
|||
nwc10 | $ perl -le 'print ******' | 08:45 | |
1 | |||
even I'm not sure how many of the things that cause that behaviour would be considered to be special cases. | 08:46 | ||
Ven | at first this was p6 and I was wondering "what". but it's perl5 and I'm even more puzzled.. | 08:47 | |
nwc10 | it's treated as ** ** ** | ||
first and last ** pairs are typeglobs | 08:48 | ||
m: 0 ** 0 | |||
camelia | ( no output ) | ||
nwc10 | m: say 0 ** 0 | ||
camelia | rakudo-moar c8b81a: OUTPUT«1» | ||
nwc10 | and undefined typeglobs end up being treated as the number 0 | ||
$ perl -wle 'print ******' | |||
Argument "*main::*" isn't numeric in exponentiation (**) at -e line 1. | |||
1 | |||
and 0 ** 0 is 1, obviously. :-) | |||
08:50
zakharyas1 joined
08:52
kjs_ joined
|
|||
masak .oO( did you mean "0 ** 0 is 1, not-so-obviously"? ) :P | 08:53 | ||
08:53
zakharyas1 left
08:54
mohij joined
|
|||
nwc10 | I *thought* that it was special-cased in the C code, but it doesn't seem to be. | 08:54 | |
masak | well, it *is* the agreed-upon default in mathematics. | ||
at least in the cases where people don't say "it doesn't have a limit in that point" | |||
nwc10 | aye, I have learned this | ||
08:54
zakharyas1 joined
|
|||
nwc10 | (the first bit, not the second bit) | 08:54 | |
but it can mean that you need to special case your implementation to get it to behave | 08:55 | ||
much like 2**31 wasn't the *right* integer on Irix, without some cheating | |||
masak | nwc10: think of how x ** 0 and 0 ** x behave as x tends to 0. the first tends to 1, the second tends to 0. | 08:56 | |
nwc10 | maths is hard - can we write Perl 6 instead please? :-) | ||
masak | nwc10: OTOH, if you look at things like the binomial theorem, it makes sense to special-case 0 ** 0 as 1. | 08:57 | |
nwc10 | yes, I'd sort of realised that "it makes sense, oh wait, 0 * 0 * 0 is 0, 0 * 0 is 0, etc" | ||
I didn't know about the binomail theorum | |||
nor do I know *why/how* the factorial function can be well defined for all numbers other than negative integers. But IIRC I've read that it can, and failed to understand the details. | 08:58 | ||
09:02
smls joined
|
|||
smls | FROGGS++ # NativeCall documentation | 09:02 | |
yoleaux | 4 Mar 2015 17:27Z <moritz> smls: ideally on both, and ideally automatically inserted in one place | ||
09:03
kaare_ left,
kaare_ joined
|
|||
smls | FROGGS__: though half-way down the page, it suddenly starts refering to "Zavolaj" without introducing the name to users first | 09:04 | |
masak | nwc10: mostly you have to realize that the unit of multiplication is 1. so if you multiply an empty list of stuff, you get 1. | ||
smls | Should we edit out all mentions of "Zavolaj" and consistently call it "NativeCall | ||
? | |||
09:05
[Sno] joined
09:11
donaldh joined
|
|||
moritz | aye | 09:12 | |
09:16
mohij left
|
|||
dalek | c: 400e3b2 | smls++ | lib/Language/nativecall.pod: say "NativeCall" instead of "Zavolaj"; use slightly prettier ".new;" instead of ".new();" |
09:18 | |
09:19
zakharyas1 left
09:20
espadrine left
09:23
kjs_ left
09:31
rindolf joined
|
|||
jnthn | morning o/ | 09:36 | |
timotimo | heyo jnthn :) | ||
nwc10 | morning jnthn | ||
nwc10 is feeling more pleased by the state of portability. | 09:37 | ||
jnthn | :) | 09:38 | |
timotimo | i'm pretty impressed we're getting this amount of portability | ||
nwc10 | we need it | ||
timotimo | sure | ||
the hardest thing to port to is still windows, isn't it? :P | 09:39 | ||
nwc10 | well, we're blocking on at least libuv for VMS. | ||
timotimo | is VMS still alive? i think i've only ever heard VMS used as a joke | 09:40 | |
but i may have confused it with something else | |||
nwc10 | yes, VMS is still alive. | ||
timotimo | i should investigate that for a tiny bit | ||
nwc10 | sadly the VMS machines I have (or had, not checked recently) only had Java 6 | ||
09:40
virtualsue joined
|
|||
nwc10 | MVS is also alive. And frustratingly still EBCDIC | 09:40 | |
timotimo | en.wikipedia.org/wiki/OpenVMS - is this a good place to start looking at this? | 09:41 | |
nwc10 | probably | ||
I don't think that "VMS" is anything like a priority | |||
things like AIX and HP/UX, which libuv (almost) supports probably should be. If anyone wants to do them | |||
although "run on the JVM" is an option too | 09:42 | ||
timotimo | fair enough i guess? | ||
masak | nwc10: it seems that the Gamma function "extends factorial in a natural way" from positive integers to complex numbers, and that's its claim to fame. the rest is details. :) | 09:43 | |
09:44
laouji_ joined
|
|||
timotimo | once we have more of the recent moarvm optimizations ported to the jvm, i expect the jvm's jit will be able to do crazy things | 09:44 | |
09:45
fhelmberger joined,
brrt joined
|
|||
brrt | \o | 09:45 | |
timotimo | ohai brrt! | ||
nwc10 | o/ | ||
brrt | ohai timotimo | ||
nwc10, has your patch been applied yet? | 09:46 | ||
the ppc32 patch | |||
and ohai nwc10 :-) | |||
nwc10 | I believe so but I think that any local checkout you have can be used to verify this. | ||
09:46
laouji left
|
|||
nwc10 | mine might be confused because they already have it | 09:46 | |
arnsholt | masak: And it's quite useful in stats/probability | 09:48 | |
Distributions generalised from discrete to continuous tend to need something along those lines | |||
masak | arnsholt: oh, interesting. | 09:49 | |
09:53
tinyblak_ left
09:58
FROGGS__ is now known as FROGGS
|
|||
FROGGS | morning | 09:58 | |
smls++ # seems I have missed some "zavolaj"'s :o) | 09:59 | ||
brrt | yes, it can has been applied | 10:02 | |
nwc10 | ah OK good. thanks :-) | 10:03 | |
10:06
espadrine joined
10:07
DrForr joined
10:10
donaldh left
|
|||
nine_ | Where do tests for Test.pm live? | 10:15 | |
FROGGS | tests? | 10:16 | |
there are none | |||
jnthn | t/01-sanity/99-test-basic.t may count :) | ||
moritz | nine_: we don't have any, cause Test.pm isn't very testable right now | ||
10:18
pecastro joined
|
|||
FROGGS | m: my role TypedPointer[::TValue] { method ^name($obj) { 'Pointer[' ~ TValue.^name ~ ']' } }; # jnthn: didn't you fix that? | 10:20 | |
camelia | rakudo-moar c8b81a: OUTPUT«Potential difficulties: Useless declaration of a has-scoped method in multi (did you mean 'my method name'?) at /tmp/Zng4o6377F:1 ------> 3my role TypedPointer[::TValue] { method7⏏5 ^name($obj) { 'Pointer[' ~ TValue.^name» | ||
10:20
pecastro left
10:24
tinyblak joined
10:26
firefish5000 joined
10:27
Ven left
|
|||
FROGGS | m: sub foo is DEPRECATED('blarg') { 42 }; say foo | 10:31 | |
camelia | rakudo-moar c8b81a: OUTPUT«42» | ||
FROGGS | isnt that supposed to print deprecation messages? | ||
10:32
pecastro joined,
pecastro left
10:33
pecastro joined
|
|||
nine_ | Any opinions on this? github.com/rakudo/rakudo/pull/381 | 10:34 | |
dalek | kudo/nom: bd0804f | (Stefan Seifert)++ | lib/Test.pm: Better diagnostics in Test::is for strings differing only in whitespace If the expected value differs from the got value only by whitespace at the end of a line, it's very hard to find this difference. Using .perl for the diag output on the other hand makes it trivial to find whitespace differences. With this patch is("foo \nbar baz", "foo\nbar baz"); gives: expected: "foo\nbar baz" got: "foo \nbar baz" |
10:37 | |
kudo/nom: 8310181 | FROGGS++ | lib/Test.pm: Merge pull request #381 from niner/nom Better diagnostics in Test::is for strings differing only in whitespace |
|||
10:37
larion joined
|
|||
FROGGS | I've seen tester reports where expected and got looked identical | 10:37 | |
timotimo | aye | 10:38 | |
nine_ | Thanks :) | ||
FROGGS | nine_++ | ||
10:38
sqirrel_ joined
|
|||
nine_ | Now I only need to find out where my superfluous whitespace comes from ;) | 10:39 | |
dalek | c: 6bc83dd | smls++ | lib/Language/nativecall.pod: prefer lowe-case name for example sub; some minor formatting tweaks |
10:40 | |
10:42
kjs_ joined
|
|||
[Tux] | useful change indeed | 10:42 | |
10:47
rurban joined
10:52
zakharyas left
|
|||
timotimo | gist.github.com/anonymous/786c6ff3d25623d9f997 - does this seem sensible? i got fed up with my perl6-m script having "../install" in them. | 10:58 | |
jnthn | .oO( löwe-case ) |
11:01 | |
11:02
laouji_ left
|
|||
masak | Muphry's Law strikes again! | 11:04 | |
11:05
brrt left
11:08
kjs_ left
|
|||
dalek | Heuristic branch merge: pushed 173 commits to rakudo/cpp by FROGGS | 11:09 | |
11:10
zakharyas joined,
firefish5000 left
11:12
cognominal joined
|
|||
dalek | ast: c61b5ba | lizmat++ | S02-magicals/ (2 files): Unfudge now passing tests |
11:13 | |
lizmat | hmmm... seems like nine_ 's change to Test::is breaks some tests | 11:15 | |
No such method 'subst' for invocant of type 'MyMatch' | |||
in method dispatch:<hyper> at src/gen/m-CORE.setting:1397 | |||
in block at lib/Test.pm:137 | |||
No such method 'subst' for invocant of type 'Capture' | 11:16 | ||
No such method 'subst' for invocant of type 'Signature' | |||
maybe we need an Any.subst ? | 11:17 | ||
11:18
spider-mario joined
|
|||
nine_ | lizmat: sorry, would this be a fix? | 11:18 | |
- if [eq] ($got, $expected)>>.subst(/\s/, '', :g) { | |||
+ if [eq] ($got, $expected)>>.Str>>.subst(/\s/, '', :g) { | |||
lizmat | testing | ||
yeah, that seems to do the trick | 11:19 | ||
running full spectest to be sure | |||
dalek | kudo/nom: 9a95f18 | lizmat++ | lib/Test.pm: Fix tests on classes that don't do .subst, nine++ |
11:24 | |
11:28
colomon left
11:32
geekosaur left
11:35
sqirrel_ left
11:38
colomon joined
|
|||
masak | I find it odd that that fix was needed. | 11:38 | |
might be my understanding that's at fault, though. | |||
why is it needed? :) | |||
nine_ | masak: subst is a Str method, but $got and $expected are Mu? | ||
timotimo | Capture and Signature are not Cool | ||
well, subst is a Cool method | 11:39 | ||
11:39
Ven joined
|
|||
masak | right. | 11:39 | |
lizmat | and apparently any class Foo either | ||
masak | I still thing it's rather arbitrary what's Cool and what isn't. | ||
lizmat | masak: fwiw, it doesn't make much sense to me either | ||
masak | I know the original intent was to emulate p5's "forgiveness" in casting a small set of core types. | ||
but it shows up in these circumstances mostly as confusion as to what's Cool and what isn't. | 11:40 | ||
lizmat | but I guess I lack the original hysterical raisons | ||
masak .oO( Perl 6 core devs uncertain about what's Cool ) | |||
lizmat: the original hysterical raisins are what I just said. emulate p5's type forgiveness. | |||
nine_ | We clearly need more hippsters to tell us what's Cool | 11:41 | |
lizmat | (ok) | ||
I was discussing certain aspects of Perl 6 yesterday with Stevan Little | |||
masak | like, .subst is clearly a Str operation, but you can also do it on an Int, or an Array. | ||
nine_: and the coolsterst to tell us what's Hip. | |||
jnthn | Key examples: Str, Int, Num, Parcel, List (so Array), EnumMap (so Hash), and Bool | 11:42 | |
nine_ | masak: and "coolster" is actually defined in the urban dictionary... | ||
masak | nine_: and "hip" is actually defined in Grey's Anatomy. | ||
jnthn | Not to be confused with 50 Shades of Grey | 11:43 | |
lizmat | (Stevan Little) apart from the usual suspects that people trying Perl 6 run into at the moment | ||
masak .oO( 50 shades of grey's anatomy ) | |||
jnthn | :D | ||
lizmat | he mentioned on thing that I hadn't heard about before / didn't see mention before | ||
suppose we have 2 modules with the same name loaded at the same time | 11:44 | ||
but with different auth / version | |||
jnthn | For me, the guideline on Cool is something like "built in, value type, has sane ways to view it as a Int, Num, or Str" | ||
Uh, s/value type// | |||
:) | |||
masak | :) | 11:45 | |
lizmat | if both modules create an object, how can we smartmatch them apart ? | ||
masak | s/value type/type/ :P | ||
lizmat: ooh | |||
lizmat: interesting | |||
lizmat: and do we always want them to be different? | |||
jnthn | lizmat: With the full name | ||
masak | nice. | ||
jnthn | lizmat: And note that in a given scope, the short name can only ever be talking about *one* of them. | ||
lizmat | yeah, but if they produce an object that is used *outside* of the scope it was created in ? | 11:46 | |
jnthn | Then it's two different types | ||
masak | ok, so objects simply won't smartmatch across auth/versions? | 11:47 | |
lizmat | sub a { use Foo:auth<one>; Foo.new }; sub b { use Foo:auth<two>; Foo.new }; say a ~~ b # what would this say ? | ||
jnthn | masak: I don't see how they sanely can. | ||
masak | oki | ||
lizmat | jnthn: so my code example would say "false" ? | 11:48 | |
11:48
yves left
|
|||
jnthn | lizmat: Well, there you have two instances | 11:48 | |
lizmat | yup | ||
jnthn | lizmat: Remove the ".new", and we get the question you probably meant to ask? | ||
Because | |||
m: class A { }; say A.new ~~ A.new | |||
camelia | rakudo-moar 9a95f1: OUTPUT«False» | ||
jnthn | :) | ||
m: class A { }; say A ~~ A | 11:49 | ||
camelia | rakudo-moar 9a95f1: OUTPUT«True» | ||
lizmat | say a.WHAT eq b.WHAT then | ||
ok | |||
jnthn | a.WHAT ~~ b.WHAT will be False | ||
eq will give you two warnings about undefined instances, and True :) | |||
m: class A { }; say (~A).perl | 11:50 | ||
camelia | rakudo-moar 9a95f1: OUTPUT«use of uninitialized value of type A in string context in block <unit> at /tmp/lhfzZGSIOE:1""» | ||
jnthn | But yeah, I really don't think we can sanely start considering them the same type | ||
lizmat | his example was really: so, I have to versions of this module loaded, | ||
11:50
rubio joined
|
|||
jnthn | I see the use case for different versions as when you want to use two things that *depend* on a different version of it | 11:50 | |
lizmat | how can I use MMD to create subs that will match objects from one or the other | ||
sub bar(Foo... and then? | 11:51 | ||
jnthn | And provided it's a black box dependency, you're fine | ||
lizmat: One candidate that will match objects of both versions, or? | |||
lizmat | no, two candidates that will match the different versions of the modules | 11:52 | |
*module | |||
multi old(Foo for version 1.0); multi new(Foo for version 2.0) | |||
jnthn | lizmat: If you mean MMD to distinguish them then I guess multi m(Foo:ver<1.2>:auth<lizmat>) { } and multi m(Foo:ver<1.2>:auth<jnthn>) { } | ||
lizmat | ok, so that's the plan, or did we just make that up? :-) | 11:53 | |
jnthn | I thought that was the plan all along? | ||
lizmat | well, there's a catch there | ||
jnthn | That importing a versioned thing imports the full name *and* the short name. | ||
lizmat | auth and version are about *compilation units* | ||
types are about classes inside those compilation units | 11:54 | ||
ok, anything exported will be both short and long name | |||
and the long name will be taken from the compilation unit info | |||
11:55
kjs_ joined
|
|||
jnthn | I think we can quite reasonably say that if you declare an auth/version for the compilation unit then it's applied to the things inside that unit. | 11:55 | |
We may want, with short names, to take the same poisoning model we have with enum values | 11:56 | ||
lizmat | ?? | ||
timotimo | m: enum Foo < Hello Goodbye >; enum Bar < Hello Byebye >; say Hello; | 11:57 | |
camelia | rakudo-moar 9a95f1: OUTPUT«Potential difficulties: Redeclaration of symbol Hello at /tmp/Oow68RNpJT:1 ------> 3llo Goodbye >; enum Bar < Hello Byebye >7⏏5; say Hello;Cannot use poisoned alias Hello, because it was declared by several enums.Please access…» | ||
dalek | kudo/nom: 9c66311 | lizmat++ | src/core/ (3 files): Better checks for being on Win |
||
timotimo | m: enum Foo < Hello Goodbye >; enum Bar < Hello Byebye >; say Foo::Hello; | ||
camelia | rakudo-moar 9a95f1: OUTPUT«Potential difficulties: Redeclaration of symbol Hello at /tmp/PErwBXfr4z:1 ------> 3llo Goodbye >; enum Bar < Hello Byebye >7⏏5; say Foo::Hello;Hello» | ||
timotimo | lizmat: ^ | ||
lizmat | ok :-) | 11:58 | |
jnthn: of course, we may want to actually match a range of versions | |||
so maybe a "where" model might be better ? | |||
jnthn | lizmat: For 6.0.0, I think we say that type names are non-fuzzy. | ||
lizmat | ok, I can live with that :-) | 11:59 | |
jnthn | lizmat: I would like to hope that actual cases where we'll have people mixing two versions in the same compilation unit will be relatively rare. | ||
lizmat | well, it could be a module that post-processes info from another module | 12:00 | |
that needs to be able to handle API changes in that other module | |||
so it may be less rare than you think | |||
I mean, we have many modules that build on other modules ;_) | |||
dalek | Heuristic branch merge: pushed 45 commits to perl6-examples by paultcochrane | ||
timotimo | there could be a pattern of a "versioning adaptor module" that'd handle two versions of the same module and interactions between them? | 12:01 | |
like a "migration module"? | |||
[ptc] | all examples now run in perl6-examples | ||
much more cleanup required... | |||
lizmat | timotimo: yes, that is one example | ||
jnthn | lizmat: That sounds odd, in so far as the module that uses theother one could say what version it wants | ||
I also note that if you are writing programs that mash up different modules, you generally want to prefer dynamic typing | 12:02 | ||
lizmat | that feels very rigid from a toolchain point of view | ||
timotimo | [ptc]: excellent work! | ||
lizmat | my idea to fix this was a bit different, though | 12:03 | |
when a distribution is installed, all of the meta info should be available as well | |||
12:03
kjs_ left
|
|||
[ptc] | timotimo: thanks :-) | 12:03 | |
lizmat | I was more thinking along a .WHERE macro/method | 12:04 | |
that would work like .HOW, but give you access to the distribution info of the compunit | |||
and smart matching would then become something like | |||
multi a(Foo where *.WHERE.auth eq 'jnthn') | 12:05 | ||
jnthn | I don't see how that can work | ||
Foo can't be bound to two things | |||
It'd need to be something more syntactic that does a query over things starting with Foo that are in scope... | 12:06 | ||
lizmat | hmmm... | 12:07 | |
jnthn | I'd urge starting simple and discovering actual pain points when we start to play with it, though. | 12:09 | |
lizmat | agree | ||
ok, let's leave it at this for now | |||
and get back to SMOP | |||
jnthn | We might be able to find a way to use something like "Foo:ver<1.*>:auth<*>" as a type query, for example. | 12:10 | |
lizmat | that feels like inventing a new syntax while we have "where" already with all its flexibility | ||
jnthn | But I'd start with the easy, precise match, thing | ||
lizmat | agree.. :-) | 12:11 | |
jnthn | Yeah, but that supposes that we somehow arrange for every version of a type to match the type's shortname, and I don't know we can reasonably make that happen. | ||
(Not saying it's impossible, just that it's not obvious to me) | 12:12 | ||
lizmat | ok | ||
dalek | ecs: c3cee44 | lizmat++ | S99-glossary.pod: Add SMOP lemma |
12:14 | |
Heuristic branch merge: pushed 19 commits to specs/newio by lizmat | 12:15 | ||
nine_ | lizmat++ # answering my quesion before I even asked it! | 12:16 | |
12:27
skids left
|
|||
dalek | Heuristic branch merge: pushed 28 commits to rakudo/newio by lizmat | 12:29 | |
lizmat | afk for a bit& | 12:30 | |
12:31
abraxxa left
12:40
Ven left
12:50
anaeem1_ left
13:01
kjs_ joined
13:04
Ven joined
13:14
kjs_ left
|
|||
smls | What's this I hear about an "array" type (lower-case "a")? | 13:17 | |
13:17
kjs_ joined,
rubio left
|
|||
timotimo | native arrays? | 13:18 | |
masak | though I don't know that they're spelled "array". | ||
smls | seen here: irclog.perlgeek.de/perl6/2015-03-05#i_10231390 | ||
timotimo | me neither | ||
masak | (maybe they are and I haven't been paying attention. but I don't think so.) | ||
sjn | \o | ||
Question: who's manaaging the content on rka^H^Hakudo.org? | 13:19 | ||
masak | smls: ...huh. | ||
smls: so maybe yes, then. | |||
timotimo | looks like it's just a shortcut for how to refer to native arrays until something is decided on | ||
smls | Does this mean Array will not gain native-compact storage directly? | ||
masak .oO( rKAAKudo: Rakudo, but for Parrots ) | |||
smls | s/gain/gain support for/ | 13:20 | |
timotimo | no clue | ||
13:20
brrt joined
|
|||
nine_ | It would seem like native arrays and Arrays are quite different. The latter supporting lazyness for example | 13:21 | |
timotimo | i thought List does lazy, does Array do it, too? | ||
.o( what the fuck do i know about perl6? ) | |||
smls | yep, Array does it too | 13:22 | |
masak | Perl 6 is weird. | ||
13:23
geekosaur joined,
geekosaur left
|
|||
nine_ | Perl 6 just has too many features. Let's scrap it and start Perl 7. I'd suggest starting with a touring machine and removing everything non-essential. | 13:23 | |
13:24
geekosaur joined
|
|||
smls | I think TimToady once explained that he thinks Array supporting laziness is worth it because it lets us assign some lazy lists to @ variables without having to use binding | 13:24 | |
13:24
coffee` joined
|
|||
osfameron | one of these maybe? www.evanscycles.com/categories/bike...ring-bikes | 13:24 | |
timotimo | turing machine! | ||
nine_ | timotimo: see! You already removed the non-essential 'o'. The process works! | ||
smls | Though I'm not very convinced of that benefit, as it does work with all lazy lists anyway | 13:25 | |
timotimo | <3 | ||
smls | *does not | ||
brrt | there is also another way to do that | ||
which would be to replace the (eager) array with a proxy referencing the array and the lazy list | |||
smls | If native array support does get added to the Array type after all, I wonder if IntLexRef shouldn't also be merged with Scalar | 13:26 | |
sjn is at a cafe, enjoying a 4-3 minute lag on his ssh connection | 13:28 | ||
anyhoo, rakudo.org content... | 13:29 | ||
masak .oO( a universal touring machine is a machine that can give any other machine a free tour ) | |||
smls | Currently, my Foo $a makes a Scalar container which can hold objects of type Foo, and my Foo @a makes an Array container which can hold objects of type Foo. | ||
Native types seems to break that rule... | |||
moritz | yes, they avoid the container entirely | 13:31 | |
at least for scalars | |||
smls | well... | ||
IntLexRef is kinda a container | |||
also implementation wise, they all store pointers rather than the actual values, if I understand correctly | 13:32 | ||
m: my num $i = 1.0; # on a related note... | 13:33 | ||
camelia | rakudo-moar 9c6631: OUTPUT«This type cannot unbox to a native number in block <unit> at /tmp/x69TI3h4Ai:1» | ||
smls | LTA error message | ||
should probably say "floating-point number" instead of "number" | |||
moritz | or "num" | 13:35 | |
smls | yep | ||
jnthn | my int @a; # will actully bind an array[int], which is non-lazy, to @a | 13:36 | |
my Int @a; # a (potentially lazy) Array[Int] | |||
Anything behind .VAR.WHAT on natives is, for now, implementation defined. | 13:37 | ||
No, the native ref types are not getting unified with Scalar, that ruins all type-driven optimization. | |||
13:38
anaeem1_ joined
|
|||
smls | fair enough; I'll refrain from naughtily peeking behing .VAR | 13:42 | |
jnthn | Well, if you're interested in how it works, that's fine. Relying on what's behind it in your code, less fine. But it's *very* rare for code to explicitly mention Scalar by name. :) | 13:43 | |
(So by extension I very much doubt there will be used cases for mentioning the native ref types by name) | 13:44 | ||
smls | but "Scalar" is officially specced, right? | 13:46 | |
jnthn | Yes, that one is | ||
As is Proxy | |||
smls | Proxy is what array subscripts return for nonexistent elements? | 13:47 | |
jnthn | No, that's a Scalar also | ||
A Scalar, at present, can have code attached saying "run this when first assigned to" | |||
Which is how auto-viv is typically done | 13:48 | ||
jnthn wouldn't find re-visiting that detail at some point... | |||
smls | What about rw class attributes, do they use Proxy? | ||
jnthn | *mind | ||
For object attributes, no | |||
13:49
anaeem1_ left
|
|||
jnthn | They don't need to, since thre's already a container | 13:49 | |
smls | ah, it's only when u want to emulate them with a method | ||
jnthn | For native ones, it's a native ref | ||
13:49
anaeem1 joined
|
|||
jnthn | Though I expect rw accessors for native things to get inlined, and the ref taking optimized away as a result | 13:49 | |
The native refs design is a careful balance of "make them behave like first-class l-values and not be too surprising in untyped code" along with "enable a dynamic optimizer to get rid of them" | 13:50 | ||
smls | makes sense (if it works out well) | 13:51 | |
jnthn | So far I'm fairly happy with how the first part is shaping up, and need to write more code to prove the second part can work as well as intended. | 13:52 | |
btw, agree on tweaking the error wording on the num assignment thing | |||
13:53
KCL joined
13:54
anaeem1 left
13:56
KCL_ left
14:00
anaeem1 joined
14:01
diana_olhovik left,
salv0 left
14:02
anaeem1 left
|
|||
Ulti | I'm not sure why having this little slang makes me so happy since I could just use the function seq("") as easily as `` but I just like that my class has a literal in the language :) | 14:04 | |
14:04
anaeem1 joined
|
|||
moritz | Ulti: tell that literal :-) | 14:04 | |
Ulti | I got my grammar to automatically detect DNA/RNA/AminoAcids now too so it constructs the correct subclass based on just the sequence data so has deep magic | 14:05 | |
I dont think its useful as a programmer but it makes being an investigative scientist playing with data really slick | 14:06 | ||
14:06
spider-mario left
14:09
MilkmanDan left,
MilkmanDan joined,
MilkmanDan left,
MilkmanDan joined,
anaeem1 left
14:11
spider-mario joined
14:12
tardisx left
14:13
MadcapJake joined
|
|||
jnthn | Ulti++ # literally awesome :) | 14:13 | |
14:15
anaeem1 joined
14:18
kjs_ left
|
|||
smls | Too bad it's not advent time; if it was we could now pressure Ulti into writing another very interesting bio/perl6 advent post ;) | 14:23 | |
lizmat | re irclog.perlgeek.de/perl6/2015-03-05#i_10229514 : the reason I implemented "is-win" was because the same logical check was done in many different (and sometimes incorrect) ways throughout the core and the spectest | 14:24 | |
jnthn | lizmat: +1 on us having it | 14:25 | |
lizmat | I have not seen a need anywhere for an "is-unix" or anything like that | ||
14:25
kjs_ joined
|
|||
smls | maybe if you want to check if you use 'fork'? | 14:25 | |
14:26
skids joined
|
|||
lizmat | m: try fork | 14:26 | |
camelia | rakudo-moar 9c6631: OUTPUT«5===SORRY!5=== Error while compiling /tmp/HVxywpR7jzUndeclared routine: fork used at line 1» | ||
lizmat | m: say $?TABSTOP; $?TABSTOP = 4; say $?TABSTOP # hardly a constant, is it :-) | 14:27 | |
camelia | rakudo-moar 9c6631: OUTPUT«84» | ||
lizmat | it appears Str.indent and Str.outdent are using that | ||
shouldn't that be $*TABSTOP really ? | 14:28 | ||
Ulti | smls I was planning on writing up a couple of blog posts, one on the optimiser changes in the last six months and how it's affected my code, and one about how "easy" it is to hack in your own syntax magic into Perl6 | 14:33 | |
14:33
cognominal left
|
|||
Ulti | though really I just stole tony-o's code and picked my part of the P6 grammar to target :) | 14:34 | |
did a "slang" keyword ever get made? because it feels like you could make something quite general | |||
tony-o++ | 14:38 | ||
out of interest is their an equivalent to wantarray in Perl6? | 14:40 | ||
Ven | no! | ||
Ulti | or will a single scalar being asigned to a @var just get treated as a single element list anyway | ||
Ven | can't have wantarray. (also, doesn't want to :P) | 14:41 | |
Ulti | because if so I will probably scalarafy single objects | ||
Ven | Ulti: as a single element list | ||
(I mean -- `my @foo = $scalar` will be a single-element list.AFAIK) | 14:42 | ||
14:43
FROGGS[mobile] joined,
anaeem1 left
|
|||
Ulti | the other way around is also true by the looks of it | 14:43 | |
14:44
anaeem1_ joined
|
|||
Ulti | though the repl can't handle multiline things :'( | 14:44 | |
ab5tract | jnthn: speaking of auto-viv, i was harping about `$x *= 5 == 5` the other day... | ||
Ulti | so I can't actually type my literal into there | ||
or paste it | |||
smls | There's no such thing as wantrarray in Perl 6, because context flows outwards and allowing it both ways would make multi-dispatch ambiguous | ||
I think | |||
14:44
anaeem1_ left
|
|||
smls | scalars tend to behave like single-element lists where approriate | 14:45 | |
lizmat | afk again | ||
14:45
anaeem1 joined
|
|||
ab5tract | moritz pointed out that this is by design, but it also smells a bit funny. hard to tell if that smell comes from perl-5-expectations, or what. but currently auto-viv feels a bit under-cooked. for instance, `$x /= 5` explodes | 14:46 | |
moritz would be fine with multi infix:</>() { 1 } | 14:47 | ||
smls | Ulti: If you want something to behave differently in different "contexts", you'll have to return an object which does that | 14:48 | |
jnthn | m: my $x /= 5; | ||
camelia | rakudo-moar 9c6631: OUTPUT«No zero-arg meaning for infix:</> in method Numeric at src/gen/m-CORE.setting:15182 in sub infix:</> at src/gen/m-CORE.setting:5208 in block <unit> at /tmp/2VCVfpe7M6:1» | ||
jnthn | That's not about auto-viv really, that's the same issue as | ||
m: say [/] () | |||
camelia | rakudo-moar 9c6631: OUTPUT«No zero-arg meaning for infix:</> in method gist at src/gen/m-CORE.setting:15184 in sub say at src/gen/m-CORE.setting:18007 in block <unit> at /tmp/H3GWJY5LHQ:1» | ||
Ulti | smls it's more I'd rather just return a list and if it only has one thing when assigning to a scalar not have the container | ||
jnthn | Which both work on the same mechanism. | ||
ab5tract | jnthn: it seems that the auto-viv of * and / are coming from the [$op] stuff | 14:49 | |
14:49
diana_olhovik joined
|
|||
jnthn | No, the semantics of the two are just defined in the same way (by the operator having 0 and 1 arg candidates) | 14:49 | |
ab5tract | right, that's what i understand. but it was an open question, at least for PerlJam and I, whether those should be tied together | ||
jnthn | And yes, it's intentional. | ||
ab5tract | jnthn: okay | ||
jnthn | (As in, the implementation intended to do it this way; it's not an accident.) | 14:50 | |
afaik, it matches what the design docs say too | |||
ab5tract | right, that part i was already assured of :) | ||
jnthn | It's a bit of a DWIM, which means it can have a bit of a WAT | ||
14:51
perl6_newbee joined
|
|||
ab5tract | right, the biggest WAT for me is lying under the surface: | 14:51 | |
m: my ($x, $c, $d); say [*] $x, $c, $d | |||
camelia | rakudo-moar 9c6631: OUTPUT«use of uninitialized value of type Any in numeric context in block <unit> at /tmp/3NiI3bceZH:1use of uninitialized value of type Any in numeric context in block <unit> at /tmp/3NiI3bceZH:1use of uninitialized value of type Any in numeric cont…» | ||
ab5tract | what is happening to auto-viv-to-1 here? | 14:52 | |
smls | there's no auto-viv happening there | ||
PerlJam | good $localtime all! | 14:53 | |
ab5tract | it _feels_ to me at least that it should produce the exact same as [*] with no args | ||
PerlJam | o/ | ||
jnthn | What smls said. Reduction and auto-viv are defined in terms of the same mechanism for getting a unit value | ||
smls | in Perl 5, too, using undef in numeric ops is a warning/error, while the pre/post-increment ops are special-cased to allow it | ||
ab5tract | smls: sure, i also understand that part. we did get into details before | ||
jnthn | Rather than both being cases of auto-viv. | ||
ab5tract | smls: not for all numeric ops | ||
jnthn | I think it's possible to argue for [*] doing what you're suggesting. | 14:54 | |
ab5tract | for instance, $x *= 5 will warn. $x += 5 will not (in perl 5) | ||
jnthn | I'm not sure if it makes things better or worse. :) | ||
ab5tract | jnthn: indeed. i'd like to clarify that my position is not that i have any clue what it _should_ do, only that what it currently _does_ feels weird and very corner-casey to me | 14:55 | |
14:55
spider-mario left,
spider-mario joined,
rmgk_ joined,
rmgk left,
rmgk_ is now known as rmgk
|
|||
ab5tract | i'd rather not have any auto-viv for numeric ops than have "0 if + or -, 1 if *, and explode if /" | 14:56 | |
or, at least, that's how exploring it makes me feel | 14:57 | ||
smls | maybe ++ should be the *only* numeric op that is allowed to operate on an undefined value; then it would be a neatly contained "exception to the rule" | ||
ab5tract | smls++ :) | ||
PerlJam | smls++ indeed. | ||
14:58
Rounin left
|
|||
ab5tract | and maybe arg-less [/] could return a NaN or so | 14:58 | |
or something not quite as LTA than what happens now | |||
masak | if I got to decide, arg-less [/] would be a *compile*-time error. | 14:59 | |
because it's clearly nonsensical, and if you write it in code, then you're confused. :) | |||
(though I guess that only goes for the static case) | |||
PerlJam | masak: perhaps ab5tract means "valueless" :) | ||
15:00
molaf joined
|
|||
masak | PerlJam: I think I got him in the right way. | 15:00 | |
PerlJam: same deal with `my $var /= $stuff;` | |||
perl6_newbee | Hello guys | 15:01 | |
PerlJam | perl6_newbee: greetings | ||
masak | perl6_newbee! \o/ | ||
ab5tract | masak: compile time error would be cool, and then it would die if it were triggered in run-time? sub half-thing { @_[0] /= 2 } | ||
perl6_newbee | :-) | ||
ab5tract | ? | ||
masak | perl6_newbee: how long are you planning to keep that nick? until you've read all the spec docs? :P | ||
perl6_newbee: will you tell us when you change the nick? | 15:02 | ||
perl6_newbee: or will you just stick with it forever, even when you're an undisputed Master of All Things Perl 6? | |||
perl6_newbee | lol I have the feeling I will be a perl newbee forever... | ||
masak | me too... :P | ||
FROGGS[mobile] | masak: what are spec docs? :p | ||
PerlJam | That's very zen in a way | ||
masak | FROGGS[mobile]: ahhh orz omg sorree | ||
FROGGS[mobile]: synopsoids | 15:03 | ||
FROGGS[mobile]: synopticals | |||
PerlJam | FROGGS[mobile]: if you're mobile, does that mean you are aging slower than the rest of us? | ||
15:03
kjs_ left
|
|||
perl6_newbee | hmm, masak, if I publish a Perl6 module I will change the nick, deal? | 15:03 | |
masak | perl6_newbee: deal. | ||
15:03
[Sno] left
|
|||
PerlJam | perl6_newbee: as long as you don't change it to perl6_guy_who_wrote_that_module ;) | 15:04 | |
masak .oO( perl6_newbee_now_with_a_module ) | |||
PerlJam: dang :) | |||
perl6_newbee | rofl | ||
PerlJam | great minds or something | ||
masak | perl6_newbee: stop being in my head :) | ||
er, PerlJam | |||
one of you guys need to change your nick, for tab completion reasons. | |||
PerlJam | clearly not me. | ||
perl6_newbee | hmm maybe something like still_perl6_newbee | ||
masak | the community demands it! | 15:05 | |
like me and moritz. one of us changed our nick ages ago... hm. seems we didn't. :P | |||
PerlJam | (I've been PerlJam for nigh on 20 years, I don't think I'm going to be able to adjust to a new nick :) | ||
masak | PerlJam: you've had it for long enough! time to change! :P | ||
PerlJam | old dogs, nick trick and all that | ||
er, new tricks | |||
heh | |||
masak .oO( old dogs, nwc10 trick ) | 15:06 | ||
perl6_newbee | Is tab completion a problem? | ||
masak | perl6_newbee: duh! | ||
:P | |||
PerlJam | Now I *know* I'm getting old. My mistyped "nick trick" is causing me fits | ||
ab5tract | so what do i do to raise this auto-viv-numeric-op-madness beyond dithering about it once a week on #perl6? | ||
15:06
pierrot left,
pierrot joined
|
|||
Ven | masak: I'm strongly convinced anything that we KNOW will fail at runtime should be a compile-time error :P. | 15:06 | |
perl6_newbee | \me scratches the head | 15:07 | |
PerlJam | ab5tract: IS there a ticket in RT? | ||
ab5tract | well, it's not a bug. everyone agrees it is operating as designed | ||
PerlJam | claim it as a bug anyway | ||
masak | Ven: me too. | ||
ab5tract | ok | 15:09 | |
PerlJam | Really, the only thing that bothers me is that we've drilled into people's heads since days of yore than $x *= $y is the same thing as $x = $x * $y. my $x *= 5 (and my $x /= 5); should behave exactly like the expanded version IMHO. | 15:10 | |
dalek | kudo-star-daily: 05e2b85 | coke++ | log/ (9 files): today (automated commit) |
15:13 | |
15:13
raiph joined
|
|||
perl6_newbee | do someone use Perl6 on WIndows? | 15:14 | |
15:14
KCL left
|
|||
PerlJam | perl6_newbee: aye. | 15:14 | |
perl6_newbee: in fact, I think that's jnthn's primary development environment | |||
perl6_newbee | cool. Do you have a problem if write strings into an file | 15:15 | |
15:15
fhelmberger left
|
|||
perl6_newbee | to be precisly. I wrote 3 strings into a file but instead of "string\nstring\nstring" I got "stringstringstring" | 15:15 | |
Anyone with the same problem? | 15:16 | ||
PerlJam | perl6_newbee: How did you write those strings? | ||
perl6_newbee: if you didn't write the newlines or use say (which provides newlines for you), then you won't get them. | |||
perl6_newbee | my $fh = 'properties.txt'.IO.open(:w); $fh.say($hash_key ~ "=" ~ $hash_value); $fh.close; | 15:17 | |
moritz | you call .say() once, so you get one newline | ||
FROGGS[mobile] | PerlJam: right, I already saved a second :o) | ||
15:18
njmurphy joined
|
|||
perl6_newbee | I forgot a for $hash.kv -> $k, $v {} thanks Moritz | 15:18 | |
The same code on Linux worked fine | |||
moritz | m: for %*ENV.kv -> $k, $v { $*OUT.say("$k=$v") } | ||
camelia | rakudo-moar 9c6631: OUTPUT«MANPATH=/home/camelia/perl5/perlbrew/perls/perl-5.20.1/man:/usr/local/man:/usr/share/manPERLBREW_VERSION=0.71PERLBREW_PERL=perl-5.20.1SHELL=/bin/bashPERL5LIB=/home/camelia/perl5/lib/perl5/:/home/camelia/perl5/lib/perl5/x86_64-linux/USER=came…» | 15:19 | |
moritz | perl6_newbee: oh, a windows/newline problem? | ||
smls | Maybe it fails to turn \n into \r\n on Windows? | ||
perl6_newbee | seems to me | ||
On Monday I can chekc the file with a hex editor and check that | 15:20 | ||
anyway, another newbe question. this time an unicode one again | 15:21 | ||
masak | decommute & | ||
perl6_newbee | If I save a txt file on Windows with the notepad and open it with perl6 I get the BOM bytes at the begin of the file as ?. | 15:22 | |
e.G.: for 'file.txt'.IO.lines -> $line { say $line } | |||
shows "?string from file" | |||
nine_ | perl6_newbee: file is saved in UTF8 encoding? | 15:23 | |
perl6_newbee | yes | ||
nine_ | UTF8 forbids a BOM | 15:24 | |
perl6_newbee | nine_: I don't think so. according to Wiki it is not | 15:25 | |
U+FEFF byte order mark (BOM). BOM use is optional, | |||
nine_ | I stand corrected | ||
perl6_newbee | it has its own unicode | ||
nine_ | de.m.wikipedia.org/wiki/Byte_Order_Mark says in UTF8 its encoded as EF BB BF | 15:27 | |
perl6_newbee | and should be at the begin of the text. That is was the Notepad does and the txt file looks like | 15:28 | |
I mean EF BB BF is at the begin and perl6 shows a ? for that byte sequence | 15:29 | ||
moritz | the BOM just comes out like any other character | ||
perl6_newbee | Do I have to handle that? I mean, why? | 15:30 | |
brrt | ideally, not | ||
but tbh byte order marks are quite silly in utf-8 | 15:31 | ||
:-) | |||
15:31
kjs_ joined
|
|||
moritz | open() could have a :strip-bom option or so | 15:32 | |
brrt | hmm, i suppose you already have to pass a flag for non-utf8 encodings? | 15:33 | |
moritz | yes | ||
15:34
rindolf left
|
|||
perl6_newbee | for a script running on linux and windows I have to check the OS and call Open different then? | 15:35 | |
I don't like that solution | |||
moritz | you wouldn't | ||
you could pass :strip-bom even on linux | |||
perl6_newbee | it would only remove BOM if it found it. | ||
moritz | right | ||
brrt | the second question is how many of your files will be bom-encoded by notepad | 15:37 | |
perl6_newbee | in that case I would like it the other way. To have BOM striped other the :dont-strip-bom attribute is set | ||
brrt | no... no | ||
perl6_newbee | all of them. | ||
It is the default behavour on Windows 7. | |||
brrt | because you don't for sure if you're going to see a BOM | ||
well, that's windows suckiness then | 15:38 | ||
i've had too much windows suckiness problems today to have any mercy with that | |||
moritz | perl6_newbee: most of the files I work with don't have a BOM | ||
brrt | screw windows. and screw microsoft and their stupid byte order marks, open file limitations and all other 'quirks' that make up the windows experience | ||
and with that, i bid you goodbye :-) | 15:39 | ||
15:39
brrt left
|
|||
perl6_newbee | I only use WIndows at work. But I think user on Windows will have this BOM issue every time the open a notepad saved txt file. | 15:39 | |
rjbs- | Yeesh. | ||
perl6_newbee | THey will stomp about it earlier or later. So BOM removed by default would trigger problems on Linux or on other places? | 15:40 | |
moritz | there's a balance to be made between enough magic and too magic | ||
for example: if you read files and don't notice you have a BOM there | 15:41 | ||
and you write the files | |||
PerlJam | perl6_newbee: what if it's *not* a BOM, but looks like one? | ||
perl6_newbee | nod | ||
moritz | how do you determine whether to write a BOM? | ||
rjbs- | PerlJam: so very unlikely | ||
15:41
njmurphy left
|
|||
perl6_newbee | aaah | 15:41 | |
I see | |||
jnthn | PerlJam: If you *know* you're reading UTF-8, can there ever actually be ambiguity? | ||
rjbs- | If the default for text i/o is to decode UTF-8 in and writing UTF-8 out, I'd expect to drop leading BOM and to not write one on output. | 15:42 | |
jnthn | PerlJam: That is, if it's not taken as a BOM, I don't think it's valid chars? | ||
moritz | .u FEFF | ||
yoleaux | U+FEFF ZERO WIDTH NO-BREAK SPACE [Cf] (<control>) | ||
jnthn | The only time it'd get problematic is if you opened a file and then read binary from it. | ||
moritz | well, the BOM is also a valid zero-widht non-breaking space | ||
PerlJam | oh, I guess I wasn't thinking that it's UTF-8. (I'm dealing with some binary formats right now that could easily have BOM-looking bytes at the front) | ||
moritz | PerlJam: you open those with :bin anyway | 15:43 | |
rjbs- | Don't you have to specify file discipline when you open it? | ||
15:43
rjbs- is now known as rjbs,
rjbs left,
rjbs joined
|
|||
jnthn | PerlJam: If we implemnt this, then it belongs, imo, in the UTF-8 decoding handling | 15:43 | |
rjbs | (Huh, .tp TLD has finally vanished from root servers.) | 15:44 | |
PerlJam | aye | ||
perl6_newbee | I vote for this feature ^^ | ||
jnthn | I don't think there's a problem with most sane Windows programs if you don't write out a BOM. | 15:45 | |
But on the whole I suspect not tolerating one when reading is going to just create a lot of questions | |||
While tolerating it is unlikely to burn anybody if it's implemented in the correct place. | 15:46 | ||
muraiki | nine_: after installing perl 5.20.2 using perlbrew, I was able to install Inline::Perl5 via panda, even with a slightly out of date libperl-dev system package (which I'm not sure is even used if I'm also using perlbrew). thanks for your help! | 15:48 | |
now the moment of truth... does our crazy monolith load properly using Inline::Perl5 | |||
PerlJam | muraiki: I had problems with Inline::Perl5 on 5.20.1, but it worked perfectly on 5.20.0. Didn't have time to explore the cause though. | 15:49 | |
muraiki | perljam: thanks, good to know | ||
hrm, how to change perl5's @INC... | 15:50 | ||
PerlJam | muraiki: use lib "/path/to/foo"; | ||
muraiki: set PERL5LIB | |||
muraiki | oh, that won't make perl6 sad? thanks :) | ||
sorry, I'm a noob | 15:51 | ||
PerlJam | no worries. | ||
(that use lib line was for your P5 program BTW) | |||
muraiki | oh, that's what i was confused about. I'm trying to use a perl5 module that's installed system wide, but since it was installed for system perl perlbrew can't find it | 15:52 | |
I guess I can just inline the use lib using $p5.run ? | 15:53 | ||
PerlJam | I'd do the env var personally | ||
perlbrew sets PERL5LIB, you just need to add to it. | |||
muraiki | oh, duh | ||
thanks :) | |||
hey, it's friday! | |||
jnthn | .oO( ♬ Tomorrow is Saturday, and Sunday comes afterwards! ♬ ) |
15:55 | |
muraiki | oh God | ||
what have i done... | |||
well, got a segfault | 15:59 | ||
16:00
yakudza left
16:04
kjs_ left,
telex left
16:06
telex joined,
[Sno] joined
|
|||
muraiki | hrm, seems like the problem is with actually using Inline::Perl5. if I do `my $p5 = Inline::Perl5.new;` I get a segfault | 16:08 | |
btyler | muraiki: are you trying to start multiple p5 interpreters in a single p6 process? | 16:09 | |
muraiki | btyler: no, this is the only one I have | ||
I just tried via repl `use Inline::Perl5; my $p5 = Inline::Perl5.new;` | |||
16:16
estrabd joined
|
|||
muraiki | oh, maybe this goes back to perljam mentioning things being broken on 5.20.1 with Inline::Perl5 | 16:18 | |
let me compile 5.20.0 | |||
16:21
raiph left
16:29
diana_olhovik left
|
|||
TimToady | *yawn* | 16:31 | |
FROGGS[mobile] | [yawn] *, * | 16:32 | |
jnthn | m: sub infix:<yawn>(|) { say 'such tired' }; [yawn] *, * | 16:34 | |
camelia | rakudo-moar 9c6631: OUTPUT«such tired» | ||
16:39
anaeem1 left,
salva left
16:40
EXAAN260 joined
|
|||
muraiki | btyler: I can Inline::Perl5.new using 5.20.0. so yeah, something is broken with 20.1/2 | 16:45 | |
btyler | muraiki: hum, good to know. glad you sorted it | 16:46 | |
16:56
raiph joined
|
|||
perl6_newbee | Does anyone know what happened to NativeCall? DBIish installation failed because of missing NativeCall and panda says it does not exists in ecosystem | 17:01 | |
TimToady | is now in with rakudo | ||
so maybe you have a version skew of some sort | 17:02 | ||
perl6_newbee | Thx. But my Rakudobrew says it is up-to-date | ||
17:02
zakharyas left
|
|||
TimToady | or a dependency that needs to be removed somewhere | 17:02 | |
PerlJam | muraiki: github.com/niner/Inline-Perl5/issues/16 Please add any useful commentary there. | ||
muraiki | unfortunately the only thing I got was a segfault :( | 17:03 | |
but I guess I can at least add that ;) | |||
TimToady | perl6_newbee: I think you are not the first person to run into this, so maybe someone who did has an answer | ||
perl6_newbee | sign, I guess I will just wait and hope it will solve itself | ||
TimToady: thx | 17:04 | ||
PerlJam | Um ... DBIish no longer has an explicit dependency on NativeCall as of 15 days ago. | 17:07 | |
perl6_newbee | um | ||
PerlJam | perl6_newbee: can you post a transcript of what you're seeing somewhere like gist.github.com | 17:08 | |
? | |||
perl6_newbee | panda says Fetching DBIish. So I think it should be the current one | ||
PerlJam | come to think of it, I haven't tried installing DBIish with panda in a while ... | ||
PerlJam tries | |||
perl6_newbee | Do you mean more than the command line output? | ||
PerlJam | yeah, what you typed and what panda told you | 17:09 | |
perl6_newbee | ok | ||
PerlJam: pastebin.com/EH8Rqm57 | 17:10 | ||
PerlJam | also my DBIish installation failed because I don't have mysql running on this box, but it didn't complain about NativeCall at all | ||
TimToady | using old metadata somehow? | 17:11 | |
moritz | PerlJam: huh, the installation shouldn't fail due to missing mysql | ||
PerlJam: please open an issue, including the error you were getting | |||
perl6_newbee | I don't have mysql running neither, but the failure says Pg.pm6. Postgresql? | ||
dalek | c: e89c8d6 | moritz++ | lib/Type/Cool.pod: Cool.rindex |
||
moritz | yes, postgres | 17:12 | |
the tests should all be written so that a missing backend driver or db shouldn't cause a failure | 17:13 | ||
moritz builds a new rakudo | |||
17:13
torbjorn joined
|
|||
nine_ | muraiki: I use perl 5.20.1 so it should work | 17:14 | |
yoleaux | 17:03Z <PerlJam> nine_: See github.com/niner/Inline-Perl5/issues/16 | ||
TimToady | Usability Idea: maybe the 'is native' trait should introspect the signature for use of 'int' | ||
moritz | and do what with it? | 17:15 | |
muraiki | nine_: I only tried 5.20.2 (failed) and 5.20.0 (worked) | ||
TimToady | carp about it not being int32? | ||
or possibly rewrite it | |||
moritz | or just assume int32? | ||
smls | re moritz's last doc commit: Isn't "Str(Cool)" a little redundant as a typespec? | 17:16 | |
Since all Cool types can be coerced to Str. | |||
TimToady | more generally, force it to C's int type | ||
possibly with a warning | |||
nine_ | muraiki: maybe I'll find some time to try it this weekend | ||
moritz | smls: it means that Cool things type-check OK against that parameter | ||
smls: and it means that it's interpreted as Str | |||
smls: I don't see a redundancy | |||
nine_ | PerlJam: a stacktrace may help figure it out | ||
17:17
simcop2387 joined
|
|||
smls | well, the second part "interpreted as a string" doesn't restrict the type in addition to Cool | 17:17 | |
TimToady | but it does imply immediate rather than lazy coercion | ||
moritz | smls: no, but it supplies information about how it'll be used | ||
smls | it's kinda part of the implementation of the sub ("what does it do with its args") rather than the typespec ("what args are accepted") | 17:18 | |
TimToady | which might be very useful if the body would coerce over and over | ||
smls | Do we even still need Cool now that we have coercive types? | ||
moritz | smls: but it's rather relevant that index or rindex on arrays don't search for elements, but do a string-wise search | ||
jnthn | And knowing "it's a Str" on the inside of the rotuine may also help the optimizer. | 17:19 | |
PerlJam | nine_: muraiki is playing with it now. Maybe get him to generate one. I'm attempting to get some other work done and being distracted by IRC :) | ||
smls | right, i suppose having such an implementation detail in the signature makes it more self-documenting | ||
nine_ | |Tux|: noticed you mentioning some Inline::Perl5 slowness. Do you have some benchmark I can work with? | ||
moritz | well, the point of perl6/doc is to document stuff :-) | ||
TimToady | it says something about the semantics of the routine | ||
[Tux] | my CSV module | ||
I can try to cut that down for you | 17:20 | ||
TimToady | if you have a Str(Cool) argument, it means you should never try to write an Int(Cool), because it won't work, and violates the contract that wants to do string processing | ||
so it's useful more on a design level | |||
masak | hello #perl6 from | 17:21 | |
A TRAIN | |||
\o/ | |||
[Tux] | nine_: gist.github.com/Tux/f781bdefeb190e12a265 | ||
rather easy to remove the Slang::Tuxic from there | |||
smls | TimToady: So why isn't the param's type relaxed to Str() ? | ||
jnthn | masak: Surfar du med full fart? | ||
TimToady | Str(Cool) really says I am a Str interface but you may only write a multi that is outside of Cool | ||
moritz | \o masak; what are you training for? :-) | 17:22 | |
17:22
donaldh joined
|
|||
masak | jnthn: no, because the wifi is "too weak in first class" according to the conductor | 17:22 | |
muraiki | nine_: I could generate a stack trace, if only I knew how to :( | ||
masak | jnthn: I swear, they keep coming up with new ways to suck every time. | ||
jnthn | Wow! | ||
TimToady | well, on Amtrak they only have WiFi in first class... | 17:23 | |
smls | TimToady: I don't get it, but I have to go. I trust that it actually all makes sense... ;) | ||
masak | moritz: reminded me of www.youtube.com/watch?v=yR0lWICH3rY | ||
17:23
smls left
|
|||
nine_ | muraiki: perl6 is just a shell script. If you look at it it's just executing moar. Copy that line, appwnd the parameters you would mormally pass to perl6 and add gdb --args to the font | 17:26 | |
TimToady | I see JVM backend is still completely hosed this morning... | ||
nine_ | muraiki: run that, press r and enter and when it segfaults press bt and enter | ||
nwc10 | TimToady: oh? donaldh certainly fixed the first thing that broke recently when you made a sane change | ||
TimToady | trying again without TEST_JOBS | ||
nine_ | muraiki: otherwise I'll just try to reproduce it when I'm back home | 17:27 | |
donaldh hears his name | |||
[Tux] | nine_ does that help? | ||
TimToady | maybe I have something old that needs cleaned out | ||
or maybe it's related to which JVM I'm using | 17:28 | ||
perl6_newbee | moritz: I removed rakudo and cloned it again. This time NativeCall was no longer a problem, unfortunatelly another tests failed: gist.github.com/wbiker/76d303624c1e0ed9eb1f | ||
nine_ | |Tux|: maybe. I'll give it a try when I' ^Hm at home | ||
TimToady | avoiding TEST_JOBS doesn't help | ||
well, and running individual tests doesn't help either | |||
masak | TimToady: oh, I didn't know you use the construction "needs [X]ed" -- is it a West Coast thing? (I've heard diakopter use it.) | ||
TimToady | I get about 3 pages of failed tests in the summary | ||
17:29
cschwenz1 left
|
|||
donaldh gets freaked out when he compiles nqp with NQP_VERBOSE_EXCEPTIONS=1 | 17:29 | ||
TimToady | masak: I was intentionally speaking Wisconsin-ese and blame tchrist++ | ||
17:30
prevost joined
|
|||
TimToady | but yeah, I said it knowing it was not in my dialect | 17:30 | |
not actually sure where it comes from exactly | |||
because bad linguist :) | 17:31 | ||
perl6_newbee | .seen moritz | 17:33 | |
yoleaux | I saw moritz 17:22Z in #perl6: <moritz> \o masak; what are you training for? :-) | ||
perl6_newbee | .to moritz I removed rakudo and cloned it again. This time NativeCall was no longer a problem, unfortunatelly another tests failed: gist.github.com/wbiker/76d303624c1e0ed9eb1f | 17:34 | |
yoleaux | perl6_newbee: I'll pass your message to moritz. | ||
17:35
Rounin joined
|
|||
muraiki | nine_: github.com/niner/Inline-Perl5/issues/16 | 17:36 | |
nine_: I can try to reproduce the crash after altering my INC if you'd like | 17:37 | ||
actually I was just able to reproduce it | 17:38 | ||
I'll add the info | |||
nine_ | muraiki: thanks! | ||
perl6_newbee | there are very few information about multiline comment #` and hard to find respectively. It works just one line. What is the end string of a multi line comment? It's not `# | ||
TimToady | it always depends on which brackets you use after the tick | 17:39 | |
perl6_newbee | aaaah | ||
cool | |||
TimToady | and you can use [[[ ... ]]] and such to avoid ambiguity | ||
m: say #`[[[ unbalance [ in here ]]] 42; | 17:40 | ||
camelia | rakudo-moar 9c6631: OUTPUT«42» | ||
perl6_newbee | thats briliant. I love it | ||
TimToady | well, it's just an extension of an existing principle for quotes | ||
a comment is just a quote that goes away, kinda | |||
17:41
_sri_ left,
laouji joined
|
|||
perl6_newbee | now as you mentioned it... I did not think this way of comments | 17:41 | |
and it makes sense | |||
muraiki | nine_: ok, stack trace added | ||
masak is very, very slightly in favor of multiline comments :) | 17:42 | ||
17:44
rindolf joined
17:45
laouji left
|
|||
TimToady | masak: I note that that was a single-line comment... | 17:47 | |
17:51
espadrine left
17:52
dj_goku left
17:53
itz_ joined
17:55
itz left,
sirdancealot joined
17:58
sirdancealot left
18:02
itz_ left
18:04
itz joined
|
|||
masak | TimToady: I meant multiline comments as opposed to nothing, not as opposed to single-line comments. :) | 18:09 | |
18:10
itz left
18:11
eli-se joined
|
|||
donaldh | TimToady: I concur lots of test failures on JVM gist.github.com/donaldh/6c1076d6a801995d952c | 18:11 | |
donaldh will take a look this evening | |||
donaldh 's evening begins in two hours or so | 18:14 | ||
18:14
eli-se left
18:16
J-L joined
|
|||
J-L | Hi, I have a question about documentation, like the kind you see at doc.perl6.org/type/Str . What exactly does ":D" as in "Str:D:" mean? Is there a page that explains what that means? | 18:17 | |
donaldh | defined | ||
as opposed to :U which means undefined | |||
J-L | When would you ever need to use undefined? | 18:18 | |
donaldh | In a method that takes a type object and constructs something | 18:19 | |
18:19
cognominal joined
|
|||
J-L | And what's the difference between a sub and a method? I see both defined, and they both seem like a function used in conjunction with a Class. | 18:20 | |
FROGGS | m: my $a = "a"~ "b";~ "c" | 18:21 | |
camelia | ( no output ) | ||
FROGGS | why doesnt that warn? ó.ò | ||
masak | J-L: subs are not associated with a class or object at all. | ||
m: sub foo { say "OH HAI" }; foo() | |||
camelia | rakudo-moar 9c6631: OUTPUT«OH HAI» | ||
FROGGS | I wasted more than half an hour on that | ||
masak | J-L: it's just that if you want, you could define a sub inside a class block. but that doesn't make objects "callable with the sub" -- it only makes the sub reachable from within the class block. | 18:22 | |
FROGGS | m: +42 | 18:23 | |
camelia | ( no output ) | ||
FROGGS | m: 42 | ||
camelia | ( no output ) | ||
FROGGS | m: 42; 1 | ||
camelia | rakudo-moar 9c6631: OUTPUT«WARNINGS:Useless use of constant integer 42 in sink context (line 1)» | ||
18:23
kjs_ joined
|
|||
TimToady | m: my $a = "a"~ "b";~ "c";42; | 18:23 | |
camelia | rakudo-moar 9c6631: OUTPUT«WARNINGS:Useless use of "~ " in expression "~ \"c\"" in sink context (line 3)» | ||
masak | J-L: subs can be called from the same block as they're defined in. (and nested blocks.) methods are called on objects, like $obj.bar() | ||
FROGGS | hmmmm | ||
18:23
kjs_ left,
Hor|zon left
|
|||
TimToady | the sinker isn't aware that the mainline doesn't use its last value | 18:23 | |
J-L | masak: Does it make the sub reachable from outside the class block, as well? | ||
FROGGS | TimToady: bit I've got another statement after that | ||
but* | |||
TimToady | I just put one and got the warning | ||
masak | J-L: no, the reach ends at the end of the block the sub is defined in. | ||
[Coke] | m: class stuff { sub hi { say "hi" }}; hi(); | ||
camelia | rakudo-moar 9c6631: OUTPUT«5===SORRY!5=== Error while compiling /tmp/fmHke2eS3cUndeclared routine: hi used at line 1» | ||
TimToady | if it's in a block, that doesn't work either | 18:24 | |
avuserow | how can I use ulimit on hack to avoid running things out of memory? something like 'ulimit -m 500000' to cap at 500MB? | ||
TimToady | m: { my $a = "a"~ "b";~ "c";42; } | ||
camelia | ( no output ) | ||
[Coke] | m: class stuff { sub hi { say "hi" } method eek() { hi() }}; stuff.eek; | ||
camelia | rakudo-moar 9c6631: OUTPUT«5===SORRY!5=== Error while compiling /tmp/sMUBAiEl2_Two terms in a rowat /tmp/sMUBAiEl2_:1------> 3class stuff { sub hi { say "hi" }7⏏5 method eek() { hi() }}; stuff.eek; expecting any of: infix stopper infix or…» | ||
[Coke] | m: class stuff { sub hi { say "hi" } ; method eek() { hi() }}; stuff.eek; | ||
camelia | rakudo-moar 9c6631: OUTPUT«hi» | ||
TimToady | the useless use warning is still relatively useless | ||
FROGGS | TimToady: that's my code: gist.github.com/FROGGS/7a43b46dd5a...ngle-p6-L8 | ||
J-L | When I read the documentation for Strings at doc.perl6.org/type/Str , I see the chomp() routine defined as both a multi sub and multi method. What's the difference? | ||
FROGGS | ahh, yeah | ||
[Coke] | J-L: "thing".chomp (method) vs chomp("thing") sub | 18:25 | |
TimToady | we've pointed out the inside-block difficulty before, but it hasn't risen to the top of anyone's queue yet | ||
FROGGS | yeah | ||
[Coke] | multi in both cases means that multiple subs/methods might have the same name but take different args. | ||
J-L | Coke: Do they both operate on "thing", or does one (or both?) return a new new object, leaving one unchanged? | 18:26 | |
[Coke] | return value is sub/method dependant. | ||
in that case, those are literals. you can't chang ea literal. | 18:27 | ||
18:27
perl6_newbee left
|
|||
[Coke] | (if the sub/method doesn't take an "is rw" parameter, it can't mutate the things passed in regardless) | 18:28 | |
TimToady would love to work on the sink warnings himownself, but has to write a talk for Budapest this weekend | |||
18:28
itz joined
|
|||
J-L | Coke: That's nice... I'm liking the "is rw" signifier. | 18:28 | |
nwc10 | what's in Budapest? and when? | ||
that's drivable from here. | |||
:-) | |||
jnthn | nwc10: TimToady is in Budapest, this weekend :P | 18:29 | |
J-L | Coke: So with chomp, I see one signature has "Str:D" while the other has "Str:D:" (an extra ':'). What's the difference? | ||
TimToady | no, just writing the talk this weekend | ||
jnthn | Ah :) | ||
TimToady | going on Monday night, conf is like Thursday night or so | ||
PerlJam | J-L: That second colon distinguishes the invocant from the rest of the args. | 18:30 | |
jnthn | Enjoy. I didn't go to Budapest for a while, but have nice memories | ||
TimToady | going to .ro after that | ||
nwc10 | cluj.pm/pages/events.html -- March 16th | 18:31 | |
TimToady is pleased to be able to show Budapest to Glo this time | |||
nwc10 | TimToady: when we went for a day, we found it very interesting. We only used euros | ||
dalek | kudo/cpp: 60db3bc | FROGGS++ | / (2 files): implement trait 'is mangled' (short for 'is mangled<C++>') For CPPStructs we already know that methods need to be mangled before calling into the C++ library, but for subroutines we need a way to tell what we are up to. |
||
nwc10 | prices quoted in euros, paid in euros, got change in euros | ||
[please do not rely on this still being true :-)] | 18:32 | ||
TimToady | Last time I was there they were celebrating the 50th anniversary of 1956, so it was impossible to get any coffee before my talk | ||
that's why I now carry penguin mints everywhere I go :) | |||
nwc10 | because the TSA would object to a tranger stove and an aeropress? :-) | 18:33 | |
18:33
pmurias joined
|
|||
TimToady | but it was quite the event, people pretending to be dead on the bridge and such | 18:33 | |
nwc10 | (I keep joking that we should get that for work, as the ultimate DR coffee solution) | ||
18:33
itz left
|
|||
TimToady | .oO(drug paraphenalia...) |
18:34 | |
nwc10 | TimToady: not sure if you've seen this - I found it quite sobering: en.wikipedia.org/wiki/Shoes_on_the_Danube_Bank | ||
J-L | Coke and PerlJam: What about the method sign() ? I see it has no args. Wouldn't it still need a "Str:D:", like mthod ord() ? | ||
[Coke] | you looking at docs or code? | 18:35 | |
TimToady | nwc10: no, hadn't seen that, and of course it wasn't there at my last visit | ||
J-L | Coke: I'm looking at docs. Specifically, doc.perl6.org/type/Str . | ||
moritz | m: say Str.sign | 18:36 | |
yoleaux | 17:34Z <perl6_newbee> moritz: I removed rakudo and cloned it again. This time NativeCall was no longer a problem, unfortunatelly another tests failed: gist.github.com/wbiker/76d303624c1e0ed9eb1f | ||
camelia | rakudo-moar 9c6631: OUTPUT«use of uninitialized value of type Str in numeric context in block <unit> at /tmp/1g_N75Q9Sa:10» | ||
moritz | J-L: it doesn't need the :D constraint | ||
TimToady | that is another place where Perl 6 defaults to lazy semantics | ||
nwc10 | TimToady: I fail at maths. As was also somewhat demostrated this morning. :-) | ||
[Coke] | so it uses the default invocant. | 18:37 | |
J-L | Oh, okay. | ||
TimToady | because we don't know in advance whether the method will handle a type object | ||
if you care, you put the :D, and if not, we still pick it up as a run-time error | |||
mostly we don't care | 18:38 | ||
though some of us care more than others :) | |||
it's part of the whole gradual typing thing to not care | |||
dalek | Iish: b327e9e | moritz++ | t/99-common.pl6: use skip_rest so that the plan is not screwed up. perl6_newbee++ |
18:39 | |
TimToady | People coming from Haskell tend to freak out just a bit that all of our types are Maybe-ish :) | ||
well, native types aren't Maybe-ish, but "just" | 18:40 | ||
we think that's a natural place to draw a distinction in defaults | 18:41 | ||
18:41
eli-se joined
|
|||
[Coke] | I already envision me grumping at developers to add more type declarations. "this ain't coldfusion", I'll say. | 18:41 | |
18:41
pmurias left
|
|||
TimToady | one can of course implement a policy module/slang and hold a gun to their heads until they use it | 18:41 | |
eli-se | what's a type declaration? | 18:42 | |
TimToady | maybe I shouldn't use that phrase right after what nwc10 said... | ||
a type annotation | |||
my Int $foo; | |||
18:42
spider-mario left
|
|||
nwc10 | I'm unaware of anyone I know personally who suffered or died, but I have constant reminders of it in the 2nd distrcit of Vienna - many building have brass plaques in the pavement outside detailing who (and how many) were deported and murdered. | 18:43 | |
TimToady | really, a type declaration would be like "subset Foo of Bar where *.speshul;" | ||
eli-se | Oh, I see. | ||
TimToady | or 'class Dogwhistle {...}' | ||
we we're pretty sloppy in how we talk here | |||
natural languages and all that... | |||
eli-se | Specifications in code are good. There's no reason to put them elsewhere or nowhere when you can put them in your code. | ||
18:44
pmurias joined
|
|||
TimToady | well, all principles can be driven into the ground to the exclusion of other principles :) | 18:44 | |
PerlJam | I think that's how people learn sometimes. | 18:45 | |
[Coke] | even that one? | ||
TimToady | yup | ||
18:45
itz_ joined
|
|||
PerlJam | Use that new hammer for every problem until you can figure out that it probably shouldn't be used for certain problems. | 18:45 | |
TimToady | which is why even Perl 6 occasionally makes hard and fast rules | ||
ab5tract | TimToady: how many hands would it take to count those? | 18:46 | |
TimToady | those which? | ||
ab5tract | the occasional hard and fast rules :) | ||
TimToady | one-pass parsing, TTIAR, required ws after keywords, required absence of ws before postfixes, required ws before infix when it collides with postfix | 18:47 | |
depends on how you count | |||
but on a higher level, all is fair if you predeclare | 18:48 | ||
ab5tract | i'm curious because it might be nice to have those all together in some doc somewhere | ||
TimToady | so you can still break any of these hard-and-fast rules, but only if you predeclare that you're gonna | ||
J-L | I tell ya, I REALLY like Perl6's "is rw" modifier (and the fact that if it's not there, it leaves the argument unchanged). Before that, it bothered me that I could never really be sure if the passed-in argument was modified. Lisp had this problem; Ruby didn't. | ||
TimToady | but that's really just a facet of one-pass-parsing, if you like | ||
18:49
pmurias left
|
|||
TimToady | LTM is pretty darn important too | 18:49 | |
since that's basically how we write your lexer for you based on the grammar | |||
syntax categories are pretty fundamental in how you combine sublexers | 18:50 | ||
what I said earlier about comments being like quotes was only a half truth, because a comment can occur inside any whitespace, but a quote can only occur where a term is expected | 18:51 | ||
J-L | Say, I'm trying to find a Pure-Perl6 solution to the Perl5 FAQ question shown with 'perldoc -q "on the keyboard"', which is "How do I check whether input is ready on the keyboard?". | ||
PerlJam | TimToady: you should teach a language construction class. :) | ||
it might pair well with a compiler construction class | |||
TimToady | I dunno...here's 50 principles of language design, and you're on your own for how to balance them... | 18:52 | |
J-L | I already found pure-Perl6 solutions for the other two questions shown with "perldoc -q keyboard" (that relate to the keyboard), now I want to formulate the solution for the third. | ||
18:53
kjs_ joined
|
|||
J-L | Namely, how do I check whether input is ready on the keyboard, without resorting to a non-standard module. | 18:53 | |
PerlJam | J-L: you just want to check, but not read if there is input there? | 18:54 | |
18:54
Ven left
|
|||
TimToady | by writing the standard module? | 18:54 | |
J-L | PerlJam: Correct. | ||
PerlJam | J-L: then, what TimToady said :) | ||
J-L | TimToady: If I can write the standard module in puer-Perl6, yes. | ||
TimToady | the trouble here is that there's no canonical way that works on any OS | 18:55 | |
japhb | m: my Supply $supply .= new; my $emitted = 0; $supply.tap({ ++$emitted}); constant ITERS = 1_000; my int $i = 0; my num $t0 = nqp::time_n(); while ($i = $i + 1) < ITERS { $supply.emit("test") }; my $rate = ITERS / (nqp::time_n() - $t0); say "supply.emit -> tap: { $rate.fmt('%.3f') } items/sec"; | ||
yoleaux | 5 Mar 2015 09:25Z <jnthn> japhb: DIHWIDT. You've only allowed one processing thread, scheduled two pieces of work, and had the first block the thread. In the future, "await ..." instead of .result should be usable to resolve this; I think .result will always be the blocking thing. | ||
camelia | rakudo-moar 9c6631: OUTPUT«Cannot modify an immutable Supply in method dispatch:<.=> at src/gen/m-CORE.setting:1355 in any at src/gen/m-Metamodel.nqp:1619 in block <unit> at /tmp/fJvcIUDO9G:1» | ||
japhb | m: my $supply = Supply.new; my $emitted = 0; $supply.tap({ ++$emitted}); constant ITERS = 1_000; my int $i = 0; my num $t0 = nqp::time_n(); while ($i = $i + 1) < ITERS { $supply.emit("test") }; my $rate = ITERS / (nqp::time_n() - $t0); say "supply.emit -> tap: { $rate.fmt('%.3f') } items/sec"; | ||
camelia | rakudo-moar 9c6631: OUTPUT«supply.emit -> tap: 3296.434 items/sec» | ||
TimToady | so if you write your OS in Perl 6, you're home free :P | ||
J-L | TimToady: In Perl5 we had the select() statement, which I know worked on Unix, and *I think* worked on Windows. (Not 100% sure about that, though.) | ||
nwc10 | camelias all the way down | ||
TimToady | either that, or you're emacs | ||
japhb | jnthn: How hard would it be to increase that rate? ^^^ Is there a lot of headroom there, or is it unlikely to increase much? | ||
J-L | There was also IO::Handle::select(), which I think also worked on Windows. | 18:56 | |
18:56
vendethiel- left
|
|||
TimToady | select doesn't work on windows if you try to mix in sockets | 18:56 | |
18:56
vendethiel joined
|
|||
TimToady | but maybe that module hides the problem | 18:56 | |
japhb | jnthn: Also, where were you suggesting I put await in my lockup test? Replace the inner .result? The outer .result? Both? | 18:57 | |
m: my Supply $supply .= new; | |||
camelia | rakudo-moar 9c6631: OUTPUT«Cannot modify an immutable Supply in method dispatch:<.=> at src/gen/m-CORE.setting:1355 in any at src/gen/m-Metamodel.nqp:1619 in block <unit> at /tmp/9UzXpD6iSJ:1» | ||
ab5tract | TimToady: I for one am looking forward to a post-release effort to gather historical/contextual discussion about the more influential decisions in perl 6 vis a vis 'balance' | ||
japhb | Is the above idiom dead? ^^^ | ||
TimToady | japhb: no | 18:58 | |
japhb | m: my Int $i .= new; | ||
camelia | ( no output ) | ||
TimToady | it's just a bug | ||
japhb | Hmmm, so just a bug in Supply somehow. | ||
TimToady | I don't think it's a maybe bug | 18:59 | |
japhb | Huh? | ||
TimToady | sorry, haskellian joke | ||
moritz | it's probably related to Supply being a role | 19:00 | |
m: role R { }; my R $x .= new() | |||
camelia | rakudo-moar 9c6631: OUTPUT«Cannot modify an immutable R in method dispatch:<.=> at src/gen/m-CORE.setting:1355 in any at src/gen/m-Metamodel.nqp:1619 in block <unit> at /tmp/IfTUTwHEdv:1» | ||
japhb | Yeah, appears so. | ||
moritz++ # Diagnosis at a glance | |||
moritz | it helps to have stared at the Supply code for quite some time :-) | 19:01 | |
japhb | Heh | ||
ab5tract | there is a _lot_ for the perl 6 effort to offer the craft and community of language design in terms of retrospective analysis | ||
jnthn | japhb: The await will, in the future, make a difference there if you put in in the inner .result call. Won't hurt for both. | 19:02 | |
TimToady | but it's difficult to dredge things out that were decided in my subconscious, except by examining the resulting rationalizations that showed up later... | ||
19:02
rindolf left
|
|||
TimToady | and it's not always clear that the rationalizations were the actual reason for the decision... | 19:02 | |
japhb | jnthn: Ah, good, thank you. | 19:03 | |
PerlJam | TimToady: are you saying that it all only makes sense in hindsight? :) | ||
moritz | m: role R { }; my R $x = R.new() | ||
camelia | ( no output ) | ||
ab5tract | ah, most certainly. but i'm thinking also of technical decisions, such as the nom rewrite or how we landed on 6model | ||
TimToady | well, sometimes I decided that I didn't like something, and figured out reasons afterwards | ||
J-L | Hmmm...maybe Perl5's IO::Select::can_ready DOESN'T work on Windows. (I just tried and it didn't seem to work.) | ||
jnthn | japhb: The, uh, supply rate is pretty slow at the moment | ||
ab5tract | that interact and inform the language design | ||
TimToady | but that could maybe just be prejudice | ||
ab5tract | *interact with | ||
PerlJam | TimToady: intuition born from experience | 19:04 | |
TimToady | "maybe just" pun intended | ||
japhb | jnthn: Any hope of improvement? Or something fundamental to the design, like the forced context switch issue that existed with Channels? | ||
ab5tract | :) | ||
jnthn | japhb: Yes, hope. Part of the point of the model is that they don't suffer the forced context switch issue and more more cache friendly | ||
japhb: There's just not be much work on optimization there yet. | |||
*been | |||
japhb | Ah, OK | 19:05 | |
J-L | I just read about promises. Are those implemented with threads? | ||
TimToady | still working on correctness, really | ||
jnthn | Indeed | ||
japhb | J-L: You can start code in a threadpool, and get a promise back, if that's what you mean. | ||
jnthn | J-L: That's a slight level confusion, but a Promise can certainly represent a piece of working being done on a thread | 19:06 | |
TimToady | see for instance the behavior of raw.githubusercontent.com/kgoess/r...restart.p6 | ||
japhb | But it's the scheduler that decides how threads are allocated. | ||
TimToady | (after taking the return out of the block) | ||
ab5tract | that in itself is excellent stuff, imo. i guess i don't talk to that many language designers, in the end, but i don't feel like i read a lot of open discussion about 'process', nor do i think that any effort has quite taken the process that perl 6 has | ||
jnthn | J-L: start { ... } schedules work on a thread, as japhb said which thread is up to the Scheduler. It doesn't start a thread per bit of work you shcedule, though. Not unless you go out of your way to make that happen, anyway. | 19:07 | |
Gotta go for a bit... | |||
bbl | |||
japhb actually has an app that starts by computing how many threads it would take to start all pending tasks at once, and then installs a new scheduler told to manage a threadpool that large | 19:08 | ||
TimToady | "I think it has something to do with free will." --God (at least the one in Time Bandits) | ||
El_Che | TimToady: still waiting for your talk video | 19:09 | |
they are clearly keeping the best until the end | |||
the sneaky bastards :) | |||
japhb | It always makes me chuckle when I run that app and my system fans start spinning up to jet engine levels. | ||
TimToady | well, just means the "6.0.0" fecal material will hit the rotating blades again :) | ||
japhb: wow, nice setup :) | 19:10 | ||
J-L | The goal of what I want to do is to make a non-blocking read of keyboard input. If there's input waiting, return it, and if there's not, either return undef or an empty string. Anybody have any idea how to do that? | ||
TimToady | well, I have a unix-centric way | 19:11 | |
19:12
gfldex joined
|
|||
TimToady | well, no, I use single-char input but it's blocking | 19:14 | |
currently looks like this: | 19:15 | ||
shell "stty raw -echo min 1 time 1 </dev/tty"; | |||
$TTY = open("/dev/tty"); | |||
at later... | |||
my $buf = Buf.new; | |||
repeat { $buf ~= $TTY.read(1) } until try my $s = $buf.decode; | |||
19:16
fhelmberger joined
|
|||
TimToady | (that's from my quiz editor that I've been using for years now) | 19:16 | |
though that particular bit of code was just upgraded to allow UTF-8 input | 19:17 | ||
19:17
spider-mario joined
|
|||
J-L | TimToady: Tell me about the "repeat" line. What's it doing, exactly? What does it do if there's no input? Does it eventually break out? | 19:17 | |
hahainternet | he reads characters into the buf | ||
well | 19:18 | ||
he reads bytes into the buf | |||
until they are decodeable as characters? | |||
i assume anyhow | |||
TimToady | repeat is just a loop that tests at the end | ||
J-L | And what if there's nothing to read? Does it break out? | ||
hahainternet | also lo @ #perl6 crew | ||
TimToady | as I said, it blocks | ||
hahainternet | prly fails at EOF too i assume | ||
but i don't know perl6's exception type stuff in any way | 19:19 | ||
TimToady | I dunno, I have an exit command :) | ||
J-L | I'm confused about the "until try" part, as well as the "~=" part. | ||
19:19
Hor|zon joined
|
|||
masak | J-L: the `try my $s = $buf.decode` part is an expression. if decoding fails, it swallows the exception (and becomes falsy). | 19:20 | |
19:20
cognominal left,
fhelmberger left
|
|||
TimToady | actually, ^D is a valid editor command :) | 19:21 | |
~= is just append | |||
since ~ is concatenate | |||
try is catching the exception that is thrown by .decode if its input is not well-formed UTF-8 | 19:22 | ||
retupmoca | m: await start { .say for lines } | ||
camelia | rakudo-moar 9c6631: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGallAgus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luíI mo dhiaidh bhí gleanntáin ghlas’ G…» | ||
retupmoca | oh | ||
apparently I need to update; that breaks here | |||
huf | is that irish or scottish? | 19:23 | |
masak | huf: Irish. | ||
huf | how can you tell? in case both look greek to you :) | 19:24 | |
19:24
Hor|zon left
|
|||
TimToady | J-L: btw, wrt irclog.perlgeek.de/perl6/2015-03-05#i_10231179 I had to explicitly hack ^D and ^Z recognition into Perl for windows at one point | 19:24 | |
so would not be at all surprised if P6 didn't support those sequences yet | |||
moritz | huf: one can tell by 'git log -- stdin' in perl6/evalbot | 19:25 | |
huf | moritz: :) | ||
J-L | Thanks, TimToady. I appreciate it. When will the version that has ^D and ^Z recognition be available? | 19:27 | |
TimToady | well, as subsequent discussion pointed out, it may be the readline hiding those | 19:28 | |
for the REPL | |||
we do have devs on Windows, so support is probably already there | |||
J-L | I'm reading up on Promises, and I wonder: How do I break a Promise? I tried "$promise.vow.break;" but I'm getting: Access denied to keep/break this Promise; already vowed | 19:29 | |
TimToady | but maybe jnthn++ never needs to type EOF | ||
moritz | J-L: how did you create the promise? | ||
19:29
anaeem1_ joined
|
|||
J-L | moritz: I used: my $p = Promise.start({ sleep 5; 42}); # $p is my $promise | 19:30 | |
19:30
laouji joined
|
|||
moritz | J-L: die()ing in the Promise breaks it | 19:30 | |
J-L | moritz: Is there a way I can kill it from outside? | ||
moritz | J-L: no, but you can create a combined promise that you can break | 19:31 | |
19:31
kjs_ left
|
|||
moritz | my $breakable = Promise.new; my $p = Promise.anyof(start { ... }, $breakable); $breakable.break # breaks $p too | 19:32 | |
J-L | moritz: I'm not familiar with combined promises. Can the code in a Promise just read an outside variable and die if the variable has a certain state? | ||
moritz | J-L: see the example I just gave | ||
J-L: and yes, you could also use an outside variable and die | 19:34 | ||
but that won't help while you're hanging in some kind of IO operations | |||
19:34
laouji left
|
|||
lizmat | FROGGS: re irclog.perlgeek.de/perl6/2015-03-06#i_10233001 , looks like pushing an ENTER phaser, does not activate phasers for that scope | 19:35 | |
19:35
xfix_ joined
|
|||
TimToady | jnthn: I think it's fine if native array methods default to eager whenever possible, including .pick(*) but not .roll(*) | 19:35 | |
19:35
xfix_ is now known as xfix
|
|||
lizmat | m: sub foo is DEPRECATED { LEAVE say "leaving"; 42 }; say foo # adding any other phaser, makes it work | 19:35 | |
camelia | rakudo-moar 9c6631: OUTPUT«leaving42Saw 1 call to deprecated code during execution.================================================================================Sub foo (from GLOBAL) called at: /tmp/xBd3x44wPH, line 1Please use something else instead.--------…» | ||
J-L | moritz: But would using an outside variable to die be safe? That is, thread-safe? (I know that in some languages that's not a good idea.) | 19:36 | |
moritz | J-L: a simple scalar should be safe | 19:37 | |
J-L | moritz: When I run "my $breakable = Promise.new; my $p = Promise.anyof(start { sleep 5; 42 }, $breakable);", I'm getting: Too many positionals passed; expected 1 argument but got 2 | ||
19:37
khisanth_ joined
|
|||
moritz | J-L: need parens after start, I suppose | 19:39 | |
TimToady | that should be okay | ||
moritz | &start is just a sub | ||
TimToady | start is a statement_prefix | ||
moritz | it is? | ||
TimToady | supposed to be | ||
moritz | well, it's not :-) | ||
works with parens here :-) | 19:40 | ||
19:40
Khisanth left
|
|||
J-L | moritz: Do the parens surround $breakable? | 19:40 | |
moritz | J-L: I mean Promise.anyof( start(...), $breakable) | ||
TimToady | std: start() | 19:42 | |
camelia | std 28329a7: OUTPUT«5===SORRY!5===Undeclared routine: 'start' used at line 1Check failedFAILED 00:01 134m» | ||
TimToady | std: start {...} | ||
camelia | std 28329a7: OUTPUT«ok 00:00 136m» | ||
J-L | moritz: Adding in those parens seemed to work. | 19:43 | |
TimToady | S04:1432 | 19:44 | |
synopsebot | Link: design.perl6.org/S04.html#line_1432 | ||
TimToady | so to be future comabitable, write (start {}), not start({}) | ||
J-L | I'm also trying the die-ing approach to stop a promise that reads input a line at a time: my $alive=1; my $p = Promise.start({while $alive {my $text = $*IN.get; say "Got $text"}}); sleep 5; $aliv=0; $p.result; | 19:45 | |
19:46
prevost left
|
|||
J-L | ...but when I type a short line + ENTER during its sleep, nothing prints and then I get: Reading from stream failed: connection already in progress | 19:46 | |
19:47
kjs_ joined
|
|||
TimToady | *compatible | 19:47 | |
J-L | (Mistake: When I wrote $aliv=0 I meant $alive=0) | ||
Are you allowed to read and write from std input/output inside a Promise's code? | 19:48 | ||
19:49
itz joined
19:50
itz_ left,
anaeem1_ left,
rurban left
|
|||
TimToady | re 0 ** 0, see also rosettacode.org/wiki/Zero_to_the_zero_power | 19:50 | |
19:53
anaeem1 joined
|
|||
TimToady | nine_: re irclog.perlgeek.de/perl6/2015-03-06#i_10233083 if you're doing anything with exceptions, the pre and post strings can have different ws now, since the default is now to move the ⏏ to the front of a ws | 19:58 | |
19:58
mohij joined,
Sqirrel joined
|
|||
TimToady | speaking of which, I think some of our tests may be overly specific to our single implementation | 19:59 | |
it's not clear that we should be testing error messages, when the main point of having exception classes is to make that not necessary | 20:00 | ||
20:00
Hor|zon joined
|
|||
ab5tract | J-L: you should be able to do anything from inside a Promise's code, unless i'm misunderstanding the feature | 20:02 | |
lizmat | FROGGS: I'm not seeing a fix for is DEPRECATED, perhaps jnthn can provide pointers | 20:03 | |
FROGGS: I'm not sure when the code for "is DEPRECATED" actually runs, before or after the op trees for the routine have been created | |||
20:03
anaeem1 left
|
|||
FROGGS | lizmat: I am debugging it atm | 20:04 | |
lizmat | ok, I'll drop it from my list then | ||
FROGGS | yeah :o) | ||
J-L | moritz and abstract: Basically, I'm trying to run at the command line: echo hello | perl6 -e "my $alive = True; my $p = Promise.start({while $alive {my $text = $*IN.get; say 'Got ', $text}}); sleep 5; $alive = False" | 20:09 | |
...but nothing's printing. It should print "Got hello", right? | |||
raiph | "[perl6] Complex Attribute Validation and/or Triggers" perlmonks.org/?node_id=1119046 | 20:12 | |
ab5tract | J-L: honestly I think that moritz promise-of-a-promise approach makes more sense to me | 20:13 | |
dalek | ecs: 4f024c5 | TimToady++ | S99-glossary.pod: generalize smop a bit |
||
PerlJam | raiph: I think tye's reply sums it up :) | 20:14 | |
J-L | moritz and abstract: Regardless, shouldn't this work?: echo hello | perl6 -e "my $p = Promise.start({my $text = $*IN.get; say 'Got ', $text}); sleep 5;" | ||
Nothing prints for me. | |||
retupmoca | I think there's a windows rakudobug: running "perl6 -e 'await start { .say for lines }'" in my terminal window doesn't work | 20:15 | |
J-L | This prints for me, but putting it inside a Promise doesn't for some reason: echo hello | perl6 -e "my $text = $*IN.get; say 'Got ', $text" | ||
retupmoca | but that same thing worked fine here | ||
ab5tract | J-L: my rakudo is compiling atm, and i won't be able to test windows | ||
retupmoca | seems reading from stdin from a thread isn't working properly on windows | 20:16 | |
ab5tract | J-L: what happens when you add $p.result after the sleep call? | ||
(in the non-$alive version) | 20:17 | ||
J-L | This DOES work for me: perl6 -e "my $p = Promise.start({say 'Got text'}); sleep 5;" | 20:18 | |
ab5tract | ok | ||
retupmoca | J-L: yes, this matches my tests: no threads, everything is fine; stdout in thread, everything is fine; stdin in thread, doesn't work | 20:19 | |
(I'm on windows powershell with nom/master/master) | 20:20 | ||
J-L | This: echo hello | perl6 -e "my $p = Promise.start({my $text = $*IN.get; say 'Got ', $text}); sleep 5; say $p.result" | ||
Gives me this: ===SORRY!===\nReading from stream failed: connection already in progress | |||
20:22
mraynham joined
|
|||
raiph | PerlJam: thanks | 20:23 | |
20:31
kjs_ left
20:33
rurban joined
|
|||
mraynham | Hi. I'm just starting to look at Perl 6, and have been to rakudo.org/how-to-get-rakudo/. I found the content a bit confusing, and wondered what the procedure is for suggesting improvements? | 20:35 | |
The "How to help" page suggests that I need to create an account, but I can't find out how to do that. | |||
vendethiel | mraynham: "suggesting an improvement" on perl6 | ||
? | |||
TimToady | I take it to mean improvements on the particular page | 20:37 | |
since obviously Perl 6 can't be improved <cough> | 20:38 | ||
vendethiel | *g* | ||
20:38
darutoko left
|
|||
mraynham | Yes, improvements to the "How to get Rakudo page". | 20:39 | |
raydiak doesn't know if there is any particular way to file an issue w/rakudo.org itself other than here, nor who maintains it | 20:40 | ||
20:40
kjs_ joined
|
|||
raydiak | since it's on wordpress instead of a github project like most of the rest of our core web presence | 20:40 | |
PerlJam | mraynham: perhaps email pmichaud with your improvements (or ask how to create an account :) | ||
sjn asked about that page just earlier today | |||
sjn would love to see that page improved too | 20:41 | ||
mraynham | Yeah, I thought as much. I'll email pmichaud and see what I can do. | 20:42 | |
sjn | mraynham: you Andy? | ||
PerlJam | hold on, I'm seeting if I have an account on rakudo.org with admin privs. | ||
er, seeing | |||
sjn | s/you/you're/ | ||
PerlJam | ah, I do | 20:43 | |
mraynham | sjn: Nope. I'm Mike. | ||
sjn | ah, ok. we had exactly the same topic of discussion at Oslo.pm :) | 20:44 | |
in other news, coincidences happen. | |||
nwc10 | how is Damian? | 20:45 | |
sjn spoke with dconway yesterday | |||
he's fine, doing his .eu tour right now | 20:46 | ||
dalek | kudo/nom: 9034557 | lizmat++ | src/core/ (6 files): Kill the Type(Any) coercion meme |
||
jnthn | lizmat, FROGGS: If you are wanting to be able to have traits that can set up phasers, we can probably have it work for those cases it doesn't already | ||
PerlJam | mraynham: if you respond to my priv msg, I can give you an account on rakudo.org | ||
mraynham | PerlJam: Thanks | 20:48 | |
FROGGS | jnthn: yes, that is what we need | 20:49 | |
jnthn | FROGGS: Which one do you need that doesn't work? | ||
FROGGS | jnthn: is DEPRECATED (ENTER phaser) | ||
looks like it is optimized away O.o | 20:50 | ||
jnthn | Not even that | ||
J-L | So, for now, as for making non-blocking reads from STDIN using Promises, it's a bug in Rakudo in Windows, and I need to wait for the fix, correct? | ||
sjn redirects Andy from Oslo.pm towards mraynham and PerlJam, just in case he wants to help improve the rakudo.org installation page | |||
FROGGS | jnthn: but --optimize=off helps | ||
jnthn | It's that we emit code-gen to call ENTER phasers upon seeing one in the code. | ||
Really? Wow :) | |||
FROGGS | jnthn: the 'run_phasers_code' is in the ast | 20:51 | |
jnthn | Oh | ||
PerlJam | sjn; there are lots of admins for rakudo.org here (though, I suspect they login about as frequently as I do :) | ||
FROGGS | but... still weird | ||
jnthn | I bet it doesn't recognize that it's not a flattenable blcok, 'cus the phaser isn't lexically within it. | ||
FROGGS | optimize=1 also works, but optimize=2 doesnt | 20:52 | |
I dont get it.... I was thinking that the optimizer in rakudo only fiddles with the ast... but the ast of the working and the non-working version are identical | 20:54 | ||
maybe something is optimized that does not show up in the ast? | 20:55 | ||
timotimo | hmm, i dun wanna backlog | ||
so much backlog | |||
TimToady | $x *= 5 is not going to change, for the reason given in the design docs that nobody actually bothers to read anymore | ||
jnthn | FROGGS: I'm really not sure :S | 20:56 | |
skids | TimToady: well, I was just reading them right now AaMoF :-) | 20:57 | |
PerlJam | TimToady: There's just so much to read! Got a pointer to the specific place where it's mentioned? | ||
ab5tract | TimToady: is that "Assignment doesn't look like binding, but consider that it's really calling some kind of underlying set method on the container, which must be mutable in order to change its contents." | 20:59 | |
retupmoca | jnthn: is it known that "await start { .say for lines }" breaks on windows console (with perl6-m)? | ||
jnthn: or should I rakudobug? | 21:00 | ||
21:00
mraynham left
|
|||
ab5tract | design.perl6.org/S09.html#Autovivification ? | 21:00 | |
TimToady | S03:4115 | ||
synopsebot | Link: design.perl6.org/S03.html#line_4115 | ||
TimToady | it's carefully hidden in the section on Assignment operators | ||
PerlJam | :-P | 21:01 | |
J-L | On my Windows, perl6-m -e "await start { .say for lines }" gives me: ===SORRY!=== and I have to CTRL-C to get out. | ||
FROGGS | jnthn: I am checking now which optimization breaks it | 21:02 | |
21:03
mohij left
21:07
Rounin left
|
|||
TimToady | +1 to always stripping BOM on textual input | 21:08 | |
jnthn | retupmoca: Wasn't known to me, but I can reproduce it | 21:09 | |
ab5tract | TimToady: so I'm more understanding of the nuances here now | 21:10 | |
m: my %k; %k<b> = 3; %k<g> = 7; for <a b c d e f g> { %k{$_} *= 6 }; %k.say | |||
camelia | rakudo-moar 9c6631: OUTPUT«a => 6, b => 18, c => 6, d => 6, e => 6, f => 6, g => 42» | ||
lizmat | m: say Supply.HOW.WHAT # a better way to find out if something is a Role ? | 21:11 | |
camelia | rakudo-moar 903455: OUTPUT«(Perl6::Metamodel::ParametricRoleGroupHOW)» | ||
ab5tract | which means you can do the following easily: (I suppose it is more difficult to introduce a "conditional autovivify") | 21:12 | |
21:12
kjs_ left
|
|||
ab5tract | m: my %k; %k<b> = 3; %k<g> = 7; for <a b c d e f g> { %k{$_} *= 6 if defined %k{$_} }; %k.say | 21:12 | |
camelia | rakudo-moar 903455: OUTPUT«b => 18, g => 42» | ||
jnthn | m: my %k; %k<b> = 3; %k<g> = 7; %k<a b c d e f g>:v >>*=>> 6; say %k; | 21:14 | |
camelia | rakudo-moar 903455: OUTPUT«b => 18, g => 42» | ||
ab5tract | jnthn: that is very pretty indeed :) | ||
jnthn | lizmat: Better than...? | 21:16 | |
21:16
fhelmberger joined
|
|||
lizmat | m: say Supply.HOW.^attributes.map: *.name # grepping on $!pun e.g. ? | 21:17 | |
camelia | rakudo-moar 903455: OUTPUT«@!candidates @!add_to_selector $!selector @!role_typecheck_list $!name $!why $!pun $!made_pun $!pun_repr $!boolification_mode» | ||
ab5tract | though to continue my verbosity vs readability theme, i wish this would also work: | ||
m: %k<b> = 3; %k<g> = 7; %k<a b c d e f g>:values >>*=>> 6; %k.say | |||
camelia | rakudo-moar 903455: OUTPUT«5===SORRY!5=== Error while compiling /tmp/vXe0ChKIn3Variable '%k' is not declaredat /tmp/vXe0ChKIn3:1------> 3%k<b>7⏏5 = 3; %k<g> = 7; %k<a b c d e f g>:value expecting any of: postfix» | ||
ab5tract | m: my %k; %k<b> = 3; %k<g> = 7; %k<a b c d e f g>:values >>*=>> 6; %k.say | 21:18 | |
jnthn | lizmat: Oh, that's an awful way | ||
camelia | rakudo-moar 903455: OUTPUT«Unexpected named parameter 'values' passed in sub postcircumfix:<{ }> at src/gen/m-CORE.setting:3619 in block <unit> at /tmp/D3xGs51QbB:1» | ||
lizmat | jnthn: I agree... | ||
jnthn | m: say Supply.HOW.archetypes.composable | ||
camelia | rakudo-moar 903455: OUTPUT«1» | ||
dalek | c: ca2186e | skids++ | lib/Language/regexes.pod: Add docs for modified quantifier |
21:19 | |
ab5tract | at that point the only "cryptic" part is the double hyper operator, but that's only in the case of not yet fully understanding/thinking in hyper operators | 21:20 | |
lizmat | m: say (class {}).HOW.archetypes.composable # checking | ||
camelia | rakudo-moar 903455: OUTPUT«0» | ||
lizmat | m: say (role {}).HOW.archetypes.composable # checking | ||
camelia | rakudo-moar 903455: OUTPUT«1» | ||
b2gills | TimToady: I assume you actually mean: " +1 to stripping the BOM by default on utf[8|16|32] " | ||
21:20
fhelmberger left
|
|||
ab5tract | with such terse syntax possible, the space saved with by abbreviations may not always be worth it. so I suppose I am proposing a full-length variant for every abbreviation in core (within reasonable limits, of course) | 21:24 | |
TimToady | I think we should strip the BOM on ASCII files too :) | ||
[Coke] | then I have know two names for things? meh | ||
ab5tract | [Coke]: fair point. also, on second thought, this is perl 6 makes this insanely easy to add as a slang. :) | 21:27 | |
. o ( composed well that sentence not ) | 21:28 | ||
21:28
zoosha left
|
|||
[Coke] | I am hoping that "the release" has a corresponding eclipse plugin up and running with builtin doc help. | 21:28 | |
ab5tract | but either way you would obviously only ever need to remember one :P | 21:29 | |
until you read someone else's code, of course | 21:30 | ||
lizmat | jnthn: seems this diff is not cutting it: gist.github.com/lizmat/ec93cc17376c985b69c9 suggestions? | 21:32 | |
FROGGS | shouldnt it be mutate.HOW.archetypes(mutate) ? | 21:33 | |
ohh, probably not | 21:34 | ||
retupmoca | J-L: jnthn: windows console problem has been rakudobugged | ||
FROGGS | lizmat: it should read: mutate.HOW.make_pun(mutate)."$name"(|c) | ||
lizmat: at least that is what I am sure of | |||
jnthn | lizmat: I'm a bit surprised we need that patch | 21:35 | |
lizmat | ok, but that part of the code doesn't run | ||
FROGGS | lizmat: yeah | 21:36 | |
lizmat | mutate.HOW.archetypes.composable is 0 for Supply in the setting | ||
jnthn | I think the issue may be more that we already punned it to call the dispatch:<.=> ? | ||
lizmat | m: my Supply $s .= new | 21:37 | |
camelia | rakudo-moar 903455: OUTPUT«Cannot modify an immutable Supply in method dispatch:<.=> at src/gen/m-CORE.setting:1355 in any at src/gen/m-Metamodel.nqp:1619 in block <unit> at /tmp/eAH2kBFy8R:1» | ||
lizmat | 1355 is mutate."$name"(|c); | ||
gtodd | if it were truly insanely super scary easy = perl6 would write a slang *by itself* and call it perl7 ... | ||
FROGGS | hmmm, the 'is DEPRECATED' bug is triggered by the block at Perl6::Optimizer:1310 | 21:38 | |
jnthn | lizmat: Yeah, I'm looking at a profile (because the profiler tells me the call graph, not 'cus I'm looking at speed :)) | 21:39 | |
lizmat: And it makes the pun the dispatches to the .= | |||
lizmat | jnthn: you're right, mutate is already a Perl6::Metamodel::ClassHOW | 21:42 | |
jnthn | lizmat: Plesae can you have a go with a patch like this: gist.github.com/jnthn/a62bec1143386cd2bb22 | ||
lizmat | will do | ||
FROGGS | jnthn: a call to P6::O.inline_call breaks 'is DEPRECATED' | 21:43 | |
lizmat | perhaps we need to remove "inline_info" inside the is DEPRECATED trait ? | 21:45 | |
raydiak | r: role R does Callable { method postcircumfix:<( )> (|) { self.say } } | 21:46 | |
camelia | rakudo-moar 903455: OUTPUT«===SORRY!===Internal error: failed to remove block» | ||
raydiak | mwahaha golfed you, sneaky bug... | ||
lizmat | $ 6 'my Supply $s .= new; say $s' | ||
Supply.new() | |||
spectesting now | |||
FROGGS | lizmat: I dont see any code that removes inline_info in any way... | 21:47 | |
lizmat | isn't that a mixin? | ||
FROGGS | lizmat: and I also dont see anything that an extra phaser would change here... | ||
21:47
DrForr left
|
|||
lizmat | 2761: $*W.apply_trait($/, '&trait_mod:<is>', $code, inlinable => $inline_info) | 21:48 | |
jnthn | FROGGS: Which call is it inlining? | ||
FROGGS | yes, that sets inline_info | ||
21:48
DrForr joined
|
|||
FROGGS | jnthn: I dunno | 21:48 | |
I'll dump the inline_info.... | |||
jnthn | FROGGS: Take a look? ;) | 21:49 | |
FROGGS: Well, you have the code object it's trying to inline too so you can just .name on it. | |||
FROGGS | :P | ||
lizmat | FROGGS: maybe we need to mark the routine as "soft" | ||
FROGGS | ohh | ||
lizmat | $r = $r but soft ? | 21:50 | |
21:50
kjs_ joined,
kjs_ left
|
|||
FROGGS | jnthn: it is inline my sub foo | 21:51 | |
jnthn | FROGGS: Is that the one you're marking DEPRECATED? | ||
FROGGS | where the is DEPRECATED trait is applied on | ||
dalek | kudo/nom: a9e5ae7 | lizmat++ | src/Perl6/Metamodel/BOOTSTRAP.nqp: Fix my Role $foo .= new, jnthn++ for actual code |
||
jnthn | FROGGS: Right, I think maybe we need to refuse to inline blocks that have phasers | ||
FROGGS: Preferably by not putting the inline_info on them in the first place | 21:52 | ||
FROGGS: It's about the last thing we do in routine_def, so the DEPRECATED trait should have already had its say by then. | |||
FROGGS | I see | 21:53 | |
21:56
muraiki left
21:57
xfix left
|
|||
raydiak | r: role R does Callable { method foo { self.say } } | 21:57 | |
camelia | rakudo-moar 903455: OUTPUT«===SORRY!===Internal error: failed to remove block» | ||
21:59
dolmen joined
|
|||
jnthn | raydiak: Eww | 22:02 | |
raydiak | jnthn: writing up the report now | 22:03 | |
you can even trigger it just with | |||
r: role R does Callable { self.say } | |||
camelia | rakudo-moar 903455: OUTPUT«===SORRY!===Internal error: failed to remove block» | ||
raydiak | (instead of 'self used where no self available' error) | ||
otoh, this works... | 22:04 | ||
r: role R is Callable { self.say } | |||
camelia | rakudo-moar 903455: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tmpfile'self' used where no object is availableat /tmp/tmpfile:1------> 3role R is Callable {7⏏5 self.say } expecting any of: prefix or term» | ||
raydiak | r: role R is Callable { method { self.say } } | ||
camelia | ( no output ) | ||
raydiak | r: role R does Callable { method { self.WHAT } } | 22:05 | |
camelia | ( no output ) | ||
raydiak | metamethods don't break it | ||
dalek | kudo/nom: 1b74e4e | FROGGS++ | src/Perl6/Actions.nqp: do not add inlining info to block with phasers When we inline these blocks we inline away said phasers. This showed up when applying trait "is DEPRECATED" to subroutines for example. lizmat++ and jnthn++ for successful collab :o) |
22:06 | |
timotimo | oh, hehe | ||
clever | |||
22:08
skids left
|
|||
lizmat | yeah! | 22:09 | |
moritz | but spesh might still inline them? | 22:10 | |
FROGGS | if it does it does not break the phasers | ||
jnthn | Right | 22:13 | |
The overall design of spesh is that its effects - besides speed increases and allocation decreases - are not meant to be otherwise observable. | 22:14 | ||
dalek | kudo/newio: 9034557 | lizmat++ | src/core/ (6 files): Kill the Type(Any) coercion meme |
22:15 | |
kudo/newio: a9e5ae7 | lizmat++ | src/Perl6/Metamodel/BOOTSTRAP.nqp: Fix my Role $foo .= new, jnthn++ for actual code |
|||
kudo/newio: 1b74e4e | FROGGS++ | src/Perl6/Actions.nqp: do not add inlining info to block with phasers When we inline these blocks we inline away said phasers. This showed up when applying trait "is DEPRECATED" to subroutines for example. lizmat++ and jnthn++ for successful collab :o) |
|||
kudo/newio: 6b353b4 | lizmat++ | src/ (7 files): Merge branch 'nom' into newio |
|||
jnthn | And it can care about preserving VM interface level semantics. | ||
dalek | kudo/cpp: 04178ab | FROGGS++ | lib/NativeCall.pm: only mangle symbols before making the call |
22:19 | |
raydiak | < FROGGS jnthn lizmat >»++ | 22:24 | |
r: role R { method foo () handles <bar> { } } # [BUG]? any reason we shouldn't be able to delegate to a method in a role? | 22:29 | ||
camelia | rakudo-moar 1b74e4: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tmpfileMethod 'add_method' not found for invocant of class 'Perl6::Metamodel::GenericHOW'at /tmp/tmpfile:1------> » | ||
dalek | ast: f3b7e45 | lizmat++ | S12-construction/autopairs.t: Unfudge now passing my Role $r .= new tests |
22:36 | |
J-L | Is there a Perl6 equivalent to Perl5's alarm() ? | 22:38 | |
Also, what is the best way to get the last element of an array? In Perl5 I could do $a[-1], but in Perl6 what should I do? @a[@a.end] ? | 22:39 | ||
geekosaur | *-1 | 22:40 | |
that is, @a[*-1] is the last element | 22:41 | ||
in general things like magic negatives have been replaced with the whatever star, to avoid program bugs when an index buggily gets decremented past 0 | |||
J-L | Thanks, geekosaur. Is there a web page that teaches that specifically? If so, I'd like to learn whatever else it teaches. | 22:42 | |
geekosaur | you are in effect declaring that you intend to access from the end | ||
lizmat | hmmm... looks like we borked the jvm build | ||
lizmat sneaks away to get some sleep& | |||
geekosaur | not sure, beyond the synopses at design.perl6.org (specifically "The Whatever Object" and following sections in raw.githubusercontent.com/perl6/sp...2-bits.pod for this) | 22:45 | |
22:47
telex left
22:48
telex joined
|
|||
donaldh is dissecting the jvm build | 22:51 | ||
raydiak | J-L: as an overview of what is going on there, the * is a Whatever, which you're likely reading about...using * in most expressions will give a little closure/anonymous sub we call a WhateverCode, which takes an arg for the * and returns the result of the expression...so "*-1" is kinda like "sub ($v) { $v-1 }" | 22:53 | |
J-L: now the other part of the magic is that when you pass a callable thing like a sub or a WhateverCode to an array subscript, it gets passed the .elems of the array and uses the result as the (non-negative) index | 22:54 | ||
J-L: so in effect @a[*-1] is the same as @a[@a.elems-1] (nearly the same as your original question's example), just a much, much nicer way to write it :) | 22:55 | ||
and dare I say, both far more expressive and functional than just saying "negative subscripts count backwards from the end" | 22:57 | ||
J-L | raydiak: Yes, much nicer. Thanks. | ||
Here's a new question: Is that a page that can explain how to use pack() and unpack() in Perl6? | 22:58 | ||
22:58
cognominal joined
22:59
FROGGS left
|
|||
raydiak | eh, not so much...the quality of the barely-existant un/pack docs are about on par with the implementation, unfortunately, from what I've heard | 23:00 | |
23:00
mule joined,
mule left
|
|||
J-L | How are they different? (the pack/unpack between Perl5 and Perl6) I ask because I'm porting some code over from Perl 5 to Perl 6 and I still have to convert the pack() code over. | 23:02 | |
I need a Perl 6 equivalent for Perl5's: split(m//, $string) | 23:04 | ||
raydiak | well, P5 un/pack is featureful and mature, while ours is at some indeterminate point of development as I understand it...idk how much of it works or not, and if anything has been changed | ||
b2gills | I'm not sure that the details of how pack will work in Perl 6 have been completely nailed down yet | ||
23:04
dolmen left
|
|||
raydiak | r: "foo".comb.perl.say # J-L: P6 version of split // | 23:05 | |
camelia | rakudo-moar 1b74e4: OUTPUT«("f", "o", "o").list» | ||
b2gills | more generally $string.comb(/./) | 23:07 | |
23:07
laouji joined
|
|||
J-L | TOoh! comb() looks nice! Thanks! | 23:09 | |
raydiak | yer welcome :) wrt alarm(), I'm pretty sure we don't have it in lieu of higher-level timing and async stuff like Promise.in()...could get at it w/NativeCall if you really wanted but then you have to make it work on both posix and windows again | 23:10 | |
J-L | Okay, here's one that's stumping me: In Perl5, I could do: $c ^= $n; But in Perl6, when I try: $c +^= $n; I seem to get a one(...) object (something I'm not familiar with). | ||
timotimo | hm, can you try [+^]= ? | 23:11 | |
J-L | raydiak: Actually, I was asking about alarm() simply because I wanted to use a Promise, but reading from STDIN in a Promise is a bug in Windows Raduko. | ||
23:11
laouji left
|
|||
timotimo | it is? | 23:12 | |
what does it lead to? | |||
because moarvm does lock its I/O objects | |||
J-L | Oops... 2 things: 1) [+^]= works fine. 2) +^= also works fine. I made a previous mistake and didn't undo it before testing +^=, so it carried over. | 23:13 | |
Is there a Perl6 equivalent to Perl5's __END__ ? | 23:15 | ||
timotimo | oooh | ||
what exactly do you want to do with it? | |||
there's =begin end, or =finish | |||
one of the two | |||
23:17
wicope left
|
|||
J-L | I like to mark the end of my file with __END__. Makes it easier to copy and paste into a post and back. | 23:18 | |
If I have a string with arbitrary binary data and I want to get its length (as number of bytes), how do I do that? | 23:19 | ||
raydiak | you'd be better off using a Buf (which has .bytes iirc) instead of a Str | 23:20 | |
J-L | Not only that, but with __END__ I can put additional information promised at the top of my script. Especially long amounts of data that might be useful in the future. | ||
raydiak | you can convert a Str to a Buf using .encode | ||
the separation is basically there b/c you can't meaningfully talk about characters in a Buf/Blob or bytes in a Str and so forth without carefully considering encoding...is the source of a lot of subtle unicode bugs | 23:24 | ||
I think Pod blocks are supposed to supplant __END__ but idk much about them myself | 23:25 | ||
dalek | p/js: db1a1c1 | (Pawel Murias)++ | t/nqp/95-cclass.t: Rescue issclass tests from the nqp-jvm repo |
23:28 | |
p/js: da1949a | (Pawel Murias)++ | / (4 files): Pass test 95. Implement nqp::isclass, nqp::findcclass, nqp::findnotcclass. |
|||
p/js: fc5f19a | (Pawel Murias)++ | TODO: Remove done item from TODO. |
|||
23:29
cognominal left
|
|||
raydiak | wrt Promise on windows, a Promise.in doesn't introduce async into your own code, just like a signal handler actually doesn't...so if you were going to solve your problem by stuffing code in a signal handler, I'd think you could just as easily say «my $p = Promise.in($wait); until $p { say "waiting and doing stuff" }; say "done waiting";» | 23:30 | |
vendethiel | pmurias++ | ||
raydiak | which, isn't as pretty as we'd like, but workarounds are seldom pretty :) | ||
23:34
Possum left
23:36
rurban left
23:39
Possum joined
|
|||
J-L | In Perl5, I often dealt with binary data by reading it to a string, manipulating it, and writing it out to file. In fact, I could compose a binary string with $string.=chr($num) which would append a byte of value $num to $string. | 23:40 | |
But now in Perl6, that doesn't seem to work; I'll append 300*500 chr()s, only to find out that when I call $string.encode.bytes that I get 587200. | 23:41 | ||
raydiak | you can do all the same things with Buf...it even does Stringy | 23:42 | |
23:42
gfldex left
|
|||
raydiak | if you aren't really working with strings, you really don't want to use real strings | 23:42 | |
in this case, .encode uses utf8 by default, so depending on what your chr()s actually are, .encode could produce a number of bytes != 1 for 1 char | 23:43 | ||
jercos | Can you append to a Buf? | 23:44 | |
raydiak | they are variable in length, yes | ||
m: my $b = Buf[uint8].new; $b[4] = 255; say @$b; | |||
camelia | rakudo-moar 1b74e4: OUTPUT«0 0 0 0 255» | ||
23:45
Ben_Goldberg joined
|
|||
raydiak | or $b[*-1] if you like :) | 23:45 | |
jercos | Hrm... | 23:46 | |
m: my $b = Buf.new(1, 2, 3);$b[*] = 4;say $b | |||
camelia | rakudo-moar 1b74e4: OUTPUT«This type cannot unbox to a native integer in method STORE at src/gen/m-CORE.setting:9007 in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:3405 in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:3487 in block <unit> at /tmp/YjJXLjXNbA…» | ||
raydiak | you *can* treat it directly *as* a string too, but I haven't used them that way, separating strings and binary was really brilliant and I'm going along with it :) | ||
23:46
kst` is now known as kst
|
|||
raydiak | +* or *-0 or so should work | 23:47 | |
jercos | m: my $b = Buf.new(1, 2, 3);$b[+*] = 4;say $b | ||
camelia | rakudo-moar 1b74e4: OUTPUT«Buf:0x<01 02 03 04>» | ||
jercos | there we go | ||
raydiak | b/c * by itself makes a whatever instead of a whatevercode, which gives you all elems | ||
TimToady | and you can append to a buf with ~= | ||
23:47
virtualsue left
|
|||
TimToady | I had an example doing that earlier today | 23:47 | |
jercos | m: my $b = Buf.new(1, 2, 3);$b ~= Buf.new(4);say $b | ||
camelia | rakudo-moar 1b74e4: OUTPUT«Buf:0x<01 02 03 04>» | ||
TimToady | irclog.perlgeek.de/perl6/2015-03-06#i_10236360 | 23:48 | |
raydiak | m: my $b = Buf.new; $b ~= "a"; say $b.decode | 23:49 | |
camelia | rakudo-moar 1b74e4: OUTPUT«Cannot use a Buf as a string, but you called the Stringy method on it in method Stringy at src/gen/m-CORE.setting:6449 in sub infix:<~> at src/gen/m-CORE.setting:1582 in block <unit> at /tmp/2tvKVvpjLn:1» | ||
raydiak | m: my $b = Buf.new; $b ~= 50; say $b.decode | ||
camelia | rakudo-moar 1b74e4: OUTPUT«Cannot use a Buf as a string, but you called the Stringy method on it in method Stringy at src/gen/m-CORE.setting:6449 in sub infix:<~> at src/gen/m-CORE.setting:1582 in block <unit> at /tmp/D45c5nHbP2:1» | ||
raydiak | m: my $b = Buf.new; $b ~= $*IN.read(1); say $b.decode | 23:50 | |
camelia | rakudo-moar 1b74e4: OUTPUT«C» | ||
J-L | I want to write this Buf[uint8] to a file. Can I just write it out as if it were a Str? | ||
raydiak | J-L: yes | ||
jercos | J-L: you can write it out as if it were a buf ;) | ||
donaldh | Well that's tricky. The fix for nqp::index on JVM that lets rakudo work at all on JVM also means we produce a different compiler that fails a lot of spectests on JVM. | 23:51 | |
And my laptop battery is now flat, finding that out. | 23:52 | ||
J-L | How do I append to a Buf? I mean, I can use array subscripting ([ ]), but then I have to use an index. | ||
donaldh | r: Buf.^methods | ||
camelia | ( no output ) | ||
donaldh | r: Buf.^methods.say | ||
camelia | rakudo-moar 1b74e4: OUTPUT«» | ||
raydiak | J-L: check the backlog like 10 or 20 lines up :) | 23:53 | |
retupmoca | m: my $b = pack("n", 123); $b ~= pack("n", 456); say $b; say $b.unpack("nn") # small pack/unpack example | 23:54 | |
camelia | rakudo-moar 1b74e4: OUTPUT«Buf:0x<00 7b 01 c8>123 456» | ||
23:54
skids joined
|
|||
J-L | When I say: my $b = Buf[uint8].new; $b ~= chr(66); | 23:55 | |
I get: Cannot use a Buf as a string, but you called the Stringy method on it | |||
retupmoca | m: my $b = buf8.new; $b[+*] = 66; say $b; | ||
camelia | rakudo-moar 1b74e4: OUTPUT«Buf[uint8]:0x<42>» | ||
jercos | m: my $b = Buf.new(74,97,80,104); $b ~= Buf.new(10); $*OUT.write: $b | 23:56 | |
camelia | rakudo-moar 1b74e4: OUTPUT«JaPh» | ||
raydiak | m: $*IN.read(1).perl.say | ||
camelia | rakudo-moar 1b74e4: OUTPUT«Buf[uint8].new(67)» | ||
raydiak | r: my $b = Buf.new: ^4; say $b ~ Buf.new: 4,5,6 | 23:57 | |
camelia | rakudo-moar 1b74e4: OUTPUT«Buf:0x<00 01 02 03 04 05 06>» | ||
eli-se | omg my compiler works | 23:59 | |
timotimo | \o/ |