🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
00:00 reportable6 left 00:02 reportable6 joined 00:18 perlbot left 00:19 simcop2387 left 00:27 simcop2387 joined 00:28 perlbot joined 00:33 jpn joined 00:36 simcop2387 left 00:39 jpn left 00:44 perlbot left 00:45 perlbot joined 00:48 perlbot left
SmokeMachine I've been playing with an idea of creating a package with "tools" to make it easier use Raku as a shell. I'm trying to "make it a shell" that instead of "pipe string" "pipe data structures" something like what nushell does but using Raku instead of creating a new language for that. Does anyone here think that make any sense? usercontent.irccloud-cdn.com/file/.../image.png 00:48
github.com/FCO/RakuSH 00:50
00:54 simcop2387 joined 01:06 perlbot joined 01:17 simcop2387 left, simcop2387 joined 01:33 razetime joined 01:54 simcop2387 left, simcop2387 joined, perlbot left 01:58 simcop2387 left 01:59 perlbot joined 02:00 simcop2387 joined
Anton Antonov @SmokeMachine Sort of makes sense. 🙂 I think more explanations are needed... 02:00
@SmokeMachine I did not figure out what is that package all about after looking at the examples for like 5-7 min. 02:02
02:02 jmcgnh left 02:15 jmcgnh joined 02:20 jpn joined 02:25 jpn left
SmokeMachine Anton Antonov: it creates the “data structures” piped between “processes” that automatically transforms into pretty format when said. It also creates some commands (for now ls, file and open) and also implemented some (multi) subs to handle that data (grep, AT-POS and ignore-columns for now). It also starts changing repl to add, for example, a way to change the prompt and adds a default prompt, but will also, probably, play 02:28
with completions in the future…
03:04 rf left 03:29 razetime left, derpydoo left 03:42 Oshawott joined 03:46 archenoth left 04:08 jpn joined 04:14 jpn left 04:31 simcop2387 left 04:32 simcop2387 joined 04:45 derpydoo joined 05:02 cm left 05:10 cm joined 06:00 reportable6 left, reportable6 joined 06:09 codesections left 06:11 codesections joined 06:33 razetime joined 06:48 tea3po joined 06:49 tea3po left, tea3po joined, tea3po left 06:50 tea3po joined 06:51 jpn joined 06:52 teatwo left 06:56 jpn left 07:00 jpn joined 07:01 tea3po left, tea3po joined 07:06 jpn left 07:21 perlbot left 07:22 abraxxa joined 07:23 Sgeo left 07:24 perlbot joined 07:27 tea3po left, tea3po joined 08:03 tea3po left, tea3po joined 08:04 perlbot left 08:05 jpn joined, tea3po left, simcop2387 left, tea3po joined 08:06 razetime left, simcop2387 joined, tea3po left, perlbot joined 08:07 tea3po joined 08:10 jpn left 08:20 simcop2387 left 08:21 simcop2387 joined 08:22 perlbot left 08:24 perlbot joined 08:25 razetime joined 08:39 razetime left 08:56 dakkar joined 09:04 raiph joined 09:05 raiph left
Nemokosch FCO a Raku shell would be very welcome 09:20
SmokeMachine Nemokosch: Yes, I think so! :) and I think Raku already has almost everything we would need in a shell. 09:23
tellable6 SmokeMachine, I'll pass your message to Nemokosch
09:24 ab5tract joined
Nemokosch Unfortunately I still haven't gotten around SpitSH, that's sort of the opposite but it could also be super useful 09:40
09:59 gfldex left 10:00 gfldex joined 10:10 seekr left 10:20 synthmeat left 10:22 synthmeat joined 11:05 jpn joined 11:09 synthmeat left 11:10 synthmeat joined 11:11 perlbot left 11:12 perlbot joined 11:16 simcop2387 left 11:17 perlbot left 11:21 simcop2387 joined 11:23 perlbot joined
Anton Antonov @Nemokosch Thanks for mentioning "SpitSH" : I was looking for it few weeks ago, unsuccessfully, because I forgot the name. 11:40
12:00 reportable6 left 12:01 reportable6 joined 12:14 jpn left 12:25 derpydoo left
@SmokeMachine Well, generally speaking, I am trying to do something very similar though "conversational agent" Finite State Machines (FSMs) for data acquisition and data wrangling. Those FSMs can be run via sequences of commands -- similar to the pipelining you mention. See github.com/antononcube/Raku-DSL-Fi...teMachines . You seem to be doing something more general, so, I am very curious about the 12:42
development of that idea.
13:10 jgaz joined 13:35 derpydoo joined 13:43 jpn joined 14:06 jpn left 14:07 jpn joined 14:09 razetime joined 14:14 kolibrie joined 14:31 perlbot left, perlbot joined 14:41 jpn left 14:51 Sgeo joined
[Coke] can we get tellable6 in #raku-doc ? 15:09
15:32 jpn joined 15:45 rf joined, kolibrie left, razetime left
rf morning 15:47
tonyo SmokeMachine: if there was a nicer version of fish available i'd probably switch from bash
rf Ive used only ksh for the last 5 years
Would recommend
[Coke] used bash for so long and is trying to use zsh because it's the new mac default. 15:48
tonyo i gave ksh a try
zsh seems to meld all of the worst parts of shells into one central place 15:49
rf Yup hahaha
Nemokosch so you're telling me there is a difference in how much they suck? xD 15:54
rf I wouldn't want to be stuck in a TTY with just zsh or just fish
Nemokosch Bash was bad enough, but then ksh really seems like lame Bash 15:55
I've seen csh a couple of times, I genuinely don't get the idea...
rf Ksh has a super hackable codebase that is why I like it 15:56
And, it's POSIX
Nemokosch I think the core concept of POSIX shells is rotten to ground. No proper data structures and no variables; if that wasn't enough, control structures and functions are just a hack 15:57
This horrible mess is the explanation for Perl
Perl will always triumph if this is the competition 15:58
15:59 [Coke] left
rf Problem is there is a lot of shell in the world already 16:00
If I could re-write all of them to Perl I would
tonyo perl is a very underrated language, usually hated by zealots 16:01
rf totally agree tonyo 16:02
Same with Raku :^)
Nemokosch I wouldn't say so. The more time I spend with Raku, the more I hate the Perl that remained. 16:03
tonyo and bash is a shell, not a language, it serves a different purpose. zsh seems designed around "fixing bash" where it makes scripting easier but 99% of the time i'm not writing a script and it doesn't do basic shell functions well. fish confoundingly just copied the bad parts of bash and thinks fixing them is a bad idea
Nemokosch but Perl needs to be understood in the context of Shell scripting, where it will always win big time 16:04
tonyo it wins in a lot of other areas, it's just a different philosophy from the typical language 16:05
code reviews, as an example, make it very obvious who's used other languages extensively
Nemokosch Perl is actually not a pragmatic language, in any other context than system scripting 16:06
to the extent that its redesign was ongoing even in the Perl 5 prime days
tonyo all the big code bases i've used perl in seemed to work pretty well (even with 300 people hacking on it simultaneously) 16:07
better than the python ones, at any rate
Nemokosch this is a good example of survivor bias. Of course, only the ones that were sufficiently solid, stuck with Perl and stayed operational with it. 16:08
then came Ruby, Python, and eventually languages that had some extra offer, like Go 16:09
tonyo the go code bases i've been have been a nightmare, even the ones with three señor devs 16:10
Nemokosch I mean, the Go language itself is ugly as hell 16:11
16:12 discord-raku-bot left, discord-raku-bot joined
but the "buzzwords" are there: fast compilation and you get a small deployable binary that runs quite fast 16:12
tonyo i like go..just the opinions of the zealots make it difficult to be productive in..writing if err != nil gives me flash backs to when i was ostricized from nodejs for criticizing callback hell (before it was the norm in the language)
Nemokosch Anyway, Perl has had its well-understood problems, the "action at a distance" narrative wasn't born yesterday. And it did get switched to languages that didn't even have a significant "killer feature", so it makes you wonder. 16:14
tonyo if i ignore the history of computing then i'd agree 16:15
Nemokosch ironically enough, Perl looks like a language that ignores the history of computing 16:16
good old "what happens if" - what happens if you call an apparent function in your code? it's debatable if exceptions were a good idea to begin with but besides the usual two cases (the function returns, an exception is thrown and propagated until caught), there are other cases 16:21
your loop may terminate, step or start over - to make it worse, this can also escalate to your callers
how are you even gonna document that? how do you do static analysis on code that invokes anything external? 16:23
and I wouldn't care, if this thing didn't somehow make it to Raku
rf Perl and Raku are both strong languages. I wouldn't be opposed to starting a large project in either 16:39
All languages have bad parts, pointing them out doesn't really emphasize anything, the reason features are there or not cannot be judged without understanding why the developers made the decisions they did. 16:41
Anton Antonov @rf Depending who you are going to work with in those projects.
rf Anton, True. But I think it wouldn't be tooo hard to teach a team Perl or Raku 16:42
Anton Antonov @rf I disagree. 🙂 Perl and Raku are hard to teach. (Except Raku grammars.)
rf I taught a team Haskell that was really hard, I think it wouldn't be as hard as that 16:43
I am not saying it will be super easy, just saying not too hard :)
Anton Antonov I advice junior colleagues not to start learning Raku, except if they have: 1) strong linguistic abilities, and/or 2) like learning programming language technologies. Otherwise, they would not get much from it. (Granted, I talk to data analysts / scientists most of the time.) 16:46
rf I don't work with many Juniors so maybe that is where our experiences differ 16:47
tea3po I am a junior and I found Raku to be very fun and engaging, interesting, but tbh it was also pretty hard. lots of syntax. lots of concepts. not as hard as haskell though. 16:50
16:51 [Coke] joined 16:52 squashable6 left
tonyo i work with a lot of juniors, of the same opinion as rf 16:52
tea3po fun and engaging goes a *long* way tbh, I suppose 16:53
tonyo C and asm kept me engaged long enough to get me a job in perl (from 10 until 32)
16:54 squashable6 joined
tonyo raku has a lot of very interesting parts to it 16:55
16:55 nima joined
tonyo want to write FP? you can get pretty close.. want to hack around in the MOP? knock yourself out. want to reinvent error handling? gopher it 16:55
want to write macros? bust out the c preprocessor and write a makefile hahahahaha 16:56
rf Yeah freedom and options to explore is everything for me
The source of rakudo is fairly hackable too 16:57
Its nice to be able to lookup that stuff
nima hello good people, perl noob here.. I'm trying to get a Cro websocket app going on MacOS. I have rakudo-star installed via brew and do zef install Cro and zef install Cro::WebSocket. But in my script when I add use Cro::WebSocket I get an error a "Could not find Cro::WebSocket in: ~/.raku, /homebrew/Cellar/rakudo-star/.... ..." 16:58
Can anyone tell me what could be the issue here? zef shows successful installation. I'm using zsh if that matters..
rf How did you install rakudo-star? 16:59
nima brew install rakudo-star
rf Ah, I would recommend rakubrew.org/
And remove the brew version
then repeat your steps with Rakubrew instead
nima ok thx let me try that
17:04 jpn left
nima got rakubrew installed and did a `rakubrew download`. both raku and zef are added to path as expected. Did `zef install --/test Cro Cro::WebSocket` and ran the script again, but received the same error ;(  any advice? 17:06
rf Hmm, how are you running the script? 17:07
nima `raku myscript.p6` 17:08
tonyo what is the output of `which raku` ?
rf we use .raku now, but that shouldn't cause an issue
tonyo may still be using the brew version
nima `/Users/myuser/.rakubrew/versions/moar-2023.02/bin/raku`
rf tonyo++ that was going to be my next question
which zef
nima `/Users/myuser/.rakubrew/versions/moar-2023.02/share/perl6/site/bin/zef` 17:09
rf Are you sure it's succeeding on the install?
I know there's some SSL dependencies on Cro::WebSocket that can fail installing
nima this is the last line I see: `===> Installing: Cro::WebSocket:ver<0.8.9>:auth<zef:cro>`
is there a way to get more verbose with zef? 17:10
rf -v
and omit --/test
Hmm I get the same it is possible that Cro::WebSocket does not have an exported module as you expect 17:11
nima: github.com/croservices/cro-websock...6.json#L32 17:12
These are it's exports, it does not export Cro::WebSocket rather other exports
nima I see! thank you very much for the help. I asked chatgpt to write the script so maybe it's using outdated knowledge... :b 17:14
rf Lol
No problem.
Nemokosch Actually, I think (or at least believe) that Raku can be taught in a non-overwhelming way 17:30
17:30 dakkar left
moreover it can be used to illustrate a whole lot of ideas about programming 17:31
17:31 simcop2387 left 17:32 simcop2387 joined
however, I also strongly believe that Perl has grown a really bad advisor over time, both from management and language design point of view 17:32
They doubled down on keeping legacy stuff alive, hence basically sacrificing the future for the past. Regardless whether this was a good decision or not - Raku cannot walk this path because there isn't a starting user base to manage wisely 17:33
Also, it really seems that certain stuff persisted too long, even when it should have been fairly apparent that the Perl community is not willing to adopt the Six. The quoted "leaky loop control" is only one example but to name some "new" examples: the concept of Cool and its broad application, single values pretending to be one-element lists, Scalar containers pretending to be items... 17:39
I only named things that I do think could be changed without tearing the language apart; the last point is the only one that might contain traps. The rest could really be introduced in, say, version 6.f, it is mostly a matter of decision. 17:41
17:44 derpydoo left
honestly, the situation is simple: take a look at the blog posts and articles about the language, and collect the positives. If a trap has no influence on a declared positive, chances are that it's just "language noise", not a defining characteristic. 17:45
17:58 nima left 18:00 reportable6 left, reportable6 joined
tonyo i'm doubtful that no news is bad news 18:05
no one is writing blog posts about how cool for loops are but you'd be lost without them
rf That is a good anology lol 18:17
18:20 Xliff joined
Nemokosch that's why I said "trap". For example, nobody ever said how good it is that @variables cannot be swapped. Everybody talks about how sigils express plurality and perhaps list assignment. 18:21
18:22 ab5tract left
This is quite literally what I had in mind. @variables and $variables could be more similar, and if you read all the articles, you probably won't ever come across 1. how different they are implementation-wise 2. what is good about that, and this should give you an idea 18:23
tonyo then that's a counter example to your point, the sigils would go away if you used that analysis 18:25
Nemokosch no, they would only contain what people actually talk about with them 18:33
the conclusion was a bit weird, unless you meant to say that there were no articles about sigils in Raku
18:37 derpydoo joined
lizmat fwiw, I would like to spend mind cycles on these questions *after* we get 6.e on the road 18:41
any cycles spent on that before the release of 6.e are of the "selling the hide of the bear before shooting it" 18:42
quality
Nemokosch that's perfectly understandable. 6.e is going to be a huge release anyway 18:45
both with regards to time and sweat involved, and the actual features 18:46
lizmat I'm glad you're understanding 18:47
18:48 tea3po left, tea3po joined 18:50 teatwo joined 18:51 teatwo left, teatwo joined 18:53 tea3po left 19:00 teatwo left, teatwo joined
Voldenet traps, eh 19:17
m: say [+] (1, 2) Z- (3, 4)
camelia -4
Voldenet my $x = (1, 2); my $y = (3, 4); say [+] $x Z- $y
evalable6 0
Voldenet I really like those 19:18
m: my $x = (1, 2); my $y = (3, 4); say $x Z– $y 19:22
camelia ===SORRY!=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> my $x = (1, 2); my $y = (3, 4); say $x Z⏏– $y
expecting any of:
prefix
term
Voldenet m: my $x = (1, 2); my $y = (3, 4); say $x Z-- $y
camelia (4)
lizmat hmmm... that probably shouldn't run at all, as -- only accepts 1 arg ? 19:30
19:32 tobs left 19:33 tobs joined 19:34 RakuIRCLogger left, RakuIRCLogger joined
Nemokosch m: my $x = (1, 2); my $y = (3, 4); say [+] $x Z- $y 19:47
Raku eval 0
Nemokosch huh 19:48
m: my $x = (1, 2); my $y = (3, 4); say $x Z- $y
Raku eval (0)
rf I can't remember the syntax if I wanted to add a new method to a class 19:49
lizmat m: my $x := (1, 2); my $y := (3, 4); say $x Z- $y # containerized Lists are assumed to be items
camelia (-2 -2)
rf thought it was something like: alter Foo { method bar() { * } }
Nemokosch augment 19:50
lizmat augment
rf lizmat++ Nemokosch++ thanks!
lizmat but please don't do that unless you really have to
Nemokosch "containerized Lists are assumed to be items" - this is tough because I can imagine that sometimes this is useful. I'm not sure but couldn't rule it out. 19:51
lizmat m: my $x = (1, 2,3); my $y = (3, 4); say $x Z- $y # basically 3 - 2
camelia (1)
Nemokosch "Scalar containers pretending to be items" is definitely the toughest situation of the three I named earlier 19:52
the least clear and probably the hardest to reasonably change 19:53
19:53 nine left, nine joined
it's still tempting because of the commonness of for loops over containerised data (e.g nested Array) 19:54
rf lizmat, i'm just playing around this code doesn't matter much :) 20:03
Can I convert a CPointer to a repr<CStruct> class? 20:04
tbrowder__ howd! ref windows.yml module gir workflow test failures (TAP module fails). is there any alternative way around using workflow testing without using TAP? 20:05
*howdy! 20:06
rf lizmat: What was that phaser that would run whenever something was GC'd? 20:09
Or *potentially* when it was GC'd 20:10
lizmat DESTROY
actually, an object that gets GCed is put on a list to have DESTROY called on it, at some point
you don't want to execute HLL code inside a GC 20:11
20:12 derpydoo left
rf Do CStruct objects get gc'd? I'm thinking of DESTROY { free(self); } 20:19
lizmat if they have a repr of P6Opaque, then yes 20:20
otherwise, I'm not sure
afk&
20:27 raiph joined 21:05 jgaz left 21:14 raiph left 22:05 jpn joined, jpn left 22:19 jpn joined 22:40 jpn left 22:46 abraxxa left
rf I have a repr<CPointer> class but for some reason I get `Cannot resolve caller infix:<===>(JSON::Simd::simdjson_element, Str:U); none of these signatures matches` when trying to compile 23:22
I never use === anywhere
23:25 ProperNoun left
Nemokosch ngl having to write 23:28
{ key: f'param/{value}' for key, value in file_paths.items() } 23:29
or something like this in Python, really feels like a lot of hassle for nothing, when in Raku I could write
'param/' <<~<< %file-paths
lol 23:30
I mean, that's part of the reason I want to rewrite that particular Discord bot; I want more moments like the latter 23:31
rf: what do you use that might use comparison? also, I wonder if --ll-exception can give some hints here 23:32
rf I don't do any comparison 23:37
Just gonna start cutting stuff until it works 23:38
Nemokosch hashing, for example, uses the same representation that === uses 23:39
rf Can you iterate a CArray? 23:45
Xliff Yes
rf Hmm was wondering if that was the issue but doesn't look like it 23:46
Xliff m: use NativeCall; my $c = CArray[Str].new( <a b c> ); .say for $c;
camelia NativeCall::Types::CArray[Str].new
Xliff m: use NativeCall; my $c = CArray[Str].new( <a b c> ); .say for $c[];
camelia No such method 'ZEN-POS' for invocant of type
'NativeCall::Types::CArray[Str]'
in sub postcircumfix:<[ ]> at /home/camelia/rakudo-m-inst-1/share/perl6/core/sources/1AF93A80CAC9B4CAA082D4D1CDCA0BDE0E610B52 (NativeCall) line 416
in block <unit…
Xliff Oh... I guess no, then.
m: use NativeCall; my $c = CArray[Str].new( <a b c> ); .say for $c[^3];
camelia a
b
c
rf m: use NativeCall; my $c = CArray[Str].new( <a b c> ); for $c -> $foo { say $foo }
camelia NativeCall::Types::CArray[Str].new
rf m: use NativeCall; my $c = CArray[Str].new( <a b c> ); for @$c -> $foo { say $foo } 23:47
camelia a
b
c
rf There
Xliff I thought that CArray had the Iterator role at one point.
m: use NativeCall; my $c = CArray[Str].new( <a b c> ); .say $c ~~ Iterator
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> my $c = CArray[Str].new( <a b c> ); .say⏏ $c ~~ Iterator
expecting any of:
infix
infix stopper
statement end
…
Xliff m: use NativeCall; my $c = CArray[Str].new( <a b c> ); say $c ~~ Iterator
camelia False
Xliff m: use NativeCall; my $c = CArray[Str].new( <a b c> ); say $c ~~ Positional
camelia True
Xliff Ah... it is a Positional 23:48
Nemokosch maybe you meant Iterable?
rf m: use NativeCall; my @c = CArray[Str].new( <a b c> ); .say for @c;
camelia NativeCall::Types::CArray[Str].new
Xliff m: use NativeCall; my $c = CArray[Str].new( <a b c> ); say $c ~~ Iterable
camelia False
Nemokosch huh, interesting
rf m: use NativeCall; my $c = CArray[Str].new( <a b c> ); .say for @$c;
camelia a
b
c
Nemokosch Positional but not Iterable...
rf That seems funky
Xliff Indeed
rf I guess it allows you to segfault
so it makes sense kind of
m: use NativeCall; my $c = CArray.new( <a b c>, 123 ); .say for @$c; 23:49
camelia CArray cannot be used without a type
in method AT-POS at /home/camelia/rakudo-m-inst-1/share/perl6/core/sources/28485B4A4AFB9691B968E5ABC378EE127800E2B7 (NativeCall::Types) line 102
in method new at /home/camelia/rakudo-m-inst-1/share/perl6/co…
rf What makes a CArray int* or int**? 23:52