»ö« 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.
vrurg .seen sergot 00:33
yoleaux I saw sergot 24 Jan 2019 14:32Z in #perl6: <sergot> oh, Mar and May...
Xliff \o 02:50
lizmat clickbaits p6weekly.wordpress.com/2019/04/15/...hrodinger/ 07:35
discord6 <Vendethiel> clicks 07:35
jmerelo Hi 07:42
yoleaux 15 Apr 2019 17:42Z <samcv> jmerelo: I have sent an assignment to my two potential students. to be completed in the next 7 days
jmerelo .tell samcv OK. Good luck. Keep me posted.
yoleaux jmerelo: I'll pass your message to samcv.
jmerelo I'm trying to find out a real use case for race/hyper for github.com/perl6/roast/blob/2288d4...race/for.t 07:43
Seems to me like anything sensible would be better done with a hyper.map or race.map
timotimo it's easier to turn sequential code using a for loop into a hyper for than to turn it into a hyper map, maybe 07:59
jmerelo timotimo: I'll document it anyway, but it seems to me that the hyper for/race for does not make a lot of sense. They take _longer_ than the bare for, too. 08:02
timotimo jmerelo: what example code are you running for that measurement?
moritz: i can't connect to p6c's vm host :o 08:03
Geth doc: de5071406b | (JJ Merelo)++ | doc/Language/statement-prefixes.pod6
Adds race/hyper closes #534 refs #2034
08:06
synopsebot Link: doc.perl6.org/language/statement-prefixes
jmerelo timotimo: this one: github.com/rakudo/rakudo/issues/2844
timotimo jmerelo: wouldn't that try to concurrently reify the two arrays? 08:10
or does the assignment do that bfore my $start?
that @sum-fib = ... looks kind of wrong? 08:11
jmerelo timotimo: why? 08:12
timotimo: it's just a sum
timotimo that'd mean all threads are hammering the same memory location, that doesn't make caches happy 08:13
timotimo and the code inside the for loop itself is probably really, really fast 08:14
jmerelo timotimo: better to just print it?
timotimo so the benefit of parallelizing will be rather slim, and perhaps rakudo won't even spawn an extra thread for work because splitting the work up is maybe slower than doing the work
jmerelo timotimo: as a matter of fact, it's slower 08:15
timotimo: 3x
timotimo printing will be slower, but it'll also be strongly contending the I/O lock
i'm refering only to the internals of the RaceSeq and its workers
not comparing for blah vs race for blah
jmerelo timotimo: so back to the original question: give me a real use case for that. If you are doing I/O it's bad, if you're accessing memory locations it's bad
timotimo: you can probably do some complicated thing and write it to a Channel, I guess... 08:16
timotimo but yeah, you'll get all the overhead of splitting the range into bits, shoving the values between threads, all that 08:17
jmerelo timotimo: baseline is: if you want to do autothreading, you will probably have to set stuff up in the same (maybe complicated) way that if you did manual threading.
timotimo "accessing memory locations" isn't the point; the point is writing to the same variable from every thread as fast as possible. that just doesn't make too much sense. what kind of workload is that? 08:18
if that's your workload, why not @sum-fib = @fib100k[100000] + @fib100k-plus[100000]
jmerelo timotimo: no workload. I was trying to come up with a sensible example for race/hyper for for the documentation.
jmerelo timotimo: or, even better, just do a Z and apply a hyper to the result. 08:19
timotimo: finally, as you see above, I have just used the test in roast.
timotimo i'm slightly surprised that test is enough to get a second thread to spawn
jmerelo timotimo: but of course if you can think of something better I'm all ears.
timotimo how about something like a particle system? 08:20
then you'd have different memory locations being written to, and more than just a single addition in the work loop
ah, fantastic, liz posted an example with the snapper active 08:22
i wonder why the maxrss keeps growing
oh 08:23
the first ~3 seconds were just creating the two fibonacci arrays
timotimo so perhaps growing the arrays is what makes maxrss go up like that 08:23
timotimo lizmat: how do you feel about an API for telemetry like T<checkpoint> = "here's my custom message", which would show up in the snapper's output at the point where the assignment was made? (and assigning over and over is fine, and assigning from other threads is also fine)? 08:31
lizmat feels like a plan... want me to do it? or you wanna go at it yourself? 08:32
timotimo (also i'd want the message to be pushed into the backend with an nqp:: op, so that the profiler can also record it) 08:33
i'd be glad if you could do it
lizmat timotimo: which nqp op did you gave in mind ? 08:37
timotimo it'll be a new one 08:38
just put a comment in the source code where it'd be appropriate and i'll add it later :D
lizmat oki 08:39
timotimo hooray
Geth doc: 1dbaeef5d5 | (JJ Merelo)++ | doc/Language/statement-prefixes.pod6
Fixes presentation of hyper and race

Thanks to @timo , @jnthn and @lizmat for clarifications.
synopsebot Link: doc.perl6.org/language/statement-prefixes
timotimo also i'd love for Telemetry to get an API that lets the user manually cause a heap snapshot to be taken by the heap snapshot profiler 08:40
discord6 <Vendethiel> .oO( Clearly we need Ruby's set_trace_func ) 08:52
timotimo i believe python has that same thing as well 08:55
lizmat timotimo: can one push to a repr('ConcBlockingQueue') from multiple threads without losing anything / segfaulting ? 09:01
timotimo yes
lizmat cool
timotimo it's rather important for that to work :)
lizmat right, just checking
so, what I was thinking was to add a "checkpoint" sub to Telemetry
that would do a snap with the given message and store that in the default snapper queue 09:02
timotimo sure; it might want to have the exact timestamp, too, or maybe that's already what you're suggesting 09:03
lizmat yes, it would do a snap, so that would have a complete Telemetry object with it 09:04
timotimo oooh, so it'll capture data from everything that's "installed"? 09:08
that's probably very good
discord6 <Vendethiel> timotimo: PyEval_SetTrace is "at leat" C api 09:13
tyil heh
if I make a Docker image based on Alpine, and install *only* python, the resulting image is actually bigger than my perl6 image based on Alpine
timotimo set_trace also lives in the pdb-like modules, i.e. debuggers
tyil so theoretically, if you want to make a small, self-contained application, Perl 6 is a better pick as your base than Python 09:14
kawaii Does anyone have any example for displaying an image (either from the web or filesystem) using GTK::Simple? 09:36
Couldn't find anything in the examples/ directory
sena_kun just in case if there are none, it is always possible to 1)get a pure gtk example; 2)using its types+calls, try to write its analog; 3)bugreport if something doesn't work. ;) 09:39
there are no means to change an attribute's type, right? 09:43
I see only `add_attribute` and rw-related calls, so how can I workaround it? 09:44
lizmat Attribute is a class like any other? 09:48
sena_kun it is, I guess, the question is how I can change its type to another one (I don't have default values, so no issue with obsoleting here). 09:50
sena_kun oh, stop, I can hack into the Attribute itself... 09:59
hmmm
sena_kun m: class A { has Int $.a }; A.new.say; my $type-attr = A.^attributes[0].^attributes[5]; $type-attr.set_value(A, Str); say A.new; 10:00
evalable6 (exit code 1) A.new(a => Int)
No such method 'set_value' for invocant of type 'BOOTSTRAPATTR'
in block <unit> at /tmp/Modp8lK5QS line 1
sena_kun I am probably too deep. :|
m: class A { has Int $.a }; A.new.say; my $type-attr = A.^attributes[0].^attributes[5]; my $a = A; $type-attr.set_value($a, Str); say $a.new; 10:01
evalable6 (exit code 1) A.new(a => Int)
No such method 'set_value' for invocant of type 'BOOTSTRAPATTR'
in block <unit> at /tmp/OAmzXJubWR line 1
SmokeMachine m: say 42 10:03
evalable6 42
sena_kun >"Bootstrapping Attribute class that we eventually replace with the real one" 10:04
the comment says it should be replaced with the normal one eventually, but when it happens? can it happen in this case?
timotimo sena_kun: i think that's just in the core setting 10:51
_sfiguser guys is there any module that can be used to inject or analyze 802.11 frames or ethernet frames in perl6 ? 11:38
sena_kun _sfiguser, not yet. 11:46
_sfiguser where do i start developing such thing? 11:48
sena_kun,
sena_kun well... I have a feeling that firstly a 802.11 protocol should be implemented in some way: a packet format, parsing && serialization. Either C bindings or pure Perl 6 is possible. It is pretty close to hardware layer, though, as it is not an application-level protocol, so you probably should wait for folks who know the ropes better than me in this area. 11:52
_sfiguser sena_kun, ok is it easy to write bindings from C libpcap? 11:54
sena_kun _sfiguser, well, "it depends", I cannot promise it is easy, but it shouldn't be too hard, of course. You want to look at docs.perl6.org/language/nativecall 11:55
you just describe the interface and then magic happens 11:56
timotimo kaiepi would be a good person to ask about capturing packets; like raw socket support might land as part of their grant work, i'd have to review the grant application to know - or ask, of course 11:58
sena_kun news.perlfoundation.org/2018/12/gra...rl-6-.html <- yes 12:03
timotimo ah, yes
nice.
patrickb o/ 13:53
What's a good value to use as `undef` to make JSON::Fast serialize a `null` value? 13:54
sena_kun Nil 13:54
? 13:55
m: use JSON::Fast;
evalable6 Cannot test 873de2da53cb31c695aabe0edc983ff4718cec65 (Commit exists, but a perl6 executable could not be built for it)
sena_kun well, 'use JSON::Fast; to-json({a => Nil}).say' serializes to `"a": null`.
patrickb sena_kun: That might be it. 13:56
sena_kun also a type object
sena_kun "use JSON::Fast; to-json({a => Int}).say" gives null too 13:56
like, if you produce either some value or a type object of this value, a type object will be translated as "null".
patrickb I was just a bit confused, because docs.perl6.org/language/5to6-perlfunc#undef stated that one likely won't have any use for `Nil`. Thus I suspected that there is a more obvious answer...
patrickb sena_kun: Thanks! 13:57
sena_kun patrickb, you are welcome! 13:58
araraloren m: say require JSON::Foo;
evalable6 Cannot test 873de2da53cb31c695aabe0edc983ff4718cec65 (Commit exists, but a perl6 executable could not be built for it)
araraloren m: say try require JSON::Foo;
evalable6 Cannot test 873de2da53cb31c695aabe0edc983ff4718cec65 (Commit exists, but a perl6 executable could not be built for it)
araraloren p6: say try require JSON::Foo; 13:59
evalable6 Cannot test 873de2da53cb31c695aabe0edc983ff4718cec65 (Commit exists, but a perl6 executable could not be built for it)
patrickb o/ tadzik 15:26
I need to decomute now, but can I poke you how I / we / you should deal with my rakudobrew changes? 15:27
pmurias . 15:41
Geth problem-solving: 146ed82b73 | (Aleks-Daniel Jakimenko-Aleksejev)++ | solutions/meta/00002 – Problem Solving.md
Fix link to the README
15:53
cpan-p6 New module released to CPAN! OO::Plugin (0.0.7) by 03VRURG 22:39