News for hackers. Stuff that matters.

Show HN: FFI Between Gambit Scheme and CPython

https://github.com/gambit/python

Hi HN,

Pr. Marc Feeley and I have just released a new module for Gambit. The 'python' module is available at https://github.com/gambit/python. It is a Foreign Function Interface (FFI) to CPython which combines a low-level API with a syntactic interface that allows Gambit users to interface with Python code. The module also offers a Foreign Procedure Call mechanism that bridges the CPython and Gambit threading models.

For example, it is now possible for Gambit users to import Python modules as such:

> \import math

> (cos \math.pi)

-1.

This module requires a recent Gambit version compiled with the '--enable-multiple-threaded-vms' option. The GitHub repo contains a short README with instructions as well as a few examples to get you started. We will be giving a talk about our work at the upcoming Scheme Workshop (https://icfp22.sigplan.org/details/scheme-2022-papers/7/An-F...). You can get a preprint of the accompanying article at https://andykeep.com/SchemeWorkshop2022/scheme2022-final22.p... .

We had fun developing this and while there are still a few known kinks, the software is generally quite stable and enjoyable. Please notify us of any problems, or just to showcase your work!

Cheers!

( 2 comments | 2 points | on HN )
Re:Show HN: FFI Between Gambit Scheme and CPython by belmarca on Wednesday September 07, 2022 @03:05PM (#32754990)
I mentioned this upcoming work in a comment last week. Here it is :) Any comments appreciated!
Re:Show HN: FFI Between Gambit Scheme and CPython by mustermannBB on Friday September 09, 2022 @02:43PM (#32783278)
Very nice. Congrats. This looks interesting.