IRC channel logs

2022-01-28.log

back to list of logs

<stis>hmm ok
<stis>Sould I make a reader macro that inline python expressions? WDYT
<stis>For python on guile
<drakonis>sure why not
<stis>Any sugestion how to prefix it? like #"f(x,*l)[n.m].sort()"
<stis>or #py f(x,*l)[n.m].sort(), using the parser
<drakonis>i think guile already has procedures that allow you to read inlined code
<chrislck>sneek: botsnack
<sneek>:)
<drakonis>it just doesn't come with any fancy syntax for that
<mwette>In nyacc, I use #<lang: ... >#; e.g., #<javascript: var a = 1 >#
<drakonis>eval-string
<mwette> https://git.savannah.nongnu.org/cgit/nyacc.git/tree/examples/nyacc/lang/nx-lib.scm#n206 line 205
<drakonis>welp, time to start writing an event loop library
<dsmith>drakonis: Something like libevent?
<drakonis>in guile?
<dsmith>Like the C libevent (or is it libev ?)
<drakonis>libuv?
<drakonis>wasnt sure if i wanted to pull in more C dependencies for guile and guix
<dsmith>drakonis: Um. I was asking if the event loop library you talking about will something like the C lib{ev,event} library.
<drakonis>oh
<drakonis>probably.
<drakonis>yes.
<drakonis>the answer is very likely to be yes.
<drakonis>i'll reference them while implementing it in guile
<dsmith>Is fibers like that? (I've never looked at fibers)
<dsmith> https://github.com/wingo/fibers
<drakonis>fibers uses cml semantics
<drakonis>could probably be useful
<drakonis>looks like i can use it for that
<drakonis>there's also 8sync
<drakonis>ah and goblins, but that one's still not there yet
<drakonis>plenty of options in this front.
<drakonis>8sync already provides event loop features
<mwette>I think libevent is a wrapper for epoll and the bsd equiv.; there are ffi wrappers in nyacc
<mwette>Fibers was written on top of epoll (when I first checked) but may support others (kqueue) now??
<dsmith>sneek: bugs?
<sneek>Someone once said bugs is Send reports to bug-guile@gnu.org, and see bug reports at https://bugs.gnu.org/guile
<stis>hmm python on guile have bitrot, got it to compile better now
<stis>on latest and greatest guile
<stis>at least it now compiles some of the py librray files
<stis>i'm not compiled everything yet ....
<dsmith>nckx: Updated patch sent
<daviid>drakonis: guile-a-sync3 https://github.com/ChrisVine/guile-a-sync3/wiki
<dsmith>A few years ago, I read that wingo modeled fibers on Go channels. So looked into Go.
<dsmith>Was very easy to learn, and seemed a fine Python replacement (with static types!)
<dsmith>But there was a lot of talk comparing Go with Rust. So I started looking into Rust.
<dsmith>Wish I had Rust 20-30 years ago.
<dsmith>And it's really weird, for some reason, I've now got this strange desire to re-write stuff in Rust.
<daviid>instead of scheme?
<drakonis>i thought it was modelled after concurrent ml?
<daviid>or your python, go experiements
<dsmith>Instead of C.
<daviid>ah, i was ready to call the doctor for you :):)
<daviid>drakonis: ialso thought it was modeled after concurrent ml
<daviid>ifind rust very difficult to read, C is much better :):)
<daviid>saying this because i had to lookat some gtk4-rust example, which i find next to unreadable, terrible
<daviid>anyway, i shall get back to work :)
<dsmith>Yeah, I was kindof dissapointed at first. Go is much prettier.
<daviid>"...all we need is ... (guile) scheme :)"
<daviid>drakonis: i was mentioning guile-a-sync not to 'compete' with fibers, but because it offers various loop-event strategy, even one using GLib, and has an implementation that uses guile-gi and another using g-golf
<daviid>drakonis: you don't want to write a event loop 'on your own', unless for studying reasons ...
<daviid>not even a binding, it's all out there already ...
<drakonis>studying reasons, sure.
<drakonis>also it goes into guix and shepherd once it is done
<daviid>drakonis: for lerning reasons, fine, to get in shepherd, then pick fibers or guile-a-sync, imo
<drakonis>i also need something to stick into the guix daemon rewrite
<daviid>i think the secret plan is to get fibers in core guile at some point
<drakonis>i'm going to do fibers, yes.
<drakonis>if i have to use a library to implement it, its probably going to be fibers.
<drakonis>i have some mostly grandiose plans for the post rewrite daemon
<drakonis>emphasis on mostly.
<drakonis>guile-a-sync3 seems very nice though
<drakonis>but it replaces a large amount of features already in baseline guile
<drakonis>correction, it combines a whole lot of them together
<drakonis>anyways, i think fibers might be a better fit because it provides the flexibility i want
<drakonis>at least from my understanding.
<drakonis>i also like the semantics.
<drakonis>daviid: do you know anything about guile being able to enter sub-repls on demand?
<drakonis>ie: whenever someone connects, spawn a sub-repl that does not interact with other running instances but is a mirror of the original at spawning?
<daviid>drakonis: is that even possible?
<drakonis>there have been attempts to do that with schemes
<dsmith>Sounds like fork
<drakonis>there's a paper on it
<drakonis>i take that it isn't available on guile
<daviid>but no, i don't know 'anything about that' - my knowledge is admittedly limited in that domain though, i use(d) spawn-server-any-port for my clutter examples, but that's about it
<drakonis> https://blog.sigplan.org/2021/08/12/reflective-towers-of-interpreters/
<drakonis>this one
<drakonis> https://dl.acm.org/doi/10.1145/3158140 the paper by the authors
<drakonis>nested repls
<drakonis>i'm asking because i'm having a bit of a weird thought about how to handle a multi-user repl running in a daemon
<drakonis>getting ahead of myself because i havent finished the important parts of the daemon rewrite
<drakonis>hm, looks like fibers needs to be touched up
<drakonis>its using deprecated guile code
***daviid` is now known as daviid
<dsmith>drakonis: Ya, bitrot always seems to set in.
<allana>Hi guile! newbie question: I am using nyacc to create a FFI to C library. If I want to call a C function in that library that has an argument for a buffer to write to, is there a scheme expression for constructing a buffer?
<allana>(and is that even a good idea)
<mwette>You need to create the buffer. I guess the argument is a pointer. So you can use make-bytevector to create the buffer.
<allana>mwette: thanks
<mwette>I believe nyacc will handle the bytevector->pointer convertion for you. (let ((bv (make-bytevector xx))) (f bv))
<sneek>dsmith-work: Greetings :D
<dsmith-work>Happy Friday, Guilers!!
<sneek>wb chrislck!!
<chrislck>sneek: botsnack
<sneek>:)
<chrislck>is sneek botsnacking me?
<wingo>:)
<dsmith-work>chrislck: It likes you.
*chrislck wags tail
<dsmith-work>hah!
<drakonis>wingo: any plans to merge fibers into mainline guile?
<lampilelo>does scm_malloc() ensure that the SCM fields of a struct allocated by it are tracked by the gc (i don't mean managed by the gc, just tracked for references to SCM objects)? based on what i read in the manual, i lean towards "no", but i'm not 100% sure
<ArneBab>Is there a way to get SSL support in the web module? I’d like to avoid setting up a full-blown server just to terminate SSL connections.
<lilyp>lampilelo: there should be a gc_malloc and gc_malloc_pointerless IIRC
<lampilelo>lilyp: i know, that's not what i was asking about, i guess i'll have to check the source to be certain