IRC channel logs

2025-02-13.log

back to list of logs

<cow_2001>how do you do exact number of items in guile peg? like in regular expressions you do (blah){3,9} for 3 to 9 both inclusive number of blah
<cow_2001>do i have to do (or foo-3 foo-4 foo-5 foo-6 foo-7 foo-8 foo-9) where foo-3 is something like (and foo foo foo) and foo-4 is something like (and foo foo foo foo) and so on?
<cow_2001>oh right. the first (and ...) is chosen, so it should start with the higher number
<cow_2001>no, that is not it
<cow_2001>hmm
<cow_2001>also, how do you match on the start of string?
<cow_2001>like ^ and $ in regular expressions
<cow_2001>(not-followed-by peg-any) is how you do $
<__monty__>When I run the REPL control characters like backspace or arrow keys are echoed rather than erasing or scrolling through input history. Anyone know why that might be?
<sneek>__monty__, you have 1 message!
<sneek>__monty__, mattrw says: I used to effectively set -O0 in guile using https://paste.debian.net/1199535/ and running (noopt) but I think that broke recently (3.0.X, X > 2 ??)
<__monty__>That seems like a misdirected message to me.
<__monty__>Not sure who runs the bot.
<daviid>__monty__: see 4.4.2 Readline in the manual
<daviid>__monty__: but fyi, most of us use emacs and geiser
<daviid>__monty__: https://www.nongnu.org/geiser/
<cow_2001>oh, okay. it will match only if the rule matches the start
<__monty__>daviid: Ah, thanks. No way to have that in a local file rather than in my $HOME?
<__monty__>I guess I can just pass a local file using `-l`.
<stirl>What is the recommended way to deal with guile packages? should I just get them from guix? or is there a package management tool that is good to use?
<cbaines>stirl, guix is my preference, but plenty of other package managers aso have packages for guile things
<stirl>ping cbaines, anything I should be wary of when running guix on fedora? Is it a messy process? I haven't looked into it much
<cbaines>if you're using selinux, then that might require some configuring to get things working
<cbaines>I don't use Fedora though, so I can't really help
<stirl>no problem, thanks for the tip
<Codeko>Hi, I'm developing a text editor in C with guile embedded. It's grown quite large, and while i pass some C functions to scheme and have an init.scm, i don't do much in scheme as im not very proficient with it. Most of the editor's infrastructure is in C, which i prefer. It has a globals.c file with all global variables https://bpa.st/YJGA. I attempted to convert all global variables to SCM objects using snarfing. After a night of
<Codeko>fixing compilation errors, the editor compiled but had scheme runtime errors, mainly type and 0x0 errors. This change also introduced significant noise to the code, making it harder to read and modify. I reverted back to the last commit. I've been postponing a decision on this while working on other parts of the editor. However, i have to implement an object-based undo system and runtime global variable inspection/modification. Should
<Codeko>i write a tiny lisp designed for my editor, or stick with guile? I really can't decide. I'd have to guess.
<rlb>I'd use guile, but if possible, I might try to move things to scheme more incrementally until becoming more confident wrt the arrangements. I imagine you've seen the manual wrt "Programming in C", etc.
<rlb>Well, I'd lean toward guile, but in the end, it'd depend on the situation.
<rlb>And before writing my own instead of guile, I'd probably also look at other alternatives.
<duncan>the question here is perhaps not one of scheme vs guile but one of using an existing scheme, vs building one's own extension implementation
<rlb>I was thinking of other schemes and even things like https://fennel-lang.org/, though I haven't played with it yet. I'm sure there are many options, and for me I presume it'd depend a good deal on my requirements/preferences.