🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
samp80 is the raku discord dead? 02:13
samp80 ...is the raku irc generally inactive too? 02:16
:( 02:22
codesections The IRC is often pretty active 02:24
This time of day/night isn't ideal -- many of the regulars are in Europe 02:26
moon-child samp80: IRC sees a good amount of activity. Obviously not 24/7 around the clock. Can't speek to the discord
samp80 oh that's sad 02:27
i saw the discord has like ≈50 members
but it's professional-looking, ie if it had more than 50 02:28
so, few questions (total noob here lol). Is it wrong to call raku perl? 02:29
(eg if someone says they program in perl, do they mean raku, or perl 5?)
and how used is perl 5
moon-child perl5 is a lot more used than raku. If somebody says perl, they mean perl5
samp80 how come 02:30
codesections plus, usage aside, they're just pretty different languages 02:31
samp80 yeah, i can tell
so why use raku over perl then?
(i'm coming from ruby, looking to learn something new) 02:32
or should i learn perl5?
moon-child most people in this channel will probably be pretty biased, but I like raku as a language much more than perl 02:33
codesections a lot of reasons :D I recently wrote a blog series www.codesections.com/blog/raku-manifesto/
samp80 lol @moon-child 02:34
i see that raku removed a bunch of perl's idiosyncracies like `$;`
Why? and are they used in perl5? 02:35
(do people call it perl5 or just perl?)
codesections (disclaimer: I don't know perl) Perl5 is fully backwards comparable 02:37
samp80 what do you mean backwards comparable?
codesections *compatible
samp80 ah 02:38
codesections with perls 1-4
samp80 is that the `use vX` thing i see?
codesections so perl,
sorry. typing issues at the moment 02:39
codesections so perl5 has a lot of inconsistencies that built up over the versions 02:39
samp80 im also reading your manifesto lol 02:40
is there a "noobs" irc channel? 02:43
codesections Raku (then called Perl6) started with the idea of "if we're going to break compatibility to fix everything all at once knowing what we know now, what sort of language would we build?"
samp80 yeah, makes sense. i gathered that
but that's about it. oh, and that people didn't like how it took forever to be developed
the heck's "prefix `if`" codesections 02:44
moon-child m: say 'woo' if True; if True { say 'hoo' } 03:11
camelia woo
hoo
moon-child I think perl has this too fwiw 03:12
samp80 oh so prefix `if`'s effectively like using it as a "Statement" 03:13
postfix `if`'s the exact same as ruby, so that's not new
moon-child though afaik in perl using 'or' and 'and' for conditionals is more idiomatic, like || and && in shell
samp80 cool 03:14
what about in raku? 03:15
what's preferred
moon-child whatever you want
samp80 .-. 03:17
that's going to be the hardest par tlol
part lol* learning the syntax
jmerelo releasable6: status 05:35
releasable6 jmerelo, Next release in ≈3 days and ≈13 hours. 1 blocker. 0 out of 79 commits logged 05:36
jmerelo, Details: gist.github.com/1786bb2d20f0ba035d...a3ad68d58b
cpan-raku New module released to CPAN! Algorithm::LBFGS (0.0.5) by 03TITSUKI 06:17
jmerelo There are still 42 unanswered Raku questions in StackOverflow stackoverflow.com/questions/tagged...Unanswered Check them out, you might now know what's the answer... 07:24
moritz many of these are answered in the comments on the question already 07:25
jmerelo moritz: then it's only a matter of upgrading those comments to a real answer, right?
moritz: some of them have unaccepted answers, though. 07:26
plant_enjoyer which editor do people use for raku? is there any survey with a breakdown? 08:56
gfldex plant_enjoyer: I use vim. To my knowledge nobody has brokenn down after doing a survey yet. 08:58
plant_enjoyer gfldex: I see, thanks
lizmat plant_enjoyer: there's also Comma, a full-blown IDE: commaide.com 09:03
plant_enjoyer lizmat: oh thanks, I don't like these though :) or more like - my hardware doesn't 09:05
frost-lab vim! and vscode.. 09:09
jmerelo plant_enjoyer: I love comma. Sometimes, emacs with raku-mode for scripts 09:11
plant_enjoyer jmerelo: I've been using emacs so far, but it started failing me recently :^( 09:12
jmerelo plant_enjoyer: well, it's not perfect, but it's pretty OK. The new raku-mode is a big improvement.
plant_enjoyer jmerelo: github.com/Raku/raku-mode/issues/43 this is annoying though 09:13
jmerelo plant_enjoyer: hadn't seen it... Give comma a try, then. Also very familiar for those that have used PyCharm or the like. 09:16
plant_enjoyer by the way, is there a nicer way of writing `SomeClass.some-method($_)`?
jmerelo: I might! 09:17
tobs plant_enjoyer: I tend to write .self instead of $_ 09:20
lizmat plant_enjoyer: you mean, having some method automatically use the topic? 09:21
tobs or what do you not like about that method call?
plant_enjoyer oh it's actually a grammar, like here raku-advent.blog/2019/12/07/parsin...with-raku/ under "setting up the testing grounds" 09:22
tobs: I heard you shouldn't write explicitly write out $_ ;) so I thought there would be a better way 09:23
lizmat m: sub a($foo = $*FOO) { dd $foo }; a(42); my $*FOO = 666; a() 09:24
camelia 42
666
lizmat plant_enjoyer: ^^ something like that maybe ?
El_Che plant_enjoyer: I know Conmma/Intellij is Java, but it's does not feel heavy on my machines (fast recent dell business laptop and 6y old consumer Dell laptop, bith Linux) 09:25
Intellij is for me one of those succesful Java on the desktop stories 09:26
(we all know the less sucesfull ones, specially enterprise software clients)
plant_enjoyer lizmat: hm, I'm kind of confused. the line I found "problematic" was `say UserJS.parse($_);`, I don't know how to use your code with that
El_Che I think that jnthn made a very good choice to use intellij as a platform 09:27
plant_enjoyer El_Che: that's cool, I'll try and download it then
lizmat plant_enjoyer: do you know about dynamic variables ?
plant_enjoyer lizmat: yes
El_Che plant_enjoyer: it's not vim though :)
plant_enjoyer El_Che: nothing's vim, unfortunately :)
El_Che I have still battle scars from vimscript :) 09:28
lizmat plant_enjoyer: my point is that you *can* use a dynamic variable as a default for a parameter in a method
plant_enjoyer El_Che: I've been using emacs because of its great vim emulation and better window support. VSCode's vim extensions butchers my code once in a while, and I can't get back to the good state.. 09:28
lizmat accessing the caller's topic is possible, but comes with performance penalties
and actually may be disallowed at one point 09:29
so I would not recommend going that way
plant_enjoyer lizmat: I don't have a method there though, I have a for loop. oh, I could just `for @inputs -> $input`
lizmat yup
that would increase readability :-) 09:30
El_Che plant_enjoyer: I tried stom, didn't like it. And I really need a good reason to use MS products
plant_enjoyer yeah :/
El_Che and I already had a intellij license around for java stuff
the funny thing I ended using intellij for raku, go and perl and not for java :)
saying this, I am just downloading ms edge on linux to check how it works with ms teans :P 09:37
no difference wuth chromium 09:45
plant_enjoyer it's the same engine now, no? 09:47
plant_enjoyer will be right back
El_Che plant_enjoyer: it is 10:04
SmokeMachine Hi! Does anyone here have used Term::TablePrint? How do I get the selected rows on that? 11:09
jmerelo SmokeMachine: as a matter of fact, there's a recipe that uses it in Raku::Recipes. Not totally sure I used that, though. I think I used it basically for printint... 11:14
SmokeMachine: if you peruse the code, it obviously has that information, but you'll need to fork it to get it out. print-table just returns Nil. 11:16
SmokeMachine: you might want to use Term::Choose instead, if that's what you're looking for. 11:17
SmokeMachine jmerelo: yes, that's what I'm thinking... but in my case, I wanted a table...
jmerelo: but probably I'll need to go with that
jmerelo SmokeMachine: if you don't want to start yak-shaving :-)... 11:21
bbkr Hi. Does anyone know what logic is used to create '.raku/short' directory? Can I change its base path to be /whatever/.raku/short? 11:38
bbkr ^ nvm, found it in rakudo/src/core.c/CompUnit/Repository/Installation.pm6. HOME env must be set. I was running my user code from supervisord managed by root and that is why (despite changing directory prior to run) i had issues with permissions of /root/.raku/short. 12:12
Geth doc: 407f8229ea | (Daniel Mita)++ | doc/Language/pod.pod6
Fix broken link to roast test
12:38
linkable6 Link: docs.raku.org/language/pod
kawaii When writing the signature of a routine, I can express that it must accept a hash, but can I further specify named keys the hash must contain to be valid? 15:35
sub myroutine(:%blah<some-key>) {} for example
jmerelo kawaii: only through "where" clauses, I guess
kawaii any documentation on that? :) 15:36
moritz if you are going that far, IMHO it's a sign that you should be using proper objects/classes, not hashes 15:38
jmerelo m: sub foo( %hash where "foo" ∈ .keys ) { say %hash }; foo( %(foo=>3) )
camelia {foo => 3}
jmerelo m: sub foo( %hash where "foo" ∈ .keys ) { say %hash }; foo( %(bar=>3) )
camelia Constraint type check failed in binding to parameter '%hash'; expected anonymous constraint to be met but got Hash ({:bar(3)})
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
jmerelo moritz: that, too...
moritz kawaii: docs.raku.org/type/Signature#index...ere_clause 15:39
kawaii never seen ∈ before :O 15:40
jmerelo kawaii: "element of" or "in". As in maths :-)
kawaii ah, thank you :D
jmerelo Probaby Junctions would work here too... 15:41
[Coke] there's no way to know if a given NFG codepoint is renderable in your font, is there. 15:43
(especially in a cross platform way)
moritz [Coke]: no
[Coke]: it's not even cross-application on the same OS
there are applications that do fallbacks (take characters from other fonts if necessary/possible), and others don't 15:44
PDF readers tend to not do that, browsers do. All other applications: really depends on the GUI framework 15:45
[Coke] Didn't think there was, but figured if anyone know of secret sauce, it'd be y'all. :) 15:47
-- w̄͆j̋̕c̏̔ 15:48
kawaii jmerelo: using that syntax, I can see how to specify one key, but what if I have say, two or three? I tried using | between them but got some Seq iterator error. 15:49
[Coke] hears a cow in the distance and realizes his son has left minecraft running somewhere.
moritz kawaii: try an all() junction 15:52
m: sub foo(%h where { %h{all('a', 'b)}:exists) { say 42}: foo({:a, :b}); foo({:a}) 15:53
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in single quotes; couldn't find final "'" (corresponding starter was at line 1)
at <tmp>:1
------> 3sts) { say 42}: foo({:a, :b}); foo({:a})7⏏5<EOL>
expecting …
moritz m: sub foo(%h where { %h{all('a', 'b)}:exists }) { say 42}: foo({:a, :b}); foo({:a})
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in single quotes; couldn't find final "'" (corresponding starter was at line 1)
at <tmp>:1
------> 3s }) { say 42}: foo({:a, :b}); foo({:a})7⏏5<EOL>
expecting …
moritz m: sub foo(%h where { %h{all('a', 'b')}:exists }) { say 42}: foo({:a, :b}); foo({:a}) 15:53
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3{ %h{all('a', 'b')}:exists }) { say 42}:7⏏5 foo({:a, :b}); foo({:a})
expecting any of:
colon pair
moritz m: sub foo(%h where { %h{all('a', 'b')}:exists } ) { say 42}; foo({:a, :b}); foo({:a}) 15:55
camelia 42
Constraint type check failed in binding to parameter '%h'; expected anonymous constraint to be met but got Hash ({:a(Bool::True)})
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
kawaii moritz: complicated, but thanks! You're right about using real objects I guess 15:59
sampersand hiall 16:06
So I'm looking to pick up a new language and im trying to decide between Perl and Raku. What's the advantage that Raku has over Perl? 16:07
kawaii sampersand: the FAQ has a particularly good list of reasons to learn Raku :) ; docs.raku.org/language/faq#Why_sho..._about_it? 16:11
sampersand oh tahts smart 16:15
timotimo testing 17:16
raku-bridge <timotimo> m: say "hello world"
evalable6 hello world
SmokeMachine m: sub a(%hash (:$key1, :$key2)) { say %hash }; a %(:1key1, :2key2); 17:34
camelia {key1 => 1, key2 => 2}
SmokeMachine m: sub a(%hash (:$key1, :$key2)) { say %hash }; a %(:1key1); 17:35
camelia {key1 => 1}
SmokeMachine m: sub a(%hash (:$key1!, :$key2!)) { say %hash }; a %(:1key1, :2key2);
camelia {key1 => 1, key2 => 2}
SmokeMachine m: sub a(%hash (:$key1!, :$key2!)) { say %hash }; a %(:1key1);
camelia Required named argument 'key2' not passed in sub-signature of parameter %hash
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
SmokeMachine m: sub a(%hash (:$key1!, :$key2!)) { say %hash }; a %(:1key1, :2key2, :3key3); 17:36
camelia Unexpected named argument 'key3' passed in sub-signature of parameter %hash
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
SmokeMachine kawaii: like this ^^?
Altreus whaaaaaaaaaat 18:56
That's neat
guifa [Coke] moritz: if you can get the original code points that define the NFG codepoint then you could, but it’s going to be very difficult to pull off (the interplay between font format, renderer, and as moritz mentions, substitions that will be handled at an even higher level than the renderer…. is insanely complex) 21:16
[Coke] yup. for my use case, which is to generate random combinations, I can just spit out a few dozen and see what "sticks". :) 21:20
doing it "right" for that use case is ridiculous. 21:21
guifa For that, I’d just check and see if the component glyphs exist 21:45
i-hate-gay Ldld 22:31
rf
d
e
r
t
r
R
4
d
JJAtria[m] is there a way to use `prompt` but without printing the characters? Like, when prompting for a password? 22:38
Doc_Holliwood Turning off echo is shell specific 22:44
on xoids executing ssty -echo should do it 22:46
stty echo to turn it back on
guifa stty -echo is pretty standard for *nix, I’m not sure the dos equivalent 22:52
I guess as a fallback you could always use get() repeatedly and print out “\r “ each time. You’d probably get a quick flash for each one, but it would bomb royally for UTF8 since most characters will be waiting for a potential combining diacritic 22:54
Doc_Holliwood pretty much everything including win10 supports ANSI 22:58
so one can manipulate the color of the echo
JJAtria[m] Hm... yeah... I was kinda expecting it to take some adverb... I'll see what I come up with 22:59
Thanks!
moon-child you can't know what the background will be, so you can't just blindly set the foreground 23:00
but, you can set fg and bg to be the same
guifa changing fg/bg colors won’t affect C&P abilities though 23:03