hpyproject / hpy

HPy: a better API for Python

Home Page:https://hpyproject.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is not an issue, but I did not find a place where to place my question

AlexSoft73 opened this issue · comments

Hi HPy Team

1- Is Hpy going to be any good for embedding it on other applications?
2- Is HPy going to allow late binding? (windows OS feature that lets you load/unload a dll on demand).
2- Is Hpy going to be a thread safe library

Thanks,

I am Planning to migrate to HPy.

Python/C-API AKA CPython

  • Has memory leaks (not noticeable when using it from the Python console, OS will handle them at finish) but when embedded they show up.
  • Py_Finalize does not finalize anything with python, it leaves lots of memory leaks PLUS python created thread alive (watch when numpy is imported)!!!
  • No Thread safe, hence, with this library only 1/SystemCores of the processor power can be used no matter how many threads are created from Pythion code.

Hello,

HPy is an API and ABI. It is designed in such a way that it will not restrict embeddability or thread safety in the API/ABI, but at the end of the day it will depend on the Python engine that implements this API/ABI. (I do not know much about late binding, but I think the same applies to it too).

What do you plan to migrate to HPy? A Python package? It is a certainly good step, but will not fix the problems you mention. They need to be fixed in CPython. Other Pythons supporting HPy may have better support for these use-cases. For example, GraalPy does support embedding of multiple independent instances into another application, they can also run in parallel (but cannot share Python objects). The entry-point API for this is not HPy, though, and is GraalPy specific. HPy does not provide embedding API.

I saw another (perhaps yours) related question at discuss.python.org. It may make sense for you to first take some time to read through the sub-interpreters PEP and some other materials about the past and recent no-GIL efforts. The issues you are raising are known and have been discussed there.

Thanks for your time steve-s

I might see what about GraalPy to check if it meets the requirements I need, thanks for this advice.

A comment: I see constantly in the python community the tendency to think of "Python as the Master of Programming Languages". Python is never going to replace:

C#, VB . NET, and other . NET languages.
C.
COBOL.
Fortran.
Java™
Perl.
PHP,... Among many other programming languages each one with its good and bad things. But programming languages well stablished each one for its own proposes, python trying to superceed them will be a wait of time and effort.

All I see in python is A good scripting language for heavy Math and scientific operations, that's all it is, and try to go beyond this goal might end up taking python to a situation where it turns it unusable and finally conducting it to its Death, which is going to be a sad

I cannot imagine Python for the following type of apps without reinventing the wheel:

  • Creating a front-end application with advance user interface.
  • Data base operations applications.
  • Cryptographic application

I can imagine python:

  • Creating a front-end application with advance user interface with support for AI.
  • Data base operations applications with support for AI.
  • Cryptographic application with support for AI.

For the above, python need be embedded.

Thanks to all

For the above, python need be embedded.

Maybe, but this is the hpy issue tracker. There are many other fora better suited to discussing wider subjects around Python, please try to use one or more of them instead.

Thanks mattip for closing this for me.