»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
SmokeMachine I was reading the post about exportable (www.0racle.info/articles/exportatio...ploration) and was trying to implement that... 02:40
and I got an output that I can't understand...
my code is: gist.github.com/FCO/a61fbbcf0a498f...419b3325fb 02:41
m: gist.github.com/FCO/a61fbbcf0a498f...419b3325fb
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix = instead.
Did you make a mistake in Pod syntax?
at <tmp>:1
------> 3Hash[Routine] %funcs =7⏏5 (my Routine %)
SmokeMachine m: gist.github.com/FCO/a61fbbcf0a498f...419b3325fb 02:42
camelia ===SORRY!===
Could not find Bla at line 2 in:
/home/camelia
/home/camelia/.perl6
/home/camelia/rakudo-m-inst-1/share/perl6/site
/home/camelia/rakudo-m-inst-1/share/perl6/vendor
/home/camelia/rakudo-m-inst-1/share/perl6…
geekosaur doesn'tt hat type have to be something like Hash{Routine} instead of square brackets? 02:45
SmokeMachine geekosaur: camelia was trying to compile the file with the output... 02:48
geekosaur: what I can't get is: the %funcs seems to be populated... why the `say "exported-EXPORT: @funcs[]; %funcs<>";` says it isn't? 02:50
geekosaur looks to me like you are producing a reference to a sub that needs a 'my' variable. whose value doesn't exist any more because sub EXPORT has returned 02:56
pretty sure it can't close over %funcs just because you returned a reference to a sub object that uses it 02:57
probably need either "our", or some other way carry the scope with exported-EXPORT. possibly use the assuming method to pass it in? 02:59
SmokeMachine geekosaur: that makes sense... 03:04
geekosaur: thanks! 03:05
geekosaur: using assuming didn't help... but the error changed... 03:07
now it dies with:
www.irccloud.com/pastebin/PAMwEWAB/
there's no `$res` on my code
geekosaur well, that sounds like it at least tried, but wasn't expecting what you did. I had been wondering how it would deal with that, tbh 03:08
might have to unroll it into the call since it again doesn't exist. ($res is probably from the hackery 'assuming' does) 03:09
yes, it is. and that hackery is …fragile 03:12
(it's sprintf-ing an anon sub and EVAL-ing it. ick) 03:13
so something went wrong generatingt he anon sub and its internal $res ended up out of scope 03:14
might be easier to return an anon sub yourself. 'EXPORT' => sub { exported-EXPORT(%funcs) } # ? 03:15
.oO { if you like sausages, politics, or rakudo, don't look at any of them being made } 03:18
SmokeMachine :) 03:20
it's working! 03:33
SmokeMachine geekosaur: gist.github.com/FCO/18bbbbe640d7f8...b612ceec3d 03:55
Xliff m: use NativeCall; class A is repr('CStruct') { has uint32 $.a }; my Pointer[A] $pa = nativecast(Pointer[A], $a.new); say $pa; 03:59
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3Pointer[A] $pa = nativecast(Pointer[A], 7⏏5$a.new); say $pa;
Xliff m: use NativeCall; class A is repr('CStruct') { has uint32 $.a }; my Pointer[A] $pa = nativecast(Pointer[A], A.new); say $pa;
camelia NativeCall::Types::Pointer[A]<0x5471150>
Xliff m: use NativeCall; class A is repr('CStruct') { has uint32 $.a }; my Pointer[A] $pa = nativecast(Pointer[A], A.new(:a = 32); say $pa; $pa.deref.gist.say 04:00
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use variable $pa in declaration to initialize itself
at <tmp>:1
------> 3vecast(Pointer[A], A.new(:a = 32); say $7⏏5pa; $pa.deref.gist.say
expecting any of:
argument lis…
Xliff m: use NativeCall; class A is repr('CStruct') { has uint32 $.a }; my Pointer[A] $pa = nativecast(Pointer[A], A.new(:a = 32)); say $pa; $pa.deref.gist.say
camelia Cannot modify an immutable Pair (a => True)
in block <unit> at <tmp> line 1
Xliff m: use NativeCall; class A is repr('CStruct') { has uint32 $.a }; my Pointer[A] $pa = nativecast(Pointer[A], A.new(:!a = 32)); say $pa; $pa.deref.gist.say
camelia Cannot modify an immutable Pair (a => False)
in block <unit> at <tmp> line 1
Xliff m: use NativeCall; class A is repr('CStruct') { has uint32 $.a = 32 }; my Pointer[A] $pa = nativecast(Pointer[A], A.new); say $pa; $pa.deref.gist.say 04:01
camelia NativeCall::Types::Pointer[A]<0x3acae80>
A.new(a => 32)
xinming Since <> is decont operation, What is [] then? 06:48
[] is still decont op?
What are the differences between <> and [] ?
moritz <> is also a quoting construct, and magical in other ways 07:09
m: say <a b>.perl
camelia ("a", "b")
moritz m: say [a b].perl
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routines:
a used at line 1
b used at line 1
xinming moritz: So, when [] and <> both used in postfix. 07:33
they are the same, right?
What I mean is, I read perl6advent.wordpress.com/2017/12/02/ it says <> is decont operation. 07:34
and I found that $list[] can also do "decont" over list.
rba Where can I find rakudo star windows binaries as zip file? I found only the msi. 07:36
chsanch rba: github.com/rakudo/star/releases 07:48
moritz xinming: ah, you mean empty <> and [] as "zen slice". Yes, should both be the same 07:50
rba chsanch: so, the message is, to build it myself? 07:51
moritz rba: I think so, yes :( 07:53
rba: I'm curious, what's your use case of zip over MSI?
chsanch rba: probably is the best option, not sure why you can't use MSI 07:54
rba moritz: Sitting in front of enterprise windows, where I'm not allowed to install msi myself.
moritz: So I will install the msi on my private machine and then smuggle the binaries on that system, I guess...
chsanch rba: www.codetwo.com/kb/msi-from-exe/ maybe with 7-Zip (I don't use windows, so not sure if that could work) 07:56
finanalyst good time-of-day. Having a problem with CompUnit::Repository. The repository is providing an old handle even when :since is set. I think this is a bug, but I wanted to check. Pastebin of code and result pastebin.com/wtA9a0nP 07:58
moritz rba: but can you install files to C:\rakudo in your enterprise windows? 08:00
rba chsanch: Tried to unzip it using 7-zip already, yet all the files have filenames like "fil<hex-uniq-id>".
El_Che moritz: colleagues using Windows use lots of portable apps (because their installations are restricted to sillyness).
moritz rakudo is not relocatable :(
El_Che but the not relocatable thing makes this argument moot
El_Che is a Linux rebel at work, with an illegal OS on his laptop :) 08:01
rba moritz: so then I'm lost anyway. I have no rights to write to c:\ 08:02
El_Che it sounds like we work on the same place or we have the same crappy desktop admins :) 08:03
rba: you'll need to compile to a directory where you have rw access to
typically, something stupid like Document or MyApps
rba El_Che: got it. will first try to find out, from which location I'm allowed to run binaries. Then I will try to build it on my personal notebook and try to relocate the binaries to the companies machine. 08:10
El_Che yes, in the same location
donaldh_ code golf, building mountains: codegolf.stackexchange.com/a/174735/66624 09:43
xinming moritz: Thanks for the clarification. 10:18
Zoffix xinming: that article lists <> as decont, simply 'cause it's easy to remember (it looks like a squished box) and unlike `[]` zen slice that's often used to interpolate `@-` vars in strings, the `<>` is seldom used. The reason `<>` or `[]` work as decont is they simply return `self`, so even a `.self` method call will decont. 10:34
xinming: also, they're currently not the same. `[]` caches the Seq, while `<>` doesn't. The `[]` was made to cache very recently, and now I'm questioning whether it was right... 10:36
Zoffix will open an Issue, but will default to reverting the caching of `[]` 10:36
Zoffix decides to just revert it 10:38
(it's 7-days old only)
xinming: oh, and the whole "self" thing works because `self` inside methods is automatically deconted (unless it's a Proxy) 10:40
m: sub postfix:<🥡> { $^a<> }; my $s = (1, 2, 3); .say for $s🥡 10:49
camelia 1
2
3
Geth doc: d2e99cc0e3 | (Zoffix Znet)++ | doc/Language/subscripts.pod6
Fix up ZEN slicing on Seqs

The caching behaviour (R#2383[^1]) was reverted[^2][^3] and non-caching behaviour propspeced[^4]
  [1] github.com/rakudo/rakudo/issues/2383
  [2] github.com/rakudo/rakudo/commit/2efffc2b43
  [3] github.com/perl6/roast/commit/5485affa47
  [4] github.com/perl6/roast/commit/f5f9ce0083
10:57
synopsebot Link: doc.perl6.org/language/subscripts
synopsebot R#2383 [closed]: github.com/rakudo/rakudo/issues/2383 [consistency][testneeded] .[] doesn't cache a Seq
Zoffix .tell AlexDaniel` I merged my post-release branches 'cause I recall you saying we could do whatever on master now, but perhaps you'd like to cherry-pick github.com/rakudo/rakudo/commit/2efffc2b43 because original commit ain't on any release. Also, it's possible the original commit introed a memory leak bug in some code that uses `[]` to decont a large Seq 11:04
yoleaux Zoffix: I'll pass your message to AlexDaniel`.
Zoffix Merci, roboto! 11:05
AlexDaniel` . 11:41
yoleaux 11:04Z <Zoffix> AlexDaniel`: I merged my post-release branches 'cause I recall you saying we could do whatever on master now, but perhaps you'd like to cherry-pick github.com/rakudo/rakudo/commit/2efffc2b43 because original commit ain't on any release. Also, it's possible the original commit introed a memory leak bug in some code that uses `[]` to decont a large Seq
El_Che releasable6: status 11:46
releasable6 El_Che, Next release will happen when it's ready. 1 blocker. 492 out of 514 commits logged
El_Che, Details: gist.github.com/2cdc187e62ef613b85...60c5ede495
atroxaper Hello, #perl6 ! 12:07
kensanata yo 12:09
atroxaper It's me again :) Yesterday I asked about wrap and signatures (stackoverflow.com/questions/529898...wrap-sub). Today I have try to find a workaround and found that it is not because wrap but because CALL-ME method;
sub s(:$arg) {}; say %(:arg(3)) ~~ &s.signature; say &s.^find_method('CALL-ME'); &s does role r { submethod CALL-ME(|) {} }; say %(:arg(3)) ~~ &s.signature; say &s.^find_method('CALL-ME');
evalable6 True
(Mu)
False
CALL-ME
atroxaper I tried to find CALL-ME method in the compiler code. As I understand the method is 'not real' for most classes. Maybe I'm wrong :) 12:12
kensanata: hi ^^
masak for the curious: www.youtube.com/watch?v=Nv8_hrS5ARY was released today, of a local talk I gave about 007 (51 min) 12:20
jkramer Are there any good modules for parsing html? modules.perl6.org/search/?q=html looks a bit sad :( 12:24
I don't want to do crazy stuff, basically just find a single specific node and get its value 12:25
masak maybe use a Perl 5 module from CPAN? 12:26
jkramer I wanted to avoid that :) 12:26
But I guess it's the best bet
masak pretty sure it is
masak I mean, I see the idealistic aspect of wanting to avoid it, but it's probably pragmatic to embrace it ;) 12:27
as TimToady would say, it was never about the "or", and always about the "and"
masak .oO( technically "xor"... )
atroxaper jkramer: I have used modules.perl6.org/search/?q=xml+au...thy+Totten 12:28
jkramer masak: The problem is I want to ship the code to people who might not be familiar with of the perls and even I am running into problems here :) dpaste.com/0PY385B 12:31
Zoffix eco: DOM::Tiny 12:31
jkramer *either of the perls
buggable Zoffix, DOM::Tiny 'Very small, self-sufficient DOM parser manipulator': modules.perl6.org/dist/DOM::Tiny:cpan:HANENKAMP
Zoffix jkramer: use that ^
jkramer Zoffix: Sweet, exactly what I was looking for :) 12:32
masak well, people seem to be suggesting p6 modules for you :)
jkramer So I don't need to use Mojo::DOM via Inline::Perl5 \o/
masak but I also think we have a big job in general of making p5<->p6 integration not just OK, but sometimes encouraged
Zoffix jkramer: FWIW, it has a huge test suite. May wish to --/test install it
(takes ages to run) 12:33
masak I haven't been around frequently enough to know whether nine++ is still fighting for the good cause, but... I happen to think it's a good idea
jkramer Thanks for the warning Zoffix :)
lizmat masak++ # nice presentation 12:34
masak <3
lizmat also: 99 ... 0 also works nicely (and optimally :-)
masak that's not Perl 6, though :P 12:35
Zoffix m: .say for 99 ... 0
camelia 99
98
97
96
95
94
93
92
91
90
89
88
87
86
85
84
83
82
81
80
79
78
77
76
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
4…
masak .oO( you think that's air you're breathing? ) :P
lizmat masak: ah, yes, duh :-) 12:36
masak lizmat: github.com/masak/007/blob/f2b68ee5...ottles.007
jkramer Cannot import symbol &to-json from DOM::Tiny, because it already exists in this lexical scope
Zoffix ah crap
jkramer Hmpf, the docs don't mention a &to-json in that module. How do I avoid that?
Zoffix jkramer: yeah, it's already filed as github.com/zostay/p6-DOM-Tiny/issues/12
jkramer: IIRC I just stuck DOM::Tiny into a separate file and exported just the DOM::Tiny class from it 12:37
jkramer Can I prevent it from being exported in the 'use' line?
jnthn Try `need` instead of `use`
Zoffix Yeah, `need` works; jnthn++ 12:39
jkramer Yup, that works :)
Is need just use without the exports? Never seen that before
Zoffix Yeah, `use` is `need` + `import` 12:39
atroxaper I add an issue github.com/rakudo/rakudo/issues/2430. Please have a look. 12:40
jkramer It's missing in my vim p6 syntax file too :)
pmurias masak: have you seen the java pattern for doing code-generation where you put annotations on a class and a preprocessor (which you write in java) takes those annotations (it also can read the signatures of method etc. of that class) and generates a class that inherits from it 12:43
masak pmurias: I had not.
pmurias the oracle people tend to use it in their truffle languages (so I have borrowed it for the nqp truffle backend) 12:46
masak ah, I see 12:47
in 007 I'd be more tempted to, you know, *transforming code* on the AST level ;)
for example, I think class declarations themselves (with or without annotations) will end up desugaring to MOP calls 12:48
pmurias masak: some of the details of the java scheme like generating code as *strings* are a bit primitive but it's interesting what can be accomplished by little means 12:51
masak: it's also interesting how they implement regular DSLs in string annotations 12:53
@Specialization(guards = "b == 2") void doDivPowerTwo(int a, int b) { return a >> 1; } 12:54
pmurias what's a SUPER equivalent in Perl 6? 13:03
$self->SUPER::method_from_parent
jkramer zostay: Should this already work in DOM::Tiny? $d.at('html > meta > link[ref=canonical]') 13:04
Seems like the attribute matching isn't working, also tried with "canonical".
jkramer This works just fine, so the tag is definitely there: $d.find('html > head > link').first(*.attr<rel> eq 'canonical').attr<href> 13:05
masak pmurias: you can probably do that exact things by walking up .^mro 13:06
pmurias: but a more idiomatic use would maybe be something like nextsame() 13:07
depends if you really want to call another method, or the same one
timotimo you can self.ClassName::methodname() 13:12
masak oh, even for class names? 13:13
timotimo as strings?
i haven't tried, actually
masak m: class C { method foo { say "C" } }; class D is C { method foo { say "D"; self.C::foo() } }; D.new.foo
camelia D
C
masak looks like
I knew it worked for roles, but not for classes
timotimo m: class Parent { method dothething() { say "parent does the thing" } }; class Child is Parent { method dothething() { say "child does the thing" }; method parentdo($classname) { self."$classname::dothething"() } }; Child.new.parentdo("Parent") 13:15
camelia Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in method parentdo at <tmp> line 1
No such method '' for invocant of type 'Child'. Did you mea…
timotimo m: class Parent { method dothething() { say "parent does the thing" } }; class Child is Parent { method dothething() { say "child does the thing" }; method parentdo($classname) { self."{$classname}::dothething"() } }; Child.new.parentdo("Parent")
camelia No such method 'Parent::dothething' for invocant of type 'Child'
in method parentdo at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo not like that in any case 13:16
jkramer zostay: Nevermind, I'm stupid and had a typo in the attr name :) 13:18
timotimo to be fair, you can use the right .dispatch method surely
masak: i'm watching your talk and i'm wondering, how hard would it be to port over NativeCall and CArray and friends? :) 13:28
masak timotimo: heh
timotimo: I have no idea ;)
timotimo have you done any performance comparisons between p6, nqp, and 007? 13:29
surely it's a bit better than nqp when it comes to math, because nqp still goes between int and num and back all the time
masak the short answer is "007 is ridiculously slow"
to be clear, the current 007 *interprets the AST* 13:30
timotimo oh no
oh, i hadn't realized that
masak and speed hasn't been a priority at all
timotimo that's sensible
masak because the goal is to explore macros
what I personally look forward to is to land infix:<ff> (in the short term) and `is parsed` (in the longer term) 13:32
buggable New CPAN upload: JSON-Path-1.2.tar.gz by JNTHN modules.perl6.org/dist/JSON::Path:cpan:JNTHN
mscha m: my @foo = rand xx 10; for 0,3...@foo -> $i { say $i } 13:37
camelia 0
0.8844963464615883
0.9309241180001215
0.14702861888670316
0.7359944433368208
0.6476432723661951
0.7295569500991561
0.12712475380280652
0.25546723986094133
0.945500368233164
mscha What am I doing wrong?
I expected: 0,3,6,9
m: my @foo = rand xx 10; for 0,3...@foo.elems -> $i { say $i } 13:38
camelia 0
3
6
9
timotimo the end point gets smart-matched against
i've reached the point in the presentation where you explain interpreterness and such 13:40
pmurias masak: is it planned for 007 to explore bigger (more usefull) forms of language extension then macros? 14:30
jkramer m: Hash.new(:lol('asd')).say 14:32
camelia {}
jkramer What's happening here?
moritz m: say Hash.new('lol', 'asd') 14:33
camelia {lol => asd}
moritz jkramer: Hash.new has a different API than you expect, that's what happens
jkramer Shouldn't it accept pairs too? According to the docs it should
moritz m: say {:lol('asd')}
camelia {lol => asd}
jkramer m: Hash.new((:lol('asd'))).say
camelia {lol => asd}
moritz jkramer: what does the tests say?
jkramer Ah it needs extra parens for some reason 14:34
moritz now you're passing the pair as a positional param
jkramer Oh that's it, thanks :)
donaldh_ There's something amiss with \ char in tr/// 14:46
m: $_ = '|\^/|'; .say; tr|^\/| |; .say 14:47
camelia |\^/|
|\ |
donaldh_ m: $_ = '|\^/|'; .say; tr|^/\| |; .say
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed replacement part; couldn't find final |
at <tmp>:1
------> 3$_ = '|\^/|'; .say; tr|^/\| |; .say7⏏5<EOL>
donaldh_ m: $_ = '|\^/|'; .say; tr|^/\\| |; .say 14:48
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed replacement part; couldn't find final |
at <tmp>:1
------> 3$_ = '|\^/|'; .say; tr|^/\\| |; .say7⏏5<EOL>
jkramer m: my %h = :foo<123>, :bar<456>, :baz<789>; class A { has $foo; has $baz; has $meep; }; A.new(:meep(123), |(%h<foo baz>:p)).say
camelia Default constructor for 'A' only takes named arguments
in block <unit> at <tmp> line 1
jkramer How can I make that work?
jnthn |% instead of | probably does it 14:49
jkramer my %h = :foo<123>, :bar<456>, :baz<789>; class A { has $foo; has $baz; has $meep; }; A.new(:meep(123), |%(%h<foo baz>:p)).say
evalable6 A.new
jkramer \o/ Thanks
buggable New CPAN upload: Zodiac-Chinese-0.0.1.tar.gz by TMTVL cpan.metacpan.org/authors/id/T/TM/...0.1.tar.gz 15:12
Geth ecosystem: tmtvl++ created pull request #411:
Add Zodiac::Chinese (github.com/tmtvl/Zodiac-Chinese)
15:32
sena_kun m: my $m = Cursor.^methods.grep(*.name eq 'alpha')[0]; say $m.^name; say $m ~~ Method; 15:50
camelia NQPRoutine
Died with X::Multi::NoMatch
in block <unit> at <tmp> line 1
sena_kun So I see it's not a Method, but cannot match it. Any better solution comes to mind(without literal string comparsion on `^name`)? 15:52
buggable New CPAN upload: DOM-Tiny-0.5.0.tar.gz by HANENKAMP modules.perl6.org/dist/DOM::Tiny:cpan:HANENKAMP
moritz m: my $m = Cursor.^methods.grep(*.name eq 'alpha')[0]; say $m.^isa(Method) 15:53
camelia Died with X::Method::NotFound
in block <unit> at <tmp> line 1
moritz ouch
m: use nqp; my $m = Cursor.^methods.grep(*.name eq 'alpha')[0]; say nqp::istype(nqp::decont($m), Method)
camelia 0 15:53
sena_kun hmm, I thought it's possible with nqp usage. was not sure if it's possible on user level, but, well, I guess I am deep enough anyway. 15:54
thanks, moritz!
moritz sena_kun: my pleasure
timotimo well, it's not derived from Method
timotimo you'd have to check against NQPMethod, right? 15:54
moritz timotimo: but the smartmatch dieing is LTA
sena_kun m: my $m = Cursor.^methods.grep(*.name eq 'alpha')[0]; say $m.^name; say $m ~~ NQPMethod; 15:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
NQPMethod used at line 1. Did you mean 'Submethod'?
sena_kun m: my $m = Cursor.^methods.grep(*.name eq 'alpha')[0]; say $m.^name; say $m ~~ NQPRoutine;
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
NQPRoutine used at line 1
Geth ecosystem: 41d0f35cb1 | (Zoffix Znet)++ (committed using GitHub Web editor) | .travis.yml
Install SSL Sock before LWP::Simple

Looks like LWP::S's tests require it now, and that causes travis builds to croak:
  travis-ci.org/perl6/ecosystem/buil...0151#L1402
16:09
Geth ecosystem: fb972a3cde | (Tim Van den Langenbergh)++ | META.list
Add Zodiac::Chinese (github.com/tmtvl/Zodiac-Chinese)
16:18
ecosystem: 12aeecf3ef | (Tim Van den Langenbergh)++ (committed using GitHub Web editor) | META.list
Merge pull request #411 from tmtvl/master

Add Zodiac::Chinese (github.com/tmtvl/Zodiac-Chinese)
azawawi hi 16:39
timotimo greetings 16:40
azawawi How does one overcome CStruct pass-by-reference restriction without writing extra wrapper C code?
timotimo you mean like clone it? 16:41
azawawi is feeling puzzled
timotimo i wonder if "is copy" does anything
azawawi timotimo: im currently working on a libclang wrapper
Geth ecosystem/zoffixznet-patch-1: 460bf45c5e | (Zoffix Znet)++ (committed using GitHub Web editor) | README.install-template.md
Shorten install instructions
azawawi timotimo: and was stuck for a while until i found out that restriction in docs / my own previous code :) 16:42
Geth ecosystem: zoffixznet++ created pull request #412:
Shorten install instructions
azawawi timotimo: the problem is libclang is also parsing cursors to nodes by value to callbacks... 16:43
parsing=passing
timotimo so the problem is that it passes structs to you, but you want to change the data locally, but not change what you got passed? 16:43
oh
it passes structs without a pointer
i think only returning structs is problematic 16:44
azawawi timotimo: true... CStruct objects are passed to native functions by reference and native functions must also return CStruct objects by reference 16:46
anyways without wrapping CXCursor passing-by-value, I get silent & random segmentation faults. 16:47
github.com/azawawi/scripts/blob/ma...ibclang.p6 # so far
once libclang is wrapped, we can traverse the nodes... and basically output nativecall stuff... like bindgen in rust. 16:48
parse C/C++ headers easily... automate nativecall boilerplate and provide another way besides gptrixie 16:50
stuck now in the final node traversal (callbacks) 16:52
Geth ecosystem: 4aca12bf96 | (Zoffix Znet)++ (committed using GitHub Web editor) | .travis.yml
s/zen/zef/;
17:02
Geth ecosystem/zoffixznet-patch-1: 4aca12bf96 | (Zoffix Znet)++ (committed using GitHub Web editor) | .travis.yml
s/zen/zef/;
17:11
ecosystem/zoffixznet-patch-1: 2f7529dc12 | (Zoffix Znet)++ | .travis.yml
Merge branch 'master' into zoffixznet-patch-1
Geth ecosystem: fb35f0c271 | (Zoffix Znet)++ (committed using GitHub Web editor) | README.install-template.md
Shorten install instructions (#412)
17:25
azawawi timotimo: ping :) 17:57
github.com/azawawi/scripts/blob/ma...ibclang.p6 # First libclang AST traversal example is now working... Needed to wrap CStruct 17:59
two weaknesses of NativeCall so far... CStruct passing and inability to create static native arrays in a simple way 18:02
gist.github.com/azawawi/bd30168698...e6b798a29c # example output 18:03
Geth doc: 4b15d44eee | Coke++ | doc/Language/subscripts.pod6
make example compile
18:57
synopsebot Link: doc.perl6.org/language/subscripts
buggable New CPAN upload: Libclang-0.0.1.tar.gz by AZAWAWI cpan.metacpan.org/authors/id/A/AZ/...0.1.tar.gz 19:12
harrison m: class Foo { has Str $.a; }; my $f = Foo.new(a => 'aaaah'); say $f; 19:40
camelia Foo.new(a => "aaaah")
AlexDaniel .
yoleaux 16:35Z <Zoffix> AlexDaniel: just wanted to confirm before I do it: am I safe to bump default lang version in Rakudo to 6.d or should I wait until after release?
AlexDaniel El_Che: if you're interested, last blocker was resolved 19:41
El_Che AlexDaniel: I am, thank you
AlexDaniel El_Che: so we're not far away from the release, but it may take a bit still
El_Che AlexDaniel: great! 19:42
I added a /etc/profile.d/rakudo-pkg.sh to set the profile, because many Linux newbies don't know how to set the PATH (and don't read the readme :) ) 19:43
I also added a link from the bin of perl6 to rakudo
harrison m: class Foo { has Str $.@a; } my $f = Foo.new(a => <1 2 3 4>); say $f; 19:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of $. variable; in Perl 6 please use the .kv method on e.g. .lines
at <tmp>:1
------> 3class Foo { has Str $.7⏏5@a; } my $f = Foo.new(a => <1 2 3 4>); s
harrison m: class Foo { has Str @.a; } my $f = Foo.new(a => <1 2 3 4>); say $f;
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3class Foo { has Str @.a; }7⏏5 my $f = Foo.new(a => <1 2 3 4>); say $f
expecting any of:
infix
harrison m: class Foo { has Str @.a; }; my $f = Foo.new(a => <1 2 3 4>); say $f; 19:47
camelia Foo.new(a => Array[Str].new(IntStr.new(1, "1"), IntStr.new(2, "2"), IntStr.new(3, "3"), IntStr.new(4, "4")))
harrison m: class Foo { has Str @.a; }; my $f = Foo.new(a => ('awesome')); say $f;
camelia Foo.new(a => Array[Str].new("awesome"))
tobs m: class Foo { has Str @.a; }; my $f = Foo.new(a => 'even without parens'); say $f; 19:48
camelia Foo.new(a => Array[Str].new("even without parens"))
harrison m: my @letters = 'a'...'d'; class Foo { has Str @.a; }; my $f = Foo.new(a => @letters); say $f; 19:49
camelia Foo.new(a => Array[Str].new("a", "b", "c", "d"))
harrison Does the existence of precompilation mean that I can dare dream of Perl6 being compiled to bytecode in the future? 19:52
timotimo it is already compiled to bytecode 19:57
try moar --dump Something.moarvm
the CORE.setting.moarvm is a bit gigantic
but you'll find enough smaller things :)
harrison timotimo: Interesting... so like the way one ships Java code... the same will be possible for Perl 6 in the future? 19:58
afaik it is not possible now. 19:59
geekosaur portable precomps are a problem currently, yes
harrison So I am getting a strange error on This is Rakudo version 2018.09 built on MoarVM version 2018.09... pastebin.com/MZ22RsLs 20:01
geekosaur you're nesting ''s 20:02
so your "string" 'aaaah' is not quoted
use double quotes or q{} or something 20:03
AlexDaniel syntax highlighting is very helpful there
geekosaur not so helpful here since it's the shell that is doing it and the shell doesn't typically do syntax highlighting 20:04
harrison geekosaur, oh, thanks. *face palm.
AlexDaniel geekosaur: yeah but on that paste it's accidentally very right 20:05
harrison So uh, either I need to get some sleep or I am overlooking something very obvious. So this is the new error: pastebin.com/kS1fQgBA 20:07
m: class Foo { has Str $.a; }; my $f = Foo.new(a => 'aaaah'); say $f; 20:08
camelia Foo.new(a => "aaaah")
harrison Huh? It works here.
*confused
timotimo i see your problem
you are using ""
look at the code that perl6 is echoing back at you
it sees "my = Foo.new" 20:09
that's because your shell doesn't have a $f defined, so it replaces it with the empty string
harrison timotimo, oh yes. You are right.
timotimo shells are fun, aren't they :) 20:10
harrison timotimo lol. I saw a quote on twitter, attributed to Larry Wall, 'It is easier to port a shell than to port a shell script.' 20:11
timotimo that has a truthish feel to it 20:12
geekosaur go look at the configure scripts autoconf creates sometime. if you dare. 20:13
harrison twitter.com/CodeWisdom/status/7315...4692992000
masak pmurias: re "bigger forms of language extensions than macros" -- yes, there's a (hazy) vision of being able to build slangs 20:38
in 007 terminology, a "lang" is a thing that drives a parser at the top level of a program, and a "slang" is generally a nested language, often with a quasiquote-like exchange of values with its outside 20:46
moony Perl 6 needs a good way to parse binary data, not just strings. Converting a string to it's binary form to parse it via grammar/regex feels evil. 21:08
also, attempting to assign a <( )> capture to a capture variable results in brokenness (Did it by mistake). 21:10
timotimo yeah, that's true. though i don't know what you mean by "<( )> capture" 21:11
moony i.e. $<sillyvariable>=<(.)> 21:12
timotimo <( is actually a thing in and of itself, and so is )> 21:13
moony oh ok
timotimo i tend to think of them as "inside-out lookbehind and lookahead" 21:13
but effectively they just set the beginning and end of the match to where ever they happen to have matched 21:14
timotimo m: say "hello world" ~~ / <( . l l . )> . <alpha> /; 21:14
camelia Potential difficulties:
Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)
at <tmp>:1
------> 3say "hello world" ~~ / <( . l7…
timotimo m: say "hello world" ~~ / <( . ll . )> . <alpha> /;
camelia 「ello」
alpha => 「w」
timotimo look, you can ever have a match that sits outside of the matched text of the whole match 21:15
even*
MasterDuke moony: jnthn has a proposal somewhere on improving binary parsing in perl 6 21:22
timotimo are you refering to the recent one for getting data from blobs? like "read a 32bit integer" and stuff? 21:23
MasterDuke timotimo: i think so 21:34
timotimo i think they're hoping for something more like grammars, but for bytes 21:35
MasterDuke ah
timotimo or even pack/unpack 21:36
avuserow I worked on a p6 module inspired by Python's Construct module as Binary::Structured
it's a class-based approach for representing binary data 21:37
MasterDuke eco: Binary::Structured 21:39
buggable MasterDuke, Binary::Structured 'Read and write binary formats defined by classes': modules.perl6.org/dist/Binary::Stru...n%20Kreher
moony timotimo, i'm talking about grammars for individual bits haha 21:56
for reading highly packed data