GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use Cgo to support C modules · Issue #235 · go-python/gpython

Use Cgo to support C modules #235

New issue
Copy link
New issue
Copy link
Open
Open
Use Cgo to support C modules#235
Copy link

Description

@Bee4Queer
Bee4Queer
opened on Oct 11, 2024
Issue body actions

I'll be honest; I'm completely new to this project and know next to nothing about it, so if there's a known reason Cgo wouldn't work, sorry. However, I think that using Cgo could be an easy(ish) way to support other modules, however likely with some changes for how Gpython works over others.

Activity

  1. ncw commented on Oct 12, 2024

    @ncw
    ncw
    on Oct 12, 2024
    Collaborator
    More actions

    We could certainly initialise and run python modules written in C, however we'd have to re-implement all the C services that they rely on so that the Go equivalent got called. Given that the implementation of Python objects is completely different to that of CPython I'd put this in the very hard but not quite impossible category!

  2. sbinet commented on Oct 12, 2024

    @sbinet
    sbinet
    on Oct 12, 2024
    Member
    More actions

    another option (possibly as difficult or work intensive) would be to emulate the C API as PyPy did with its cpyext module:

    • https://pypy.org/posts/2018/09/inside-cpyext-why-emulating-cpython-c-8083064623681286567.html
    • https://pythoncapi.readthedocs.io/index.html
    • https://pythoncapi.readthedocs.io/cpyext.html
  3. corona10 commented on Oct 12, 2024

    @corona10
    corona10
    on Oct 12, 2024
    Collaborator
    More actions

    My personal suggestion is targeting HPy instead of C API itself, C API expose too much of implementation detail from CPython.
    https://hpyproject.org/

  4. corona10 commented on Oct 12, 2024

    @corona10
    corona10
    on Oct 12, 2024
    Collaborator
    More actions

    FYI, GraalPython and PyPy success to support HPy

  5. corona10 commented on Oct 12, 2024

    @corona10
    corona10
    on Oct 12, 2024
    Collaborator
    More actions

    (By the way, long time no see people)

  6. sbinet commented on Oct 12, 2024

    @sbinet
    sbinet
    on Oct 12, 2024
    Member
    More actions

    yes, I was about to suggest HPy as well (but was refreshing my memory a bit about it before posting :})

    anyways: whatever the avenue gpython chooses, it's a very long and hard road, which (to be honest) is probably not sustainable with the current workforce available for this project (sadly, but it is what it is)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.