IRC channel logs

2019-09-24.log

back to list of logs

***catonano_ is now known as catonano
<wingo>ArneBab: fwiw the read benchmarks will differ between guile 1.8 and guile 2 or later depending on your locale; 1.8 does no encoding conversion
<heisenberg-25>Hi, how do you run tests in guile? I using srfi-64 for writing the tests
<civodul>heisenberg-25: i use srfi-64 and Automake with its "test driver" for SRFI-64
<civodul>see for example https://notabug.org/cwebber/guile-gcrypt
<heisenberg-25>civodul: This is exactly what I am looking for. Thanks
<chrislck>heisenberg-25: I use a custom test-runner see https://github.com/Gnucash/gnucash/blob/maint/libgnucash/engine/test/srfi64-extras.scm#L23 I think gives nicer output
<nly>hi
<heisenberg-25>chrislck: Okay I will check it out. Is it available as a separate module though?
<chrislck>huh no just copy and paste
<heisenberg-25>oh, I didn't open file and looking at it it only depends on srfi-64. Thanks
<chrislck>here's example usage https://github.com/Gnucash/gnucash/blob/maint/libgnucash/app-utils/test/test-date-utilities.scm
<lispmacs>is the a scheme project around providing something like a i/o buffer management framework?
<lispmacs>*there
<lispmacs>e.g., something like this: https://www.gnuradio.org/blog/2017-01-05-buffers/
<lispmacs>or maybe a C based framework I could wrap with a guile scheme interface?
<jcowan>Not that I know of
<lispmacs>I guess I could make one, but it would be "yet another subproject" of my project
<jcowan>I've sketched out something for ring buffers, but I had characters in mind, not other buffers. Still, the idea is much the same. I copied most of it from Elisp anyway.
<jcowan> https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/BuffersCowan.md
<jcowan>It would be easy to generalize the elements to be any Scheme objects
<jcowan>sorry, no, brain fart on my part: those are gap buffers
<lispmacs>ack, more code hidden behind the great wall of CloudFront!
<roptat>what's a good way to do multithreading with guile? I've tried guile-fibers and it's very fun, but I also use sdl that needs to run on just one thread (running it on a fiber means it can switch threads apparently)
*civodul thinks it's a question for davexunit and the other games 'round here :-)
<roptat>I found (ice-9 threads) and (srfi srfi-18) in the manual, but I'm not sure which I should use (if any)?
<roptat>it's confusing how so many things are reimplemented twice with small differences in different modules
<civodul>srfi-18 is just a layer above the core thread primitives
<civodul>an overall thing layer, just a bit too thick in some places
<civodul>*thin
<civodul>there's also (ice-9 futures)
<civodul>i guess it all depends on the type of program you have
<civodul>if you want parallel computations, i'd say futures
<civodul>if you want an event loop *and* parallelism, fibers
<civodul>if you want something fairly specific to placate SDL and what not, (ice-9 threads)
<roptat>I'll go with ice-9
<civodul>:-)
<davexunit>roptat: you can multithread all you want, you just need to make sure that all SDL stuff happens on the main thread.
<davexunit>personally I haven't done multi-threaded programs with SDL yet.
<roptat>I'm not sure how to get communication actually
<roptat>the fibers part is supposed to do something and give feedback to the SDL part
<roptat>I'm not sure how to pass values between threads
<davexunit>I don't know if fibers will work well with sdl unless you force fibers to use a single thrad
<davexunit>thread*
<davexunit>because you don't have control over which pthread your fibers will run in
<roptat>exactly, I already tried that and failed
<davexunit>one of those times where C and Scheme aren't going to get along
<roptat>that's why I'm looking for a way to run SDL on a separate thread, and separate from the process I have in fibers
<davexunit>you could do that if you added some thread-safe message passing mechanism similar to fiber's channels
<roptat>the question is how to do it?
*heisenberg-25 also wants to know the answer to roptat's question
<davexunit>roptat: I guess you'll want to use the mutexes and stuff that guile provides
<chrislck>quick question about macros: I have a macro in X.scm (define-syntax macro... ) being (export macro), and later X.scm has (load-from-path "Y.scm"). it seems Y.scm cannot access the macro... any quick solution other than duplicating macro into Y.scm?
<chrislck>(obv I've confirmed duplicating macro in Y does work)
<civodul>roptat: maybe you can have an actual thread not managed by Fibers and dedicated to SDL, and use Fibers for the rest of your program
<civodul>the SDL thread could still put/get messages on channels
<davexunit>can you use channels from "outside"? I wasn't aware of that ability
<civodul>yes, i think so
<davexunit>neat. that seems like the way to go, then.
<amz3>yes you can
<chrislck>sneek: botsnack
<sneek>:)
<amz3>chrislck: try to move the macro to another file that is NOT a module and then use include form https://www.gnu.org/software/guile/manual/html_node/Local-Inclusion.html#index-include
<roptat>oh, nice
<roptat>I'll try that
<amz3>roptat: see https://github.com/wingo/fibers/wiki/Manual#user-content-index-get_002dmessage
<amz3>the very last sentence.
<chrislck>amz3: thank you! this trips me up
<heisenberg-25>is there any real-world or toy example of fibers? I am looking to improve my threading code
<amz3>heisenberg-25: there is many examples in fibers repository
<amz3>s/many/several/
<heisenberg-25>amz3: thanks
<heisenberg-25>Anyone had this error `In procedure mkstemp!: Permission denied` while importing a locally build library
<amz3>heisenberg-25: are you using guix?
<amz3>or guix os?
<heisenberg-25>No. I am using ubuntu :)
<heisenberg-25>I am rebuilding guile 2.9.3 again
***logicmoo is now known as dmiles