»ö« 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.
00:12 Coleoid_north left 00:16 pecastro left 00:37 Doc_Holliwood left 00:43 wildtrees left 00:44 wildtrees joined 00:50 wildtrees left 00:54 lucasb left 00:56 reach_satori joined 01:05 hythm joined 01:15 mowcat joined 01:19 k0Le left 01:33 molaf left 01:34 k0Le joined 01:35 mowcat left, mowcat joined 01:46 molaf joined 01:52 stu002 left
gdonald my spiral thingy: gist.github.com/gdonald/28750b8e6a...a2b2df20b8 01:58
02:13 Cabanossi left 02:19 Cabanossi joined 02:22 mowcat left 02:25 reach_satori left 02:28 reach_satori joined 02:32 reach_satori left, ravenousmoose joined 02:40 reach_satori joined 02:41 xelxebar left 02:42 xelxebar joined 02:50 reach_satori left 02:52 reach_satori joined 02:58 netrino left 03:04 MasterDuke left 03:12 reach_satori left 03:35 ravenousmoose left 04:01 reach_satori joined
discord6 <RaycatWhoDat> Dumb question: What could be considered a low-level module for Perl 6 programmers if NQP isn't it? 04:20
04:22 dogbert17 left, aindilis joined
Xliff RaycayWhoDat: What do you mean? 04:22
NQP is definitely "low-level".
discord6 <RaycatWhoDat> NQP says you shouldn't rely on it. 04:23
Xliff Perl6 is based on NQP
Well... you shouldn't!
.... until you have to!
discord6 <RaycatWhoDat> o
Xliff And then you need to keep track of what you use in case things change.
What are you trying to do? 04:24
discord6 <RaycatWhoDat> I was under the impression that it was black magic that should never be touched
<RaycatWhoDat> unless you're a core dev
Xliff Yes. Tell that to the necromancers.
They know who they are.
discord6 <RaycatWhoDat> timotimo <_<
Xliff The fact that the word "necromancer" exists should tell you everything.
Hence my admonishment: '... keep track of when things change!' 04:25
NQP is stable enough, as it has to track the MoarVM opcodes.
discord6 <Rogue> Damian used a bit of it to add for/else
Xliff github.com/perl6/nqp/blob/master/d...s.markdown
Those are fairly stable up and until MoarVM is updated or changed. 04:26
discord6 <RaycatWhoDat> Ah. Got it. 04:27
Xliff Last time that was updated was August 4th.
You don't need to be a core dev to use NQP. It's there to be used! 04:28
Just no one wants to support it with relation to Perl6. If you have issues, you are better off taking them to #nqp
Be prepared to stand firm and ask the right questions, and you should be fine. 04:29
discord6 <RaycatWhoDat> Understood.
Xliff So....
What are you trying to do?! :> 04:30
I was about to go to bed, but I can stay up for something juicy! :D
discord6 <RaycatWhoDat> The honest answer? Trying to reason myself out of using Perl 6.
Xliff *gasp* 04:31
discord6 <RaycatWhoDat> D:
Xliff Whyyyy?!
discord6 <RaycatWhoDat> I know, I know.
Xliff The "honest answer" wasn't much of one. :q
discord6 <RaycatWhoDat> I feel like I have too many daggone options and I am not very good at convincing other people to use "less-popular" languages. 04:32
Xliff Ah. Yes. That's an occupational hazard when using a Perl.
Again. What. Are. You. Trying. To. Do?
discord6 <RaycatWhoDat> Personally, make a game with Perl 6. Professionally, try to replace a Java microservice with Perl 6. 04:33
Xliff RaycatWhoDat: Are you staring down a rabbit hole and looking for a place to grab on to? 04:34
Aahhh....
Yes. Well...
timotimo is the person to talk with there.
And... well... me.
With respect to microservices, the default answer is always "use CRO" 04:35
TBH, these days, when you say "microservice" everyone screams "Go!" 04:36
discord6 <RaycatWhoDat> Yeah. That's my competition.
Xliff Depends on what you are trying to do. I still have yet to figure out Go's popularity.
Yeah, well the only way you beat Go with Perl6 is flexibility.
discord6 <Rogue> I don't think Go ever got much enduring popularity
Xliff You will NOT beat it, performancewise.
discord6 <Rogue> it just had its moment of being the topic of conversation, and then the hype died down with few people actually using the language 04:37
<RaycatWhoDat> Really? I thought people were still big on Go.
<Rogue> Honestly it's been ages since last I saw a discussion about Go on my normal programming forums 04:38
<Rogue> i.e. the Programming discord server and /r/perl6 (which wouldn't have anything about Go anyway) 04:39
<Rogue> lol
<RaycatWhoDat> wait a second
Xliff Take the example Go program on the bottom of this page... blog.golang.org/examples
discord6 <RaycatWhoDat> I feel like I've seen you before, now that you mention that Discord
<Rogue> Please tell me it wasn't in a political discussion lol. 04:40
<RaycatWhoDat> Were you like the one guy who was big on Perl 6 over there when I came through
<Rogue> Oh yeah yeah
Xliff For all that syntax, I bet a Perl6 solution would be cleaner and easier to read.
discord6 <Rogue> those were the days, evangelizing as hard as I could go
<RaycatWhoDat> I agree with you, Xliff
<RaycatWhoDat> Honestly, I need to stop waffling on these things and just experiment. This "Ready-aim-aim-aim" disease is killing my potential. 04:42
<RaycatWhoDat> I should just make the thing and let the code speak
04:44 hythm left, holyghost left, holyghost joined
Xliff RaycatWhoDat: Hear, hear! 04:44
gist.github.com/Xliff/9fb038df877e...c6bf8be7e8 04:48
04:52 reach_satori left
discord6 <RaycatWhoDat> Bless, Xliff 04:54
<RaycatWhoDat> This is a good starting point to build a case
Xliff :>
Also, the .map calls are there to help new users follow what's going on. They are NOT necessary. 04:56
.str should handle the conversion.
.Str or .gist -- I think its the latter.
Ah. It's .gist! 04:58
discord6 <RaycatWhoDat> Interesting. 04:59
05:03 jaldhar joined
Xliff And with that... I depart for the soft cushions of me bed. 05:09
discord6 <Rogue> sounds fantastic
Xliff I'm still wondering about the nqp.... 05:10
RaycatWhoDat: Do I need to bring out the feathers and whipped cream?
discord6 <RaycatWhoDat> wait, what 05:14
Xliff Why. NQP? 05:15
I'm still wondering what made you think in that direction.
Coz... once you start dealing with NQP, there's no going back. 05:16
I'm thinking about taking the plunge. So I'm curious as to why you thought of it.
discord6 <RaycatWhoDat> Oh, I wanted to see if NQP was within a stone's throw of D and C++. shrug Nothing concreate
<RaycatWhoDat> concrete*
Xliff Hmmm.... 05:17
More like a boulder.
It's actually closer to Lisp
05:17 sauvin joined
discord6 <RaycatWhoDat> I had a dream of a pure-Perl-ish ecosystem using NQP, Perl 5, and Perl 6. 05:17
<RaycatWhoDat> But, alas.
<RaycatWhoDat> "ecosystem" in this case, meaning having 99% of my use cases covered 05:18
<RaycatWhoDat> Which is a bit like asking for the moon, I think
05:20 wamba joined
Xliff Could work at it. 05:21
You should start by listing your use cases! 05:22
discord6 <RaycatWhoDat> Game development, shell and automation scripting, string transformations and a bit of analysis. 05:24
<RaycatWhoDat> Web development, professionally. But I know JavaScript so I wouldn't use Perl.
Xliff Can do all that, although game development is best left to C, and managed by NativeCall 05:25
Web Dev, although you need to be a little specific. Web Dev requires JS. Can't get around it.
discord6 <RaycatWhoDat> Game development in C sounds... rough.
Xliff Still, on the server-side, Perl6 can handle a bit.
C/C++ -- NativeCall should be able to deal with it. 05:26
Most engines are written in one or the other.
And C# can be made to speak C for NativeCall purposes.
Anything done in Java can be done in Perl6 if you don't mind the performance hit. 05:27
discord6 <RaycatWhoDat> Mm. 05:29
Xliff Wow! Quantum Break was done in D? Who knew? 05:30
discord6 <RaycatWhoDat> Okay. This is a lot to digest but it's a good start.
<RaycatWhoDat> Yeah.
<RaycatWhoDat> I think Contact has bits in D too.
Xliff Contact or Control?
discord6 <RaycatWhoDat> The latter.
<RaycatWhoDat> Thanks.
Elronnd @RaycatWhoDat I'm currently running my game engine in d, but with perl6 for scripting
Xliff :)
Currently playing both.
discord6 <RaycatWhoDat> how
Xliff Elronnd++ !! 05:31
Elronnd: Lemme guess... NativeCall?
Elronnd actually, the perl6 scripting part isn't done yet--using a scheme thing atm--but will be done soon. And is oss so can be integrated
Xliff: yah. NativeCall + embedding moarvm
Xliff Ooh!
Code anywhere? 05:32
discord6 <RaycatWhoDat> I have to look into this NativeCall stuff
Elronnd perl6 is probably fast enough for basic or 2-d stuff, but I wouldn't use it for anything big or 3-d
github.com/elronnd/libport
Xliff Elronnd: I've got COGL running with a Perl6 fronting.
discord6 <RaycatWhoDat> On the flip side, oh boy, back up to five langauges
Xliff Still early days, but it does workl.
discord6 <RaycatWhoDat> languages*
Elronnd I actually have a couple of questions about nativecall, if anyone is knowledgeable about it
Xliff Elronnd: I can take a shot. What's up? 05:33
Elronnd so basically
discord6 <RaycatWhoDat> Aight, thanks for the info, I'm outta here
Xliff 'nn Raycat
discord6 <RaycatWhoDat> Go to sleep Xliff
Elronnd I have a class declared as repr('CStruct'). It has some member variables--say, an int64. The problem is that when I try to instantiate that class from the p6 side, it makes it a *pointer* to int64
night raycat
Xliff LOL
05:33 jaldhar left 05:34 jaldhar joined
Xliff Elronnd: You sure its a pointer? 05:34
Elronnd well
Xliff Is that online, somewhere?
Elronnd when I pass it from p6 to c, it looks like a pointer from the c side. I can't actually demo any code right now because I'm in the middle of a system migration 05:35
Xliff So you have to deref on the C side to get the value set in P6?
Elronnd backing up $HOME and it's about halfway done, so I don't want to disturb it. Plus, I wiped out my p6 install which was in $HOME
yes
Xliff -weird-
I have not had that problem. 05:36
At least, not yet.
Which version of Perl6?
Elronnd so if I have on p6 side class foo is repr('CStruct') { has int64 $.whatever; } foo.new(whatever => 5), then on the c side I have to say struct foo { int64_t *whatever; }
latest git as of a couple weeks ago
Xliff See.... int64 is a concrete type, so it should NOT do that.
Elronnd ah, worth mentioning 05:37
Xliff Sounds like your 'CStruct' is acting like the pointer. Not the int64
Elronnd this is returning an instance of foo from a perl6 callback
which may change the calculus
05:37 Cirno-ne-baka joined
Xliff Yeah. I would look at how that callback is returning foo. 05:38
Cirno-ne-baka Ohayo
Xliff Cirno-ne-baka: Ohayo! 05:39
Elronnd ohai Cirno-ne-baka
Xliff: will you be around in a couple of hours? It's probably better if I get my thing figured out so I can give you actual code to chew on
Xliff Will probably be dosing, but I will be more than happy to help out when I wake back up.
Elronnd aight, thanks! 05:40
Xliff Elronnd: Have you seen my github page?
github.com/Xliff
Cirno-ne-baka example from perl6intro `class bar-chart { has Int @.bar-values; method plot { say @.bar-values; }}class line-chart { has Int @.line-values; method plot { say @.line-values; }}class combo-chart is bar-chart is line-chart { method plot { say @.bar-values; say @.line-values; }}my $actual-sales = bar-chart.new(bar-values =>
[10,9,11,8,7,10]);my $forecast-sales = line-chart.new(line-values => [9,8,10,7,6,9]);my $actual-vs-forecast = combo-chart.new(bar-values => [10,9,11,8,7,10], line-values => [9,8,10,7,6,9]);say "Actual sales:";$actual-sales.plot;say "Forecast sales:";$forecast-sales.plot;say "Actual vs
Forecast:";$actual-vs-forecast.plot;`
Elronnd you made the gtk stuff, right?
Xliff Feel free to peruse my project code. Maybe something there will help.
Much of it deals extensively with NativeCall
Elronnd will take a look
Cirno-ne-baka give me output `Actual sales:[10 9 11 8 7 10]Forecast sales:[9 8 10 7 6 9]Actual vs Forecast:[10 9 11 8 7 10][]` 05:41
Xliff Yes. I made the "gtk stuff" LOL
Elronnd :)
Xliff OK. Off to bed. o7
Elronnd cya
Cirno-ne-baka but must be like this `Actual sales:[10 9 11 8 7 10]Forecast sales:[9 8 10 7 6 9]Actual vs Forecast:[10 9 11 8 7 10][9 8 10 7 6 9]`
what i`m going wrong? 05:44
05:46 sno left
Cirno-ne-baka but with `role` work exactly 06:01
06:07 jaldhar left 06:08 jaldhar joined 06:13 ambs left
Kaiepi "... that's pretty cool, i'll look into perl. ..." 06:14
this was just from mentioning the async support perl 6 has alone
06:15 ambs joined 06:26 sno joined, Voldenet left 06:31 Voldenet joined, Voldenet left, Voldenet joined 06:37 molaf left 06:56 MasterDuke joined 07:00 k0Le left 07:01 k0Le joined 07:07 jaldhar left 07:26 Doc_Holliwood joined
Geth_ problem-solving/path-to-raku: e0185a4a78 | (Elizabeth Mattijsen)++ | solutions/language/PATH-TO-RAKU.md
Settle on .raku / .rakumod / .rakudoc / .rakutest
07:51
07:54 domidumont joined 07:56 domidumont left 07:57 domidumont joined 07:59 _jrjsmrtn left
Geth_ problem-solving/path-to-raku: 9bcb834ec9 | (Elizabeth Mattijsen)++ | solutions/language/SWOT-TO-RAKU.md
Added "no longer linked to *good* reputation of Perl as weakness
07:59
08:05 sno left, __jrjsmrtn__ joined 08:14 domidumont left 08:21 sno joined, Cirno-ne-baka left 08:28 domidumont joined 08:35 domidumont left 09:18 jmerelo joined 09:21 sena_kun joined 09:30 wamba left
sena_kun m: msub f { say 42 }; &f.wrap(sub () { callsame; say "Before second call"; callsame; }); f 09:33
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routines:
f used at line 1
msub used at line 1. Did you mean 'msb'?
sena_kun m: sub f { say 42 }; &f.wrap(sub () { callsame; say "Before second call"; callsame; }); f 09:34
camelia 42
Before second call
sena_kun bisectable6, sub f { say 42 }; &f.wrap(sub () { callsame; say "Before second call"; callsame; }); f;
bisectable6 sena_kun, On both starting points (old=2015.12 new=565b2ac) the exit code is 0 and the output is identical as well
sena_kun, Output on both points: «42␤Before second call␤»
sena_kun am I missing anything?
timotimo hm, is there something like "nextcandidate" for "same"? 09:40
it's possible that callsame clears the piece that saves away what's going to get invoked 09:41
sena_kun has no idea
timotimo with the takedispatcher op
sena_kun is that a bug or?
09:47 wamba joined 09:48 Black_Ribbon left 09:50 domidumont joined
timotimo m: sub f { say 42 }; &f.wrap(sub () { {*}; say "before 2nd"; {*} }); f 09:50
camelia 5===SORRY!5=== Error while compiling <tmp>
{*} may only appear in proto
at <tmp>:1
------> 3sub f { say 42 }; &f.wrap(sub () { {*}7⏏5; say "before 2nd"; {*} }); f
expecting any of:
horizontal whitespace
term
timotimo ah
10:00 Doc_Holliwood left 10:06 Ven`` joined 10:20 Doc_Holliwood joined
Geth_ problem-solving/path-to-raku: 69786a25f2 | (Elizabeth Mattijsen)++ | solutions/language/PATH-TO-RAKU.md
Fix typo
10:36
10:39 dogbert17 joined 10:47 lucasb joined 10:50 isBEKaml joined 10:59 Doc_Holliwood left 11:01 wamba left 11:03 Doc_Holliwood joined
Geth_ doc: 6c71f0e958 | (JJ Merelo)++ | 7 files
Fixes #3024 and adjusts regex
11:10
doc: 1589642efb | (JJ Merelo)++ | doc/Language/testing.pod6
Eliminates meta-ok, which wasn't there anyway
synopsebot Link: doc.perl6.org/language/testing
11:19 jmerelo left
SmokeMachine Elronnd: are you usin HAS instead of has? 11:21
timotimo i think the problem has more to do with "typedef struct { int64_t number } the_struct; the_struct *foo" being indistinguishable from "typedef struct { int64_t *number; }; the_struct; the_struct foo;" 11:23
11:23 Cirno-ne-baka joined 11:31 wamba joined 11:34 robertle left 11:38 robertle joined
SmokeMachine One question: would that be possible to make a module that introduce a slang that makes every block that comes after a term mean “,” and the block? I mean: `func 42 {;}` mean `func 42, {;}` and `func 13 -> $bla {;}` mean `func 13, -> $bla {;}` 11:53
Is it possible? Would it break anything? 11:54
timotimo would surely be possible to make, not saying how hard it'll be :)
SmokeMachine timotimo: I think I would be cool... what do you think? 11:57
timotimo well, it'll be a valid use of TTIAR, which is usually one of our better ways to figure out that someone has made a mistake 11:58
like forgetting a semicolon after a sub call when followed by a block
SmokeMachine timotimo: you mean it would make worse job finding errors? 12:03
timotimo only in some circumstances 12:04
12:14 mj41cz joined 12:26 mj41cz left 12:47 Guest69469 left 12:49 zakharyas joined 13:05 zakharyas left 13:19 Guest69469 joined 13:40 domidumont left 13:47 sena_kun left 14:07 sno left, k0Le left 14:08 Doc_Holliwood left 14:10 sno joined 14:11 MilkmanDan left 14:12 domidumont joined, MilkmanDan joined 14:13 domidumont left 14:15 Kaiepi left 14:17 Kaiepi joined
Xliff . 14:30
How would you invoke a function pointer from C? 14:36
14:39 isBEKaml left 14:40 sena_kun joined 14:44 cpan-p6 left 14:45 cpan-p6 joined, cpan-p6 left, cpan-p6 joined 14:52 Doc_Holliwood joined 15:10 mowcat joined, Ven`` left 15:21 Doc_Holliwood left, Doc_Holliwood joined 15:25 Maylay joined 15:31 domidumont joined 15:32 navalned joined 15:33 navalned left 15:46 sno left 16:13 daemon is now known as Cortana 16:25 wildtrees joined 16:30 jmerelo joined 16:35 discord6 left, discord6 joined, discord6 left, discord6 joined 16:38 jmerelo left 17:09 Cortana is now known as daemon 17:11 HoboWithAShotgun joined, dogbert11 joined 17:12 mowotter joined 17:13 pirateFinn_ joined, eveith joined, nightfro` joined, pierrot_ joined, perryprog_ joined 17:15 broquain1 joined, tyilanmenyn joined, bawse_ joined, KotH_ joined, dogbert joined, a3r0 joined 17:16 sca joined, dogbert is now known as Guest23744, jdv79_ joined, klapperl joined, mst_ joined, Maylay_ joined 17:18 moritz_ joined, mst left 17:19 mst_ is now known as mst, m0ltar_ joined 17:20 Maylay left, Doc_Holliwood left, mowcat left, Guest69469 left, dogbert17 left, rindolf left, nightfrog left, b2gills left, bawse left, pierrot left, webstrand left, krunen left, moritz left, TreyHarris left, samebchase left, Elronnd left, Technaton left, klapperl_ left, m0ltar left, karupanerura left, KotH left, perryprog left, oftl left, shadowpaste left, pirateFinn left, jdv79 left, broquaint left, sca_ left, nightfro` is now known as nightfrog, pirateFinn_ is now known as pirateFinn 17:21 karupanerura joined, mowotter left 17:23 sjn joined, samebchase joined, krunen joined 17:24 camelia left, rindolf joined, TreyHarris joined 17:25 b2gills joined, shadowpaste joined 17:26 oftl joined 17:28 camelia joined, aborazmeh joined, aborazmeh left, aborazmeh joined 17:29 ChanServ sets mode: +v camelia 17:37 Elronnd joined 17:44 HoboWithAShotgun left 17:45 Leningrad joined 17:46 Leningrad is now known as StPetersburgh 17:51 kybr joined 17:56 sno joined 17:57 tyilanmenyn is now known as tyil 18:00 ravenousmoose joined 18:07 Cirno-ne-baka left 18:13 KotH_ is now known as KotH 18:15 Itaipu left 18:20 ravenousmoose left 18:23 sno left, pierrot_ is now known as pierrot 18:24 pierrot is now known as Guest31213 18:26 mj41cz joined, pecastro joined 18:34 Black_Ribbon joined 18:44 aborazmeh left 18:52 domidumont left
SmokeMachine m: my Supplier $supplier .= new; { my $*a = 42; $supplier.Supply.tap: { say $*a } }; { my $*a = 13; $supplier.emit: $_ for ^10 } # Is that expected? I would expect that to print 42... 19:14
camelia 13
13
13
13
13
13
13
13
13
13
SmokeMachine why is that printing 13?
sena_kun it is expected 19:16
because scope is dynamic in this case
blocks from taps are executed from `emit` position 19:17
SmokeMachine sena_kun: yes, the `emit` really calls the tab block?
s/tab/tap/
sena_kun SmokeMachine, I did not see the implementation, but it is written that code that calls `emit` pays for execution 19:20
SmokeMachine, 6guts.wordpress.com/2017/11/24/a-u...ncy-model/ <- read the "Backpressure" part
>The general principle with Supply is that the sender of a message pays the cost of its processing. 19:21
SmokeMachine sena_kun: yeah... that would make sense...
19:27 molaf joined 19:31 sno joined
SmokeMachine almost there... www.irccloud.com/pastebin/7mozd53M/ 19:33
19:33 rindolf left 19:35 lucasb left 19:44 Itaipu joined, webstrand joined
Elronnd timotimo: hmm, I think you are right (re. nativecall) 19:48
19:51 sono__ joined 19:54 Black_Ribbon left 19:57 khisanth_ left 20:03 zakharyas joined 20:09 khisanth_ joined, cpan-p6 left 20:10 cpan-p6 joined, cpan-p6 left, cpan-p6 joined, Sgeo__ joined 20:11 Itaipu left, robertle left 20:12 Itaipu joined 20:13 Sgeo_ left
Xliff Elronnd: Yeah. That's what I was trying to get at earlier. 20:14
timotimo: Does native call handle the ability to invoke a C function pointer? 20:17
s/handle/have/
20:17 robertle joined
timotimo yeah 20:23
i think it does
20:26 vrurg left 20:32 telex left 20:34 telex joined 20:45 Guest31213 is now known as pierrot, pierrot left, pierrot joined 20:46 vrurg joined 20:56 aborazmeh joined, aborazmeh left, aborazmeh joined 21:11 mj41cz left 21:25 aborazmeh left
Xliff timotimo: Can you link to a good example? 21:28
I've been trying to find one with no luck.
timotimo no :( 21:32
SmokeMachine is there any map-ish List method that accept multiple blocks and uses it as candidates for each run? 21:33
Xliff SmokeMachine: Um... I don't understand what you are thinking, here. 21:34
SmokeMachine: .dumpmap evaluates based on a condition. 21:36
So I would think that, run through a given/when in the block, might do what you want.
21:37 sena_kun left
timotimo i think the question is for a kind of round-robin map maybe? 21:38
SmokeMachine I mean something like: (1, 2, 3, 4, 5, "a", "b", "c", "d", "e").map: -> Int $a { $a * 2 }, -> Str $a { $a xx 2 }
Xliff Exactly. 21:39
(1, 2, 3, 4, 5, "a", "b", "c", "d", "e").map({ when Int $a { $a * 2 }; when Str { $a xx 2 };}).say
m: (1, 2, 3, 4, 5, "a", "b", "c", "d", "e").map({ when Int $a { $a * 2 }; when Str { $a xx 2 };}).say
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3"a", "b", "c", "d", "e").map({ when Int7⏏5 $a { $a * 2 }; when Str { $a xx 2 };}).
expecting any of:
block or pointy block
infix
Xliff m: (1, 2, 3, 4, 5, "a", "b", "c", "d", "e").map({ when Int { $a * 2 }; when Str { $a xx 2 };}).say
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3, "b", "c", "d", "e").map({ when Int { 7⏏5$a * 2 }; when Str { $a xx 2 };}).say
Xliff m: (1, 2, 3, 4, 5, "a", "b", "c", "d", "e").map({ when Int { $_ * 2 }; when Str { $_ xx 2 };}).say 21:40
camelia (2 4 6 8 10 (a a) (b b) (c c) (d d) (e e))
lizmat weekly: www.youtube.com/channel/UCDkz-__gl...LexukpG0DA # Perl 6 tutorials
notable6 lizmat, Noted! (weekly)
SmokeMachine yes, makes sense! thank you Xliff!
Xliff :)
21:41 nepugia joined
SmokeMachine Xliff: the nearest I've got from function pointer on native call was this... I don't think it could help... but take a look and let me know if something there could help you, please... 21:44
github.com/FCO/bernalang/blob/mach...t.pm6#L351
Xliff SmokeMachine++ 21:51
I was hoping for something simpler, but I will take a look.
SmokeMachine Xliff: The wrapper for GccJit (without the BernaLang) is here if you like: github.com/FCO/GccJit/blob/master/...GccJit.pm6 21:55
Xliff .tell jnthn What's the best way to invoke a C function pointer using NativeCall? 21:56
tellable6 Xliff, I'll pass your message to jnthn
21:58 zakharyas left
SmokeMachine Xliff: I just saw you helped me with that code a few months ago... colabti.org/irclogger/irclogger_lo...01-08#l484 22:06
Xliff Yup! I remember that! :) 22:07
22:10 kiwi_75 joined, kiwi_75 left 22:11 cjkinni joined 22:30 mowcat joined 22:37 Kaiepi left
Xliff SmokeMachine: So if you are returning a Function class from gcc_jit_context, how are you invoking the returned Function? 22:37
22:37 Kaiepi joined 22:38 Kaiepi left 22:39 Kaiepi joined 22:45 wamba left
SmokeMachine Xliff: That's the problem... I don't tall them... :( github.com/FCO/bernalang/blob/mach...t.pm6#L410 22:50
call
Xliff Ahh... you get gcc_jit to call them. 22:51
SmokeMachine yes...
22:53 cjkinni left
Xliff OK. Thanks, SmokeMachine 22:56
22:57 kensanata joined 22:59 pecastro left 23:33 m_v_m joined
m_v_m Hi. I have a strange error with 2d arrays. I would like to create 2d array like that: pastebin.com/Mw9vtW3m and I have error: expected Array[Array[Int]] but got Array ($[]) 23:35
To be honest...I really don't know why.
23:36 kensanata left
timotimo two things: 23:37
declaring a "Foo @bar" gives you an "array of Foo", so you're asking for Positional[Array[Array[Int]]], so a 3d array basically 23:38
if you put [] around something, it will be iterated into an array, which means [[]] will just turn into a 1d array (you can get a depth-two array with [[],]) 23:39
m: my Array[Int] @t_map; @t_map[1][2] = 99; say @t_map.perl
camelia Type check failed in assignment to @t_map[1]; expected Array[Int] but got Array ($[])
in block <unit> at <tmp> line 1
timotimo m: my Array[Int] @t_map = Array[Int].new; @t_map[0][1] = 99; say @t_map.perl 23:40
camelia Type check failed in assignment to @t_map[0]; expected Array[Int] but got Array ($[])
in block <unit> at <tmp> line 1
timotimo m: my Array[Int] @t_map = Array[Int].new,; @t_map[0][1] = 99; say @t_map.perl
camelia Array[Array[Int]].new(Array[Int].new(Int, 99))
timotimo did the same thing wrong that you did, lol
time for bed
m_v_m: does that help?
m_v_m Yes, but why it is so strange ...
Perl6 is really nicely done..but that kind of behaviour is really strange. 23:41
timotimo you can use [] around something to get an array of items from something, for example [<foo bar baz>] or [some-sequence-generating-sub()] 23:42
the thing that requires the comma is the "single-argument rule" where a single iterable thing will be taken as a list of things instead of a single thing
Xliff What? 23:43
timotimo modulo scalar containers
Xliff It's early for you, timotimo.
timotimo psst
Xliff So... nothing more on function pointers from C?
timotimo *shrug*, nativecast it i guess?
Xliff How?
That actually sounds right, for some reason, but I still need a proper signature.
so... 23:44
my $func = nativecast (& (int32, Str --> gdouble), $c-pointer)?
or ... my &func = nativecast (& (int32, Str --> gdouble), $c-pointer)?
23:45 m_v_m left
timotimo timo@schmand ~> perl6-gdb-m -e 'use NativeCall; nativecast(:(int32, int32 --> int32), Pointer[int64].new(0x1234512345))(1, 2);' 23:45
Xliff You do any more work on live coding, or looking for a missing feature?
timotimo Thread 1 "perl6-m" received signal SIGSEGV, Segmentation fault.
0x0000001234512345 in ?? ()
^^^^^^^^
Xliff O_o 23:46
\o/
Rock on.
timotimo puts a rock on his head 23:47
Xliff :)
timotimo you want to make sure info about casting function pointers lands somewhere you would have looked? 23:52
and no i haven't used the livecoding any more after the hilbert curve a few weeks ago
i should have told m_v_m about the xx operator 23:56
Xliff Yes. I am planning on updating the docs after I get a working use case. 23:57
Thanks.
timotimo sorry that it took me so long to respond
Xliff No worries. Neck deep in another project? 23:58
timotimo moarperf
i would love to reach the grant goal
Xliff Ah. OK. Then I won't keep you any longer. You know where I live. 23:59