🦋 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.
ugexe I’d probably use Cro::FastCGI then 00:42
Cro::FCGI rather
01:32 MasterDuke left 01:48 epony joined
Voldenet I like using plain http server more (Cro::HTTP::Server), because it's sufficiently fast and easier to reason about 02:07
It's not the general rule, but in a lot of languages http server is also faster than fcgi 02:08
and since Cro::FastCGI is supposed to be drop-in replacement, fcgi can be added later 02:15
02:23 epony left 02:27 epony joined 02:42 kylese joined 02:43 hulk left 03:15 kylese left, kylese joined 03:28 k3ut0i joined 03:30 kylese left 03:35 kylese joined
tonyo sparrow is another good option 03:54
not sparrow, rather 03:55
humming-bird
04:34 maylay left 04:43 maylay joined 05:10 Guest1 left 05:20 jpn joined 05:25 jpn left 05:27 tejr left 06:27 tejr joined 07:21 derpydoo joined 07:29 epony left 07:38 epony joined 07:53 k3ut0i left 08:19 jpn joined 08:24 jpn left 09:00 jpn joined 09:04 jpn left 09:14 jpn joined 09:18 melezhik joined
melezhik My 2 cents. I you want something simple and lightweight ( just a few deps ) then use humming bird , cro is more mature solution but comes with more dependencies overhead and sometimes harder to debug ( cause it involves a lot of calls along a stack trace and some of them are not trivial to comprehend , especially when it comes to cro templates 09:23
errors or cro routes errors ) . Humming bird does not have template engine out of the box . So I have used both of them and they have pros and cons . SparrowCI and sparky runs on cro , internal job web site runs on HB and I am quite satisfied with that.
09:28 melezhik left 10:06 sena_kun joined 10:10 Summer left
nemokosch Adding an own template engine is kind of a weird flex for most web frameworks imo 10:10
melezhik Why ? 10:11
nemokosch Because templating is just a bunch of glorified opinions anyway. It's not like there are considerably better or worse options or any need to reinvent it for the umpteenth time 10:13
melezhik I mean not necessarily own template engine , but support of existing , I always find this useful , so a user don’t spend time on integration…
nemokosch I'm specifically talking about $yet-another-amazing-template-system 10:14
melezhik Yeah
nemokosch Integrating an existing, well-established system is fine and reasonable
Of course this is all the funnier if the language happens to be PHP 10:15
melezhik I mean I would be quite happy with any template engine supported out if the box in a web framework so I just don’t spend time on integration , and I agree all in all the are “all the same” , it’s just the matter of a choice and taste
nemokosch Symfony brings its own template system called Twig. And frankly, the arguments they themselves list for using it over vanilla PHP are anything but convincing lol 10:17
melezhik Like am I am not a huge fan or cro template engine , but after all it’s better then nothing
nemokosch Maybe the one about security. But then I'm pretty sure Twig also allows one to inject code and then what was all the hassle for 10:18
melezhik Ok … 10:19
nemokosch This is also why YAML seems to be going the wrong way, neglecting its own very niche and purpose
The world doesn't need another scripting language, that's what the world needs the least
melezhik You mean in a sense of using it as a tempting system for web or ?
nemokosch I mean that YAML is a data language. Data that a system gives meaning to. Because people hated writing and reading XML and later JSON as well 10:21
YAML has references and attribute flattening. These are fairly essential data composition operations. However, it's not meant to allow "take every odd value and multiply them by two" kind of hacks. This sort of configurability kills portability and simplicity, aka the sole purpose 10:25
When somebody replaces PHP for a scriptable template system, it's the same thing.
PHP is the scriptable template system 10:26
Of course this applies for PHP frameworks, not the whole world. The whole world should just decide a bunch of scriptable(? maybe not) template systems to use 10:27
11:16 jpn left 11:33 abraxxa-home joined 11:49 k3ut0i joined 11:59 Sgeo left 13:13 jpn joined 13:20 jpn left 14:09 jpn joined 14:13 jpn left 14:23 jpn joined 14:29 jpn left 15:11 k3ut0i left 15:19 Guest1 joined 15:26 _________ left 15:28 _________ joined 15:36 jpn joined 15:40 jpn left
jdv should? why don't we all use asm or c or python then - no need for alternatives 15:42
i've only used cro's template stuff once but it seemed decently raku/minimal-ish 15:45
with how powerful interoplation is in raku i'd contend it might be enough natively for "web/html templating" 15:46
16:00 stanrifkin_ joined 16:02 _________ left
nemokosch for template systems, really there should be like 3 options and that's it 16:10
16:10 _________ joined
just like for data exchange XML was dominant once upon and now it's fairly obviously all JSON, no alternatives 16:11
jdv i have written a simple xml generation "subsystem" in raku before for a project and it was delighful - all 100% just raku string interp 16:14
the only slightly annoying part was getting it all "pretty/lined up" but that's probably something stupid on my part 16:15
tinita nemokosch: what's attribute flattening? 16:22
nemokosch that you can combine key-value pairs from different YAML object references into one object 16:28
tinita nemokosch: ah, so I assume you mean the << merge key? 16:29
nemokosch yes
once upon I considered using YAML to replace the baked CSON files (awk hackery) in the Raku highlighter plugin - it turned out that it has no similar flattening for lists. Not because there weren't hundreds of people that asked about it before or dozens of people who requested it, "just because" 16:31
so suddenly there was no point in using YAML and eventually I used plain Raku code that defines Maps and references some dynamic variables that I documented in comments 16:32
tinita nemokosch: it would be easy to implement though with a custom tag. e.g. !concat [*seq1, *seq1, ...] 16:34
nemokosch so by essentially running code? 16:35
tinita the merge key will also internally run code, yeah. it's basically the same mechanism
nemokosch I mean "internally" all parsed data runs code but it makes a huge difference what the provided interface is. For data description, the interface should be tight and the least scriptable because that's more secure and portable 16:36
tinita the parser itself does not know anything about merge keys. it's detected by the constructor as the !!merge tag
nemokosch well, how to put it. You are essentially saying that it's worse than I assumed, or I don't know 16:37
tinita so a custom !concat tag and the implicit !!merge tag will both run some code during construction
maybe, that depends on how you define worse =) 16:38
nemokosch the point is all the same: there shouldn't be all this custom scriptability; there should be reasonable fundamentals
and I'm kind of butthurt about this, if that's the right word to use, because most people simply don't get the chance to roll out their technology and get it used by millions
not understanding - or worse, ignoring - what one got entrusted with feels so... wrong 16:39
antononcube This is exactly what I hear when I (try to) discuss my Machine Learning (ML) template engines. (One made with Mathematica, the other with Raku.) 16:42
tinita at work we are using YAML::PP with files that use << plus the custom !include tag to load files. so it's really helpful
aws is using custom tags to make the files less verbose
nemokosch at that point, they could really be using any scripting language, except sunk cost is strong 16:43
tinita ansible is also using a custom tag, !vault
antononcube @nemokosch Thanks! I was just going to ask would it better make additional ML templates with/via YAML. 16:44
nemokosch and they really could be using anything because from all I know, these YAML files are anything but portable and basically depend on the underlying system to be secure
antononcube One of my mistakes was to base my template engines on CSV files -- I should have used JSON from the get go. 16:45
tinita *shrug* they could be, but they aren't. I guess we can agree to disagree =)
nemokosch it's the same story as Markdown (with all the flavors) except worse (because Markdown is still recognizable as what it was meant to be)
antononcube Markdown rules! (Meaning, most likely, I am not using Pod6 for anything serious anytime soon.) 16:46
nemokosch And then one asks "which markdown" and you see how it went wrong 16:47
antononcube 🙂 🙂 Comes with the territory. But, in my case it is easy -- the one supported by GitHub. 16:48
I mentioned this before -- in order the debug the Markdown parser I work on, I use its Pod6 interpreter. 16:49
nemokosch it's almost a cliché, an elaborate version of the second system syndrome, that once something fulfills its purpose just perfectly, it's damned to lose its original purpose
now Markdown still kind of retains its original purpose I guess because I haven't seen Markdown that stopped looking like mildly decorated text
antononcube Please, come up with proper "marketable" name and write 5-6 paragraphs describing it in more detail. 16:50
nemokosch but YAML doesn't. All that YAML in the cloud world is basically a custom language hardwired to the platform and they resemble each other without having virtually any benefits of that resemblance 16:51
antononcube I think dependencies on Markdown tables and/or Mermaid diagrams can make it less decorated.
Actually, Mermaid diagrams are just a bonus, so, they should not be taken into account. 16:52
nemokosch it's suddenly a half-assed scripting language with custom extensions that bears no value as a universal data description language competing with JSON (or XML and TOML at times)
antononcube As for something that is a "decorated" Markdown, I think that is Markdeep.
nemokosch it is competing with EVALFILE invoked on Raku code 16:53
oh Mermaid diagrams are already quite far fetched 😄 16:54
doesn't even seem to be text-oriented
antononcube I think YAML fits well with Markdown from a "data scientist" perspective. For example, YAML is used a lot in RStudio / Quarto notebooks. 16:55
nemokosch and for YAML, it really is a shame that it's not really universal because it would have been almost banal to just improve over JSON by adding references and maybe some essential composability, like one dedicated operation or two 16:56
I'm kind of embarrassed myself that I found it so obvious that custom concatenation of CSON files using awk is unmaintainable, unreadable and has to go - and then the best I could come up with was turning all the data into some Raku expression with dynamic variables that I documented in some comments 17:00
antononcube Yeah, using templates is very tempting. 17:01
nemokosch yeah... at the end of the day, it pretty much was some template files, that's one way to look at them 17:02
except preferably a structural template, not a textual template 17:03
antononcube This is what I have been doing mostly in the last few days -- template programming. (See "JavaScripdt::D3".) 17:04
jdv idk. part of the pros of json to me is its severe restrain and minimalism 17:31
give people a bit of nonsense and they'll amplify it no matter what it seems 17:32
its a similar sentiment to why i sometimes write stuff in shell - force it to stay "simpler" cause peeps love to jamb shit in everywhere that has no place being there 17:33
librasteve yep 17:39
btw - found this ... www.stilldrinking.org/programming-sucks ... seems apposite to the YAML conversation 17:43
17:52 jpn joined 17:56 jpn left 18:24 epony left 18:38 epony joined 19:25 jpn joined 19:34 jpn left 19:38 jpn joined
nemokosch yes, and the sentiment seems to be quite similar 19:45
antononcube @jdv I try to have a CLI script to access the functionalities of almost all of my Raku packages. I think this should be some sort of unwritten rule for packages submitted to raku.land. 19:51
19:58 jpn left 20:03 lizmat_ joined 20:06 lizmat left 20:24 jpn joined
tonyo melezhik: humming-bird and Ryml are great together, too. ryml gives you type support in your template (and it's all raku) 20:26
nemokosch Ryml is basically HTML::Tag with less clumsy syntax 20:30
20:31 jpn left
melezhik I will check it out, thanks @tonyo 20:33
tonyo ahh yea, wish i'd seen that one first. ryml is all generated code, there was some thought into how to do that with XSDs too to make them type safe just haven't gotten around to it 20:35
20:40 Guest1 left 20:44 jpn joined 20:48 jpn left
nemokosch well I could say the other way around as well - maybe if Ryml was around when I needed a more convenient way to generate HTML, I would have chosen that 😄 21:06
21:10 stanrifkin_ left 21:20 abraxxa-home left 21:31 elcaro left, elcaro joined 21:40 Summer joined 21:41 jpn joined 21:46 jpn left 21:49 jpn joined 21:54 jpn left 22:15 jpn joined 22:20 jpn left 22:26 jpn joined
antononcube Any chess players around? (Hmm... in the Raku community as whole.) 22:32
I plan to make two chess-related personas for LLM-didactic purposes. It would be nice if someone(s) test them. (Using Raku.) 22:33
jdv not since hs chess club. circa late 90s:)
antononcube @jdv You qualify! Do you have OpenAI / ChatGPT account and API key? 22:34
jdv maybe 22:35
antononcube Great! There are three options, using: 1) Raku REPL 2) Raku chatbook 3) ChatGPT's interface 22:36
jdv can you email? 22:37
antononcube I am interested in people interested in the first 2. 🙂
jdv i can try i guess
antononcube @jdv What do you mean? To email you the Raku script / notebook?
I will most likely put the prompt and the related setup and experiments in GitHub. 22:38
jdv cool. just wut u want me tp do. 22:39
im a bit distracted atm 22:40
antononcube Ok. I will put a list and a demo.
jdv thanks
22:42 jpn left 22:58 Tekk left 23:20 sena_kun left
antononcube @jdv Basically, no need -- GPT sucks at chess. (Not a big surprise...) 23:20
Or, more precisely, ChatGPT-4 sucks at chess when FEN notation is used. 23:21
jdv oof 23:23
drawing board?
antononcube No, misplacing pieces and pawns. 23:25
I plan to report that in a blog post. 🙂 I am glad I have that evidence.
jdv cool. i meant the classic "back to the drawing board":) 23:27
maybe theres another way
tonyo antoncube i still play a bit
antononcube Yeah, some other clever prompting... Maybe, but I doubt it. I strongly suspect it is a waste of time. 23:28
jdv alright 23:29
antononcube Here is my prompt:
> You are a ChessMaster engaged in a text-based chess game. You play the opponent, usually with the black chess pieces and pawns. > The game should be easy to follow and adhere to standard chess rules. > > Here is how you behave: > > - Forsyth-Edwards Notation (FEN) strings to communicate the state of the gameplay > > - Ensure you play by standard chess rules. > > - Ensure the game interprets and executes
these moves correctly > > - Allow the player to input using > 1. Algebraic Notation (AN) input, for example, "e2 to e4" to move a pawn > 2. Descriptive input, like, "biship from a3 to f8" > > - When the user gives you AN string you respond with three strings: > 1. FEN position after user's AN input is played > 2. Your move given as AN string > 3. FEN position after your AN move is played > > - If asked
provide clear feedback to the player after each move, including the move itself > - For example, "You moved: e2 to e4" and "Opponent moved: e7 to e5". > > - If asked provide player guidance > - Include in-game guidance resources or instructions that explain chess rules, move input, and special conditions like check and checkmate > > - Proclaim when the user gives you AN move that is wrong, non-complient with the
stanard chess rules. > > - When the user asks you to start a game without specifying a FEN string: > - You give the standard initial position as start > > - You play the black opponent, the user the white, except if the user says that he plays the black side
jdv whoa:)
tonyo chess is a little too open ended, there's some videos of levy r and hikaru trying to play gpt and after 20 or 30 moves it loses game context and starts making illegal/bad moves
antononcube Good to know! Mine started illegal moves almost right away. 23:30
jdv youd think gpt has it in there somewhere
but maybe the context and spread is a bit much... 23:31
tonyo is 4 the newest one? they had to do something to make it even playable 23:34
antononcube Yes, but the newest one has several incarnatinos. Mostly, number of tokens related. (Input/output-wise.)
tonyo i wonder if limiting its moves to something that's been played before and has the highest chance of winning is a key to making it work, then it's just acting as a big dumb db 23:35
antononcube Here is how the chess game with the prompt above looks like (using Raku chatbook): 23:37
cdn.discordapp.com/attachments/633...069d7&
Notice the wrong placement of the white bishop!
jdv fun 23:39