🦋 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.
lucs Instead of traversing a huge (for example) capture with for $s ~~ m:g/.../ {...} , can I do something like while $s ~~ /.../ {...} ? 00:01
s/can I/how can I/ 00:02
A plain 'while' like that keeps hitting the first match all the time, not sure how to make it move along.
gfldex lucs: if you want to act as the grammar is parsing, you have to put the code that reacts inside the grammar itself 00:11
lucs: see example 4 in gfldex.wordpress.com/2021/03/11/ra...match-for/
lucs gfldex: Will read that, thanks. 00:12
00:20 mowcat left 00:27 lizmat left
lucs gfldex: If I understand your example, is it correct to say that the 'take' is evaluating to False? 00:39
00:52 parabolize left 00:55 parabolize joined 01:06 swaggboi left 01:09 MasterDuke left 01:14 swaggboi joined 01:20 kvw_5 joined, kurahaupo_ joined 01:23 kvw_5_ left, kurahaupo left 01:35 kurahaupo_ left, kurahaupo joined 01:41 Kaiepi joined 01:59 dtb joined
dtb does anyone know how to read from stdin. This is not easily findable at docs.raku.org 02:03
02:07 lizmat joined
moon-child dtb: get to read a single line. words or lines to get a sequence of words or lines (respectively) 02:08
dtb @moon-child Right, what's the RAKU equivalent of my $foo = <STDIN> ? 02:11
moon-child I don't know what <STDIN> is 02:12
to read everything, use slurp
02:14 abraxxa left 02:15 abraxxa joined
dtb @moon-child OK, I see the get documentation in IO::CatHandle. Thanks; 02:21
raydiak dtb: $*IN is what you're looking for. IO::Handle docs list the various ways to read from it. CatHandle is something different 02:27
moon-child you don't need $*IN. Plain get works implicitly on $*IN 02:28
dtb @moon-child Yeah, my $foo = get; works.
02:39 softmoth left 02:49 _jrjsmrtn joined 02:51 __jrjsmrtn__ left 03:28 Doc_Holliwood joined 04:20 sno left 04:28 parv joined 04:29 parv left, parv joined, parv left 04:34 parv joined 04:53 samebchase-6 is now known as samebchase- 04:55 gordonfish left 04:56 gordonfish joined 05:06 jmcgnh left 05:13 wamba joined, jmcgnh joined 05:15 neshpion left 05:19 stoned75 joined, Doc_Holliwood left 05:23 sno joined 05:46 wamba left 06:08 ufobat_ joined 06:29 frost-lab joined 06:30 abraxxa left 06:33 abraxxa joined
moon-child it would be cool if there were shorthand T@ and T% (or something like that) for Positional[T] and Associative[T] 06:34
so you could say, e.g., sub foo(--> Int@) instead of sub foo(--> Positional[Int])
06:39 patrickb joined 06:40 Sgeo_ joined 06:41 Sgeo_ left 06:43 Sgeo left 06:44 wamba joined 06:49 parabolize left
moritz_ I'm not sure that what Raku needs is more abbreviations :D 06:53
moon-child maybe... 06:55
it's just really weird that Int @x is so much shorter than Positional[Int] \x. Latter seems stuffy and verbose 06:56
06:57 jmerelo joined 07:10 Geth left 07:12 domidumont joined 07:16 parvXirc joined, parvXirc left
frost-lab m: say Int(True); say True.Int 07:47
camelia True
1
07:58 jmcgnh left, parv left, swaggboi left, dataangel left, elcaro left, xinming_ left, PotatoGim left, karupanerura left, donaldh left, vaskozl left, spacekookie left, camelia left, takside left, dylanwh left, ssm left, esh left, caasih left, rjeli left, Ekho left, Ulti_ left, samcv left, klapperl left, domidumont left, samebchase- left, shadowpaste left, releasable6 left, tellable6 left, statisfiable6 left, notable6 left, bisectable6 left, evalable6 left, benchable6 left, guifa left, aindilis left, aik|onl left, Manifest0 left, pat_js left, cxreg left, [ptc] left, gfldex left, nebuchadnezzar left, tomaw left, DarthGandalf left, uzl[m] left, asymptotically left, xelxebar left, DiffieHellman left, Tirifto[m] left, draco100[m] left, Benett left, e left, bonz060 left, patrickbkr[m] left, mtj left, unclechu left, wamba left, dtb left, kvw_5 left, eater left, wingfold left, vrurg left, dogbert17 left, tonyo left, cooper left, nativecallable6 left, bloatable6 left, coverable6 left, shareable6 left, unicodable6 left, committable6 left, sourceable6 left, squashable6 left, quotable6 left, greppable6 left, mrsolo left, skaji_ left, codesections left, kini left, rba left, summerisle left, jcallen left, spycrab0 left, a3f left, stux|RC-only left, moon-child left, AlexDaniel` left, mojca left, abraxxa left, sxmx left, renormalist left, aluaces left, rjbs left, mightypork left, grumble left, benaiah left, raydiak left, tadzik left, synthmeat left, Mithaldu left, _________ left, robinsmidsrod left, linkable6 left, MilkmanDan left, Grinnz left, Garland_g[m] left, jhill left, Altreus left, ugexe left, zostay left, perry left, riatre left, jmerelo left, kurahaupo left, timlegge left, jast left, bdju left, mniip left, masak left, agentzh left, hobbs left, nine left, brass left, kst left, patrickb left, frost-lab left, stoned75 left, samebchase left, maggotbrain left, Black_Ribbon left, cosimo left, defaultxr left, dustinm` left, APic left, db48x left, literal left, torbjorn left, dotdotdot left, ambs left, leont left, marcusr left, japhb left, Sir_Ragna left, nicholatian left, jjatria left, epony left, sno left, gordonfish left, Kaiepi left, simcop2387 left, Woodi left, afresh1 left, markmarkmark left, tobs left, Voldenet left, silug left, hvxgr left, BinGOs left, ufobat_ left, _jrjsmrtn left, sivoais left, UukGoblin left, demostanis[m] left, pwr22 left, tusooa left, kiti_nomad[m] left, CIAvash left, lizmat left, sena_kun left, b2gills left, El_Che left, Maylay left, telex left, gugod left, xkr47 left, brown121407 left, eseyman left, moony left, webstrand left, stux|RC left, lnx left, |oLa| left, albino_ left, rypervenche left, mendel left 08:02 ThaEwat left 08:03 juanfra__ left, Nasrudin left 08:06 kst joined, brass joined, nine joined, hobbs joined, agentzh joined, masak joined, mniip joined, bdju joined, jast joined, timlegge joined, jmerelo joined, telex joined, SmokeMachine joined, daxim joined, leah2 joined, Grauwolf joined, peteretep joined, tbrowder joined, riatre joined, perry joined, zostay joined, ugexe joined, Altreus joined, Grinnz joined, MilkmanDan joined, linkable6 joined, bonz060_ joined, KotH joined, avar joined, mst joined, robinsmidsrod joined, _________ joined, Mithaldu joined, synthmeat joined, tadzik joined, raydiak joined, benaiah joined, grumble joined, mightypork joined, rjbs joined, aluaces joined, renormalist joined, sxmx joined, abraxxa joined, torbjorn joined, literal joined, db48x joined, APic joined, dustinm` joined, defaultxr joined, cosimo joined, Black_Ribbon joined, maggotbrain joined, samebchase joined, stoned75 joined, patrickb joined, DarthGandalf joined, dotdotdot joined, ambs joined, leont joined, marcusr joined, japhb joined, Sir_Ragna joined, nicholatian joined, buffet joined, jjatria joined, nativecallable6 joined, bloatable6 joined, coverable6 joined, shareable6 joined, unicodable6 joined, committable6 joined, sourceable6 joined, squashable6 joined, quotable6 joined, greppable6 joined, skaji_ joined, mrsolo joined, codesections joined, kini joined, rba joined, summerisle joined, jcallen joined, spycrab0 joined, a3f joined, stux|RC-only joined, moon-child joined, mojca joined, mithaldu_ joined, pnu__ joined, charsbar joined, bartolin_ joined, jdv79 joined, gabiruh joined, ecocode joined, ribasushi joined, roguelazer joined, dpk joined, camelia joined, spacekookie joined, vaskozl joined, donaldh joined, karupanerura joined, PotatoGim joined, xinming_ joined, elcaro joined, dataangel joined, swaggboi joined, parv joined, lucs joined, [Coke] joined, BinGOs joined, tailgate joined, jraspass joined, pounce joined, hvxgr joined, silug joined, Voldenet joined, tobs joined, markmarkmark joined, afresh1 joined, Woodi joined, simcop2387 joined, Kaiepi joined, gordonfish joined, sno joined, ingy joined, lnx joined, webstrand joined, moony joined, eseyman joined, brown121407 joined, xkr47 joined, Maylay joined, El_Che joined, b2gills joined, sena_kun joined, lizmat joined, tinita joined, mtj joined, moritz_ joined, wmoxam_ joined, Grrrr joined, spacebat2 joined, fvox_ joined, imcsk8 joined, broquaint joined, perlmaros joined, perigrin joined, m_athias joined, mendel joined, rypervenche joined, albino_ joined, Benett joined, m6locks_ joined, sjn joined, krunen joined, cooper joined, tonyo joined, dogbert17 joined, vrurg joined, wingfold joined, eater joined, kvw_5 joined, dtb joined, wamba joined, pecastro joined, klapperl joined, samcv joined, Ulti_ joined, Ekho joined, rjeli joined, caasih joined, esh joined, ssm joined, dylanwh joined, takside joined, holyghost joined, e joined, tomaw joined, nebuchadnezzar joined, gfldex joined, [ptc] joined, cxreg joined, pat_js joined, Manifest0 joined, aik|onl joined, aindilis joined, guifa joined, benchable6 joined, evalable6 joined, bisectable6 joined, notable6 joined, statisfiable6 joined, tellable6 joined, releasable6 joined, shadowpaste joined, samebchase- joined, domidumont joined, gordonfish left
moon-child m: say Bool ~~ Int 08:07
camelia True
08:07 frost-lab joined, a6502 joined, gugod joined, epony joined 08:08 asymptotically joined, xelxebar joined, DiffieHellman joined
frost-lab Why is the former Boolean instead of 1 08:08
08:08 rjeli left 08:09 rjeli joined, PotatoGim left, kawaii joined 08:10 jhill joined 08:11 timeless joined 08:12 PotatoGim joined
moon-child frost-lab: because bools are already ints. Bool.Int is special-cased docs.raku.org/routine/Int#enum_Bool 08:12
08:12 DiffieHellman left 08:14 DiffieHellman joined, BuildTheRobots joined 08:15 nige joined
frost-lab moon-child It makes sense. Thanks. 08:15
nige o/ just trying to get some evidence together for the EU trademark application 08:16
lizmat, do you happen to have stats on the readership for the Raku Weekly? 08:17
I understand that the weekly is branded "Rakudo Weekly News - News about the Raku Programming Language on Rakudo" - it's still useful from the point of view 'about the Raku Programming language'
08:17 jmcgnh joined
jjatria guifa++ on the insane hatred for l10n and friends 08:19
I don't like abbreviations that make me think _more_
08:20 frost-lab left, frost-lab joined, rjeli left, rjeli joined, jhill left, jhill joined, PotatoGim left, PotatoGim joined, BuildTheRobots left, BuildTheRobots joined
moon-child wait, l10--ohh 08:26
I don't like that
jraspass i18n, k8s are the other two i know - en.wikipedia.org/wiki/Numeronym 08:27
moon-child I think I've made my peace with i18n. But I still don't _like_ it 08:28
08:32 sena_kun left, aborazmeh joined 08:34 sena_kun joined 08:35 squashable6 left 08:36 kiti_nomad[m] joined, squashable6 joined 08:42 brtastic1 joined, nige left, nige joined 08:43 ThaEwat joined, juanfra__ joined, AlexDaniel` joined, tusooa joined, patrickbkr[m] joined, Tirifto[m] joined, unclechu joined, demostanis[m] joined, Nasrudin joined, pwr22 joined, draco100[m] joined, Garland_g[m] joined, uzl[m] joined, CIAvash joined 08:47 nige left, nige joined 08:49 EXAABHZ9 joined, ufobat_ joined, _jrjsmrtn joined, sivoais joined, sftp joined, cgfbee joined, pierrot joined, timotimo joined, tyil joined, UukGoblin joined, pel joined, dg joined, cgfbee left, tyil left 08:51 tyilanmenyn joined 08:54 sivoais left 08:55 sivoais joined 08:57 parv left 08:59 cgfbee joined 09:04 aborazmeh left 09:10 Doc_Holliwood joined
db48x my favorite is l20n 09:22
because it was localization 2.0 09:23
09:24 brtastic1 left 09:46 abraxxa left 09:48 abraxxa joined
Altreus i18n does have the benefit of not making me type the whole word out every time I need to reference it 09:50
Modules that didn't shorten it that way tended to use the entire line width just to reference them 09:51
09:52 Black_Ribbon left 10:04 Doc_Holliwood left 10:21 |oLa| joined
db48x I wonder if we could shorten them further 10:54
10:54 sno left 10:58 stoned75_ joined 11:02 stoned75 left, DiffieHellman left 11:12 nige left, nige joined 11:14 kurahaupo joined 11:16 |oLa| left 11:17 nige left, nige joined
Altreus you can have apostrophes in raku so yeah 11:21
l'n
11:32 nige left, nige joined
db48x lol. I was thinking of emoji, but that works too :) 11:35
11:37 nige left, nige joined 11:39 wamba left 11:40 wamba joined 11:42 nige left, nige joined 11:46 shadowpaste left 11:47 nige left, nige joined 11:49 frost-lab left 12:03 tyilanmenyn is now known as tyil 12:35 stux|RC joined 12:43 db48x left 12:44 db48x joined, jmerelo left
guifa Altreus: I think use statements are uncommon enough it’s not a huge concern — it’s in the exported subs for common use stuff. But thankfully Raku can help out there by letting module authors give people options on how stuff get imported in 13:05
13:12 nige left, nige joined
Altreus well I've not actually seen it in use since 2009 perl5 code 13:13
:D
guifa Most of the time we can lexically scope like lizmat++ said to avoid probelms, but when they have to be in the same scope, I think it might not be a bad idea to have either a :long option for the use statement, or a dummy .rakumod file (maybe lib/Foo/Bar/CrystalClear.rakumod) that imports a slightly longer version of things just in case 13:16
guifa is afk
13:17 nige left, nige joined 13:22 nige left, nige joined 13:27 nige left, nige joined 13:43 softmoth joined 13:47 Sgeo joined 13:55 MilkmanDan left, MilkmanDan joined, parabolize joined 13:59 wbiker joined 14:08 wamba left 14:23 wamba joined
lucs I'm expecting to catch all here, but every second one is skipped: 14:25
p6: .say for "Ab Ac Ad Ae Af Ag" ~~ m:g/ A .*? )> [ A | $ ] /;
camelia 「Ab 」
「Ad 」
「Af 」
lucs Is my understanding of )> incorrect? 14:26
Or, how dow I make that work? 14:28
codesections What do you intend `[ A | $ ]` to be doing? (the A there is capturing the A's that aren't in your match)
lucs codesections: My intention is to capture A followed by anything up to the next A. 14:29
And to capture all such groups.
So I'd like to get «「Ab 」␤「Ac 」␤「Ad 」␤「Ae 」␤「Af 」␤「Ag 」␤ 14:30
codesections Ah. In that case, I think you need a lookahead assertion: docs.raku.org/language/regexes#Loo...assertions 14:31
lucs Dang, that's kind of what I thought )> did :)
Will read, thanks.
codesections to express 'match up to the next A without consuming the next A'
lucs Exactly
Aw, I knew that :/ 14:32
lucs is more and more forgetful over the years :(
14:32 ufobat__ joined
codesections The )> is similar, but slightly different -- it limits what is part of the capture, but no what is matched (frequently that amounts to the same thing, but not here b/c of the :g) 14:33
lucs codesections: Yep, now I understand.
codesections :)
14:36 ufobat_ left 14:45 patrickb left 14:54 gordonfish joined
softmoth dtb, I've created an issue for documenting how to read from stdin. Thanks for reporting the problem. github.com/Raku/doc/issues/3867 14:55
15:08 Sgeo left 15:12 Sgeo joined
dtb @softmouth Yeah, I found the get documentation in IO:Handle but the one line that called out reading from stdin was confusing. 15:16
15:17 domidumont left
dtb @softmouth After Hello World, this seems like a fairly common task for noobs so maybe an example in the Raku by Example 101. 15:18
15:19 softmoth left
dpk if i want to use Raku as grep with Raku regexes, how do i do that? raku -pe something or other? 15:25
15:26 Sgeo_ joined
dpk ah, raku -ne 'say $_ if $_ ~~ /some regex here/' 15:27
15:27 rindolf joined 15:28 Sgeo left 15:32 Sgeo__ joined 15:35 Sgeo_ left
dpk remind me to create a proper rakugrep command-line tool some day 15:36
15:37 mowcat joined 15:39 Sgeo__ left 15:47 Sgeo joined, sno joined
lizmat weekly: www.nntp.perl.org/group/perl.perl5...59770.html 15:55
notable6 lizmat, Noted! (weekly)
lucs dpk: Port ack to Raku. 15:58
dpk that would indeed be handy 16:02
16:07 ufobat__ left 16:08 Sgeo_ joined 16:10 Sgeo left
lizmat I have considered it 16:15
and would support anybody who would take that on 16:16
[Coke] probably would need to call it something else, but seems like a good plan! 16:17
El_Che the competence will be hard now that ack has faster alternatives 16:25
tadzik do any of these alternatives actually support Perl regexes? 16:26
16:27 jmcgnh left
El_Che pcre 16:28
(I am an ack user)
ag supports pcre
pretty sure they all do
(even grep supports pcre)
[Coke] I imagine anyone using a raku regex command line tool is more interested in being able to use those specific regexes. 16:29
El_Che I don't know 16:30
the readability of raku regexes is a huge win for programs
for a one liner it's less relevant
they tend to be less complex, I would think 16:31
[Coke] ... right, so if they *wanted* them, they're going to be more concerned about having the regexes than the speed. otherwise just use the variety of existing tools. 16:36
16:36 jmcgnh joined
El_Che it would be a cool dev tool to learn regexes on top 16:39
17:09 abraxxa left 17:12 abraxxa joined 17:14 abraxxa left 17:17 abraxxa joined 17:24 b2gills left, b2gills joined 17:26 wamba left 17:29 aborazmeh joined 17:34 kleb joined
kleb hi folks! why do I get "TTT" as output to this program? 17:39
#!/usr/bin/env raku
use v6;
my $a = False;
my $b = True;
my $c = False;
given ($a, $b, $c) {
    when (False, False, False) { say "FFF"; }
    when (False, False, True)  { say "FFT"; }
    when (False, True,  False) { say "FTF"; }
    when (False, True,  True)  { say "FTT"; }
    when (True,  False, False) { say "TFF"; }
    when (True,  False, True)  { say "TFT"; }
    when (True,  True,  False) { say "TTF"; }
    when (True,  True,  True)  { say "TTT"; }
    default {
        say "default";
    }
evalable6 default
codesections m: say $_ ~~ True 17:40
camelia Potential difficulties:
Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead
at <tmp>:1
------> 3say $_ ~~ 7⏏5True
True
codesections kleb: ^^^^
True always matches and False always doesn't
kleb ah, gotcha 17:41
interesting
lizmat this allows you to e.g. use a condition in a grep, as grep just does a smartmatch on what it is given
[Coke] if you had just "when True" or "when False" it would give you that same warning. I suspect the (T,T,T) hides it enough 17:42
kleb i think i understand the root of the problem, but am still unclear as to how i can achieve the sort of behavior i am looking for 17:44
what is the cleanest way for me to select the FTF branch? 17:46
*if i have three booleans, and want to dispatch to a code snippet depending on their relative values 17:47
codesections m: say (False, True, False) ~~ (:not, :so, :not)
camelia True
kleb ah, bingo! 17:48
i didn't realize I could put the :not :so in those locations
thanks folks!
codesections I _think_ that works. I'm still getting my head around how smartmatching and destructuring (in signatures) interact/compare
kleb it does! i just tried it
#!/usr/bin/env raku 17:49
use v6;
my $a = False;
my $b = True;
my $c = False;
given ($a, $b, $c) {
    when (:not, :not, :not) { say "FFF"; }
    when (:not, :not, :so)  { say "FFT"; }
    when (:not, :so,  :not) { say "FTF"; }
    when (:not, :so,  :so)  { say "FTT"; }
    when (:so,  :not, :not) { say "TFF"; }
    when (:so,  :not, :so)  { say "TFT"; }
    when (:so,  :so,  :not) { say "TTF"; }
    when (:so,  :so,  :so)  { say "TTT"; }
    default {
        say "default";
    }
evalable6 default
kleb }
lizmat kleb: please use a gist for that :-)
pasting pieces of code of several lines 17:50
kleb how is that done? sorry i am new to this functionality
m: say "Test"; 17:51
camelia Test
lizmat kleb: do you have a Github account ? 17:52
kleb yes
lizmat then go to: gist.github.com
enter your code there in a gist, and then post the URL here
gist.github.com/lizmat/5315ff935c7...248ca475ed 17:53
kleb gotcha - is this preferred over pastebin? 17:54
lizmat no, pastebin is also ok
kleb i can do pastebin.com/raw/svAktZYF
lizmat any type of pastebin 17:55
yup
kleb cool! thanks for the tips!
gtg!
17:55 kleb left 18:12 wamba joined 18:13 PlayPause9 joined, patrickb joined
PlayPause9 I'm new to Linux, I'm on Linux Mint Cinnamon and I want to uninstall and reinstall Comma. Does anyone know how I do this? 18:14
lizmat sena_kun ^^ 18:16
El_Che do you use the standalone comma or the plugin for intellij?
sena_kun asks the same question
lizmat :-) 18:17
PlayPause9 Each time I want to run Comma, I have to do "./bin/comma.sh" in the terminal. I think that's standalone.
El_Che PlayPause9: just rm -rf the directory where you installed it
sena_kun El_Che++
El_Che PlayPause9: you had a problem I remember vaguely 18:19
PlayPause9 What does it mean to "rm -rf"? Can you give further details?
El_Che yes 18:20
rm is the remove file command in UNIX/Linux
the option -r means recursive (== also remove directories)
the option -f means force 18:21
you can also use a file browser like nautilus to delete the directory by selecting it and pressing delete
18:33 MilkmanDan left
PlayPause9 Ah, alright. Thanks. So, how do I use "rm -rf" when trying to uninstall Comma? What would the Terminal look like? 18:33
18:34 MilkmanDan joined
El_Che I use Ubuntu and the terminal shortcut is ctrl+shift+t 18:35
look in applications, there should be a terminal there 18:36
dtb How are unicode characters output with the say function?
PlayPause9 Oh sorry El Che, I wasn't clear. I mean, what do I put into the terminal? 18:38
El_Che you type it, but first you need to make sure what the directory is 18:39
otherwise you'll delete other stuff
evalable6: say "😏"
evalable6 😏
raydiak PlayPause9: they mean just delete the directory where Comma is. if you aren't familiar with the terminal, you may want to just use your file manager of choice to delete the directory. I wouldn't start learning the terminal with potentially disasterous commands like "rm -rf" if I were you 18:43
PlayPause9 raydiak I see. Thank you. Thank you too El Che for trying to help me. 18:45
I assume it's okay that I use the file manager that comes with Linux Mint itself?
raydiak yes, anything that can delete the directory should work fine 18:46
PlayPause9 Alright, thanks.
18:46 MasterDuke joined
raydiak just make sure you're comfortable with it and know that you're deleting the correct directory. you're welcome of course 18:47
dtb @el_che say "U+1F600"
Doesn't work.
PlayPause9 How do I do file and/or folder searches on Linux btw? 18:48
raydiak there's usually a search feature built in to the file manager, often a button that looks like a magnifying glass 18:49
El_Che dtb: docs.raku.org/language/unicode#Ent..._sequences 18:50
MasterDuke 'grep' to search inside files, 'find' to find files by name/size/date/etc
tellable6 2021-04-09T02:50:32Z #raku-dev <vrurg> MasterDuke I have updated gist.github.com/vrurg/d824dc212991...45e5c2e7be with the last blin output. This time against a26ff40 18:51
El_Che PlayPause9: the graphical programs should be pretty evident (e.g. nautilus on Ubuntu has a search bar on top)
dtb @El_Che so if I read that right you specify the unicode by decimal \c or hex \x... Why no \u to just enter the unicode value? 18:52
El_Che PlayPause9: I would suggest to read a base UNIX/LInux course for basic CLI actions.
the invested time will be won many times
japhb Looking for feedback on a design approach, any takers welcome. I'm working on an interruptable input library (meaning, that real time events can interrupt the user's input, and the library will pause, handle the realtime event (which can include writing updates somewhere on the screen) and then return to the user's input in progress). The problem is that raw communication with a TTY has an underlying 18:53
uniprocessing assumption -- querying the VT emulator involves printing a query string, then reading a query response and parsing it; this entirely breaks if you want to multitask TTY I/O. So my thought is to have a TTY controller in its own thread, with a command channel to interface with other threads. The command channel allows the rest of the program to say things like "read a raw character" or "print
this string" or "perform this query" or what have you, as indivisible operations. Operations that need a response can include a promise in the command packet that will be kept with the result. Can anyone see problems with this approach?
PlayPause9 Thanks everyone. The Linux Mint start-menu bar doesn't have anything resembling a search feature (e.g. no magnifying glass) but nonetheless, I'll use find. Thanks for your patience. 18:56
raydiak dtb: \u would be ambiguous as to whether you're specifying the codepoint in decimal (\c) or hex (\x) 18:58
19:02 asymptotically left, asymptotically joined
dtb @raydiak but it wouldn't be ambiguous as to whether you're specifying the codepoint in unicode. 19:03
other languages provide the u+##### pathern 19:04
japhb dtb: In Raku, it's all unicode. 19:05
raydiak a unicode codepoint can be specified many ways. the hex representation you asked about initially is only one way to specify that same character
dtb @japhb Ah, now I see. say "\x1F600" works 19:06
japhb m: say "\c[BUTTERFLY]"; # dtb 19:07
camelia 🦋
dtb @japhb yeah I'm not digging the named approach.
japhb The entire unicode database is included in Rakudo.
raydiak m: say "\c128512" eq "\x1f600" 19:08
camelia True
dtb @raydiak... Thanks, I see the pattern now.
raydiak you're welcome 19:09
japhb dtb: I find the numeric approach works well when I'm dealing with a series of codepoints where their relative sequence has meaning, like the 1/8th block characters. But I prefer the named version when I just want to print some symbols/glyphs. 19:10
19:11 linkable6 left
db48x using the names really helps when you have to make some changes 6 months or a year after writing the code 19:11
japhb It helps that I have a helper program for searching the unicode DB. :-)
db48x: Oh yeah, definitely that too.
19:12 linkable6 joined
db48x as for your architecture question, having a thread that has sole responsibility for talking to the terminal seems entirely reasonable to me 19:13
I’ve not done much work in that area, but the one relevant program that I have worked on has developed more and more towards that design 19:14
19:14 linkable6 left
japhb db48x: Ah, thank you. 19:14
19:14 lucs is now known as plucs, linkable6 joined
db48x some things still just call printf, but most of the output is done by sending messages to a thread 19:14
messages like “update my progress bar to 23%” 19:15
japhb OK, my idea matches someone's reality at least. :-) 19:16
db48x the only complicated thing that it does is have a synchronization message
it’s just an empty message that expects an empty reply 19:17
japhb db48x: Oh, so other parts can say "I want to know when the TTY thread is caught up with all my requests"?
db48x and we just use it to ensure that all log messages have been printed out before we exit 19:18
exactly, yea
japhb OK, that's a good thought, thanks.
db48x but aside from that, it is very crude. just barely enough code to make things work 19:19
japhb db48x: Honestly, I've been kinda working my way up from the bottom anyway. "What's the minimum I need to change to support this feature?" The jump to the architecture idea above came when my current code couldn't handle the case of a network message arriving asynchronously and needing to change the screen while the line edit routine was in its read loop. 19:21
PlayPause9 I want to report something very strange guys. I did a full search on my PC for "comma" and I never found anything that resembled a folder that Comma had been installed to. I then used the terminal to run the comma.sh file that was (amongst other stuff) extracted from the comma tarball that I'd already downloaded and then Comma loads my most recent project and file. It does seem like it is installed in some way, how else can it "remember" previous
work? I'm not running it out of the Start-Menu though so perhaps this really is the IntelliJ thing rather than a proper installation? If Comma is installed, I want to uninstall it so I can reinstall it but that might not be necessary.
japhb (Or in particular, for this to happen on *multiple* network connections) 19:22
db48x japhb: that’s my preference for how to do things as well
PlayPause9 My question then would be: do you think I installed Comma? 19:24
MasterDuke PlayPause9: it puts config files and such in a file in your home directory. '.Comma<something something>version'
it then looks for those to import settings from a previous version 19:25
PlayPause9 I see. I had to turn on "see hidden files" to find it but yeah, I found the .config folder and I found Comma. It's in an "Edument Central Europe" folder. I've never heard of Edument before but oh well. I believe I can just delete this and that'll be that. 19:27
lizmat Edument Central Europe is the company making Comma 19:28
PlayPause9 Meanwhile, Comma is FOSS? 19:29
lizmat many parts of it are
19:30 linkable6 left
PlayPause9 I see. Despite this, Comma is still the preferred Raku IDE in the Raku community? 19:30
19:30 linkable6 joined
lizmat yes 19:30
as it is created by the current Raku architect: Jonathan Worthington 19:31
19:35 softmoth joined
raydiak it's a very good tool, and not an evil company trying to strong-arm you into paying. I'm fairly certain that you won't find better Raku support in any other IDE in existence, free or otherwise 19:41
19:47 aborazmeh left 19:49 dogbert11 joined
PlayPause9 I see. Thanks for the responses guys. I just checked the Raku Wikipedia page and it had no mention of this "Jonathan Worthington" fellow. Larry Wall is mentioned as its creator so I was of the opinion that Mr. Wall was still the lead developer for the language (I believe such people are referred to as "Benevolent Dictators"). The Wiki page makes no mention of Mr. Wall stepping down. When did this happen and when did Mr. Worthington come into the 19:52
picture?
19:53 dogbert17 left 19:54 Black_Ribbon joined 19:55 linkable6 left, linkable6 joined 19:57 dogbert11 left
lizmat github.com/MoarVM/MoarVM/graphs/contributors # I'd say around 2012 ? 19:57
well, actually before that 19:58
github.com/Raku/CCR/blob/main/Rema.../README.md 19:59
first recovered blog post of Jonathan from 2006
PlayPause9: Mr. Wall was never much involved in the actual implementations 20:00
20:01 dogbert11 joined
lizmat still listed as #6 at github.com/rakudo/rakudo/graphs/contributors 20:01
20:05 aborazmeh joined
PlayPause9 I see. It's a bit strange that Mr. Wall is credited as the creator of Raku and yet, based off of your words, was mostly uninvolved with its development. There seems to be a bit more to this than I initially expected but nonetheless, I'm sure I can read about Raku's development some other time. Thanks lizmat. 20:06
lizmat no, he was involved alright
PlayPause9 Then again, you said "implementation", rather than development. I think there's a nuance here that I'm not getting. 20:07
lizmat just not directly in the implementations
PlayPause9 Right.
lizmat design.raku.org
that was mostly Mr. Walls work
as were the apocalypses before that 20:08
PlayPause9 Alright. Thanks lizmat. 20:10
MasterDuke he did STD.pm mostly by himself, right?
softmoth "no mention of this 'Jonathan Worthington'" That is a major oversight in the Wikipedia page :)
and viv, IIRC 20:11
lizmat yes, he did 20:13
a bit before my time, really :-)
softmoth Well, maybe not a major oversight. It's a pretty terse history. Damien is mentioned, but Audrey isn't, for example
lizmat well, feel free to update those pages
lizmat is still being blocked because of ore new ISP :-(
softmoth :-/
lizmat I mean, the 500Mbit is nice 20:14
s/ore/our
20:16 dogbert17 joined 20:19 dogbert11 left 20:20 xinming_ left, xinming_ joined, abraxxa left 20:23 abraxxa joined 20:44 stoned75_ left 20:48 m6locks_ is now known as m6locks, stoned75 joined, linkable6 left 20:50 linkable6 joined 21:31 rindolf left, stoned75 left
japhb OK, I feel like there's a hole in my memory right now. Is there a way to detect in a *cross-platform*, *non-Nativecall* way that a standard handle (not a socket) is ready to read or write, *without blocking*? The best option I've seen so far is the epoll module, but that's not cross-platform. 21:42
21:48 PlayPause9 left 21:50 patrickb left
moon-child japhb: possibly .Supply.Channel.poll? 21:55
japhb moon-child: Hmmm, interesting idea. Might require some work to do that with raw I/O, but I'll throw that idea in my mental blender. 21:59
japhb has a sinking feeling they're about to read a couple more chapters of Advanced Programming in the Unix Environment ... 22:00
moon-child i mean if nativecall is ok it's literally just poll({fd, POLLOUT}, 1, 0) 22:01
22:06 plucs is now known as lucs 22:16 kurahaupo_ joined 22:17 kurahaupo left 22:18 no-n joined 22:20 wamba left
japhb moon-child: More to it than that ... I'm discovering that I have just crossed the threshold from "knowing a few things is good" to "not knowing All The Things will be a mess". 22:42
23:00 aborazmeh left 23:01 idiosyncrat2 joined 23:11 DiffieHellman joined 23:29 dogbert17 left 23:31 dogbert17 joined 23:43 pecastro left 23:51 mowcat left