🦋 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.
ab5tract license is totally unnecessary while trying things out 00:03
I paid for a license but I don\t think I'm actually using anytihng from it at the moment :) 00:04
00:07 yewscion joined 00:12 ulipink joined 00:17 yewscion left 00:18 ulipink left
tbrowder good to know, thank you! 00:21
ab5tract There's a small set of instructions in the readme here: github.com/ab5tract/comma-plugin 00:24
If you do try it out, let me know if you into any trouble by pinging me here or via an issue in GitHub 00:25
00:36 yewscion joined 00:44 yewscion left 00:47 ulipink joined 00:49 jpn left 00:52 ulipink left 01:05 yewscion joined 01:10 yewscion left 01:14 yewscion joined 01:18 yewscion left 01:23 ulipink joined, ulipink left, ulipink joined 01:28 ulipink left 01:39 lizmat_ joined 01:41 lizmat left 01:57 ulipink joined 02:01 ulipink left 02:08 guifa left, guifa joined
antononcube @tbrowder i use the “.raku” extension. 02:14
tbrowder ab5tract: will do 02:15
antononcube: thanks!
02:19 hulk joined 02:21 kylese left 02:50 MoC left 03:09 Sgeo left 03:15 hulk left, kylese joined 04:10 erdem left 04:41 erdem joined 05:04 yewscion joined 05:09 yewscion left 05:58 guifa left 06:41 Sgeo joined 06:51 Sgeo left 06:53 Sgeo joined 07:07 Aedil joined 07:22 yewscion joined 07:26 yewscion left 07:51 ulipink joined, ulipink left, ulipink joined
antononcube BTW, I use VSCodium not VSCode. VSCodium is a telemetry-free version of VSCode. See: vscodium.com 07:56
07:56 yewscion joined 08:01 yewscion left
librasteve ab5tract: yes I have the Raku plugin and the Jupyter & Python plugins installed on IntelliJ Universal … fwiw I also have zen install Jupyter::Chatbook, I run jupyter-notebook on the command line and then I copy over the token into the Intellij Jupyter configured server dialog 08:36
08:47 yewscion joined 08:49 Aedil left 08:52 yewscion left 08:58 jpn joined 09:02 jpn left 09:11 jpn joined 09:19 yewscion joined 09:24 yewscion left 09:38 jpn left 09:40 sena_kun joined 09:52 yewscion joined 09:53 jpn joined 09:57 yewscion left 10:26 Sgeo left 10:30 Sgeo joined
antononcube Note, that all magic cells I mentioned above work fine in Jupyter with VSCode. discord.com/channels/5384078799804...8322919534 10:30
Also, with VSCode there is no need for separate start of “jupyter notebook” — the Jupyter kernels are automatically found and started when needed. 10:33
10:39 lizmat_ left, lizmat joined 10:41 leedo left, yewscion joined 10:45 Xliff joined 10:46 yewscion left
Xliff Hello! 10:49
lizmat Xliff o/
Xliff Can we serialize generic raku datatypes into XML. Kinda like JSON::Fast and to-json?
lizmat! \o
lizmat doesn't LibXML do that (to an extent) ? 10:50
Xliff I am aware of XML::Class, but that's for classes not simple values.
lizmat and raku.land/zef:raku-community-modules/XML ? 10:51
make-xml ? 10:52
Xliff Those are more parsing than serializing. 10:53
lizmat raku.land/zef:raku-community-modul...tstr-name- ?
Xliff No. make-xml is crafting which is not serialization. 10:54
lizmat other than that, I don't have any suggestions :-(
Xliff > "use XML; make-xml("boo").say" # <boo/> 10:55
OK. I can handcraft one, but I'd rather have something simple.
10:57 leedo joined 11:01 yewscion joined 11:06 yewscion left
Xliff lizmat: What's a good blog place for raku? 11:07
lizmat I use dev.to nowadays 11:08
Xliff 'k
librasteve I still use wordpress.org (sorry) 11:13
Xliff No need to apologize, librasteve. See the travesty of my recently created dev.to post... 11:17
dev.to/xliff/serializing-basic-typ...o-xml-4bl2
I wonder if that code block can be fixed.
11:17 jpn left
lizmat ``` sections work ? 11:18
also, tag it #rakulang please :-) 11:19
Xliff lizmat: That they do. I just tried it. 11:20
lizmat: Weekly? 11:22
lizmat weekly: dev.to/xliff/serializing-basic-typ...o-xml-4bl2 11:23
notable6 lizmat, Noted! (weekly)
Xliff \o/
librasteve what's the best way to declare enums when I want to use them in two modules - is there such as thing as enum TagType <Singular Regular> is export? 11:33
11:34 yewscion joined
enum TagType is export <Singular Regular>; oh gotta do it the right way! 11:36
11:39 yewscion left 11:43 Sgeo left 12:01 MyNetAz left 12:11 Xliff left 12:16 MyNetAz joined 12:48 yewscion joined 12:55 yewscion left 13:18 yewscion joined 13:22 yewscion left
antononcube On blogs: I use WordPress, but it is too much work to transfer / publish notebooks into posts. GitHub's ".io" sites are much better for both Markdown and Jupyter notebooks. 13:38
13:40 ulipink left 13:49 yewscion joined 13:54 yewscion left 14:03 yewscion joined 14:08 yewscion left 14:40 yewscion joined 14:44 yewscion left 14:56 guifa joined
timo Xliff, as the first step I would say escaping has to be sprinkled all across the code so you can't accidentally make bogus XML through string concatenation 14:57
ideally it'd be some kind of XML::Writer or whatever that creates the output instead of ad-hoc escaping of stuff 15:16
15:25 Aedil joined 16:07 Guest68 joined 16:23 Guest68 left 16:24 apac joined 17:05 yewscion joined, SrainUser joined 17:10 yewscion left 17:17 zostay left, zostay joined 17:18 toddr left 17:20 toddr joined
SrainUser How do I move multiple objects from an array of objects into RakuAST::StatementList.new(...)? 17:29
lizmat doesn't RakuAST::StatementList.new(@objects) do the right thing ? 17:37
SrainUser Thanks lizmat, I will try that. 17:40
Hey lizmat to create a programming language would it be smarter to evaluate a generated Raku AST, or generate raku source code and run it? 17:44
lizmat really depends how far you're straying from Raku 17:45
the RakuAST approach would give you much more flexibility, but at the expense of verbosity and being at the bleeding edge of development 17:46
the "generate Raku code" is more conservative, and possibly too limiting for your programming language ?
otoh, it *is* a battle-tested approach: many template systems and packages such as "cro" depend on it 17:47
SrainUser RakuAST is a battle tested approach? 17:49
17:51 Aedil left
lizmat no, the .EVAL approach :-) 17:51
SrainUser I figure evaluating rakuAST would be slower since it executes at compile time and then run the code. 17:52
lizmat parsing a grammar and then executing it, is not that much different though :-) 17:56
guifa also, it can be done at compile time too potentially
well I guess if it's for another language it wouldn't be able to go into BEGIN statement
unless it's for config files, etc 17:57
SrainUser It would have to parse the raku grammar and then the language grammar. What part of the Raku grammar does RakuAST not cover yet (like concurrency?). 18:00
lizmat afaik the Raku grammar covers all concurrency stuff, the unsupported parts are more in the nooks and crannies of Raku 18:06
SrainUser Timo was the one who suggested compiling to RakuAST, but I'm concerned it would be slow. Generating objects is less verbose than generating source code I think.
timo when you generate source code as text, it will then be parsed and during parsing the AST objects are created for you 18:07
so you can skip the text part if you go straight to the AST objects
and you don't have to deal with the more interesting parts of the syntax, like making sure strings are escaped properly, or that method, variable, or function names don't have silly special characters in them that break the syntax 18:08
you should be able to turn RakuAST into a precompiled file that can then be loaded 18:09
SrainUser I could create a file with just the AST objects and the .EVAL method? 18:13
lizmat timo: precomp is still a bit of a sore subject in RakuAST :-( 18:14
timo OK
i guess that's what it means to be "at the bleeding edge"
my assumption is that if you create the rakuast for the definition of a function or class, and you .EVAL that, then you can use the result. and if you do the creation at BEGIN time, for example using `constant &myfunction = blabla.EVAL` you should be able to have that precompiled like normal. but there could be something that makes that not work, and since i haven't tried it yet, i wouldn't know what 18:19
it would - or even could - be
guifa I would say compiling to RakuAST is not going to be slower. Consider defining a string 18:22
if you're trying to generate Raku source code, you need to figure the escapes for it (or let Raku do it, passing it through .raku) 18:23
so you go string --> escaped string --> concatenation of string --> parsing of string and creating of RakuAST objects --> generation of MoarVM code
or you could just go string --> RakuAST object --> ggeneration of MoarVM code 18:24
lizmat guifa: just ?
guifa lizmat: I mean, in the sense you're skipping three steps from the previous chain 18:25
lizmat ah, ok, *phew* :-) 18:26
guifa remember, I used RakuAST for the Intl::Format::DateTime haha, I did everything to eek out every bit of performance from that sucker
lizmat ah, nice! should have a look at that when I get around to doing RakuAST again 18:27
guifa some of that was precompiling random bits of RakuAST in BEGIN/constants, etc
I think now with the DEPARSE function I could probably clean up the code a teeny bit more, but at the moment I don't want to look at that code for a very long time :)
BUt like this one would help a lot, beacuse the helper functions could be written in true Raku and compiled ahead of time: github.com/alabamenhu/IntlFormatDa...lc.rakumod 18:29
lizmat :-) 18:30
19:20 guifa left 19:35 Sgeo joined 20:08 yewscion joined 20:14 yewscion left 20:42 yewscion joined 20:47 yewscion left 21:06 ulipink joined
SrainUser "RakuAST::StatementList.new(@objects)" returns with error: "No such method 'IMPL-BEGIN' for invocant of type 'List'". Specifying each element of the array: "RakuAST::StatementList.new(@objects[0], @objects[1])" works. Could I insert each object from the array into StatementList.new() with a loop or something else? 21:06
[Coke] RakuAST::StatementList.new(|@objects) # perhaps 21:08
21:08 librasteve_ joined, yewscion joined
librasteve_ www.irccloud.com/pastebin/BHfWUFWW 21:09
librasteve oops wrong channel 21:10
SrainUser Yes, that works
21:13 yewscion left
SrainUser What does |@ do? What is it called? 21:18
librasteve it flattens the elements of @a as a shorthand for @a.Slip
21:19 ulipink left
docs.raku.org/language/list#Slips 21:19
21:33 ulipink joined, ulipink left, ulipink joined 21:35 japhb left 21:40 ulipink left 22:09 yewscion joined 22:14 yewscion left 22:26 japhb joined 22:27 yewscion joined 22:32 yewscion left 23:00 yewscion joined 23:01 apac left 23:04 yewscion left 23:13 yewscion joined 23:15 jpn joined 23:17 yewscion left 23:19 jpn left 23:23 sena_kun left
SrainUser Is there anything above RakuAST::StatementList in the rakuAST hierarchy? 23:54