IRC channel logs

2023-02-14.log

back to list of logs

<lechner>Hi, would someone please point me into the right direction as to how to declare and use nested records with guile-json? The child record is being encoded a second time as a string http://paste.debian.net/1270645
<lechner>i think the issue is in line 29
<old>mfiano: I'm not aware fo any
<drakonis>mfiano: positive? and negative?
<mfiano>returns -1, 0, or 1 depending on the sign of a given exact/inexact number.
<old>I guess that (lambda (x) (cond ((negative? x) -1) ((positive? x) 1) (else 0)) would be it
<old>but I don't think it's anywhere in rnrs or srfi
<old>nor Guile
<mfiano>ok thanks
<lechner>nvm, i got it
<daviid>sneek: later tell akirakyle '... There is one heisenbug g-golf crash that I'll sometimes run into with "large" gsk scene graphs ...' if you just make the code available, i can try to run, reproduce and debug, i hope you can find the time to just publish the code that causes the crash, thanks! and good stud semester then ...
<sneek>Will do.
<daviid>sneek: later tell akirakyle i hope some (other) guix contributor do (find the time to) patch guix and make it so the latest v0.8.0-a.3 available to their guix users, recently a guix user did ping in this channel, thought there was a bug in g-golf, but as i did suspect, was actually trying a v0.8.0-a.3 against v0.8.0-a.1 ...
<sneek>Will do.
<daviid>old: fwiw https://gi.readthedocs.io/en/latest/writingbindableapis.html, together with https://developer.gnome.org/documentation/guidelines/programming/introspection.html - https://developer.gnome.org/documentation/ - and of course a GObject tutorial https://docs.gtk.org/gobject/tutorial.html - food for (futur) thought ...
<daviid>old: here, two examples of C and C++ libs that are (partially at least) some libs that 'later' provide
<daviid>*that are (partially at least GIntrospecatble - opencv-glib 1.0.4 https://github.com/red-data-tools/opencv-glib.git -and libvips https://www.libvips.org/API/current/binding.html
<daviid>old: in this link https://www.libvips.org/API/current/binding.html, search for gobject-introspection on that page ...
<daviid>old: libvips is fully introspectable - opencv-glib is unfortunately only 'covewrs' a (very) small subset of opencv
<daviid>old, last (but not least) - remember, GObject are 'just' C struct, but come with a bunch of well though, well designed, well written and well debugged functionality ... might be interesteing to 'play with' a tiny libpatch subset, make it introspectable ... then import its typelib in g-golf ...
<daviid>*well thought ...
<daviid>note that i (totally) disagree with two comments made at the libvips site wrt GI: (1) '... it does not cross-compile well, since typelibs include a lot of ...' well, that is none sense, as any C lib _must_ 'describe' their C struct layout, ofc :) - (2) '... installation for your users is likely to be tricky' well, not at all, once configure pass, which means user have gobject-introspection-1.0 >= xx, glib-2.0 >= yy and gobject-2.0 >=
<daviid>zz, from a user pov, it is exactly tha same as compiling any otyher C lib ...
<Zambyte>Hi, is the (ice-9 psyntax) module broken right now? Importing it breaks for me
<daviid>Zambyte: what guile version, what platform, how did you istall, how do youlaunch guile, then paste the error ... note that if/when psyntax does not work, guile itself does not even compile, so likely 'someting else' is going on, have to go though so i'll let others shimm in ...
<Zambyte>v3.0.9 on Guix. The expression (import (ice-9 psyntax)) yields: No variable named syntax? in #<module (#{ g122}#) 7f0b47c30320>
<Zambyte>Tried it from the REPL and from an R7RS library (also loaded from the REPL). Same error in both cases.
<Zambyte>I get the same error using guix shell guile --pure -C -- guile
<attila_lendvai>can i mix call-with-input-file and fibers? i mean, when the fibers lib suspends my fiber inside c-w-i-f, will it close the file? i see a closed file error that i'm unable to reason about
<attila_lendvai>for extra complexity, mkfifo named pipes are involved
<attila_lendvai>hrm, getting rid of call-with-input-file and simply using open-file "fixed" my problem... (and gave me another one)
<attila_lendvai>open-pipe* really should return with (values port pid) instead of just the port
<lloda>custom equality predicate for srfi-64? I can do (test-assert (custom=? args ...)) but i want the log to report args not #t/#f
<old>lloda: I don't think you can do something like that
<old>But let me seet
<old>hmm there's no easy way. you would have to look at how it's done in srfi-64 and implement your own
<lloda>hmm :-/
<lloda>thx
<old>I've tried this btw:
<old> (define-syntax-rule (test-string= name expected exp ...) (let-syntax ((equal? (with-ellipsis ::: (syntax-rules () ((_ args :::) (string=? args :::))))) (test-equal name expected exp ...))
<old>without success.
<old>I though that by binding equal? to a syntax-transform to string=? would work but nope
<old>since srfi-64 generates a lot of syntaxes on its own
<drakonis> https://qfpl.io/share/talks/propagators/slides.pdf time to port this to guile
<drakonis>wrenching it away from its mit scheme deps
<old>drakonis: I wanted it to do at some point after reading it in Software Design for Flexibility
<drakonis>excellent
<old>It it not that hard to do
<old>And we might want to be able to parellelize it somehow
<old>that's more tricky
<drakonis>apparently there has been work on that by ekmett in haskell
<drakonis> https://github.com/ekmett/concurrent and https://github.com/ekmett/propagators
<drakonis> https://github.com/iu-parfunc/lvars
<drakonis>old: have you published the sources anywhere?
<drakonis>if you've already gotten started on it, that is.
<old>not started :-/
<old>I'm very busy with my master thesis and new job. That and working on guile-parallel and guile-ev
<old>But I would like to start it soon
<drakonis>oh, i see.
<old>I want amb operator also
<count3rmeasure>how useful is guile-ev right now? is it stable enough to code against?
<wklew>wasn't cwebber working on a propagators impl in guile?
<sneek>dsmith-work: wb!!
<dsmith-work>Hey hey
<dsmith-work>sneek A botsnack for you
<sneek>:)
<old>count3rmeasure: https://git.sr.ht/~old/guile-ev
<old>no README yet
<old>Still writting some tests for different watchers
<old>API not stable. but you can already use the ffi
<count3rmeasure>old: word! thanks for the answer, I've definitely got use cases in mind for it
<old>here's an example of async I/O https://git.sr.ht/~old/guile-ev/tree/master/item/tests/test-io.scm
<old>I want to use guile-ev in guile-parallel for asynchronous timer and files
<old>timer tests: https://git.sr.ht/~old/guile-ev/tree/master/item/tests/test-timer.scm
<old>you have the ffi here: https://git.sr.ht/~old/guile-ev/tree/master/item/ev/ffi.scm.in
<old>the rest is wrappers with GOOPs around the ffi
<old>The difficulty reside in managing the lifetime of C structures properly
<old>the wrappers does that for you
<count3rmeasure>ahhhh
<lechner>Hi, open-pipe* inherits the caller's current-*-ports. Is that the right behavior? Called programs locally believe they are talking to a terminal https://www.gnu.org/software/guile/manual/html_node/Pipes.html
<old>count3rmeasure: let me know if you have comments of the API
<old>It's not fixed yet
<sneek>Welcome back dsmith-work :)
<count3rmeasure>old: I will!
<count3rmeasure>old: thanks for the links
<cow_2001>i miss python3 -m http.serve, but i don't want to install 1/2GiB just that. is there such a thing in guile? do i write my own?
<drakonis>yes it has that
<haugh>cow_2001, (guile)Web Server
<cow_2001>skimmed through the info bits, but i didn't spot a file server
<cow_2001>ready made one, that is
<FiskFan1999>I was wondering, does the run-server procedure handle requests concurrently, or one at a time?
<apteryx>cow_2001: yeah, the actual web server part seems left as a homework to the user
<apteryx>which is a tough sell in the face of 'python3 -m http.serve'
<cow_2001>oh well...
<cow_2001>maaan matrix is the unreliablest thing ever
<dthompson>Haunt has a simple file server https://git.dthompson.us/haunt.git/tree/haunt/serve/web-server.scm
<cow_2001>dthompson: i am cloning and looking in
<cow_2001>dthompson: (thank you)
<dthompson>:)
<flatwhatson>FiskFan1999: fibers provides a concurrent web server for guile: https://github.com/wingo/fibers/wiki/Manual#44-concurrent-web-server
<FiskFan1999>thanks flatwhatson
<flatwhatson>with the same handler interface as the built-in web servers, so you can swap out different server implementations