Re: Recommended project structure

2023-06-09 Thread Olivier Dion via General Guile related discussions
On Fri, 09 Jun 2023, wolf wrote: > On 2023-06-08 23:33:47 -0400, Olivier Dion wrote: >> On Fri, 09 Jun 2023, wolf wrote: > That is pretty embarrassing mistake on my part, the link is: > https://www.erikedrosa.com/2017/10/29/guile-projects-with-autotools.html > . I had a quick look at it and I

Re: Recommended project structure

2023-06-08 Thread Olivier Dion via General Guile related discussions
On Fri, 09 Jun 2023, wolf wrote: > Greetings, > > I am starting a small, personal project and I want to write it in GNU Guile, > since I really like it so far. However, since one of the major goals is for > this to be a learning experience and doing it "the right way", I wanted to ask > about

Re: Static site generator

2023-01-13 Thread Olivier Dion via General Guile related discussions
On Fri, 13 Jan 2023, James Crake-Merani wrote: > Hi, > > I was wondering if you guys are aware of any static site generators > written in Guile. I'm looking for something that can be extended in > Guile so I can write my own code for it in Scheme. I'm aware of GNU > Artanis but to my knowledge

Re: [ANN] Guile-Parallel 1.0.0 released

2023-01-08 Thread Olivier Dion via General Guile related discussions
On Sun, 08 Jan 2023, Zelphir Kaltstahl wrote: > > user@user-desktop:~/dev/advent-of-code-2022/day-14$ guix shell \ >> --file=guile-parallel/.guix.scm \ >> --with-source=guile-parallel=guile-parallel > user@user-desktop:~/dev/advent-of-code-2022/day-14$ guile Try with:

Re: [ANN] Guile-Parallel 1.0.0 released

2023-01-08 Thread Olivier Dion via General Guile related discussions
On Sun, 08 Jan 2023, Zelphir Kaltstahl wrote: > On 12/31/22 21:31, Olivier Dion wrote: >> On Sat, 31 Dec 2022, Zelphir Kaltstahl wrote: >> >>> Maybe I can already make use of it in coming AoC puzzles. >> Any sort of feeback is welcome! > > Hello Olivier! > > May I ask how to make use of the

Re: guile-fibers timerfd_create bug (was: Re: [ANN] Guile-Parallel 1.0.0 released)

2023-01-03 Thread Olivier Dion via General Guile related discussions
On Tue, 03 Jan 2023, Damien Mattei wrote: > no i did not test fibers ,just look at it, but perhaps it is necessary for > parallel ? i saw the configure file (of parallel) claim about fibers? > i Only for running a certain benchmark against fibers. > will download fibers and test on Mac again

Re: [ANN] Guile-Parallel 1.0.0 released

2023-01-03 Thread Olivier Dion via General Guile related discussions
On Tue, 03 Jan 2023, Damien Mattei wrote: > on Mac os i have (only) one error: > In procedure dlsym: Error resolving "timerfd_create": "dlsym(RTLD_DEFAULT, > timerfd_create): symbol not found" I can replace timerfd with timer_create(). It's POSIX compliant. -- Olivier Dion oldiob.dev

Re: [ANN] Guile-Parallel 1.0.0 released

2023-01-02 Thread Olivier Dion via General Guile related discussions
On Mon, 02 Jan 2023, Olivier Dion via General Guile related discussions wrote: > On Mon, 02 Jan 2023, Greg Troxel wrote: >> Maxime Devos writes: >> >>>> epoll is as I understand it linux only so that's not a reasonable >>>> dependency. fibers now w

Re: [ANN] Guile-Parallel 1.0.0 released

2023-01-02 Thread Olivier Dion via General Guile related discussions
On Mon, 02 Jan 2023, Greg Troxel wrote: > Maxime Devos writes: > >>> epoll is as I understand it linux only so that's not a reasonable >>> dependency. fibers now works with libevent which wraps multiple >>> faclilities and is thus pretty portable. >> >> Guile-Fibers still uses epoll on Linux,

Re: [ANN] Guile-Parallel 1.0.0 released

2023-01-02 Thread Olivier Dion via General Guile related discussions
On Mon, 02 Jan 2023, Greg Troxel wrote: > O > Olivier Dion via General Guile related discussions > writes: > >> I haven't use fibers a lot, but I think that if you ever need to handle >> asynchronous I/O, for now you should stick with fibers. Also, fibers >> wa

Re: [ANN] Guile-Parallel 1.0.0 released

2022-12-31 Thread Olivier Dion via General Guile related discussions
On Sat, 31 Dec 2022, Zelphir Kaltstahl wrote: > Maybe I can already make use of it in coming AoC puzzles. Any sort of feeback is welcome! > I am currently a bit confused about where the line is between a good use-case > for guile-parallel and guile-fibers. Or whether they could work well

[ANN] Guile-Parallel 1.0.0 released

2022-12-30 Thread Olivier Dion via General Guile related discussions
Hi Guilers, I'm happy to announce the first release of guile-parallel. A library that offers primitives for parallelization of your programs. Project page: List of features: - Userspace threads (jobs schedulers) - Safe dynamic-wind for all types of

Re: interfacing C and guile

2022-12-30 Thread Olivier Dion via General Guile related discussions
On Fri, 30 Dec 2022, Damien Mattei wrote: > there was a mistake in my previous post, i wanted to say int cfunc > (int,int,char *), suggestion answered to use '*: > > (define cfunc (foreign-library-function "libguile-cfunc" "cfunc" > #:return-type int #:arg-types (list int int '*))) > > works at

Re: list vs vector

2022-12-28 Thread Olivier Dion via General Guile related discussions
On Wed, 28 Dec 2022, Sascha Ziemann wrote: Here are the profling informations: --8<---cut here---start->8--- scheme@(guile-user)> ,profile (vxml:traverse-pre (sxml->vxml xcb) remove-whitespace) #:loop 1 % cumulative self time seconds seconds

Looking for a computation benchmark in Guile

2022-11-10 Thread Olivier Dion via General Guile related discussions
Hi, In my research on dynamic instrumentation, I would like to see what's the runtime overhead of dynamically patching function entry/exit with my tool. I can already patch every libguile function dynamically, I just need to see what's the impact on the runtime now. Here's the specification of

Re: map-par slower than map

2022-11-10 Thread Olivier Dion via General Guile related discussions
On Thu, 10 Nov 2022, Damien Mattei wrote: > Hello Zelphir, > > i finally find a possible cause of no speed up of my code, i find that > using your code the procedure keep blocked on the first 'touch at line 27 > here: > I have found a possible deadlock with Guile's mutex. In some very rare

Re: escaping from a recursive call

2022-11-10 Thread Olivier Dion via General Guile related discussions
On Thu, 10 Nov 2022, Damien Mattei wrote: > will it work well in // code with future or thread ,i'm having already > problem with // code that,compute well but show no speed up, is it because > of continuation? not being compatible with //,does macro generates > functions that causes unknown

Re: escaping from a recursive call

2022-11-09 Thread Olivier Dion via General Guile related discussions
On Wed, 09 Nov 2022, Damien Mattei wrote: > good... thank, it works, i do not know a lot about 'prompts , a good > explanation is here: > > https://stackoverflow.com/questions/29838344/what-exactly-is-a-continuation-prompt In the Guile manual: Top > API Reference > Control Mechanisms > Prompts

Re: escaping from a recursive call

2022-11-09 Thread Olivier Dion via General Guile related discussions
On Wed, 09 Nov 2022, Damien Mattei wrote: > but in the general case , i want a macro that can do it on any function > (i'm not sure it can be done because the continuation have to be captured > just before the call to the function and be inlined at the good > place) I'm not aware of any

Re: escaping from a recursive call

2022-11-09 Thread Olivier Dion via General Guile related discussions
On Wed, 09 Nov 2022, Damien Mattei wrote: > i need a way to escape not only the current call of a recursive function > (it is already done) but alls: > > example: > > (def (foo n) > (cond ((= n 0) 'end0) > ((= n 7) (return 'end7)) > (else (cons n (foo {n - 1}) Is that what you want?

Re: map-par slower than map

2022-10-13 Thread Olivier Dion via General Guile related discussions
On Thu, 13 Oct 2022, Damien Mattei wrote: > i do not see what has changed in your code ? Just copy it. Trust me it has changed. > really strange,even with bad code the moment it crash should be the same, > sometimes works,crash or freeze I don't get any of these problem .. running with

Re: map-par slower than map

2022-10-13 Thread Olivier Dion via General Guile related discussions
On Thu, 13 Oct 2022, Damien Mattei wrote: > the code did not worked when data length were more little than number of > cpus (6 on my host) (iota 5) returns #unsepcified: Yeah sorry I miss indended the output and the rest. Here's a version that should work: --8<---cut

Re: map-par slower than map

2022-10-13 Thread Olivier Dion via General Guile related discussions
On Thu, 13 Oct 2022, Damien Mattei wrote: > i trying to use your code but it seems there is a ) mismatch > somewhere? Right there's a missing ')' a the end to close the procedure, sorry about that. -- Olivier Dion oldiob.dev

Re: map-par slower than map

2022-10-13 Thread Olivier Dion via General Guile related discussions
On Thu, 13 Oct 2022, Damien Mattei wrote: > ok , i think the problem comes both from my code and from guile parmap so. > Obviously parmap could be slower on other codes because of the nature of > list i think, it is hard to split a list in sublist and send them to thread > and after redo a single

Re: map-par slower than map

2022-10-12 Thread Olivier Dion via General Guile related discussions
On Wed, 12 Oct 2022, Damien Mattei wrote: > Hello, > all is in the title, i test on a approximately 3 element list , i got > 9s with map and 3min 30s with par-map on exactly the same piece of > code!? I can only speculate here. But trying with a very simple example here:

Re: http-request bearer token syntax for Twitter v2 api

2022-10-12 Thread Olivier Dion via General Guile related discussions
On Wed, 12 Oct 2022, Mortimer Cladwell wrote: > Hi, > Has anyone successfully submitted a bearer token to Twitter v2 api using > http-request? What syntax did you use? Without success I have tried many > permutations/splellings/capitalizations of: No but I managed with sourcehut.

exit-hook never executed

2022-09-22 Thread Olivier Dion via General Guile related discussions
Hi, `exit-hook' seems to only be executed when in a REPL. Is there a way for it to be executed at the end of a none interactive program? My intend here is that I have a module that load a foreign extension and initialize its runtime so that other modules of that extension can be used. I then

Re: GC Warning: Repeated allocation of very large block

2022-09-19 Thread Olivier Dion via General Guile related discussions
On Mon, 19 Sep 2022, Damien Mattei wrote: > is this message appearing when a single scheme variable reach a given > size? This message is from the bdwgc and not from Guile itself. From their documentation: --8<---cut here---start->8--- The garbage collector

Re: How can i make executable guile file to process command line arguments?

2022-08-18 Thread Olivier Dion via General Guile related discussions
On Thu, 18 Aug 2022, Jacob Hrbek wrote: > I have this file which i use to interact with a version controlled > repository similar to a Makefile. > > How can i make it work with e.g. `./file.scm echo wheee` -> Will execute > the `(define (echo msg) ...)` and output `wheee` in the terminal? You

Re: Using Guile 2.2 modules with Guile 3

2022-08-06 Thread Olivier Dion via General Guile related discussions
On Sat, 06 Aug 2022, Maxime Devos wrote: > On 06-08-2022 17:11, Olivier Dion via General Guile related discussions > wrote: >> Hi, >> >> Say I want to use guile-dbi wich use Guile 2.2. Is there any danger for >> me to use it with Guile 3.0? I see that Guile will r

Using Guile 2.2 modules with Guile 3

2022-08-06 Thread Olivier Dion via General Guile related discussions
Hi, Say I want to use guile-dbi wich use Guile 2.2. Is there any danger for me to use it with Guile 3.0? I see that Guile will recompile the module because the already compiled one does not match, I guess. Other than that, any side effects? Regards, old -- Olivier Dion oldiob.dev

Re: mmap for guile

2022-06-26 Thread Olivier Dion via General Guile related discussions
On Sun, 26 Jun 2022, Matt Wette wrote: > flags >(logior MAP_ANON MAP_PRIVATE) Why MAP_ANON instead of MAP_ANONYMOUS. The latter is more clear and you don't have to care about compatibility like C does. Also, does MAP_FIXED or MAP_FIXED_NOREPLACE is passed to `flags' if `(not

Re: [EXT] Re: guile program distributed as single executable?

2022-06-07 Thread Olivier Dion via General Guile related discussions
On Tue, 07 Jun 2022, "Thompson, David" wrote: > It doesn't actually generate standalone binaries. It is very hacky but it > can produce redistributable tarballs for a specific use-case (games using > chickadee) by including shared libraries and other bits from the host > system. Kind of like

Re: Question about an error with ports

2022-03-11 Thread Olivier Dion via General Guile related discussions
On Fri, 11 Mar 2022, Chris Vine wrote: > On Fri, 11 Mar 2022 09:58:59 -0500 > Olivier Dion wrote: >> I'm not sure this is related to the functions themself but instead the >> underlying filedescriptor opened iwth ON_NONBLOCK? > > The problem I am referring to is different: it is that delimited >

Re: Question about an error with ports

2022-03-11 Thread Olivier Dion via General Guile related discussions
On Fri, 11 Mar 2022, Maxime Devos wrote: > Olivier Dion via General Guile related discussions schreef op do 10-03- > 2022 om 18:46 [-0500]: >> I haven't check the implementation details, but I think it's just a >> question of buffering.  `get-bytevector-n` will block just like

Re: Question about an error with ports

2022-03-11 Thread Olivier Dion via General Guile related discussions
On Fri, 11 Mar 2022, Chris Vine wrote: > On Thu, 10 Mar 2022 18:46:34 -0500 > Olivier Dion via General Guile related discussions > wrote: >> On Thu, 10 Mar 2022, Zelphir Kaltstahl wrote: >> >> > Just one question: Why is get-bytevector-some better than >&g

Re: Question about an error with ports

2022-03-10 Thread Olivier Dion via General Guile related discussions
On Thu, 10 Mar 2022, Zelphir Kaltstahl wrote: > Just one question: Why is get-bytevector-some better than > get-bytevector-n and specifying a number of bytes? I haven't check the implementation details, but I think it's just a question of buffering. `get-bytevector-n` will block just like

Re: Question about an error with ports

2022-03-10 Thread Olivier Dion via General Guile related discussions
On Thu, 10 Mar 2022, Zelphir Kaltstahl wrote: > I have the following questions: > > (1) Is the read-from-write-to procedure useful at all, or is there a better > way > to get all stuff from an input port and output it to an output port, avoiding > possibly large string values? On Linux,

Re: with-exception-handler experiment

2022-03-09 Thread Olivier Dion via General Guile related discussions
On Tue, 08 Mar 2022, Jérémy Korwin-Zmijowski wrote: > Hello Guilers, > > Hope you are all fine and safe. > > In the following code, I have a test which should check if my result is > correct. > > If you change the expected string value "1 run, 1 failed" the assert > procedure does not throw. >

Re: Exception handling - symbol for encoding exception type?

2022-03-08 Thread Olivier Dion via General Guile related discussions
On Tue, 08 Mar 2022, Zelphir Kaltstahl wrote: > I think in some other languages this would be encoded in > the type or class or the exception itself. One would catch > only exceptions of a specific type. This is a convention > inside the code, which does not necessarily spread to other >

Re: good papers on graphics in scheme/lisp?

2022-03-02 Thread Olivier Dion via General Guile related discussions
On Wed, 02 Mar 2022, Blake Shaw wrote: > Next week I will start working on my installation /Scribble Jam/ for > iLight Singapore[2], and I'm planning to do it all in Guile OpenGL + > GLSL. I've started fiddling with Guile OpenGL and it seems pretty > complete and performant (I haven't

Re: Shell commands with output to string

2022-02-23 Thread Olivier Dion via General Guile related discussions
On Thu, 24 Feb 2022, Blake Shaw wrote: > Olivier Dion via General Guile related discussions > writes: >> This is great and should be merged into the standard library of Guile. >> Maybe not at it's (I have not read everything), but this would be trully >> benifical to all

Re: Shell commands with output to string

2022-02-23 Thread Olivier Dion via General Guile related discussions
On Wed, 23 Feb 2022, Zelphir Kaltstahl wrote: >> There's ton of missing stuffs in the standard library IMO. On top of my >> head, filesystem paths manipulation (e.g. path-join) is also one that is >> probably getting re-invented a lots. > > I actually made something for that, trying to copy

Re: Shell commands with output to string

2022-02-22 Thread Olivier Dion via General Guile related discussions
On Tue, 22 Feb 2022, Leo Butler wrote: > Olivier Dion via General Guile related discussions > writes: > >> On Tue, 22 Feb 2022, Zelphir Kaltstahl wrote: >>> Hello Guile users! >>> >>> How would I run a shell command from inside Guile and get its out

Re: Shell commands with output to string

2022-02-22 Thread Olivier Dion via General Guile related discussions
On Tue, 22 Feb 2022, Zelphir Kaltstahl wrote: > Hello Guile users! > > How would I run a shell command from inside Guile and get its output > as a string, instead of the output being outputted directly? (Guile > 3.0.8) I use the following: (define-module (shell utils) #:use-module (ice-9

Re: 'guild compile' and C(++) extensions (in the context of LilyPond)

2022-02-19 Thread Olivier Dion via General Guile related discussions
On Sat, 19 Feb 2022, Jean Abou Samra wrote: I had similar problem with Jami. I added C++ primitives to Guile, but these were not load using the foreign function interface. Note, I'm using Guile 3.0.8, but I think the same could be done for Guile 2.0. Basically what I do is to add a `compile`

Re: Proposal: Deep Dive into the Guile Docs & Makeover Proposal

2022-02-19 Thread Olivier Dion via General Guile related discussions
On Sat, 19 Feb 2022, Neil Jerram wrote: > Personally, I am now a big fan of Scheme-centric + FFI, as it means > always writing Scheme and never having to hack C code. If everyone > agreed on that, we could discard all the C-centric parts of the > manual, and focus the rest on a clearer use

Re: Proposal: Deep Dive into the Guile Docs & Makeover Proposal

2022-02-18 Thread Olivier Dion via General Guile related discussions
On Thu, 17 Feb 2022, Blake Shaw wrote: > looking forward to any feedback. Some things that I think could use some improvement: When you play a video while you're talking, make sure that the volume of the video is very low so we can still hear you. For example, around 4.20 I

Re: Guile cookbook ?

2022-02-12 Thread Olivier Dion via General Guile related discussions
On Sat, 12 Feb 2022, adriano wrote: > Il giorno sab, 12/02/2022 alle 14.55 +0100, adriano ha scritto: >> > >> Hint taken :-) > > Actually, I was thinking about a Guile cookbook, rather than the Guix > cookbook > > Can the Guix cookbook also contain examples of how o do things in Guile > ? > >

Re: [PP?] GNU Guile 3.0.8 released

2022-02-11 Thread Olivier Dion via General Guile related discussions
On Fri, 11 Feb 2022, Andy Wingo wrote: > Note however that as with macros, when a definition changes in module > A, a separately compiled module B that uses that definition doesn't > automatically get recompiled. This is a limitation in Guile that we > would like to fix. I find this to be

Re: Ideas for making Guile easier to approach

2022-02-10 Thread Olivier Dion via General Guile related discussions
On Thu, 10 Feb 2022, Leo Butler wrote: > It would be a pity to deprecate and/or remove that little bit of > culture for the sake of...OTOH, creating a workable system that > allowed one to dynamically alias modules would definitely be useful. The cultural reference can still be there in the

Re: Ideas for making Guile easier to approach

2022-02-09 Thread Olivier Dion via General Guile related discussions
On Wed, 09 Feb 2022, Christine Lemmer-Webber wrote: > Module names > > > ice-9 -> guile > -- > I think that ice-9 is a weird namespace for "guile's standard library" > but it's what we have for historical reasons. Still I would have > preferred that namespace simply be

Re: Newbie thoughts on Guile Hall + Guix

2022-02-09 Thread Olivier Dion via General Guile related discussions
On Wed, 09 Feb 2022, Blake Shaw wrote: > Perhaps a survey is due. I believe that a roadmap for the future of Guile is due. There were discussions last months on the mailing list for recruting a new maintainer and perhaps making a group of hackers to develop Guile. I don't know if things will

Re: Proposal: Deep Dive into the Guile Docs & Makeover Proposal

2022-02-08 Thread Olivier Dion via General Guile related discussions
On Tue, 08 Feb 2022, Blake Shaw wrote: > * SUMMARY: Recent discussions on the Guix mailing list revealed that > many in the Guix community have found the Guile Reference Manual > difficult to navigate as newcomers. That should come as no surprise -- > in PDF form, the docs span approximately /850

Re: Newbie thoughts on Guile Hall + Guix

2022-02-06 Thread Olivier Dion via General Guile related discussions
On Sun, 06 Feb 2022, Maxime Devos wrote: > Olivier Dion schreef op zo 06-02-2022 om 17:05 [-0500]: >> > Is it restricted to Makefiles, or can it also be used without >> > generating Makefiles?  If not, things like progress bars should be >> > easy >> > to implement and file names containing

Re: Newbie thoughts on Guile Hall + Guix

2022-02-06 Thread Olivier Dion via General Guile related discussions
On Sun, 06 Feb 2022, Zelphir Kaltstahl wrote: >> is just a matter of shipping the `makefile` with the source codes. > What is this similar to Hall thing you have written, which generates the > files > from the code you gave? I've setup a quick demo here: https://gitlab.com/oldiob/cbuild Note

Re: Newbie thoughts on Guile Hall + Guix

2022-02-06 Thread Olivier Dion via General Guile related discussions
On Sun, 06 Feb 2022, Vivien Kraus wrote: > Hello,  > > Le dimanche 06 février 2022 à 11:35 -0500, Olivier Dion via General > Guile related discussions a écrit : >> As much as I like hall for pure Guile project, >> it's difficult to integrate extension libraries

Re: Newbie thoughts on Guile Hall + Guix

2022-02-06 Thread Olivier Dion via General Guile related discussions
On Sun, 06 Feb 2022, Maxime Devos wrote: > This seems like a practical build system to me. Is it available online > somewhere? I'd like to investigate it a bit for some common problems > in ad-hoc Makefiles (in particular w.r.t. cross-compilation, tracking > dependency information, choosing

Re: Newbie thoughts on Guile Hall + Guix

2022-02-06 Thread Olivier Dion via General Guile related discussions
On Sat, 05 Feb 2022, Christine Lemmer-Webber wrote: > Anyway, just some thoughts. Making Guile packages is already much less > intimidating now thanks to Hall's work. Thank you for it! Here's my two cents. As much as I like hall for pure Guile project, it's difficult to integrate

Re: Need help embedding Guile

2021-12-29 Thread Olivier Dion via General Guile related discussions
On Wed, 22 Dec 2021, Mikael Djurfeldt wrote: > All of this indicates that it could be nice to have some kind of Guile > shutdown call in the C API. Such a shutdown call could go through live > objects and free them. Indeed, that's a cool feature. Not many libraries are able to do so though and

Re: SD4F: (exist? procedure-**maximum**-arity)

2021-12-28 Thread Olivier Dion via General Guile related discussions
On Wed, 29 Dec 2021, Blake Shaw wrote: > Hiya Guilers, > > I've just started Sussman & Hanson's new book "Software Design for > Flexibility" and am trying to translate one of the functions from > MIT-Scheme to Guile: Out of topic here, but what's your first impression of the book? I was

Re: Need help embedding Guile

2021-12-22 Thread Olivier Dion via General Guile related discussions
On Wed, 22 Dec 2021, Dimitris Papavasiliou wrote: > Foreign objects currently come in two categories: > > 1. Complete geometric operations such as `cube' and `difference' >above. These are allocated on the C++ side and a so-called "smart >pointer" (shared_ptr) is exported to Scheme.

Re: Need help embedding Guile

2021-12-21 Thread Olivier Dion via General Guile related discussions
On Tue, 21 Dec 2021, Dimitris Papavasiliou wrote: > The idea is that the C++ program, after some initialization, loads and > evaluates > one or more Scheme files (provided by the user as command line arguments). > During the course of their evaluation, these create objects on the C++ side >

Support for more atomic operations

2021-11-25 Thread Olivier Dion via General Guile related discussions
Hi! Does anyone know if Guile plans to have better support for atomic operations? For example `atomic-box-fetch-and-add!`. I know that in theory, one can do the following: -- (define (atomic-box-fetch-and-apply! box op

Re: foreign objects and the garbage collector

2021-09-21 Thread Olivier Dion via General Guile related discussions
On Tue, 21 Sep 2021, adriano wrote: > Hi Olivier, > > thank you very much for your reply > > Il giorno dom, 19/09/2021 alle 14.11 -0400, Olivier Dion ha scritto: >> On Sun, 19 Sep 2021, adriano wrote: >> > >> > > > > > >> > It'd be so nice to have an example >> >> (define (with-my-resource

Re: foreign objects and the garbage collector

2021-09-19 Thread Olivier Dion via General Guile related discussions
On Sun, 19 Sep 2021, adriano wrote: >> If you want to avoid the problem, you should explicitely bind and >> call the gps-close function and not rely on the garbage collector to >> do it for you. You can use dynamic-wind to open and close >> resources as needed. > > It'd be so nice to have an

Re: backing out of debugger

2021-09-14 Thread Olivier Dion via General Guile related discussions
On Tue, 14 Sep 2021, Luis Felipe wrote: > On Tuesday, September 14th, 2021 at 1:27 PM, Mortimer Cladwell > wrote: > >> Thanks Luis. What about in emacs/geiser where Ctrl-D won't work? > > The equivalent in Geiser would be C-c C-q, I think. But I don't know > if that's any better than typing ,q

Re: Trouble creating SRFI-9 Record in C

2021-09-10 Thread Olivier Dion via General Guile related discussions
On Sat, 11 Sep 2021, paul wrote: > In Guile land, that works great. Now, i want to create a foo in C > and pass it to a function in the Guile script. I do something > like the following: > > ``` > scm_c_primitive_load("foo.scm"); > scm_call_5(scm_variable_ref(scm_c_lookup("make-foo")), >

Contract programming in Guile

2021-07-17 Thread Olivier Dion via General Guile related discussions
Hi all, I'm a big fan of contract programming and was wondering if there's any SRFI or library that offers this in Guile? Here's an example of what I mean by contract: ;; Given (define (sum x y z) "Return the sum

Portability of Guile

2021-07-02 Thread Olivier Dion via General Guile related discussions
Hi all, I was wondering what is the state of Guile concerning portability to OS others than Linux. I have a C++ program that I want to interact with libguile. The program run on iOS, Android, Windows, MacOS and Linux. The program is statically linked, so I don't mind building Guile from source

Re: Guile 3.0.7 compile cache messages

2021-06-01 Thread Olivier Dion via General Guile related discussions
On Mon, 31 May 2021, Zelphir Kaltstahl wrote: > Hello Guile Users! > > It seems my Guile (version 3.0.7, installed via GNU Guile, updated today) is > doing something weird, or perhaps something correct but unexpected with regard > to informing about it finding compile caches. When I run a program

Check if thread is in Guile mode

2021-05-17 Thread Olivier Dion via General Guile related discussions
Hi, Is there a way to check if the current thread is in Guile mode? Something along like: bool is_guile_init = scm_in_guile_mode() would be nice to have. -- Olivier Dion PolyMtl

Re: C extensions

2021-02-21 Thread Olivier Dion via General Guile related discussions
On Sun, 21 Feb 2021, Tim Meehan wrote: > Hello Olivier, thanks! > Those functions helped, and now I know where in the source of Guile to look. > > Is "inexact" the same thing as "floating point number" in Guile-speak? I don't think so. If I remember correctly, exact numbers are numbers that can

Guix records

2021-02-05 Thread Olivier Dion via General Guile related discussions
Hello, In the module (guix records), there's some very nice syntax rule `define-record-type*` that allows very powerfull declarative style of records. For example: -- (employee (age 30) (name "Foo") (profession

Re: Using Guile for soft-realtime

2021-01-24 Thread olivier . dion--- via General Guile related discussions
On Sun, 27 Dec 2020, Joshua Branson via General Guile related discussions wrote: > Hey Olivier! > > I've heard that guile is generally faster than python, but there are > some other schemes that are faster, notably chez scheme. Yes. I remember seing somewhere that Guile is much more energy

Re: no scm_foreign_object_p ?

2021-01-23 Thread olivier . dion--- via General Guile related discussions
On Sat, 23 Jan 2021, Matt Wette wrote: > I started using foreign objects but want something akin to number?, > string? etc. > Is there something that works here? > I was hoping to see scm_foreign_object_p(type, object). The only thing I see in the manual is `scm_assert_foreign_object_type`.

scm_shell() SEGV on scm_init_readline()

2020-12-30 Thread Olivier Dion via General Guile related discussions
Hi, When calling scm_shell() in a Guile's context, this sometime results in a segmentation fault when initializing readline. This fault is intermittent and I suspect a race condition since I have a second thread doing things in Guile's context. Searching on the web have not gave much. I

Using Guile for soft-realtime

2020-11-11 Thread Olivier Dion via General Guile related discussions
Hi Guile's community, I would like to use Guile as a scripting engine for a soft-realtime software. I'm a little bit worried about the asynchronous nature of the GC and its nondeterministic time. Searching in the manual, I found the section 5.7.4.2 about performance constraints, which is empty