🦋 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.
skyesoss What's the best way to move ~/.raku somewhere else? I couldn't find any documentation surrounding it, but is RAKUDO_PREFIX something to look to change, because it's messing up my include paths 01:50
lizmat weekly: felix-knorr.net/posts/2023-06-24-r...esome.html 09:43
notable6 lizmat, Noted! (weekly)
lizmat also on Hacker News: news.ycombinator.com/item?id=36465989 09:49
Voldenet > (1, 2, 3).map(* + 1) 11:02
it's pretty amazing how most language complicate lambdas 11:03
especially when most lambdas are simply one-arg ones 11:04
leont Seems I lost the slides for my 2021 presentation ("Raku syntax I miss in other languages"). I really ought to make it a blog series. 11:07
lizmat leont: you should! and do a RCS one :-)
leont RCS?
lizmat Raku Core Summit ? 11:17
timo social.coop/@jsbarretto/110598797097154054 i feel like raku is the perfect language to prototype these two suggestions 11:44
lizmat the deparsing part for Dutch is already done :-)
timo indeed, i saw that, though i haven't tried it yet or seen any example? 11:45
timo m: use nqp; augment class ClassHOW { method gender() { nqp::sha1(self.name).substr(2) } }; say Str.^gender; say List.g 11:47
camelia ===SORRY!=== Error while compiling <tmp>
augment not allowed without 'use MONKEY-TYPING'
at <tmp>:1
------> use nqp; augment class ClassHOW⏏ { method gender() { nqp::sha1(self.name
expecting any of:
generic role
timo m: use nqp; use MONKEY-TYPING; augment class ClassHOW { method gender() { nqp::sha1(self.name).substr(2) } }; say Str.^gender; say List.^gender; say Hash.^gender
camelia ===SORRY!=== Error while compiling <tmp>
You tried to augment class ClassHOW, but it does not exist
at <tmp>:1
------> se MONKEY-TYPING; augment class ClassHOW⏏ { method gender() { nqp::sha1(self.name
expecting any of:
lizmat m: use v6.*; use RakuAST::Deparse::L10N::NL; say Q|say "Hoi allemaal" if 42|.AST.DEPARSE
camelia say("Hoi allemaal") if 42
lizmat m: use v6.*; use RakuAST::Deparse::L10N::NL; say Q|say "Hoi allemaal" if 42|.AST.DEPARSE(RakuAST::Deparse::L10N::N) 11:48
timo m: use nqp; use MONKEY-TYPING; augment class Perl6::Metamodel::ClassHOW { method gender() { nqp::sha1(self.name).substr(2) } }; say Str.^gender; say List.^gender; say Hash.^gender
camelia Could not find symbol '&N' in 'RakuAST::Deparse::L10N'
in block <unit> at <tmp> line 1
===SORRY!=== Error while compiling <tmp>
You tried to augment class Perl6::Metamodel::ClassHOW, but it does not exist
at <tmp>:1
------> augment class Perl6::Metamodel::ClassHOW⏏ { method gender() { nqp::sha1(self.name
expec…
lizmat m: use v6.*; use RakuAST::Deparse::L10N::NL; say Q|say "Hoi allemaal" if 42|.AST.DEPARSE(RakuAST::Deparse::L10N::NL)
camelia zeg("Hoi allemaal") als 42
lizmat timo ^^ an example
timo can we also de-deparse like that? :D
lizmat timo: not yet, but that's the plan 11:50
timo amazing
leont Oh right! Yeah I hadn't gotten around to writing that either.
lizmat thanks to the power of RakuAST :-) 11:51
timo ok, i tried to constant CH = Str.HOW and augment CH, but that tells me CH is closed, and i wonder if that means i'm not doing it right because otherwise it would have said ClassAHOW
ClassHOW is closed*
Geth setup-raku/dependabot/npm_and_yarn/semver-7.5.2: f6c2e1f0d6 | dependabot[bot]++ (committed using GitHub Web editor) | 2 files
Bump semver from 7.3.7 to 7.5.2

Bumps [semver](github.com/npm/node-semver) from 7.3.7 to 7.5.2.
  - [Release notes](github.com/npm/node-semver/releases)
  - [Changelog](github.com/npm/node-semver/blob/ma...NGELOG.md)
  - [Commits](github.com/npm/node-semver/compare......v7.5.2)
... (7 more lines)
11:53
timo m: use v6.*; use RakuAST::Deparse::L10N::NL; say Q|my $foo; our $bar; class A { has $.hello }|.AST.DEPARSE
camelia my $foo;
our $bar;
class A {
has $.hello
}
lizmat m: use v6.*; use RakuAST::Deparse::L10N::NL; say Q|my $foo; our $bar; class A { has $.hello }|.AST.DEPARSE(RakuAST::Deparse::L10N::NL) 11:58
camelia mijn $foo;
onze $bar;
klasse A {
heeft $.hello
}
leont The Dutch squicks me 11:59
lizmat afk& 12:00
Xliff use v6.*; use RakuAST::Deparse::L10N::ES; say Q|my $foo; our $bar; class A { has $.hello }|.AST.DEPARSE(RakuAST::Deparse::L10N::ES) 13:34
m: use v6.*; use RakuAST::Deparse::L10N::ES; say Q|my $foo; our $bar; class A { has $.hello }|.AST.DEPARSE(RakuAST::Deparse::L10N::ES)
camelia ===SORRY!=== Error while compiling <tmp>
Could not find RakuAST::Deparse::L10N::ES in:
/home/camelia/.raku
/home/camelia/rakudo-m-inst-2/share/perl6/site
/home/camelia/rakudo-m-inst-2/share/perl6/vendor
/home/camelia/ra…
Xliff m: use v6.*; use RakuAST::Deparse::L10N::JP; say Q|my $foo; our $bar; class A { has $.hello }|.AST.DEPARSE(RakuAST::Deparse::L10N::JP)
camelia ===SORRY!=== Error while compiling <tmp>
Could not find RakuAST::Deparse::L10N::JP in:
/home/camelia/.raku
/home/camelia/rakudo-m-inst-2/share/perl6/site
/home/camelia/rakudo-m-inst-2/share/perl6/vendor
/home/camelia/ra…
Xliff m: use v6.*; use RakuAST::Deparse::L10N::DE; say Q|my $foo; our $bar; class A { has $.hello }|.AST.DEPARSE(RakuAST::Deparse::L10N::DE)
camelia ===SORRY!=== Error while compiling <tmp>
Could not find RakuAST::Deparse::L10N::DE in:
/home/camelia/.raku
/home/camelia/rakudo-m-inst-2/share/perl6/site
/home/camelia/rakudo-m-inst-2/share/perl6/vendor
/home/camelia/ra…
Xliff consideres use cases... and his eyes go wide.... 13:40
Coooool!
Geth setup-raku: f6c2e1f0d6 | dependabot[bot]++ (committed using GitHub Web editor) | 2 files
Bump semver from 7.3.7 to 7.5.2

Bumps [semver](github.com/npm/node-semver) from 7.3.7 to 7.5.2.
  - [Release notes](github.com/npm/node-semver/releases)
  - [Changelog](github.com/npm/node-semver/blob/ma...NGELOG.md)
  - [Commits](github.com/npm/node-semver/compare......v7.5.2)
... (7 more lines)
14:06
setup-raku: ecf28d5c4e | (Shoichi Kaji)++ (committed using GitHub Web editor) | 2 files
Merge pull request #28 from Raku/dependabot/npm_and_yarn/semver-7.5.2

Bump semver from 7.3.7 to 7.5.2
elcaro Has someone a blog/gist on migrating my modules from legacy ecosystem & CPAN to zef 14:28
I figure at the very least, a version bump & author update, and push to zef. 14:29
legacy ecosystem I probably just delete it from that big flat file
CPAN I'm not so sure... Can I even delete from CPAN? I guess I should log into PAUSE and check, but if anyone has a min-guide that would help 14:30
(or am I basically on the right track with the above statements)
timo Xliff: what use cases can you think of? i'm not entirely sure 15:15
leont elcaro: you can delete files from CPAN, though I have no idea how the indexer handles it 15:22
rf Morning folks 16:08
timo there's also i think a website that keeps deleted stuff from cpan 16:53
sjn set your mirror to backpan.perl.org to download packages that have been removed from cpan 16:56
ingy anyone know if this work got done for raku? news.perlfoundation.org/post/grant...s_for_raku 17:17
nemokosch soon™️ for years 17:34
ceterum censeo, it's a nonsense that YAML doesn't support mixing anchored arrays in another array
Xliff timo: I18N Raku? 19:24
Voldenet I've seen some programming languages with i18n and it was the most horrifying stuff I've ever seen 20:21
it seems like a good idea to not use english everywhere, but then you end up using single syscall/module/some moving part that only uses english for its debug output, exceptions and other messages 20:23
timo excel has i18n for formulas 20:40
support.content.office.net/en-us/m...287f35.png 20:41
support.microsoft.com/en-us/office...cc8d326889 20:42
guifa so for i18n, one thing we COULD do (and I had kinda working) is i18lize the error messages 20:56
the catch is it requires wrapping .message on every X:: on INIT which is, well, slow (I don't think it was working on BEGIN when I last looked at it) 20:57
[Coke] if we are doing internationalization right, we should have a lookup table for all the error messages, and not have english be special. 21:36
Voldenet formulas in excel create very annoying problem that is solved by "functions translator" addin 21:42
this is not particularily useful, because excel itself isn't that user friendly to begin with
it's from the same the same line of reasoning that translates error messages 21:44
You _help_ your users by letting them use _their_ language 21:46
lizmat I think the most important thing is being able to deparse a program in language X in language Y 21:47
so that people using different languages can help each other fixing problems
Voldenet sure why not, as long as it's a programming language 21:48
Voldenet imo english variable, class, method names and comments are bigger problems than keywords in any actual code 21:54
I'm not going to hate deparsing too hard, but translated exceptions are pure evil 21:56
Most error messages are always going to be irrelevant (no matter the language) for end users, but when the developer gets an error message that uses enduser's language, they actually may not understand what it says 22:00
on top of it, translated messages are really, really difficult to find 22:04
lizmat if all error messages are typed, then translating should be a smot (simple matter of translation) 22:06
so maybe we should first try to get rid of ad-hoc error messages in core :-)
I think though that multi language support would be befitting a 100 year programming language 22:07
Voldenet I'd just argue to make translations opt-in choice
[Coke] elminating ad hoc messages is great on its own.
lizmat Voldenet: they would always be opt-in: in the DEPARSE examples, you need to specify a role to get translations 22:09
Voldenet of course, but for exceptions, I'm scared of C# way of doing it
lizmat on that thought, /me goes to sleep& 22:11
[Coke] ~~ 22:13
nemokosch C# putting people to bed lol 22:20
Voldenet implementing nqp in C# would let you see `未将对象引用设置到对象的实例` as error message when using zh-Hans locale 22:21
that doesn't invite good night's sleep 22:22
Tirifto I think multilingual programming would be great to have, but perhaps tricky to get right. I’ve seen Citrine do it, but from what I know, the implementation of the localisation was pretty naïve. 22:32
Tirifto I don’t think translating whole programs is a particularly efficient way to go, but you’d definitely want the interface to be translatable. So any names that get exported from a package (variables, subs, methods). Because otherwise a module written in Chinese would be practically unusable by modules written in Hebrew, for example. 22:38
Voldenet in the meanwhile, all programmers will simply switch to english :) 22:39
if you don't get a single thing right that is
Tirifto And then languages have the problem of not mapping one-to-one. A word can be translated in different ways, just as multiple words can have the same translation in a different language. Which can cause problems in translating code, i.e. if you rely on polymorphism that only works because the names of two different methods happen to agree in your language, but might not in others. 22:42
Voldenet, all programmers already use English, so the only way to go is up. :P 22:43
Voldenet but of course, some programmers use the funny math symbols mostly, but eventually there's tons of english there 23:08
guifa [Coke]: that I think could be done. I don't think the error messages themselves are per se Raku standard. 23:40
lizmat: you know I'm VERY in favor of getting rid of adhoc messages. I think it's good not just for i18n, but also for allowing errors to be filtered better 23:41
(e.g. some messages make a message based on a priviate attribute, or generate a message that combines three or four data points but aren't easily extreactable)
leont Yeah, less ad-hoc exceptions would be great 23:42
guifa given 23:45
guifa class A { method x { … } }; class B is A { method x { … } }; 23:46
guifa is there anyway I can wrap A.x() that would ALSO manage to catch calls to B.x() ? (I'm assuming no) 23:46
guifa if that's the case, if we did an overhaul of X classes, if we had X.message pass along to a X.MAKE-MESSAGE that was in turn set for each class, then a localization module could easily wrap X.message() and handle stuff without the overhead of hundreds of wraps 23:51
Also re parse/deparse. AppleScript (RIP) apparently had an experimental French and German dialect going which actually could work okay because scripts actually compiled to a weird bytecode that preserved to a large degree certain structures of the input. 23:53
(not that I'm suggesting we do that. I think error messages is as far as we should go. MAYBE figuring out a way to fenangle .WHY or something but that's better on individual compiles I think) 23:54