Re: Need help embedding Guile

2021-12-22 Thread Dimitris Papavasiliou
On Wednesday, December 22nd, 2021 at 5:29 PM, Maxime Devos wrote: > This seems clear to me (I think you mean that there's some guile code > that preprocesses the node graph to optimise it a little, before > evaluating things). I don't see what dead code elimination has to do > with the structure o

Re: Need help embedding Guile

2021-12-22 Thread Dimitris Papavasiliou
Thanks to everybody for their suggestions. I'll respond to all in this single message to keep the discussion from spreading out too much. Please let me know if this is inconvenient for you. I also apologize in advance for my large messages. There's a TL;DR of sorts in the last 3 paragraphs. Le

Re: Need help embedding Guile

2021-12-22 Thread Mikael Djurfeldt
Hi, I think you should give up the idea to GC collect all objects. Due to the GC being of the conservative type, that can't be guaranteed to happen. Any attempt to wait until all objects are collected runs the risk of hanging indefinitely. Here's a suggestion for a less "heavy-handed" approach th

Re: Need help embedding Guile

2021-12-22 Thread Maxime Devos
Hi, Dimitris Papavasiliou schreef op wo 22-12-2021 om 11:41 [+]: > Creating the complete graph before evaluation begins in the second > phase is probably not necessary (nodes could be evaluated as they're > created), but it creates the opportunity for certain optimizations > (like dead code el

Re: Need help embedding Guile

2021-12-22 Thread Maxime Devos
Olivier Dion schreef op wo 22-12-2021 om 09:46 [-0500]: > From `eval-in-sandbox` documentation: > >  If SEVER-MODULE? is true (the default), the module will be unlinked >  from the global module tree after the evaluation returns, to allow MOD >  to be garbage-collected. > > So I _think_ you're gu

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. Fai

Re: Need help embedding Guile

2021-12-22 Thread Thien-Thi Nguyen
[cc trimmed] () Dimitris Papavasiliou () Wed, 22 Dec 2021 11:41:22 + One idea would be to simply call `scm_gc()' and `scm_run_finalizers()' until the latter returns 0. As far as I can see, this should ensure all finalizers are called, assumming no references to any foreign obje

Re: Need help embedding Guile

2021-12-22 Thread Dimitris Papavasiliou
Hi Olivier, Thanks for chiming in! On Wednesday, December 22nd, 2021 at 12:39 AM, Olivier Dion wrote: > From this description, what I understand is that you want to use Scheme > as a configuration file for batching the operations to be done in a > second phase in C++. >From an architectural poi