»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by moritz on 22 December 2015. |
|||
00:07
Exodist joined
00:11
skids left
|
|||
Todd_ | This did the trick: | 00:12 | |
use Terminal::ANSIColor; | |||
my $Terminal = %*ENV<TERM>; | 00:13 | ||
sub PrintRed ( $Str ) { | |||
if $Terminal ~~ /xterm/ || /linux/ { print color('bold'), color('red'), "$Str", color('reset'); } } | |||
thank you again! bye bye | 00:14 | ||
Geth | doc: 2dd13df6e2 | (Will "Coke" Coleda)++ | 2 files Don't use private class WrapHandle The WrapHandle class: o Isn't actual part of the signature of these methods o Is a private class (internal to the methods on Routine), so we can't refer to it at this level and expect the signatures to compile. also fix a typo. Closes #1254 |
00:15 | |
00:18
Sound left,
Todd_ left
00:19
bjz left
00:20
kurahaupo_ joined
|
|||
Geth | doc: 46be212f6f | (Will "Coke" Coleda)++ | doc/Language/quoting.pod6 Add example of nested Q delimiters Closes #1256 |
00:22 | |
00:23
kurahaupo__ left
00:32
lukaramu_ left
00:34
bjz joined
00:38
rburkholder left
00:39
vendethiel left
00:45
aborazmeh joined,
aborazmeh left,
aborazmeh joined
00:48
Cabanossi left
00:49
Cabanossi joined
00:50
skids joined
00:57
wamba left,
jast left,
jast joined
01:07
bjz left
01:09
raschipi joined
|
|||
samcv | sweet. nqp::chr is soon going to be 46% faster | 01:11 | |
which causes the Int.chr to be 12.3% faster | 01:12 | ||
raschipi | samcv++ | ||
AlexDaniel | :O | ||
\o/ | |||
samcv | except in the rare case the caracter has to be normalized before creating the string. then it's the same speed as before | 01:13 | |
raschipi | samcv: If you keep this up, soon we will be as fast as C. | ||
samcv | hah. | ||
01:22
aborazmeh left
|
|||
samcv | just doing the good work :) | 01:22 | |
01:26
aborazmeh joined,
aborazmeh left,
aborazmeh joined
01:30
cyphase joined
01:35
skids left
|
|||
Voldenet | Hm, I wonder how to forward all arguments to another method or submethod | 01:39 | |
I'm looking for something like `sub one { ... } sub two { one(@_) }` from perl5 | 01:40 | ||
m: sub one (Str $x) { say $x }; sub two { a($^a) }; two("test"); | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: a used at line 1 |
||
Voldenet | m: sub one (Str $x) { say $x }; sub two { one($^a) }; two("test"); | ||
camelia | test | ||
MasterDuke | Voldenet: `sub one(|c) { sub two(c) }`, something like that | ||
Voldenet | m: sub one (Str $x) { say $x }; sub two { one(@_) }; two("test"); | 01:41 | |
camelia | Type check failed in binding to '$x'; expected Str but got Array ($["test"]) in sub one at <tmp> line 1 in sub two at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Voldenet | Uh, obviously. :) | ||
MasterDuke | huggable: capture | ||
huggable | MasterDuke, nothing found | ||
MasterDuke | huggable: Capture | ||
huggable | MasterDuke, Argument list suitable for passing to a Signature: docs.perl6.org/type/Capture | ||
MasterDuke | Voldenet: check out that link ^^^ | ||
u-ou | in the repl, is there a way to say the previous answer | 01:42 | |
AlexDaniel | m: sub one (|x) { two(|x) }; sub two($blah) { say $blah }; one ‘test’; | ||
camelia | test | ||
Voldenet | m: sub one (|x) { two(|x) }; sub two($blah, $foo) { say $blah, $foo }; one 'test', 'foo'; | 01:43 | |
camelia | testfoo | ||
Voldenet | splendid | ||
samcv | huggable, hug me | ||
huggable hugs samcv | |||
u-ou | is there a way to get the last evaluated thing in the repl? | 01:44 | |
01:45
bjz joined
|
|||
u-ou | like _ in python | 01:45 | |
01:45
cschwenz joined
|
|||
MasterDuke | u-ou: i don't think so, pretty sure the repl loses a lot of info about stuff that just happened | 01:45 | |
u-ou | ok | ||
01:47
cschwenz left
01:48
Cabanossi left
01:49
Cabanossi joined
|
|||
BenGoldberg | u-ou, You can always just assign the result to a variable. | 01:59 | |
Does anyone know if there's something like nextsame/nextwith, but which can use an arbitrary Callable? | 02:07 | ||
I'm kinda thinking of perl5's goto &subname.... | 02:08 | ||
AlexDaniel | BenGoldberg: return foo(…) ? :) | 02:09 | |
raschipi | Obligatory: tail-call optimization, when? | 02:10 | |
02:10
kurahaupo_ left
|
|||
AlexDaniel | raschipi: when someone submits a PR? :) | 02:10 | |
don't think it is as simple though | 02:11 | ||
BenGoldberg | Some things might depend on being able to play with the results of callframe(), and so *automatic* TCO is probably not a good idea. *However* letting users perform explicity TCO should be doable. | 02:12 | |
02:21
muraiki left
|
|||
Geth | whateverable: e1420bc936 | (Aleks-Daniel Jakimenko-Aleksejev)++ | Unicodable.p6 Make unidump: command understand hex numbers Just a quick change to make it work |
02:43 | |
whateverable: 5bba2379ee | (Aleks-Daniel Jakimenko-Aleksejev)++ | Unicodable.p6 Tiny style tweaks Just making it more consistent. I wish the whole unicodable will be refactored eventually. |
|||
02:46
benchable6 left,
bisectable6 left,
committable6 left,
statisfiable6 left,
bloatable6 left,
unicodable6 left,
evalable6 left
02:47
Cabanossi left
02:49
Cabanossi joined
02:50
bjz left
02:52
evalable6 joined,
ChanServ sets mode: +v evalable6,
unicodable6 joined,
bisectable6 joined,
bloatable6 joined,
ChanServ sets mode: +v unicodable6,
committable6 joined,
ChanServ sets mode: +v bisectable6,
ChanServ sets mode: +v bloatable6,
ChanServ sets mode: +v committable6,
benchable6 joined,
ChanServ sets mode: +v benchable6,
statisfiable6 joined,
ChanServ sets mode: +v statisfiable6
|
|||
AlexDaniel | (… had to update rakudo to get :i fix) | 02:52 | |
02:58
ZzZombo joined
|
|||
ZzZombo | What modules would be my best bet at creating my own HTTTP proxy server? | 02:59 | |
SmokeMachine | m: enum Bla of Int (bla => 42) # should it be valid? | 03:00 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> No such method 'set_of' for invocant of type 'Perl6::Metamodel::EnumHOW' at <tmp>:1 |
||
03:10
ribasushi left
03:12
dmaestro left
03:13
skids joined
|
|||
skids | What's the nqp incantation to transform a BOOTStr to str? | 03:14 | |
timotimo | nqp::hllize | ||
or perhaps you mean decont_s? | |||
skids | I think it's an NQP 'str' but I'm not totally sure. it's from a nqp::getattr_s | 03:17 | |
03:18
Cabanossi left
03:19
Cabanossi joined
|
|||
skids | still 'P6opaque: representation mismatch when storing value (of type BOOTStr) to attribute (of type str)' | 03:20 | |
BenGoldberg | m: for ^Inf { if callframe($_) -> $c { say $c.code ?? $c.code.name !! '?' } else { last } }; | 03:21 | |
camelia | (signal SEGV) sink-all sink <unit> ? eval evalfiles command_eval command_eval command_line ? ? ? |
||
BenGoldberg | Oops? | 03:22 | |
03:24
cyphase left
03:26
noganex joined,
ribasushi joined
03:27
ZzZombo left
03:29
noganex_ left,
cyphase joined
03:34
khw left
|
|||
MasterDuke | BenGoldberg: i just created a moarvm issue for that github.com/MoarVM/MoarVM/issues/562 | 03:35 | |
timotimo | i'd prefer a more concise title ("segv from accessing code objects from callframes") and the code to run it at the beginning of the ticket's description | 03:39 | |
the segv there is just a missing null pointer check, though it's surprising to have a callframe that gives null there | 03:40 | ||
though perhaps that's what you get when you give a too high number to callframe? | |||
m: say callframe(10000).code | |||
camelia | ctxcaller needs an MVMContext in block <unit> at <tmp> line 1 |
||
timotimo | m: say callframe(10000).code.name | ||
camelia | ctxcaller needs an MVMContext in block <unit> at <tmp> line 1 |
||
timotimo | fair enough i guess | ||
03:40
ZzZombo joined
|
|||
ZzZombo | sup | 03:41 | |
timotimo | ZzZombo: have you heard of the http adaptation protocol (or something like that?) | 03:42 | |
en.wikipedia.org/wiki/Internet_Con...n_Protocol | |||
anything you could want to do with a custom proxy server you could do with squid and this instead | |||
03:48
xtreak joined
03:55
bjz joined
|
|||
skids | Ah. The BOOTStr is null. | 03:59 | |
03:59
mst left
04:01
raschipi left
|
|||
ZzZombo | timotimo: it was very interesting to learn, but unfortunately it doesn't seem like there is a whole lot of usable ICAP servers for Windows. | 04:03 | |
04:05
xtreak left
04:06
Cabanossi left
04:07
Cabanossi joined
04:11
ribasushi left,
xtreak joined
04:12
AlexDaniel left
04:17
mst joined
04:20
ribasushi joined
|
|||
skids | m: use nqp; my $b; "o" ~~ / . {$b := $/.CURSOR }/; my $f := nqp::getattr_s($b,Cursor,"\$\!name"); nqp::say(nqp::isnull($f)); nqp::say($f); | 04:22 | |
camelia | 0 say requires a concrete string, but got null in block <unit> at <tmp> line 1 |
||
skids | :/ | ||
Ah. isnull_s. | 04:25 | ||
04:43
Slobo joined
04:44
xtreak left,
Slobo left
04:55
ZzZombo left,
ZzZombo joined
05:02
skids left
05:39
xtreak joined
05:43
BenGoldberg left
05:52
aborazmeh left
05:58
vendethiel joined
06:07
cyphase left
06:10
wamba joined
06:12
cyphase joined
06:21
cyphase left
06:26
cyphase joined
06:34
cyphase left
06:38
cyphase joined
06:51
cyphase left
06:56
cyphase joined
|
|||
samcv | ugh wikipedia how can you not sort things numerically | 06:58 | |
all the 9's at the top and it's not sorting by population | 06:59 | ||
i'm guessing it might be because they used commas with the numbers so it's sorting it as text. maybe on wiki you have to put the raw numbers in and it adds the commas by itself | 07:01 | ||
07:02
vendethiel left
07:03
cyphase left
07:05
Cabanossi left
|
|||
samcv | wiki markup is so insane. | 07:05 | |
when it gets to complicated tables and such | |||
07:06
Cabanossi joined
07:08
xtreak left
07:12
cognominal left
07:19
jordman_ joined,
jordman left,
dalek joined,
ChanServ sets mode: +v dalek
07:24
cyphase joined
07:28
cyphase left
07:29
wamba left,
unicodable6 left
07:37
unicodable6 joined,
ChanServ sets mode: +v unicodable6
07:44
unicodable6 left
07:46
salv0 joined
|
|||
samcv | .tell nine getting those failing tests again. maybe because i'm using libffi under moarvm and not dyncall? | 07:50 | |
yoleaux | samcv: I'll pass your message to nine. | ||
07:54
robertle joined
07:55
nadim_ joined
08:00
domidumont joined
08:04
rindolf joined
08:06
mephinet joined,
domidumont left
08:09
domidumont joined
08:13
setty1 joined
08:16
darutoko joined
08:18
Actualeyes left,
Actualeyes joined
08:21
El_Che_ joined,
El_Che_ left
08:37
domidumont left
08:40
TEttinger left
|
|||
Woodi | hi #perl6 :) | 08:46 | |
samcv | hi Woodi | ||
Woodi | samcv: *nicode question, if you don't mind... | 08:47 | |
08:47
pistacchio joined
|
|||
pistacchio | hi, is there a community forum anywhere? | 08:47 | |
samcv | sure Woodi i am unicode. we all are unicode | 08:51 | |
Woodi | so Unicode started as 32bit numbers, now 64 ? then encoding problems, let's say, resolved by utf-8... but that don't include *other* things like sorting, numbers - every such thing needs additional lookup table ? | ||
just trying to find way to learn past bits and utf-8 :) | 08:52 | ||
samcv | ok. utf8 and unicode are seperate. unicode assigns characters to codeponits | ||
utf-8 is a way of encoding these codepoint numbers in section of 8bits | |||
the highest unicode codepoint is technically 0x10ffff but nothing is anywhere close to that high | 08:53 | ||
which is 1,114,111 and there aren't that many cp (yet?) but how moarvm stores codepoints is in 32 bit signed numbers | 08:54 | ||
well it can be 8 bits technically if all the codepoints in the string are under 128 | |||
but regardless. 32 bits signed. so those negative numbers are used to store things higher than the max of a 32 bit signed number, and are also used to encode 'graphemes' which are made up of multiple codepoints | 08:55 | ||
Woodi | but 32/64 bit number space do not include eg. sorting ? | 08:56 | |
samcv | i don't get your question | ||
but basically. there are enough negative codepoints to never run out (these synthetics) | |||
you'd have to have so much string data that it cannot be stored in any computer to use them all up. | 08:57 | ||
Woodi | codepoints are just numbers. how to sort lexially, by checking $cp1 < $cp2 numerically ? | ||
08:58
RabidGravy joined
|
|||
samcv | uhm cmp sorts by cp | 08:58 | |
i have implemented the Unicode Collation algorithm though if you want to sort properly | |||
Woodi | that algo uses additional data or just cp ? | ||
samcv | i added a docs page on the new metheods/operators i added docs.perl6.org/language/experimental#Collation | ||
the unicode collation algorithm uses additional data. so sorts things properly. (alphabetically) | 08:59 | ||
m: use experimental :collation; say <ä a o ö>.collate; # (a ä o ö) | |||
camelia | (a ä o ö) | ||
samcv | m: say <ä a o ö>.sort; # (a ä o ö) | ||
camelia | (a o ä ö) | ||
Woodi | and sotry with roman numbers and numbers from other cultures is similiar ? cp alone are not enought ? | 09:00 | |
*story | |||
samcv | yeah it does all languages | 09:01 | |
also for latin script, it will sort 'a' before the letter 'Za' | |||
err 'Z' | |||
and you can custom set how to sort it. like if you want to ignore case. or ignore diacritics | 09:02 | ||
read docs.perl6.org/language/experiment...ion_Levels how the collation levels work | |||
Woodi | opened :) | ||
ok, thank you samcv++ | 09:03 | ||
samcv | is that what you wanted? | ||
Woodi | yes :) making sure that cp's alone are not enough for all what Unicode do | 09:04 | |
it's kind of problem with learning Unicode | |||
nadim_ | Morning P6 \o/ | 09:05 | |
Woodi | hi nadim :) | ||
nadim_ | do we have some Devel::Size equivalent? | ||
morning Woodi, long time ... | |||
09:06
espadrine joined
|
|||
Woodi | pistacchio: hi, sorry for late answer... we don't have specialised forum but Reddit have specialised subreddit for us :) | 09:06 | |
09:07
domidumont joined
|
|||
nadim_ | I find myself use'ing three four packages all the time, is there a way to use them all in a package and just use that one? | 09:08 | |
Woodi | nadim_: I think distros could be the answer but not sure | 09:10 | |
samcv | Woodi, i've been asked to do a chapter on unicode for moritz's book. and have been meaning to make a blog post about unicode for too long now lol. | 09:11 | |
Woodi | private CPANs, etc :) | ||
samcv: I hear writing is learned by writing things :) | 09:13 | ||
samcv | that's just a rumor... | 09:14 | |
Woodi | samcv: there is many blog post and articles about unicode and moust of them are similiar... I think something new should be written... | 09:15 | |
samcv | ok so write what other people haven't written about unicode. that seems easy enough. link to one of these blog pages so i can make sure to be better than that one :P | 09:16 | |
Woodi | samcv: I don't know to point "this is typical, bad blog post" :) | 09:17 | |
09:18
rburkholder joined
|
|||
samcv | this is an alright post www.joelonsoftware.com/2003/10/08/...o-excuses/ | 09:19 | |
Woodi | samcv: problem is to explain you need to start from begining and that makes a lot of paragraphs. maybe post with very short intro ? :) | ||
i read this twice I think. and that's basics, like subject indicate :) | 09:20 | ||
samcv | imo it goes too much into encoding and not into unicode | ||
it doesn't really say what unicode is. just how it can be encoded | 09:21 | ||
chansen_ | This is aslo a good introduction post: reedbeta.com/blog/programmers-intro-to-unicode/ | ||
samcv | which i thought was leaving a lot out of it | ||
Woodi | maybe usually diacritics part is where moust readers finish reading... | ||
samcv | that looks a lot better chansen_ | 09:22 | |
i find it really interesting lol. but that's just me | |||
Woodi | it's much never then joels++ :) | 09:23 | |
chansen_ | samcv: yeah, touches more Unicode concepts | ||
samcv | unicode is a framework for programmatically determining the properties of a character. determining what a 'visual' character is. these concepts are clear to humans writing on paper. but to a computer, it does not know what words are | 09:24 | |
doesn't know how words and sections of words interact. and unicode is the framework which allows us as programmers to be able to support a vast array of scripts and languages by having clearly defined property values that can be followed | 09:25 | ||
Woodi | i think programmers just prefer simpler things like ascii, that them can control from start to finish... | ||
samcv | yeah of course. i mean ideally nobody would ever need to know the codepoint numbers and it wouldn't matter and it'd be abstracted enough away or something | ||
Woodi | how much is Unicode in Go and Rust ? | 09:26 | |
samcv | so ascii it ties letters to 8 bits. but unicode actually describes WHAT they are. and how they interact wih the surrounding codepoints | ||
not i don't think | |||
i mean i think they support utf-8 | 09:27 | ||
but nothing like perl 6 with its concept of graphemes | |||
Woodi | so probably Perl6 have a guaranteed lead for next 20 years :> | ||
samcv | swift is #2 with unicode support | ||
hah | |||
perl 6 was designed to be good enough for the next 100 years. or so they say | 09:28 | ||
at least in its flexibility and extensibility internally and such | |||
Woodi | samcv: I probably cynic here but I bet graphemes was sheduled to be invented by Unicode commeittee in future session :) | ||
Perl6 just was too fast :) | 09:29 | ||
samcv | idk i could write a post about what unicode means for a perl 6 programmer. but. i don't like that really. because i think unicode should be transparent like it wasn't even there | 09:30 | |
and the codepoints themselves will eventually become irrelevant | |||
and everybody would use the Unicode collation algorithm o sort things because the codepoints have no impact on the actual characters themselves and it will be a magical land, where everybody uses perl 6 | 09:31 | ||
Woodi | samcv: maybe post how to use graphemes would be nice. eg. you used above .collate and that's not what ascii user can imagine... such things | 09:32 | |
samcv | yeah. it's easy for people to grasp, these letters aren't in the right order! | ||
when they see them. because that is the 1st thing that comes to mind, not their code values. and then expand on that. and show how unicode collation algorithm and all the properties and things give us a framework for this | 09:33 | ||
actually i think unicode is enormously simple | 09:34 | ||
for the task they do. it is amazing | |||
09:35
parv joined
|
|||
Woodi | easy to say :) | 09:35 | |
parv | m: say easy | 09:36 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: easy used at line 1 |
||
Woodi | first: how to type that thingies :) | ||
parv | Woodi, what did you say? | ||
Woodi | parv: when ? :) | 09:37 | |
samcv | Woodi, could probably write the reason things get added to unicode. such as some things are added to aid in transcribing historical text. others to allow two way roundtripping with another encoding. and need for such a thing. as well as current usage | ||
i find it interesting they have picture of squares. and like that is going to explain to you about the nature of unicode | 09:39 | ||
though i guess it's kinda neat. but. that was my first thought. | 09:40 | ||
parv | Woodi, nevermind | ||
Woodi | samcv: I think Unicode will be used when we switch to using command lines in GUI, like `console in games :) | 09:41 | |
parv has been doing copy-paste for unicode things not easily entered via US layout keyboard | |||
samcv | compose key! | 09:42 | |
parv | samcv, I may set up that & remember the seq. or, not. don't | 09:43 | |
... care enough yet. | |||
samcv | parv, you can steal my xcompose github.com/samcv/dot-files/blob/ma.../.XCompose | 09:45 | |
Woodi | dayly used things always have priority... | ||
samcv | you can always search for the description or search for the symbol you copied from somewhere to remember the squence | ||
then you can do 🐧 and 💯 and uh. ≤ and “ this ” and ¿ and whatever stuff | 09:46 | ||
parv | samcv, thanks # downloaded & bookmarked | ||
samcv | i have M-dash and n-dash and minus sign and horizontal bar | 09:47 | |
chansen_ | samcv: How about writing about Perl 6's string model? Show how it's superior to other models/languages (concatenation, substring ...). Such post would give Perl 6 good exposure outside it's community | 09:51 | |
samcv | yeah that for sure :) | ||
been good talking and getting me brainstorming | 09:52 | ||
parv .oO(if one can search unicode grapheme by description in vim) | 09:53 | ||
samcv | can one? | ||
parv | I no nothin'. wondering myself | 09:54 | |
09:57
jraglin left,
jraglin joined
|
|||
RabidGravy | m: gist.github.com/jonathanstowe/d9f6...7277336aa7 | 10:03 | |
camelia | (Hash[Str,<anon>]) (Str) (Associative[Str,<anon>]) No appropriate parametric role variant available for 'Associative' in block <unit> at <tmp> line 12 |
||
RabidGravy | any way out of that? Assuming I need to know the "of" of the Associative attribute | 10:04 | |
actually isn't that a bug? | 10:07 | ||
in rakudo that is | |||
seeing that the Associative role only has one parameter as defined but somhow it manages to create one with two parameters | 10:09 | ||
10:15
kent\n left
10:23
labster left
10:24
kent\n joined
10:26
andrzejku joined
|
|||
pistacchio | how can i make "eq" to return "false"? I can only get Any | 10:52 | |
lizmat | pistacchio: show us the code! :-) | 10:53 | |
m: dd "foo" eq "bar" | 10:55 | ||
camelia | Bool::False | ||
pistacchio | oh, done | ||
it was the result of a grammar .made call. I just had to call .Bool on it :) | 10:56 | ||
10:56
vendethiel joined
|
|||
lizmat | m: dd ?Any # or prefix with ? | 10:56 | |
camelia | Bool::False | ||
RabidGravy | so in the gist above how does the .type of the attribute become "Associative[Str,<anon>]" when there isn't a two parameter candidate for Associative? | 10:58 | |
or is the .gist() cheating somehow? | |||
like the Mu.gist has knowledge of the guts that isn't exposed properly in the Perl6 associative role | 11:00 | ||
lizmat | RabidGravy: nothing springs to mind, I'm afraid :-( | 11:02 | |
RabidGravy | my immediate thought for a fix is make Associative have two candidates | 11:03 | |
but I don't know what to call the key type constraint accessor | 11:04 | ||
11:04
Cabanossi left
|
|||
lizmat | afk again& | 11:04 | |
11:07
Cabanossi joined
|
|||
RabidGravy | or actually just give the existing one a second parameter with a sensible default | 11:08 | |
ah keyof | 11:10 | ||
will make a patch for that later, as the sun is out we're going to the seaside | |||
11:11
wamba joined
|
|||
pistacchio | can you tell me why here ideone.com/AaSl2g <crontask> works file, while <crontask>+ hangs the execution? | 11:14 | |
11:21
vendethiel left
11:24
setty1 left
|
|||
pistacchio | can you tell me why here ideone.com/AaSl2g <crontask> works file, while <crontask>+ hangs the execution? | 11:35 | |
11:42
pistacchio left
11:54
lukaramu joined
12:05
Cabanossi left
12:07
Cabanossi joined
|
|||
moritz | \o from Oslo | 12:08 | |
parv: <crontask> matches zero characters | |||
12:08
xinming left
|
|||
moritz | sorry, meant pistacchio | 12:08 | |
EGONE | 12:09 | ||
12:09
xinming joined
12:10
parv left
12:13
jraglin left
|
|||
sjn | o/ from Oslo :D | 13:00 | |
13:03
rumble joined,
grumble is now known as Guest52475,
Guest52475 left,
rumble is now known as grumble
13:12
darutoko left
13:13
aborazmeh joined,
aborazmeh left,
aborazmeh joined
13:20
Cabanossi left
13:22
Cabanossi joined
13:23
lichtkind joined
13:35
lukaramu_ joined
13:38
lukaramu left
13:41
salv0 left
13:44
kurahaupo__ joined
13:47
salv0 joined,
ChoHag left
13:49
domidumont left
14:04
Cabanossi left
14:06
AlexDaniel joined
14:07
unicodable6 joined,
ChanServ sets mode: +v unicodable6,
Cabanossi joined
14:16
domidumont joined
14:21
aborazmeh left
14:23
Sound joined
|
|||
timotimo | bench: compare HEAD "hey how are you".contains("w a") for ^100_000 ||| so "w a" ~~ / w ' ' a / for ^100_000 | 14:30 | |
benchable6 | timotimo, starting to benchmark the 1 given commit | ||
timotimo, ¦HEAD: «Benchmark: Timing 10 iterations of 0, 1... 0: 0.4836 wallclock secs @ 20.6801/s (n=10)␉␉(warning: too few iterations for a reliable count)«timed out after 10 seconds»» | 14:31 | ||
timotimo | oh? whoops :) | ||
bench: compare HEAD "hey how are you".contains("w a") for ^1_000 ||| so "w a" ~~ / w ' ' a / for ^1_000 | |||
benchable6 | timotimo, starting to benchmark the 1 given commit | ||
timotimo, gist.github.com/748f075fdcd57cff22...625aa0e372 | |||
timotimo | hm, the n in there can't be controlled, right? | 14:32 | |
MasterDuke | timotimo: correct | 14:33 | |
14:34
ChoHag joined
|
|||
MasterDuke | you could make it controllable | 14:35 | |
timotimo | it'd probably be beneficial to come up with a more involved benchmark to compare matching a string inside of another string with contains vs match (though perhaps it'd be fairer to use index instead of contains) | ||
MasterDuke | i keep forgetting how much overhead `for ^n` has compared to `loop (my int $i = 1; $i <= n; $i = $i + 1) {` | 14:37 | |
timotimo | there is an optimization inside the Perl6::Optimizer that will transform that if n is literal | 14:38 | |
it constantly breaks, though | |||
it's very sensitive to changes in other parts of the compiler ;( | |||
MasterDuke | bench: compare HEAD my $s = 0; $s = $s + 1 for ^1_000_000; say $s; ||| my $s = 0; loop (my int $i = 1; $i <= 1_000_000; $i = $i + 1) {$s = $s + 1}; say $s; | 14:41 | |
benchable6 | MasterDuke, starting to benchmark the 1 given commit | ||
MasterDuke, gist.github.com/43d49c93c5ddffa99e...d8071c2acd | |||
MasterDuke | loop takes one-tenth the time | ||
timotimo | bench: compare HEAD my $s = 0; for ^1_000_000 -> int $_ { $s = $s + 1 }; say $s; ||| my $s = 0; $s = $s + 1 for ^1_000_000; say $s; | 14:42 | |
benchable6 | timotimo, starting to benchmark the 1 given commit | ||
timotimo, gist.github.com/53858e0d9e218e0c55...46b228890e | |||
timotimo | that's at least 2x faster | 14:43 | |
bench: compare HEAD my $s = 0; for ^100_000 -> int $_ { $s = $s + 1 }; say $s; ||| my $s = 0; $s = $s + 1 for ^100_000; say $s; | |||
benchable6 | timotimo, starting to benchmark the 1 given commit | ||
timotimo, gist.github.com/a447873fa320927880...d89a7f804e | |||
timotimo | um ... huh? | ||
apparently only after a given point | |||
bench: compare HEAD my int $s = 0; for ^100_000 -> int $_ { $s = $s + 1 }; say $s; ||| my $s = 0; $s = $s + 1 for ^100_000; say $s; | 14:44 | ||
benchable6 | timotimo, starting to benchmark the 1 given commit | ||
MasterDuke | `-> int $_` has to create an extra frame, right? | ||
benchable6 | timotimo, gist.github.com/f72c3331f3e333521e...3a82bb0e20 | ||
timotimo | that's right | ||
14:45
ChoHag left
14:47
darutoko joined
|
|||
MasterDuke | m: for ^1_000_000 {}; say now - INIT now | 14:48 | |
camelia | 0.4982313 | ||
14:51
Cabanossi left
14:52
Cabanossi joined,
domidumont left
|
|||
timotimo | DrForr: do you think it's already feasible to use Perl6::Parser to find stuff like "do any ecosystem modules call a method with this name with n positionals / this named arg"? | 14:55 | |
in the io grant, ioninja used a simple grep line to figure out if any calls to comb, lines, words, or slurp-rest pass the "close" named parameter, but it'd only ever find usages of "close" that's on the same line, and it'd false-positive on having "close" somewhere else on the line, too | 14:56 | ||
15:15
khw joined
15:22
n1ce joined
15:25
vendethiel joined
15:26
ZzZombo left
|
|||
masak | that's a very interesting use case to have. timotimo++ | 15:26 | |
15:27
n1ce left
15:33
gdonald joined
15:35
pmurias joined
|
|||
pmurias | jnthn: do we need to keep p6invokehandler? It seems to be a parrot relict as the current backends just turn it into call. | 15:36 | |
15:39
wamba left
15:41
hankache joined
15:43
wamba joined
|
|||
timotimo | aye, perl6-all-modules is already fantastic | 15:48 | |
but unless you have a search tool with source code understanding, its use for automated surveying is limited | |||
15:49
Cabanossi left
15:51
salv0 left
|
|||
jnthn | pmurias: I suspect it's a relic also | 15:51 | |
15:52
Cabanossi joined
|
|||
pmurias | jnthn: is rakudo-debugger maintained? | 16:06 | |
jnthn | pmurias: As time allows, yes :) | 16:20 | |
Or doesn't allow, perhaps :P | 16:21 | ||
I think recent slang changes mighta caused some upset | |||
16:25
jraglin joined
16:28
jraglin left
16:42
hankache left
|
|||
vendethiel | > my @rm'd = $!state{'breakpoints'}.grep({ $_ ne @parts[2] }); | 16:56 | |
Grammar::Debugger's source code is nice :) | |||
timotimo | jnicethnice | 16:57 | |
17:21
domidumont joined
17:36
espadrine left
17:39
espadrine joined
17:47
andrzejku left
17:48
ChoHag joined
|
|||
samcv | anyone had experience with a dual intel/nvidia laptop running linux. i know there's some weird things since linux doesn't have the same support as windows for these weird configs | 17:48 | |
17:50
Cabanossi left
17:52
Cabanossi joined
|
|||
samcv | hmm maybe have to use proprietary drivers for this. sounds like a hassle. since i do no gaming | 17:52 | |
17:53
Actualeyes left
|
|||
AlexDaniel | timotimo: in fact, maybe it'd be nice to have a bot for this… | 17:53 | |
17:54
dct joined
|
|||
geekosaur | I am under the impression recent nouveau does have limited support for it. but both the nv and nouveau drivers have (different) bugs | 17:54 | |
but I have no direct experience; all my gear has Intel Iris Pro | |||
(that said, being the SME for a window manager means getting exposed to everyone else running into driver bugs :) | 17:55 | ||
samcv | i mena it's inherently weird. the nvidia card goes through the intel framebuffer | 17:56 | |
18:01
TeamBlast left
|
|||
samcv | well this t540 feels much faster than my x220. has same ram frequency (x220 supports 1666mhz if you install hacked b ios) and same amount of memory. and 2.4ghz vs 2.6ghz | 18:01 | |
though i have an ssd and it is 6.0gb/s vs 3.0gb/s on the x220. though the cpu has got to be faster, or something. i don't think i really had a hard drive bottleneck before. | 18:02 | ||
and doesn't look like i can max out 6gb/s with aes encrypted hd. that's benching at 2.3GB/s on the t540 | 18:04 | ||
18:04
TeamBlast joined
|
|||
samcv | but still could have less strain on the rest of the cpu. hmm | 18:04 | |
will have to run some rigorous benchmarks so i can actually figure out what it is | |||
AlexDaniel | m: say 2576980377.uniprop | 18:05 | |
camelia | Error, MoarVM cannot get Unicode codepoint property for synthetic codepoint -1717986919 in block <unit> at <tmp> line 1 |
||
samcv | actually wait. it's the same base ghz actually. more research is needed | ||
lol AlexDaniel nice overflow | 18:06 | ||
AlexDaniel | seeing it in my tests… | ||
samcv | you test that high of a cp? | ||
that's not a real one. but it should still throw differently | |||
or show different error | |||
or does it happen with normal ones | 18:07 | ||
AlexDaniel | samcv: github.com/perl6/whateverable/blob...#L133-L136 | ||
18:07
Actualeyes joined
|
|||
AlexDaniel | m: say 0x11FFFF.uniprop | 18:08 | |
camelia | |||
samcv | what are you expecting to happen? | ||
AlexDaniel | m: say 0x99999999.uniprop | ||
camelia | Error, MoarVM cannot get Unicode codepoint property for synthetic codepoint -1717986919 in block <unit> at <tmp> line 1 |
||
samcv | a different error? throwing in perl 6 and not moarvm? | ||
AlexDaniel | uhhh I don't know… | 18:09 | |
samcv | or just say invalid codepoint? | ||
AlexDaniel | m: try { say 0x99999999.uniprop } | ||
camelia | ( no output ) | ||
AlexDaniel | maybe it's fine… | ||
except for the overflow | |||
samcv | yeah | 18:10 | |
probably an sprintf thing didn't do the right integer type etc lol | |||
it thinks the cp is less than 0 though. which is weird. since it's not | 18:16 | ||
18:16
unicodable6 left
|
|||
samcv | and changing it to %li fixes it. hm | 18:16 | |
18:18
unicodable6 joined,
ChanServ sets mode: +v unicodable6
|
|||
AlexDaniel | unidump: U+D800 | 18:18 | |
unicodable6 | AlexDaniel, gist.github.com/290250032f193908de...fd87a80fcc | ||
AlexDaniel | samcv: ↑ better than nothing I guess? | ||
samcv | this is sufficient | ||
:) | |||
i like your tables very much so | 18:19 | ||
18:19
Cabanossi left
|
|||
AlexDaniel | unidump: 0x99999999 | 18:19 | |
:| | |||
samcv | XD | ||
AlexDaniel | I'll leave it as is for now… gonna revisit it later | 18:20 | |
18:22
Cabanossi joined
|
|||
AlexDaniel | m: say 0x99999999.uniname | 18:27 | |
camelia | <unassigned> | ||
AlexDaniel | samcv: mmmmhmm | ||
samcv: why uniname works but uniprop doesn't? | |||
samcv | because uniname isn't in the same property function in moarvm | ||
AlexDaniel | internally, yes. But as a user, why would I care? | 18:28 | |
samcv | different functions are the path they go through. they don't really share | ||
you shouldn't | |||
AlexDaniel | m: say 0x99999999.chr | ||
camelia | chr codepoint too large: 2576980377 in block <unit> at <tmp> line 1 |
||
samcv | but you can't get a property for a non-real codepoint | ||
AlexDaniel | m: say 0xD800.chr | 18:29 | |
camelia | Error encoding UTF-8 string: could not encode codepoint 55296 in block <unit> at <tmp> line 1 |
||
samcv | the <unassigned> is not its name but is uh | ||
AlexDaniel | then I shouldn't be able to get its name also? | ||
samcv | whatever idk. will come back to it in an hour. gotta do something | ||
AlexDaniel | :) | ||
samcv | that's probably true AlexDaniel | ||
for ones above the legal limit | |||
cause it's not unassigned it's non grata | 18:30 | ||
18:38
Tonik joined
18:45
raschipi joined
|
|||
pmurias | n/j #perl6-dev | 18:45 | |
do we want to "fabricate" unicode properties for synthetic code poins? | 18:47 | ||
18:51
Sound left
|
|||
jnthn | pmurias: Yes; so far we just take the properties of the base character and use those as the properties of the synthetic | 18:53 | |
18:53
TEttinger joined
|
|||
samcv | .o(probably broken for extend graphemes but i have not checked yet) but that was added recently support for extend grapheme cluster break | 18:53 | |
19:00
rburkholder left
|
|||
Voldenet | How can I effectively load and unload snippets / modules in p6 script? | 19:01 | |
19:03
davido_ joined
19:05
davido_ left,
Cabanossi left
|
|||
Voldenet | My use case is that I'd like to invoke perl6 scripts without reloading moarvm and leaking much memory | 19:05 | |
19:06
dct left
|
|||
MasterDuke | Voldenet: EVALFILE | 19:06 | |
mst | now scoping is lexical you can probably load stuff into scope | ||
but I dunno if rakudo will free the loaded CU after it drops out of scope | |||
19:07
dct joined
|
|||
Voldenet | Oh, hm. I guess that can be easily checked with some tests | 19:07 | |
19:07
Cabanossi joined
|
|||
rjbs- | twitter.com/ignasi35/status/845339657474859008 | 19:11 | |
Voldenet | Nice. | ||
mst | rjbs-: you have a tail | ||
jnthn | MoarVM can collect compunits, and to my knowledge we have no remaining EVAL-related leaks | 19:13 | |
mst | jnthn: wondering if there are lexical loading related ones | 19:18 | |
mst plans to stuff things into a CUR with a timestamp version at some point or similar for reloading | |||
or at least, I plan to try it and see what goes wrong | |||
because that should be entertaining | |||
19:19
FROGGS joined
19:25
labster joined,
darutoko left,
zakharyas joined
|
|||
mst | TimToady: incidentally, it seems like every time PEG grammars get mentioned online at least one person jumps in with "they're terrible use Marpa!" and a link to a not particularly clear critique of PEG - is there anything you can think of that elucidates the differences and explains why perl6 (and ingy's Pegex) preferred PEG ? | 19:28 | |
TimToady: my attempts to find comparisons just lead me in circles of Marpa zealots shouting "but PEG's terrible" and people going "uhh ... could you provide an actual analysis of this?" and then *crickets* | 19:30 | ||
19:32
dct left
|
|||
RabidGravy | I think the tumblweed is enough counter critique | 19:32 | |
(I have no view on the matter) | 19:33 | ||
timotimo | /me didn't even read | ||
19:33
sufrostico left
|
|||
masak | mst: I read something -- a Marpa blog post -- to the effect that "while recursive descent is the easiest one to *explain* and conceptually *understand*, it's also the least optimal and least flexible from a number of parser-y points of view" | 19:34 | |
mst | RabidGravy: yeah, it's enough for me to not worry about it ... but that doesn't mean the question didn't nerd snipe me anyway | ||
raschipi | u: AxCCx81 | 19:35 | |
unicodable6 | raschipi, U+00C1 LATIN CAPITAL LETTER A WITH ACUTE [Lu] (Á) | ||
19:35
setty1 joined
|
|||
raschipi | I wonder what normalizes the codepoints I pasted. | 19:36 | |
mst | masak: that would be a pretty reasonable explanation | ||
RabidGravy | you need more beer, I for one fell asleep halfway through making a tiny change to Associative.pm | ||
Voldenet | How can I force GC in moarvm, can I do this? | 19:38 | |
masak | mst: one concrete case of that that I could think of is that an operator parser could be recdescent'd, but everyone I've ever seen ends up making it something like shunting algorithm instead, often citing performance | ||
timotimo | Voldenet: yes, "use nqp", then "nqp::force_gc" | ||
masak | even Perl 6 itself does a custom parser for the ops, in fact | ||
timotimo | good thing about perl6 grammars is that you can drop in anything you can imagine at any point in the parse process | 19:39 | |
as long as you return a Cursor at the end, iirc | |||
masak | 007 uses that a little bit | 19:40 | |
somewhere in the region of "you can declare your own operators, and they install themselves in the parser" | 19:41 | ||
mst | masak: oh interesting | 19:42 | |
19:43
Vishalk169 joined
|
|||
Vishalk169 | Hi | 19:44 | |
Who's there ? | 19:45 | ||
19:45
Vishalk169 left
|
|||
masak | just us chickens... | 19:45 | |
mst | too late | ||
timotimo | they came to see if perl6 is alive and it was clear to see that perl6 is actually dead | 19:46 | |
19:47
gdonald left,
gdonald joined
|
|||
AlexDaniel | raschipi: perl 6 does :) | 19:48 | |
raschipi: I haven't done anything in the bot to prevent normalization | |||
19:49
Cabanossi left
|
|||
AlexDaniel | .u AxCCx81 | 19:49 | |
yoleaux | U+0041 LATIN CAPITAL LETTER A [Lu] (A) | ||
U+0301 COMBINING ACUTE ACCENT [Mn] (◌́) | 19:50 | ||
AlexDaniel | I wonder who is more right | ||
unicodable or yoleaux | |||
19:52
Cabanossi joined
|
|||
raschipi | AlexDaniel: How hard would it be to prevent normalization in a string? | 19:56 | |
AlexDaniel | raschipi: I guess you'll have to work with a Buf then | ||
raschipi | I'm thinking about file names, which need to be the same bit-by-bit to work. | 19:57 | |
geekosaur | utf8-c8 is supposed to be engaged for filenames. but, yes, this needs to be thought out better | 19:58 | |
AlexDaniel | where's Zoffix when you need him :) | ||
raschipi | If I have a file with the decomposed form on disk, I would need a Buf literal to be able to open it? | ||
AlexDaniel | raschipi: that's a good question, yes | 20:01 | |
but no, I don't know | |||
raschipi | Right, I created a file with the decomposed forma and now I can't delete it. Let me use a graphical file browser. | 20:04 | |
timotimo | utf8-c8 will always roundtrip properly | ||
but if you have something like the A with combining accute accent, you'll end up with one or two synthetic graphemes after the A | |||
20:07
Tonik left
|
|||
raschipi | OK, how can I declare a utf8-c8 literal? | 20:08 | |
timotimo | you can't, source files go through NFG unless you specify a different encoding on the commandline | 20:09 | |
but you can spell out the Buf and put a .decode call directly in the source | |||
raschipi | That's a hassle, isn't it? Can't copy and paste filenames to source code. | 20:10 | |
20:11
Belial joined
|
|||
timotimo | if your filenames are weird, then yeah :P | 20:12 | |
raschipi | Is there a way to say: "This string or any canonically equivalent?" | 20:13 | |
timotimo | if you have Str, then "eq" | ||
Belial | Hi all, here pretty much looking for where to start with Perl 6? I used Perl 5 for work and am interested to see what has been done for the new iteration. Any tips for a C/C++ programmer learning Perl 6? | ||
timotimo | we have a few documents that could be the right thing for you, Belial | 20:14 | |
El_Che | Pick a problem, and write a solution | ||
timotimo | one is the 5-to-6 pages in the docs that highlight important differences when you come to 6 from 5 | ||
El_Che | while keeping a browser open with the perl6 doc | ||
timotimo | another is the perl6 page on learnxinyminutes, which is for "people who can already program" in general | ||
Belial | Ah most excellent, won't have to slog through the very basics, for some reason I can't make myself skip it lol | 20:15 | |
El_Che | (is there any known schedule for the release of O'Reilly Learning Perl 6?) | 20:16 | |
lizmat | no known schedule, afaik | 20:18 | |
El_Che | Is it me, or did brian d foy changed the title? | ||
"Learning Perl 6, the Nutshell Book from O'Reilly Media" | |||
I don't remember the nutshell part | |||
lizmat | perhaps that's just O'Reilly marketing, really | 20:19 | |
it's akin to "for dummies", but hopefully it shouldn't make you feel as stupid :-) | |||
El_Che | "Learning X" and "Nutshell" are very different kind of books | ||
20:20
domidumont left,
Belial left
|
|||
Voldenet | Hm, what's the most viable way to inspect the memory usage of moarvm? | 20:21 | |
RabidGravy | does t/spec/S02-types/pair.rakudo.moar have traditional failures or have I broke something | 20:22 | |
20:23
sufrostico joined
|
|||
timotimo | Voldenet: multiple ways to do it; i've been working on a little branch that does An Interesting Thing, let me dig it up | 20:23 | |
github.com/MoarVM/MoarVM/pull/536 | |||
another way is to use the moar-gdb.py gdb plugin and call "moar-heap" from a frame that has "tc" as a local variable available | 20:24 | ||
Voldenet | I want to see if ix.io/pfh will leak something, my understanding is that it shouldn't... | ||
timotimo | yet another way is the heap profiler which you get by telling perl6 to --profile=heap | ||
Voldenet | but I'd need to validate | ||
timotimo | oh, you can just watch the memory usage in top or something | 20:25 | |
Voldenet | hm, something like this would probably work, but I might be profiling leaks in shell-* area ix.io/pfi | 20:26 | |
timotimo | ah i was about to suggest using /proc/self for that | ||
Voldenet | Wow, I've used /proc/pid my whole life | ||
:P | |||
but i'll split that for sanity, I don't want to check if shell ops are leaky :P | 20:28 | ||
timotimo | right, that's why i suggested just watching in top | 20:29 | |
Voldenet | hm, top has the problem of not monitoring over-time growth, and I don't want to sit 10 hours and watch it :-) | 20:30 | |
timotimo | hm, okay, how about this | 20:31 | |
in addition to sleep 0.1, you also { say "hi" } | |||
Voldenet | :> | ||
timotimo | and you pipe that into something that invokes ps for every line it gets | ||
Voldenet | Well, I was just planning to make a perl script doing Proc::Async.new that'd save csv with memory usage measurements | 20:33 | |
(i'm sure it's already solved, but I definitely need this :P) | |||
20:33
sufrostico left
20:35
sufrostico joined
20:37
Belial joined,
Belial left
20:42
matiaslina joined
|
|||
[Coke] | .ask awwaiid if they can check out github.com/perl6/doc/issues/1247 | 20:45 | |
yoleaux | [Coke]: I'll pass your message to awwaiid. | ||
Voldenet | uh, I wonder why Proc has pis and Proc::Async doesn't | 20:48 | |
s/pis/pid/ | |||
raschipi | OK, IO::Path.new is 'multi method new(Str:D $path)' | 20:49 | |
20:50
BenGoldberg joined
|
|||
raschipi | Shouldn't it take Stringy instead of Str so it can receive a Buf with the exact bits we need? | 20:50 | |
To open a file with a name that Str would normalize. | 20:51 | ||
20:51
wamba left
20:53
lichtkind_ joined
20:57
lichtkind left
|
|||
Voldenet | okay, I'm not sure what to do to get a pid | 21:00 | |
> perl6 -e 'my $sleep = run <sleep 3>, :out; say $sleep.pid' | 21:01 | ||
this should theoretically work... right? | |||
21:05
Cabanossi left
|
|||
pmurias | jnthn: jnthn/rakudo-debugger seems to have a parrot specific Makefile, I have made a PR request to get rid of nqp::p6invokehandler but I don't know how to test it | 21:06 | |
21:07
Cabanossi joined
|
|||
raschipi | m: my $sleep = run <sleep 3>, :out; say $sleep.pid | 21:11 | |
camelia | run is disallowed in restricted setting in sub restricted at src/RESTRICTED.setting line 1 in sub run at src/RESTRICTED.setting line 14 in block <unit> at <tmp> line 1 |
||
jnthn | pmurias: Oh, the Makefile should be tossed | 21:13 | |
pmurias: We moved the driver program into Rakudo since it needs maintaining with the compiler | 21:14 | ||
So that repo of mine is just the frontend | |||
pmurias: 'tis gone :) | 21:15 | ||
pmurias: Test the PR - does it pass spectest? :) | |||
21:19
matiaslina left
|
|||
Voldenet | Argh, I still can't just run the process and get its pid, i feel sad now | 21:43 | |
and running fork + execv doesn't feel like a perl6 solution at all :( | 21:45 | ||
BenGoldberg | Voldenet, run should work, just not with camelia. | 21:48 | |
mst | I'm getting (Any) for .pid and also it doesn't seem like it actually ran it | ||
I'm rather confused | |||
21:50
nadim_ left
|
|||
AlexDaniel | and what are you doing exactly? | 21:52 | |
Voldenet | reposting the same code, but: perl6 -e 'my $sleep = run <sleep 3>, :out; say $sleep.pid' | ||
mst | I can't work out if it even got started tbh | 21:53 | |
AlexDaniel | mst: say $sleep.out.slurp-rest; :) | 21:54 | |
oh, and run needs :out then | |||
mst | but .pid is still (Any) after that | ||
AlexDaniel | ah, it's there, right | ||
yea, I see | |||
21:56
BenGoldberg left
|
|||
Voldenet | So... how do I force it to get started? | 21:56 | |
AlexDaniel | interestingly… pid does not seem to be set at all | 21:57 | |
github.com/rakudo/rakudo/blob/fb38...re/Proc.pm | |||
21:57
rburkholder joined
|
|||
timotimo | maybe some class deriving from Proc was supposed to do something about pid at some point | 21:58 | |
Voldenet | well, I made some rather "solid example" | 21:59 | |
ix.io/pft | |||
Without pid trying to do system-level stuff would get extremely hard | 22:00 | ||
mst | use IPC::Run:from<Perl5>; | ||
timotimo | i'm not sure what the api should look like to correctly get the pid out of our stuff | ||
AlexDaniel | Voldenet: yea, it's simply not there. Sad. Anyway, why do you need to know the pid exactly? | 22:01 | |
Voldenet | mst: yeah, that does the job, but I could make that whole tool in perl5, the point was getting it done in perl6 :-) | ||
timotimo | i mean at the nqp op level | ||
Voldenet | AlexDaniel: getting /proc/(pid)/smaps | ||
AlexDaniel | :o | ||
mst | I'm curious how perl6 even tells when a process has exited if it doesn't have the pid to correlate with waitpid() | ||
timotimo | that's libuv domain | 22:02 | |
it knows what to do | |||
geekosaur | this is also why it's hard to get file descriptors, a lot of stuff is hidden at the libuv level | ||
Voldenet | it'd be harder to re-implement libuv though ;-) | 22:03 | |
timotimo | yeah, we're planning to eventually throw out libuv partially | ||
only fro synchronous I/O, of course | |||
we just lazily implemented synchronous I/O based on just starting an uv loop and waiting for it to terminate, and that got us sync i/o | |||
but it has big overhead and more frustratingly makes it impossible to open a socket on one thread and read from it in another >:( | 22:04 | ||
mst | Voldenet: what I'm finding is that perl6 can be used to write TCP daemons just fine, but for traditional unixy stuff, perl5 is still much more likely to be sane | 22:05 | |
(insert semi-regular grumble about no unix socket support here) | |||
timotimo | oh, yeah, that | ||
Voldenet | mst: but I tried some socket programming yesterday and managed to get some segfaults out of it, not with anything reproducible though | ||
mst | I haven't managed that yet | 22:06 | |
22:06
rindolf left
|
|||
mst | I'm sure it'll happen eventually given the number of times I've segfaulted perl5 | 22:06 | |
Voldenet | It was basically something about writing to a 'already-closed' socket | ||
AND signals | |||
that's why it's not really a reproducible combo | 22:07 | ||
gfldex | do we got isatty somewhere? | ||
Voldenet | mst: well, perl5 sits rather tight with tons of native code wrapped into packages, it's bound to segfault at some point | ||
mst | Voldenet: oh, please, that doesn't count. | 22:08 | |
Voldenet | (I remember using openssl + DBI + pthreads crashed it mercilessly) | ||
mst | I mean single threaded pure perl segfaults | ||
breaking XS modules is for amateurs | |||
Voldenet | :-) | ||
lizmat | gfldex: IO::Handle.t | ||
22:09
cpage_ left
|
|||
mst | I managed to make it deref a null pointer mucking with CORE:: once | 22:09 | |
that was -ing hilarious | |||
gfldex | lizmat: thanks | ||
Voldenet | That's... hilariously frustrating ;-) | 22:10 | |
timotimo | oh if you want "hilariously frustrating" i have the story for you %) | ||
have you heard of a program named "rakudobrew"? | |||
Voldenet | Not really, should I? :-) | 22:11 | |
timotimo | not important | ||
22:11
FROGGS left,
RabidGravy left
|
|||
Voldenet | Or rather, heard the name, didn't use it. | 22:11 | |
timotimo | anyway, it puts a folder in your home that has a bin/ where it puts a rakudo and any binaries you installed | ||
you're supposed to add that bin/ folder to your path and you can have multiple versions in there and switch all scripts/modules/... with just one command | 22:12 | ||
Voldenet | and that's sane... enough | ||
timotimo | yup | ||
some people use that as root, which is not so terrible, but not perfect | |||
but in itself it's not problematic | |||
here's what happened | |||
22:12
sftp left
22:13
sftp joined
|
|||
timotimo | someone didn't want to add the path to every user's path (or something like that?) so they symlinked /usr/bin into the rakudobrew folder | 22:13 | |
now guess what the first thing is that rakudobrew does when you switch between versions | |||
Voldenet | hmm, throw "invalid .so"? | 22:14 | |
raschipi | Nukes the directory, yay! | ||
Voldenet | Wow. | ||
timotimo | nukes the directory, exactly! | ||
someone was left with a not very complete system | |||
mst | rm /usr/bin/* # oops | ||
Voldenet | Oh, now I get what's linking into /usr/bin was | ||
timotimo | and rakudobrew got something put in | ||
to prevent that same thing from happening again | 22:16 | ||
but we figured out since then that we shouldn't be recommending regular users to use rakudobrew at all | |||
Voldenet | Eh, but how does rakudobrew know which part of PATH contains rakudo? | 22:18 | |
timotimo | huh? | 22:19 | |
it puts rakudo there | |||
and you're supposed to add "there" to your PATH | |||
Voldenet | Ah. | ||
timotimo | i.e. export PATH=/home/me/.rakudobrew/bin:$PATH | ||
Voldenet | So it's more suitable to making some packages, not using in $PATH, and PATH way is for devs only | 22:22 | |
Okay, time to write some perl6 wrappers around native methods. | 22:23 | ||
timotimo | nah, you shouldn't create packages with rakudobrew | ||
native methods? you mean C or C++? | |||
Voldenet | fork and execv :) | 22:24 | |
I guess passing the array to it moderately tricky. | |||
s/it/it is/ | |||
22:27
gdonald left
|
|||
timotimo | nah, we have CArray for that | 22:28 | |
22:35
espadrine left
|
|||
gfldex | m: dd &fail | 22:36 | |
camelia | Sub fail = sub fail (| is raw) { #`(Sub|60576296) ... } | 22:37 | |
gfldex | this seams to point to the proto. Is there a way to get hold of a specific multi candidate? | ||
geekosaur | m: dd &fail.^candidates | 22:38 | |
camelia | No such method 'candidates' for invocant of type 'Perl6::Metamodel::ClassHOW' in block <unit> at <tmp> line 1 |
||
geekosaur | sigh | ||
m: dd &fail.candidates | 22:39 | ||
camelia | (sub fail ( --> Nil) { #`(Sub+{Callable[Nil]}|37020544) ... }, sub fail (Exception:U $e --> Nil) { #`(Sub+{Callable[Nil]}|37020696) ... }, sub fail ($payload --> Nil) { #`(Sub+{Callable[Nil]}|37021152) ... }, sub fail (|cap is raw (*@msg) --> Nil) { #`(S… | ||
22:40
cpage_ joined
|
|||
gfldex | m: dd &fail.candidates».signature.grep(* ~~ :(|cap is raw (*@msg))) | 22:42 | |
camelia | ().Seq | ||
22:42
Voldenet left
|
|||
gfldex | m: dd &fail.candidates».signature.grep(* ~~ :(|cap is raw (*@msg) --> Nil)) | 22:42 | |
camelia | (:( --> Nil), :(Exception:U $e --> Nil), :($payload --> Nil), :(|cap is raw (*@msg) --> Nil), :(Failure:U $f --> Nil), :(Failure:D $fail --> Nil)).Seq | ||
gfldex | m: dd &fail.candidates.grep({.signature ~~ :(|cap is raw (*@msg) --> Nil)}) | 22:43 | |
camelia | (sub fail ( --> Nil) { #`(Sub+{Callable[Nil]}|53990576) ... }, sub fail (Exception:U $e --> Nil) { #`(Sub+{Callable[Nil]}|53990728) ... }, sub fail ($payload --> Nil) { #`(Sub+{Callable[Nil]}|53991184) ... }, sub fail (|cap is raw (*@msg) --> Nil) { #`(S… | ||
timotimo | if you have a capture you can use .^can or something to get one that can do what you want | ||
rather than having to grep | 22:44 | ||
gfldex | i want to .wrap the candidate with the right signature | ||
m: dd &fail.candidates.grep({.signature ~~ :(|cap is raw (*@msg) --> Nil)})».signature | 22:45 | ||
camelia | (:( --> Nil), :(Exception:U $e --> Nil), :($payload --> Nil), :(|cap is raw (*@msg) --> Nil), :(Failure:U $f --> Nil), :(Failure:D $fail --> Nil)) | ||
gfldex | it's matching a bit much | ||
22:46
dct joined
|
|||
timotimo | you can wrap the whole thing, inspect if the incoming capture is right, then do your stuff or not | 22:46 | |
gfldex | I want the least fragile possible. | ||
And it may be a good bit faster to wrap only the stuff that needs wrapping. | 22:47 | ||
22:47
Voldenet joined,
Voldenet left,
Voldenet joined
|
|||
timotimo | it's not enough to add a new candidate in a lexical scope, yeah? you need the whole-program effect of the wrap? | 22:48 | |
gfldex | yes | 22:49 | |
timotimo | OK | ||
gfldex | I want to .wrap the fail candidate that works on Str and add ANSI red to it `if $*IN.t`. | 22:50 | |
Not speed critical in this case but would be nice to have a method to do so if possible. | 22:51 | ||
m: dd &fail.candidates».signature.grep(:(|cap is raw (*@msg) --> Nil) ~~ *) | |||
camelia | (:(|cap is raw (*@msg) --> Nil),).Seq | ||
gfldex | HA! | ||
timotimo | oh | 22:52 | |
it's not fail that's outputting stuff, you know? | |||
well, it generates a message, i guess | |||
Voldenet | uh, i think I didn't get through | ||
hm, what's the type for Null in CArray? | |||
timotimo | can you elaborate a bit more? | ||
Voldenet | I need to pass a null-delimited array to execv, something like: { "/bin/ls", "-l", NULL } | 22:53 | |
timotimo | oh | ||
easy. if it's a CArray[CString] just put in CString | |||
i.e. the type object | |||
because type objects are perl6's version of "undefined"/"no value" | |||
22:54
zakharyas left
|
|||
Voldenet | no such thing as CString | 22:54 | |
and using Str doesn't work at all, hm | 22:56 | ||
gfldex | m: dd &fail.candidates.grep(:(|cap is raw (*@msg) --> Nil) ~~ *)».signature | ||
camelia | Type check failed in binding to '$e'; expected Exception but got Signature (:(|cap is raw (*@msg)...) in block <unit> at <tmp> line 1 |
||
timotimo | oh, yes! you're right | 22:57 | |
it has to be CArray[Str] | |||
22:58
sufrostico left
|
|||
timotimo | github.com/rakudo/rakudo/blob/nom/....t#L26-L37 - here's some tests that use CArray[Str] | 22:59 | |
we might want to put in a test to cover passing a Str to get a null | |||
23:05
kurahaupo__ left
23:06
kurahaupo__ joined
|
|||
Voldenet | so, eh, apparently invoking execv from perl6 isn't as straightforward | 23:15 | |
gfldex | m: &fail.candidates[2].wrap({ say "foo" }); fail "oi‽" | 23:17 | |
camelia | Cannot invoke object with invocation handler in this context in block <unit> at <tmp> line 1 |
||
gfldex | there goes my nice idea :( | 23:18 | |
Voldenet | Any idea what's wrong with this: ix.io/pfC | 23:20 | |
23:20
Cabanossi left
23:22
Cabanossi joined
|
|||
timotimo | Voldenet: huh, doesn't that have to set $argc + 1 to Str? | 23:33 | |
m: my @argv = <hello how are you>; my $path = "me"; my @result; @result[0] = $path; $argc = @argv.elems + 1; for ^@argv.elems { @result[$_ + 1] = ~(@argv[$_]) }; @result[$argc] = 0; dd @result | 23:34 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '$argc' is not declared. Did you mean '@argv'? at <tmp>:1 ------> 3= "me"; my @result; @result[0] = $path; 7⏏5$argc = @argv.elems + 1; for ^@argv.elem |
||
timotimo | m: my @argv = <hello how are you>; my $path = "me"; my @result; @result[0] = $path; my $argc = @argv.elems + 1; for ^@argv.elems { @result[$_ + 1] = ~(@argv[$_]) }; @result[$argc] = 0; dd @result | ||
camelia | Array @result = ["me", "hello", "how", "are", "you", 0] | ||
timotimo | no, it's fine | ||
can you find out what strace thinks is going on? | 23:35 | ||
Voldenet | timotimo: basically this, execve("ls", ["ls", "-la"], [/* 22 vars */]) = -1 ENOENT (No such file or directory) | 23:37 | |
Yeah, maybe I don't have ls in my system | |||
:D | |||
timotimo | are you sure execve will use $PATH for you? | 23:38 | |
stackoverflow says: execve() does not look at PATH; for that, you need execvp(). | 23:39 | ||
Special semantics for execlp() and execvp() | |||
The execlp(), execvp(), and execvpe() functions duplicate the actions | |||
of the shell in searching for an executable file if the specified file‐ | 23:40 | ||
name does not contain a slash (/) character. | |||
raschipi | You can tell by the p. | ||
timotimo | p stands for path? | ||
raschipi | yeah | ||
timotimo | earlier today i heard p stands for pot. 420 blaze it! | ||
Voldenet | hmm, still doesn't work with p on the end though | 23:41 | |
23:42
cyphase joined
|
|||
raschipi | Are you using a Unix-like OS? | 23:43 | |
Voldenet | obviously, a debian | ||
timotimo downloads teh code | 23:44 | ||
Voldenet | huh, strace does see a write syscall | ||
raschipi | Of course, since you used strace above | ||
Voldenet | ...but it doesn't output anything to the stdout | 23:45 | |
timotimo | ah, yeah | ||
it's trying to write to stdout | |||
but it doesn't know that libuv already configured stdout to be quite a strange beast | |||
so it's not talking to it properly | |||
23:46
kurahaupo__ left
|
|||
timotimo | and boom, it's getting "bad file descriptor" errors when trying to write its result to stdout | 23:47 | |
then it's trying to output the error to stderr | |||
but stderr is configured the same way as stdout | |||
so it just gets EBADF there, too | |||
then it gives up and exits with code 2 | |||
geekosaur | actually that sounds weird. does libuv really move stdout and stderr away from fds 1, 2? | ||
timotimo | no, it does not | 23:48 | |
or ... maybe it does? | |||
geekosaur | EBADF is only returned if the fd is closed | ||
timotimo | oh? huh. | 23:49 | |
23:50
Cabanossi left
|
|||
timotimo reads closely the full strace log | 23:50 | ||
23:50
cyphase left
|
|||
geekosaur | or if it's not open in write / read-write moe | 23:51 | |
timotimo | here it dup3s 9 (which is /dev/tty) to 0 | ||
geekosaur | but that would be even weirder | ||
timotimo | and then the same to 1 | ||
23:52
pmurias left,
Cabanossi joined
|
|||
timotimo | i don't know most of these ioctls, FIONBIO? TCGETS? | 23:52 | |
Voldenet | TCGETS is used to get termios | 23:53 | |
geekosaur | non-blocking I/O for the first (old way; why???) | ||
and also used incidentally by the isatty() check to see if it should use line vs. block buffering | |||
(default line for ttys, block for everything else) | |||
timotimo | anyway, i'm late for bed | 23:54 | |
geekosaur | those last 2 lines are about TCGETS | ||
timotimo | have fun figuring this out :) :) | ||
may be enough to just close 0, 1, and 2 and opening then dup3ing /dev/stdin, stdout, and stderr in | |||
hah, stat 4 times, then open | 23:55 | ||
for many, many things, everything related to precomp and module loading | |||
5 times in this instance here | |||
geekosaur | stackoverflow.com/questions/1150635...vs-fionbio fwiw | 23:56 | |
but I kinda want to slap anyone using FIONBIO for anything but a quick port of a 4.2BSD program >.> | |||
timotimo | feel free to ask the libuv people what their reasons are | 23:57 | |
they probably have some | |||
Voldenet | hmmm, hmmm, obviously perl5's exec doesn't work all that well | 23:59 |