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:32 Manifest0 left 00:59 rf_ left, rf joined 01:53 MasterDuke joined 03:05 deadmarshal_ left 03:55 deadmarshal_ joined 05:20 Heptite left 08:33 stevied_test left 08:34 stevied_test joined 09:04 Manifest0 joined 09:08 ab5tract joined 09:10 dakkar joined
el gatito (** advocate) how do i create a docstring 12:15
Nemokosch what is a docstring? 12:16
el gatito (** advocate) sub my-func is export(:my-func) { """documentation here...""" } 12:19
or #`(documentation here...) 12:20
Nemokosch you'd use POD, I think
also known as "plain old documentation"
I think the discord library is a good example 12:21
github.com/shuppet/raku-api-discor...el.rakumod 12:23
el gatito (** advocate) sub my-func is export(:my-func) { =begin pod documentation here... =end pod } like this? 12:28
Nemokosch That can also work 12:30
docs.raku.org/language/pod#Declarator_blocks idk I like this 12:31
for me, the semantics is a bigger question
p6steve just to circle back on this - I have now had the time to review the implementation of role DataSlice in the Dan module and to check whether there is a simple fix to my code to get .<C> or $_<C> working .... without going into the details, the status is (i) I agree that the current, working example for sort is a (bit of a) hack, (ii) DataSlice employs delegation and overloads so that it can mix Positional and
Associative as "cascading accessors", this has about 80% coverage of the use cases, (iii) the issue arises because sort seems to coerce a DataSlice to an Array [which I guess is necessary to Iterate it] and this Array will not take <C>, (iv) it is beyond my skill to identify a quick fix to dehack sort, (v) as the use cases for Dan (and it's brethren) solidifies, I would like to circle back and refactor this area
(likely employing something like Hash::Agnostic / Array::Agnostic) to get the non-hacky sort syntax working, (vi) but since the hack will continue to work alongside a future "non-hackified" example I think that it's good enough for now because (vii) I am focusing my time to get Dan::Polars to MLP per the TODO lists(s) over there --- I have made an issue for this over at GH Dan and, as ever, will be happy to adapt my
priorities according to comments/issues from users of Dan over on GH ...
๐Ÿ˜Ž 12:33
lizmat p6steve++ 12:34
el gatito (** advocate) also f.__doc__ is &f.WHY in raku 12:35
Nemokosch I didn't know the former and haven't used the latter (yet) ๐Ÿ˜… 12:36
el gatito (** advocate) the WHY and HOW names... 12:37
lizmat m: say 'Life, the Universe and Everything'.WHY
camelia 42
lizmat :-)
Nemokosch xddddd 12:39
el gatito (** advocate) it is very obvious that python __doc__ is something related to documentation but when i looked at WHY i don't know what it is supposed to mean
lmao
p6steve did anyone try Jupyter::Kernel with MathJax? 12:43
Nemokosch @Anton Antonov ping 12:44
I didn't use it either way ๐Ÿ™Š
p6steve just a wild idea... 12:46
Nemokosch it's okay, need to tighten the userbase, I'd say 12:48
el gatito (** advocate) the naming makes the language feels like its designed to be a meme lol 12:51
p6steve ... I really like that we can do Jupyter D3 (thanks to @anton) ... just occurred to me that MathJax (and no doubt other JS plugins) would be cool too (yes for different user needs --- such as authoring an interactive scientific paper) 12:52
Anton Antonov Incidentally, I am currently working on an article titled โ€œLiterate programming with Raku and D3.jsโ€. I am trying to show how LT documents can be created using CLI scripts and not using Jupyter. I find Jupyter too heavy and hard to install. (Raku-Jupyter especially, and Jupyter in general.) 13:05
p6steve I'm all for a raku native replacement for Jupyter - for me the key would be alternating code / md cells with a web frontend 13:07
but that could be just a thin layer on a cli basis 13:08
Anton Antonov A nice thing about Brian Dugganโ€™s Jupyter implementation, though, is that it is relatively easy to add new functionalities for the code cells. That is how I made my first D3.js demos. (Brian productized that hack later.) For example, for a client I am making a Jupyter-based prototype with special DSL cells that evaluate natural language specs into data results. (I did that with Mathematica 2 years 13:10
ago.)
lizmat argh... someone teach the discord bot to *not* just break up lines without mentioning the nick again!! 13:12
like ^^
it's unambiguous in this case, but something else *could* get inbetween
Nemokosch I think the discord bot is used as a product, for all intents and purposes. Either it can be configured that way - or well, someone will have to fork and modify it, I guess. 13:15
lizmat I thought gfldex was running it? 13:16
p6steve Well I think we will need to live with / support Jupyter for a long time (but noticing that it is becoming less Python centric) like EVCXR depth-first.com/articles/2020/09/2...ith-evcxr/
Anton Antonov Yeah, sure the investment in Jupyter by some โ€œserious playersโ€ is huge. For example, Jupyter + Raku + VS Code is cool, and would say, it is a nicer combination than the typical Jupyter-in-the-web-browser. 13:22
But again, Jupyter + Raku + VSCode is hard to get consistently work (and look the same) on the few different machines I have tried itโ€ฆ
Nemokosch lizmat: seems like you've been missing out on these news, perhaps it could be a good moment for a DM...
Anton Antonov Not that interested in Rust, but I was looking into notebook solutions for Swift. 13:23
@p6steve In general โ€” to paraphrase Rowan Atkinson โ€” I find your Python and Rust obssessions disturbing. 13:25
13:25 Nemokosch joined
Nemokosch you have a tendency of talking about "obsession" pretty easily, good sir 13:26
I, as somebody you also "accused" of Python obsession, can tell you for one: if automation scripts were that convenient in Python, I would have never thought about learning Raku in the first place 13:27
and if my betting on Raku had turned out to be wrong, I would have come back a long time ago 13:28
Anton Antonov I do not think anyone working seriously with Raku is possessed. Only obsessed onesโ€ฆ 13:29
p6steve haha 13:30
Anton Antonov @Nemokosch I like the packages of the โ€œdocoptโ€ family (for making CLI scripts.) Both R and Python have an implementation, of โ€œdocoptโ€, so I can transfer CLI designs and/or showcase comparisons. 13:35
p6steve I have made a rod for my own back with Dan::Polars which forces me to code 50% in Rust (which, after Raku, is like being made to work down a mine)
Nemokosch oh, the one with the ugly site... not gonna lie, I don't like it a lot ๐Ÿ˜„ 13:36
"the description of a help message but formalized" quite a bruh moment. How would that compete with CLI generated straight from declarative code? 13:37
Anton Antonov I think you are using a certain British idiom. Speaking of โ€œDan::Polarsโ€ why are making a rod for your back and not a pole? 13:38
Nemokosch help-message-as-a-DSL
Anton Antonov Well, it is a โ€œremedyโ€ solution, so it is good and workable, but not great. 13:39
p6steve English has many words that mean almost the same - my favourite example is %(swine => 'pork', cow => 'beef', lamb => 'mutton') where the key is stolen from German and means the animal in the field and the value is stolen from French and means the meat on the plate 13:41
for me, Raku is like English and Rust is like German 13:45
13:49 Nemokosch left, Nemokosch joined
Nemokosch For me, Javascript is English 13:50
except I like Javascript more actually, lol
"a language popular for historical reasons, known for its simple fundamental structure, where everything is allowed" 13:51
I'm not sure Hungarian is complex enough to be compared to Raku. Maybe some conlang. I liked the idea of Kotava, maybe that could be compared. 13:52
Also regarding popularity, alas. Frankly, Kotava is insanely niche even compared to Raku
German might be Pascal 13:54
Created by a German native, too
and the biggest living community of comtemporary Pascal is also tied to Germany in and out
"a rigorous, yet reasonably clean language with many-many incompatible dialects - but there is a standard everybody should understand" 13:55
14:00 Heptite joined 14:13 Nemokosch left
Anton Antonov @Nemokosch Interesting remarks on Pascal. I was taught programming rigorously with Pascal in high school... 14:20
p6steve Raku & Javascript are quite similar capability-wise 14:21
Nemokosch I'd say for completely different reasons, though 14:33
In Javascript, this is because of the ridiculously simple model that is essentially its own metamodel 14:34
even simpler than Python'
in Raku, another route is taken: "there is one for each (...)" 14:35
even though you may reach a point where the model is it's own metamodel - but that language is not Raku anymore 14:38
or phrased the other way around: Raku is much more than a self-hosted system 14:39
it's extended in all crazy ways that JS isn't
el gatito (** advocate) is that python (minus the popular for historical reasons part)? 15:17
lua's is probably even simpler 15:18
Nemokosch Python has what you would call rules 15:19
English not really
Javascript also not really - anything you can syntactically form, will probably do something 15:20
15:20 jgaz joined
in Python, half of the things you can form are invalid and will throw immediately 15:20
el gatito (** advocate) i thought you mean in terms of semantics in that respect python allows you to do any kind of crazy shit you can imagine 15:30
Nemokosch that's exactly what I wouldn't say when the reference is Javascript 15:33
Python clearly doesn't allow you "to be wrong"
while Javascript embraces faults, even its own faults. That's much more like English ๐Ÿ˜› 15:34
el gatito (** advocate) true 15:39
exactly why it is one of the worst languages on earth 15:40
15:41 zashi joined
Nemokosch I don't know, I empathize with it, kinda 15:41
the positives overweigh the negatives for me
el gatito (** advocate) when i am talking abt how python allows anything i mean its amazing introspection features lol turns out thats not what you mean 15:42
then what would php be? 15:43
a fractal of bad design
rf PHP isn't necesarrily bad, I think its far more usable than JavaScript
Nemokosch Call me a charlatan but I think neither of these languages are bad, lol 15:45
el gatito (** advocate) rf: really? most people would agree that js is the better language
Nemokosch I still say: no language is bad, unless it's Shell. If it's Shell, then it's not only bad but also evil.
el gatito (** advocate) how about cobol
Nemokosch I've never used Cobol, or even looked at it for a remotely longer period of time 15:46
so I have no opinion about that
rf JS is trying to be PHP nowadays anyways, look at NextJS and TSX
Nemokosch I think programming languages are generally much better than programmers anyway
these "hate trends" are more about people being stupid and easy to buy with superficial stuff 15:47
rf Lisp is by far the most sound language design, but it isn't necesarrily sound for developers
I don't know how to spell necessarily apparently lol 15:48
el gatito (** advocate) this is a fibonacci sequence calculator in cobol rosettacode.org/wiki/Fibonacci_sequence#COBOL
rf I think a good language is a language that gets stuff done, and doesn't get in the way of the developer. OCaml, Raku and Perl are my gotos for those reasons 15:49
Nemokosch rf: see, English is forgiving xD
nobody even noticed probably
el gatito (** advocate) now rewrite that in any other language 15:50
Nemokosch what are the numbers for? ๐Ÿ˜„ 15:53
I mean... okay, it is verbose. Verbose like hell, even. But there have been trends to return to "literate programming", right? 15:54
el gatito (** advocate) the authors of this language take "literate programming" a little too far 15:55
Nemokosch I get the intention at least - same as Java 15:58
bit of a "code monkey" mentality
write more - but it should really be self-explanatory and rigid
something that might work for 50 years without ever modifying 15:59
you wouldn't feel like modifying it anyway ๐Ÿ˜†
el gatito (** advocate) it is also designed by a literal commitee 16:01
m: my \hiย there = 1; say(hiย there); 16:23
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Term definition requires an initializer at /home/glot/main.raku:1 ------> my \hiโย there = 1;
el gatito (** advocate) m: my \hi there = 1; say(hi there);
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Term definition requires an initializer at /home/glot/main.raku:1 ------> my \hiโ there = 1;
Nemokosch why would this work, though 16:24
el gatito (** advocate) im trying to put a no break space
in between
turns out they convert it to normal space 16:25
Nemokosch ohhhh 16:26
come to think of it: related issue
github.com/Raku/problem-solving/issues/357
that is, indeed it isn't clear, in strings at least, how that would be interpreted 16:27
el gatito (** advocate) m: my \๐š‹๐š›๐šž๐š‘ = 1; say bruh;
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Undeclared routine: bruh used at line 3
el gatito (** advocate) real
nbsp are converted to normal space but mathematical monospace aren't converted into their respective ascii forms 16:28
Nemokosch I'm fairly certain this falls into the "nobody thought of it" territory... 16:29
the disadvantages of designing an arbitrarily complex language
everything is allowed, unless explicitly forbidden
el gatito (** advocate) meanwhile python...python ๐š‹๐š›๐šž๐š‘ = 1 print(bruh) # 1 16:32
16:34 camelia left, m_athias left 16:35 m_athias joined
Nemokosch the funny thing is 16:35
it breaks the REPL in both
although both say it has a length of 4
by the way, not gonna lie, Raku's version seems saner again ๐Ÿ˜† 16:37
if you're gonna allow Unicode weirdness like that, why on earth would you map that to something completely different under the hood? 16:38
16:38 m_athias left, m_athias_ joined
m: my \๐š‹๐š›๐šž๐š‘ = 1; say ๐š‹๐š›๐šž๐š‘ 16:38
Raku eval 1
16:40 camelia joined, zashi left
el gatito (** advocate) its called nfkc normalization 16:43
16:43 m_athias_ is now known as m_athias
the point is that ๐š‹๐š›๐šž๐š‘ and bruh represent the same abstract characters just in different fonts 16:46
Nemokosch from this spaghetti abbreviation, I can't say for sure but Raku strings undergo a certain normalization 16:49
and it's certainly not this one because these strings are not equal 16:50
found this unicode.org/reports/tr15/#Canon_Co...quivalence 16:53
so for example 16:58
m: "LATIN SMALL LETTER A WITH ACUTE".uniparse eq "LATIN SMALL LETTER A, COMBINING ACUTE ACCENT".uniparse andthen .say; 16:59
Raku eval True
Nemokosch I think this is a difference between NFKC and NFC (that MoarVM uses) 17:01
17:38 dakkar left 18:09 m_athias left 18:28 Monalika9 joined 18:29 jgaz left 19:27 jgaz joined
thanks to thundergnat, I noticed this snippet of mine was incorrect 19:59
so I made it even crazier
20:01 NemokoschKiwi joined
lizmat you've just shown the power of NFG :-) 20:02
NemokoschKiwi m: what is that? 20:03
camelia ===SORRY!=== Error while compiling <tmp>
Bogus postfix
at <tmp>:1
------> what is thatโ?
expecting any of:
infix
infix stopper
postfix
statement end
statement modifier
โ€ฆ
NemokoschKiwi oops
lizmat: what is that? ^^
m: gist.github.com/2colours/d4d247d98...7aaad4844a
camelia ((abcd) (a bcd) (ab cd) (abc d) (a b cd) (a bc d) (ab c d) (a b c d))
lizmat docs.raku.org/language/unicode#Normalization 20:04
andrewshitov.com/2018/10/31/unicode-in-perl-6/ 20:05
NemokoschKiwi after today, I was ready for "no fucks given", to be honest ๐Ÿ˜… 20:06
lizmat m: dd "\r\n".chars # most common form of NFG 20:08
camelia 1
NemokoschKiwi so C in NFC stands for codepoints 20:11
substitute that for G and graphemes
lizmat no, I think Composed ?
NemokoschKiwi oof
"Characters are decomposed and then re-composed by canonical equivalence " 20:12
this is the working of NFC apparently
6guts.wordpress.com/2015/04/20/thi...-and-more/ 20:16
This article is good 20:20
I'd add it to the glossary entry of NFG 20:21
20:37 Monalika9 left 21:05 NemokoschKiwi left 21:16 deoac joined
deoac Is it possible to use Perl source filtering in a Raku program? I've tried ```use Filter::Simple:from<Perl5>;``` without success. 21:19
22:14 deoac left
p6steve hi deoac - my reply is over on #raku-irc 22:19
23:35 ab5tract left 23:46 nachtvlinder joined 23:48 nachtvlinder left