Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python interface #2108

Closed
tillmo opened this issue Sep 21, 2022 · 2 comments · Fixed by #2138
Closed

Python interface #2108

tillmo opened this issue Sep 21, 2022 · 2 comments · Fixed by #2138

Comments

@tillmo
Copy link
Contributor

tillmo commented Sep 21, 2022

Build a python interface, using e.g. hyphen. Start with the core #2107 API #1790. The python interface could be used to interface Hets with https://github.com/gavel-tool and to build new interfaces, like a new GUI.

@b-gehrke
Copy link
Collaborator

Notes for hyphen

Building it:

  • A PR prepares an automatic build for debian
    • not yet approved, but being actively review
  • Systemwide installation not included
    • Build setup.py for local pip installation?
    • Extend import path env variable PYTHONPATH to build dir?
    • Symlinking build dir to python import paths?

Things to keep in mind:

  • Parent modules
    • In python, when we import a module a.b.c, we necessarily also import the packages a and a.b first
    • In Haskell those package must not exist
    • Such packages must be added to hyphen.importing.EXPECTED_EMPTY manually
    • For example in Hets the Common namespace

Library

  • Hyphen loads installed modules or source files.

In general, the preferred way of accessing Haskell code from Python via hyphen is to install the Haskell code as a ghc-pkg visible library; such libraries can always be directly imported into Python with hyphen (as we have been doing so far).

  • Hets needs to be library as well (at least parts needed for core API)

@b-gehrke
Copy link
Collaborator

b-gehrke commented Jan 5, 2023

Is building a GUI still the best case? Do a quick research for a framework e.g. Gtk/GI, Qt. Preference is on Gtk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants