🦋 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.
Timon Halo 02:31
nemokosch it's crazy that in Raku you can just take LibXML::Reader (dwarring++) and in Javascript everything is flooded by DOM-based XML parsers or SAX at most 11:00
I wanted a pulling XML parser where I can ask for the next tag or something... 11:01
and if I don't ask for it, no "parsing" happens
antononcube @nemokosch I am not sure are you criticizing JavaScript, or, praising DWarring/Raku. 12:16
nemokosch does it always have to be any of such choices? 12:20
antononcube I am not sure. 12:21
nemokosch How does planet.raku.org work? It would be nice to get an API to the recent blog posts, better than the whole Atom XML feed 13:51
lizmat nemokosch I have no idea... 15:28
lizmat nemokosch I also think planet.raku.org could also use an overhaul 15:30
nemokosch in a more "managed" fashion, allowing insertion of "ad-hoc" raku blog finds into planet.raku.org instead of needing to subscribe to a RSS feed 15:31
tonyo m: use nqp; my $a; sub a { nqp::bindkey(nqp::ctxcaller(nqp::ctx()), '$a', 5); }; a; dd $a 17:24
camelia Any $a = Any
tonyo m: use nqp; my $a; sub a { nqp::bindlexdyn('$a', 5); }; a; dd $a 17:27
camelia Any $a = Any
tonyo hmm
nemokosch lizmat: perhaps it could but it's really bothersome that you wanted to solve a very specific problem and everything falls right at your face 17:32
lizmat fwiw, I know the feeling 17:33
nemokosch the raku.org site basically provides a voluntaristic API for the most recent blog posts by regularly polling a large xml file and generating a JSON from it
the raku.org site basically provides a voluntaristic API for the most recent blog posts by regularly polling a large xml file and generating a JSON from it 17:34
it would be already better if whatever serves planet.raku.org did this itself and provided an endpoint 17:35
lizmat agree
nemokosch no need to save the whole world. It wouldn't even make a difference for that host probably 17:36
however, that does make a difference for building raku.org content into a static server
whether it needs to provide an ad-hoc API by regularly polling some online resource or not
lizmat couldn't you make the list of recent blog posts the only non-static thing? 17:37
or is that your point: making it a static JS call to a shortened list provided by planet.raku.org ? 17:38
nemokosch Well, I'm not sure if I get you but maybe I can just say how it went down 17:43
the current raku.org workflow is basically a cronjob running on a host who-knows-where 17:44
this cronjob does a few things: it updates the repo, rebuilds the site, and fetches the new blog posts into a JSON
so when this idea came to build an image for all content states, I thought, let's just get rid of the blog post fetching, so stupid, the client could just do this 17:45
it turned out that there are no great real-time ways to deal with a hefty XML in the first place. Perhaps building a DOM could still be fast enough but it's a waste of resources 17:46
and this is when it hit me: the whole reason for this preprocessing in the cronjob and then only serving the JSON is most probably that you wouldn't want to charge all visitors by a 4MB and growing XML for something as mundane as showing 7 titles with 7 links 17:47
basically there were two parallel things in the cronjob: building the site, and building this mini API that is a static JSON file 17:48
for now, I think it's workable to just steal this mini API from the actually running raku.org instance, so that it can serve whatever other instance of the website 17:49
but ultimately if we do want to replace the running raku.org instance, something should provide this service, and it's preferrable that it not be built into the static website itself 17:50
[Coke] wonders if we could write an azure function that used cro, or if the overhead of getting raku & cro in there is too much 17:53
nemokosch for planet.raku.org and blog post aggregation, that could make sense 17:57
that's currently pretty much untouchable, using some tool called perlanet
tonyo any ideas on how to get set a variable in an outer context like that? 18:00
ugexe m: my $a; sub a { CALLERS::<$a> = 5; }; a; dd $a 18:06
camelia Int $a = 5
tonyo i can't get callers out far enough from the package 18:09
i can find the lexical scope using nqp but can't seem to bind to it's pad
tbrowder__ language police: its, its, its.... 20:39
hey, tonyo, working on yr book at all? 20:40
tonyo yea yea, i always have to go back and correct that one when writing 20:42
which book?
tonyo my computer borked and i lost all of one of them and partial of another 21:28
tbrowder__ y 22:57
i thought you said some time ago you were thinking about writing a book by expanding a doc on one of yr projects 23:00
on my todo list is to use yr article on the website to put my contact db online for friends and family 23:02