tim-editor / guile-rs

Safe high level rust bindings to guile
5 stars 0 forks source link

Implement foreign objects #4

Open Javyre opened 6 years ago

Javyre commented 6 years ago

I half-wrote a system for foreign object using finalizers but the manual strongly advises against that...

We could try to use scm_gc_malloc() with boxes or something which would be way cleaner... heres an example usage of scm_gc_malloc() and scm_gc_malloc_pointerless(): https://www.gnu.org/software/guile/manual/guile.html#Creating-Foreign-Objects

Javyre commented 6 years ago

According to guile guys, finalizers are fine since we need destructors when dropping rust objects... Ill start working on the seconds half of the impl

Javyre commented 6 years ago

Well, I successfully implemented foreign objects pretty cleanly with only one slot... still waiting on response from guile-user: https://lists.gnu.org/archive/html/guile-user/2018-02/msg00003.html

Javyre commented 6 years ago

Left a lot of the old Typelist code commented out in the commit since I don't know if this is the definitive solution... Still no response from mailing list... 😢