🦋 Welcome to the main IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Logs can be inspected at colabti.org/irclogger/irclogger_log/raku
Set by lizmat on 21 April 2021.
Geth doc/frithnanth-patch-6: a97a5fae3e | (Fernando Santagata)++ (committed using GitHub Web editor) | doc/Type/Map.pod6
Correct a link to Hash

Hash → /type/Hash
09:01
doc: frithnanth++ created pull request #3879:
Correct a link to Hash
09:02
doc/frithnanth-patch-6: c5efe1771b | (Fernando Santagata)++ (committed using GitHub Web editor) | doc/Type/Map.pod6
Small correction
09:07
Geth doc: de76ddd4f7 | (Fernando Santagata)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Map.pod6
Correct a link to Hash

Hash → /type/Hash
10:02
doc: fe86b23f0d | (Fernando Santagata)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Map.pod6
Small correction
andinus i'm trapping SIGINT & exiting with `exit 0` but for some reason the program continues execution even after that 10:36
paste.debian.net/hidden/ceeadba2/ 10:37
i want it to stop execution after it catches SIGINT & executes that block 10:38
wait, it's working fine now, didn't change anything 10:43
codesections yeah, that code looks generally fine to me (your paste doesn't have enough context that I can test it, but it looks generally fine). No idea why it wasn't working at first, though 10:48
andinus can i make it so that it exits the loop if SIGINT is caught? 10:52
i have to print some things after the loop exists, currently the loops goes on printing things and what i'm printing gets mixed with that 10:53
codesections yep. Use &last: docs.raku.org/language/control#last
lizmat make the tap set a variable that gets checked in the loop end lasts if it is true ?
*and
andinus here is the entire thing: paste.debian.net/hidden/92c7c227/ 10:55
i cant use last because the signal thing is outside the loop, is it okay if i put it in? 10:56
lizmat: i see, that'll do it
oh now the loop exits fine but the program terminates soon after 11:00
i believe its because the MAIN sub ends there
lizmat from your gist, that looks like it is to be expected? 11:01
andinus no, i'm printing a scorecard after the loop exits
it doesnt get printed because MAIN exits, adding a sleep() fixes it, is there a better way? 11:02
lizmat updated gist?
andinus updated: paste.debian.net/hidden/250c3fce/ 11:03
lizmat take the signal out of MAIN, and put it at the top
define $end-loop just before that 11:04
are you supposed to show the score card on normal exit?
andinus and also @players then
yes, score card on both SIGINT and when it normally ends 11:05
lizmat no, the tap should *only* set $end-loop to true and do nothing else
andinus i see, then how do i print the scorecard?
oh, i just check $end-loop and print it there?
lizmat where you now have the sleep(2)
*20
andinus ah, that'll make it print on normal exit too 11:06
lizmat and you may need some more "last if $end-loop" checks
yup
andinus i see, that fixes everything, thanks 11:09
El_Che lizmat: change the topic to "🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language..." 11:26
lizmat subliminal advertising, eh?
El_Che the curse of my life: if I see a joke, I have to go with it 11:27
lizmat 🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Logs can be inspected at colabti.org/irclogger/irclogger_log/raku 11:27
lizmat El_Che++ 11:27
m6locks grand 12:09
wl20 HI :) 17:07
andinus hello o/ 18:21
codesections \o 18:22
dakkar m: for 1..1 { say FIRST 13; say ENTER 45 } 19:39
camelia Nil
45
tellable6 2021-04-27T18:30:43Z #raku <Xliff> dakkar: ^^ That, but in a way that will work for different environments.
dakkar m: for 1..1 { say INIT 1; say FIRST 2; say ENTER 3 } 19:45
camelia 1
Nil
3
kybr just curious, has anyone tried to make a slang that adds ruby-like function arguments? -> $foo, bar {...} becomes {|$foo, $bar|...} 19:47
El_Che what is de advantage of that notation? 19:51
kybr none, generally. 20:00
but slangs show the versatility of raku. i think i read somewhere the idea that you can write C in any language, but you can write any language in raku. 20:02
i'm experimenting with "faking" language X in raku where faking means not having to write an actual grammar, only making the minimal set of tweaks to make piece of language X pass. 20:04
for what it's worth, i prefer the pointy blocks. 20:06
El_Che I am not a fan of slangs 20:09
raku syntax is complex emough
the balkanisation of that means unreadable code 20:10
If you're talking DSL, that something else
codesections fwiw, I strongly disagree
I think Racket has blazed a pretty good trail with their view on LOP (en.wikipedia.org/wiki/Language-ori...ogramming) 20:11
and, done well, it can make code more readable. (Done poorly, it's a disaster, but most things are) 20:12
El_Che counterpoint: I think the biggest advantage of languages at go is that I can quick glance and have a good idea what the code does
at => like
El_Che if you throw funny syntax at me, I'll get lost even if I know the language 20:13
codesections 100% agree. But I think Raku is already about as far away from Golang as it's possible to get
El_Che I write some Ruby and until today the | | notation is weird to me :)
codesections (I like both languages, but think they have *radically* different goals) 20:14
kybr (i'm following all this.)
El_Che yes, but what you loose in syntax, you win with builtin batteries
so, that's makes raku readable to me
not a zillion of functions to do simple things, so the code stays small 20:15
kybr El_Che: you follow a "way" of writing raku? link?
El_Che I mean the std syntax without slangs
I know that and raku has many built-in functions
codesections (my conference talk at FOSDEM was basically exactly about this/about how Go and Raku have totally different design goals: fosdem.org/2021/schedule/event/pro...software/) 20:16
El_Che they do, I agree on that
kybr El_Che: when you say that a DSL is something else, you mean writing a grammar and evaluating strings? 20:20
El_Che I mean like creating something like the Puppet language in Raku 20:21
so you're not writing Raku, but powerfull Puppet manifests
so not just parsing strings. but also use Raku features
(I am in the process of moving everything off from things like Puppet, so it's an academical discussion for me :) ) 20:22
kybr I'm thinking of ways to make it easy for users of language X to move to raku by mimicking syntax as much as possible. I'd rather not have to use a slang, but i might. i'm already using MONKEY-TYPING and augment. 20:25
El_Che in that case they could keep writing what ever they write
kybr hahahh. yes. of course.
El_Che consistency is important and very often importing stuff break that 20:26
stealing idea's, that's different ;)
kybr codesections: i like the idea of LOP, but i have not really tried to use it. i am not a racket user. i think that Red also uses this idea: www.red-lang.org/ 20:34
(i think/hope the "take the red pill" shirt in the video is an unfortunate blunder) 20:36
wl20 ;) 20:38
codesections kybr: yeah, agreed (on both counts). I really ought to spend more time with Red – I really like what I've seen, but I just am not a huge fan of ORMs in general so I've not yet used it as much as I should 20:57
tonyo i was looking at making a lisp slang that can actually work with the context of the running program 21:03
tellable6 2021-04-29T07:10:35Z #raku <andinus> tonyo was away
Geth ¦ doc: Altai-man self-unassigned A lot of TODOs in Any github.com/Raku/doc/issues/1494 21:07
kybr El_Che: i'll think about what you said. i'm still trying to work out where to draw the line. i think i will not go so far as a slang, but i will definately need augment. 21:12
raydiak kybr: while I'm not sure that the easiest way to move to a new language is by using tools to not learn the new language, I think what you're doing is kinda cool anyway from a creative and postmodern standpoint. using rakudo to parse and execute other languages besides raku is an interesting thought 21:49
kybr right now it is just a dubious, academic experiment to figure out how similar these two languages are in terms of syntax. 22:08
kybr anyway, i'm not trying make something that keeps people from learning raku! i'm trying to do the opposite. i am toying with making a thing that would allow users to reuse documentation and examples from another system. 22:19
raydiak of course, I'm not speaking ill of it. I like your idea. It's just easier (for me at least) to learn a new language by jumping in head-first from scratch, so I like it for reasons other than your intended use case :) 22:21
kybr i'm trying to determine where to draw the line on how far i bend raku. i think 'augment class Block' yes, slang no... er maybe a tiny bit.
raydiak being the author of Inline::Lua, I have no philosophical objections to mixing other languages into raku 22:22
I'd say it depends on your intended uses. An educational on-ramp can afford to be much more liberal than general-use production stuff 22:25
kybr perhaps i've misled y'all. here's a thing: github.com/kybr/SuperCollider i work on creative/musical systems in academic settings. 22:29
raydiak looks like a cool project 22:35
kybr thanks. now i know that raku has the flexibility to bend toward SuperCollider syntax. i'm still deciding how much to bend. it's also a learning exercise for me. 22:42
raydiak you'll certainly learn a lot. and yes, it can bend as much as you want. as long as you don't intend to be able to run existing SC code but just want to replicate the functionality in a rakuish way, I'd personally be inclined to just export some subs or a class from your module, no need to change the language at all that I can see 22:47
thats arguably a lot less fun though
codesections I hadn't really focused on Inline::Lua. Would it give you compatibility with languages that have a Lua runtime (I'm thinking of Fennel, but there are several) or would that be an entirely separate project? 22:58
raydiak heh, I haven't the slightest idea tbh. if it's something that embeds a lua interpreter within itself and makes use of that, probably not. if it's something you can call from within plain lua code and acts more like a library, then...possibly 23:01
codesections To be fair, I can't really think why I'd _want_ to do that. It just sounds like fun, mostly 23:04
tonyo if you _could_ write python in raku then you'd have all of the disgusting pypi open to you as modules
raydiak we do have Inline::Python by nine++
tonyo or lua, or clojure, or go
codesections ouch, the idea of a program that needs to pay the startup times of _both_ Raku and Clojure... 23:06
tonyo you're missing the point 23:07
inline::python is rad.gov 23:08
but if raku parsed and then ran python or clojure etc, then it wouldn't require those runtimes/libs to be installed
you wouldn't pay clojure start up time, it'd be directly in the raku runtime/language 23:09
japhb tonyo: That's assuming that existing libraries don't assume they are running on a "real" python and expect its behavior.
tonyo no jvm to spin up, etc
it wouldn't be a good slang if it deviated drastically from the behavior of the original language 23:10
japhb tonyo: Not the language behavior, CPython's behavior.
codesections unless you're running Raku on the jvm, of course.
tonyo even if it gives you 90% of the libraries that don't do weird stuff then you're gaining quite a bit 23:11
codesections (I'm mostly joking, but isn't that part of the pitch for things like Gradle? One runtime to rule them all, or something likei that)
er, graal, I mean 23:12
tonyo it's less about what vm it's running on 23:14
raydiak the reason I wanted to be able to mix lua into raku was less for the ecosystem and more because it's pretty much the opposite of raku, what made it seem quite complementary to me...minimal syntax makes for verbose code, but it runs like lightning. so you could use it in e.g. hot paths of games or other performance-sensitive stuff, without requiring a C compiler and so forth
codesections raydiak: that makes sense. My general hope is to be able to use Rust for that sort of niche, which _seems_ promising -- but I haven't put that to the test yet 23:16
tonyo forth has pretty minimal syntax and is pretty succinct 23:18
codesections ha. that's putting it mildly 23:19
raydiak codesections: I don't know much about rust beyond the fact that everyone seems to think it's a great thing 23:22
codesections it's the language I write most often, apart from Raku. There's a lot to like, but right now I'm thinking of the fact that it has an `extern C` functionality very similar to NativeCall and getting its build tooling setup is painless 23:24
raydiak sounds slick. would be a cool project if you decide to pursue it 23:30
I had a lot of fun writing Inline::Lua; this conversation kinda makes me want to dust it off 23:31