This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html Set by lizmat on 8 June 2022. |
|||
00:27
Kaiepi left
|
|||
Esteemed Immortal Doctor Tien | Is there a problem with this tutorial? Im sure i typed it correctly but i get an error about using * split * on the string 3 : 0 | 00:41 | |
docs.raku.org/language/101-basics | |||
It's this line that gives an error : ``` my ($r1, $r2) = $result.split(':');``` | |||
Is there a problem with this tutorial? Im sure i typed it correctly but i get an error about using *split* on the string 3 : 0 | |||
gfldex | <@438903654796361729> there is a bug indeed. | 00:51 | |
m:``` | 00:55 | ||
# start by printing out the header. | |||
say "Tournament Results:\n"; | |||
my $file = q:to/■/; | |||
Beth Ana Charlie Dave | |||
Ana Dave | 3:0 | |||
Charlie Beth | 3:1 | |||
Ana Beth | 2:3 | |||
Dave Charlie | 3:0 | |||
Ana Charlie | 3:1 | |||
Beth Dave | 0:3 | |||
■ | |||
my @names = $file.lines.head.words; # ... get players. | |||
dd @names; | |||
my %matches; | |||
my %sets; | |||
for $file.lines.tail(*-1) -> $line { | |||
next unless $line; # ignore any empty lines | |||
00:55
discord-raku-bot left
00:56
discord-raku-bot joined
|
|||
Esteemed Immortal Doctor Tien | Idk. Is the typo on the page? | 01:39 | |
03:02
[Coke]_ is now known as [Coke]
03:32
[Coke]___ joined
03:35
[Coke] left
04:54
Heptite left
05:30
tbrowder left,
tbrowder joined
05:44
Kaiepi joined
05:53
camelia left,
nicole left,
thowe_ left,
aqua2 left
05:54
nicole joined,
aqua2 joined,
thowe joined
06:14
camelia joined
06:16
camelia left,
camelia joined
06:45
razetime joined
|
|||
Zephyr | what's the error? | 07:10 | |
tio.run/##bVPLbtswELzzKyaJCtt1rUQO...m3wJzUtHVl | |||
the standalone code gldex gave works fine for reference | |||
m: | 07:12 | ||
my ($a, $b) = "3:0".split(":"); | |||
say $a; | |||
say $b; | |||
^``` | 07:13 | ||
my ($a, $b) = "3:0".split(":"); | |||
say $a; | |||
say $b;```(deleted my message thinking bot didn't reply when it was slow) | |||
Esteemed Immortal Doctor Tien | hmm i'll have to recreate it on this debian machine. but it didnt' like the split statement | 07:33 | |
hmm. copying the files straight away it does produce the same output | 07:35 | ||
i couldn't detect any typos though before. so i'm not sure the problem | |||
Nemokosch | lol, that stop symbol for EOF is so cute 😄 | 07:36 | |
Esteemed Immortal Doctor Tien | i can't remember the message exactly but it said split had wrong arguments or something and listed them | 07:41 | |
which confused me because $pairing and $result are literally both defined at the same time so it didn't make sense one of them could have split called on it and the othe rnot | |||
which confused me because $pairing and $result are literally both defined at the same time so it didn't make sense one of them could have split called on it and the other not | |||
i remember specifically checking for mispellings too. heh. | 07:43 | ||
Nemokosch | I hope $*IN is a file handle... | ||
hooray | |||
it seems to work on this tio page | 07:44 | ||
the only thing I changed is the file - I defined it as $*IN | 07:45 | ||
Esteemed Immortal Doctor Tien | can raku get confounded by invisible characters? like it won't halt but continue in a bad state? | ||
Nemokosch | I don't know... | ||
what was the error message, though? | |||
Esteemed Immortal Doctor Tien | CAnnot resolve caller split(Any:U, Str:D); Routine doe snot have any candidates. Is only the proto defined? in block <unit> at test.raku line 13 | 07:48 | |
Cannot resolve caller split(Any:U, Str:D); Routine does not have any candidates. Is only the proto defined? in block <unit> at test.raku line 13 | |||
typed by hand since i don't have discord on the tablet | |||
if there's a typo i literally cannot see it. | 07:50 | ||
i'm comparing them on the tablet vs my pc and they look identical | 07:51 | ||
Nemokosch | it seems that split was called on a missing value | ||
I copied the files to my WSL(2) environment and that also worked | 07:53 | ||
Esteemed Immortal Doctor Tien | maybe there's something wrong with my tablet | 07:54 | |
it says the same raku version | |||
v6.d | |||
well now. apparently if i restore the line saying **next unless $line;** it eliminates the error | 07:57 | ||
but on my pc i don't get an error whether that line is commented or no. | |||
Nemokosch | I don't know if you know this but v6.d is very broad, it's more like a protocol than a version | 07:58 | |
Esteemed Immortal Doctor Tien | well. dpkg isn't any more specific. it just says 2020.12+dfsg-1 | ||
Nemokosch | yeah well I'm not saying this is the reason of the error - because the example itself might be older | ||
but I think that's a seriously outdated version | 08:00 | ||
that you better not use if you have options | |||
Esteemed Immortal Doctor Tien | my pc is debian 11.3... and the tablet 11.5. that's all i got | ||
well yeah but i'm using debian. kind of par for the course | |||
Nemokosch | I mean debian is fine; the APT sources are outdated | ||
I'm not sure anybody takes care of APT sources | |||
Esteemed Immortal Doctor Tien | ah ok debian testing has a more updated version from this year | ||
apt is part of debian though...? | |||
anyway. is it possible that somehow these two debians were compiling rakudo slightly differently to produce a difference | 08:02 | ||
does removing that line produce an error for you? | |||
Nemokosch | well, it would make some sense | ||
do you understand that line? | |||
Esteemed Immortal Doctor Tien | yeah it's advancing the loop | ||
i just don't get what the error means or why it would triggered by that | |||
Nemokosch | okay moment, the version upgrade is stuck in my head 😅 | 08:04 | |
cloudsmith.io/~nxadm-pkgs/repos/ra...ormats-deb I haven't used these native packages but they are maintained by El_Che (by IRC name) | |||
Another way is (what I am using) is to use `rakubrew` which is like a wrapper on top of building Rakudo bundles and it can handle multiple installed versions with different backends blabla | 08:06 | ||
rakubrew.org/ | |||
Esteemed Immortal Doctor Tien | hmm. is that like home brew on macos | ||
where it downloads compiles and puts everything in different directories | |||
Nemokosch | I would think so | ||
and perlbrew in particular | |||
Anyway, these are good options imo if you want latest implementations | 08:08 | ||
back to ` next unless $line; # ignore any empty lines` | |||
08:08
saint- left
|
|||
yeah the comment is descriptive here... let me try what happens without | 08:09 | ||
like tbh an 'empty line' shouldn't be Any:U still | 08:10 | ||
Esteemed Immortal Doctor Tien | well. do i need anything other than the c compiler and make to build rakudo? | ||
i already ran out of space on this vm image | |||
Nemokosch | oops lol | ||
I don't know, I didn't need to install anything when I once built the rakudo-star bundle from source, on Ubuntu | |||
I can imagine Perl is used somewhere | |||
well maybe you could check the deb package by El_Che, then | 08:12 | ||
yeah absolutely didn't break without | |||
which is not even surprising because my input file had no empty lines | |||
(the example data had no empty lines) | |||
Esteemed Immortal Doctor Tien | yeah rakubrew downloads a huge perl script which runs i guess to somehow build rakudo | 08:17 | |
lol this is some script. it has a long comment about using perl to abstract away different directories you have in your $HOME folder like videos, documents, local program data, etc | 08:20 | ||
Nemokosch | that makes quite a lot of sense actually | 08:21 | |
Esteemed Immortal Doctor Tien | well that's what a 30k line file that is totally cross-platform does i guess | ||
Nemokosch | yeah | ||
because it tries to work on Windows and Mac so it's not at all trivial | |||
Esteemed Immortal Doctor Tien | i feel like perl has the most massive repository of modules and software in general, not just for cross-platform | 08:22 | |
so replacing it, even by its own successor, will be challenging | |||
anyway i think this is far enough outside the area of just learning raku. heh | 08:24 | ||
thanks for the help | |||
i'll have to remake this vm image and put perl on it to do rakubrew efficiently | |||
Nemokosch | Yeah, you know... yesterday I re-read some articles about Perl and its "wasted future" | 08:26 | |
I don't know the details or how different people felt about the stagnation of Perl with no definite future. In 2000, I was meant to sing songs and learn to tie my shoes | 08:27 | ||
What I can see and conclude from those articles is that 1. Perl in 2022 is completely unappealing to new projects 2. the Perl community got overly obsessed with backwards compatibility, perhaps partially because of the Perl 6 incident | 08:29 | ||
Perl is an excellent toolset for cross-platform scripting and will be magnitudes better than Shell implementations even in 2050 | 08:31 | ||
But if you ask me, it's an insult to the programming world that Shell languages count as programming languages at all so it's not a high tally | 08:33 | ||
Esteemed Immortal Doctor Tien | by 'shell' do you mean dynamic? | ||
Nemokosch | I mean Ksh, Bash and all that jazz | ||
the POSIX /bin/sh | |||
Esteemed Immortal Doctor Tien | well. even those have their cross-platform problems. subtle differences in system utilities like sed or what not | ||
Nemokosch | Of course | ||
But most importantly they are horrible as langauges | 08:34 | ||
But most importantly they are horrible as languages | |||
Esteemed Immortal Doctor Tien | also it's strange that perl would be the ultimate cross-platform language. i thought that was supposed to be java or c# or something | 08:35 | |
does rakudo aim to be cross-platform as well? | |||
Nemokosch | Yes | ||
It's just, you know... because of the lack of resources (mainly human resources), not everything is well-tested | |||
Also, think about it the following way | 08:37 | ||
I like Terminal::LineEditor and Terminal work of japhb in general | |||
they tend to depend on termios | |||
now, termios is a POSIX standard | |||
it has no proper Windows port | |||
so now is it cross-platform or not? | |||
Kaiepi | raku tui is kind of sad w/o raw input | ||
like, character-by-character input, no line discipline | 08:39 | ||
it's comparable to java in that sense? | 08:41 | ||
Nemokosch | Oh yeah, I wanted to respond to this | ||
Java is not a scripting language. You might remember that Javascript was advertised as a less serious version for scripting | 08:42 | ||
Kaiepi | in the sense that you're stuck with ffi if you want raw input | 08:43 | |
Nemokosch | why do you want raw input? | ||
Kaiepi | it's nice for games and stuff | 08:44 | |
Nemokosch | You mean Turbo Pascal crt unit style? 😄 | 08:45 | |
Good old ReadKey and ClrScr | |||
sorry folks but the ultimate cross-platform language was Turbo Pascal all along... | |||
Kaiepi | something along those lines, yeah | 08:47 | |
Nemokosch | Do you think it would be better to expose raw input, if possible? | 08:48 | |
oh yeah, one more. The way Perl and Java/C# are cross-platform is very different | 08:49 | ||
Java and C# (.NET) are like "implement this VM, who cares how, and then you get to translate your code to that VM" | 08:51 | ||
Perl is, if I'm right, written around C | 08:52 | ||
so the cross-platformness comes from the availability of C across platforms | |||
I'd say even Perl does a bit better with POSIX systems than Windows | 08:54 | ||
Kaiepi | there's a lot of platform-dependent grossness in raw input in general, so not as a whole. something like forth-standard.org/standard/facility/EKEY would help a lot | 08:55 | |
there's a lot of platform-dependent grossness in raw input in general, so not as a whole. something like forth-standard.org/standard/facility/KEY would help a lot | |||
Nemokosch | forth 🥺 | ||
do you use Forth? | 08:56 | ||
Kaiepi | a little bit | ||
Nemokosch | I studied it for a little while, around 5 years ago | 08:57 | |
But I basically failed to use it on PC in any meaningful way | |||
what do you use it for? | |||
Kaiepi | i try to do the perl weekly challenge in it sometimes when its problems are stack-friendly. otherwise i have the same problem 😛 | 08:58 | |
Nemokosch | And you know, the irony. gforth depends on C when in theory I'd say C is a higher-level langauge | 09:00 | |
And you know, the irony. gforth depends on C when in theory I'd say C is a higher-level language | |||
When we had a few lab classes with microcontrollers at the university, I realized that was the real territory where Forth could shine | |||
there are some microcontrollers and implementations like Mecrisp Forth iirc | |||
because C does feel kinda like a PC-ish language, assuming registers, memory allocation, etc | 09:02 | ||
I've read it about Forth that it's one advantage that it doesn't require any operating system, it can act like the operating system itself | |||
with much more direct use of the resources | |||
C mostly hides the stack; in forth, most of the time you don't need variables on the stack because you can just manipulate it directly | 09:04 | ||
09:23
razetime left
11:13
razetime joined
12:49
razetime left
13:16
Kaiepi left
13:32
Kaiepi joined
13:54
Heptite joined
14:25
[Coke] joined
14:28
[Coke]___ left
14:35
razetime joined
17:13
razetime left
20:10
Kaiepi left
20:11
Kaiepi joined
20:15
Kaipei joined
20:19
Kaiepi left,
Kaipii joined
20:22
Kaiepi joined
20:23
Kaipei left
20:26
Kaipei joined,
Kaipii left
20:30
Kaiepi left
|