|
1 | 1 | Changelog
|
2 | 2 | =========
|
3 | 3 |
|
| 4 | +Version 0.9 (April 25th, 2023) |
| 5 | +------------------------------ |
| 6 | + |
| 7 | +This release adds numerous major features and indicates the end of HPy's *alhpa* |
| 8 | +phase. We've migrated several key packages to HPy (for a list, see our website |
| 9 | +https://hpyproject.org) and we are now confident that HPy is mature enough for |
| 10 | +being used as serious extension API. We also plan that the next major release |
| 11 | +will be ``1.0``. |
| 12 | + |
| 13 | +Major new features |
| 14 | +~~~~~~~~~~~~~~~~~~ |
| 15 | + |
| 16 | +Support subclasses of built-in types |
| 17 | + It is now possible to create pure HPy types that inherit from built-in types |
| 18 | + like ``type`` or ``float``. This was already possible before but in a very |
| 19 | + limited way, i.e., by setting :c:member:`HPyType_Spec.basicsize` to ``0``. In |
| 20 | + this case, the type implicitly inherited the basic size of the supertype but |
| 21 | + that also means that you cannot have a custom C struct. It is now possible |
| 22 | + inherit from a built-in type **AND** have a custom C struct. For further |
| 23 | + reference, see :c:member:`HPyType_Spec.builtin_shape` and |
| 24 | + :c:enum:`HPyType_BuiltinShape`. |
| 25 | + |
| 26 | +Support for metaclasses |
| 27 | + HPy now supports creating types with metaclasses. This can be done by passing |
| 28 | + type specification parameter with kind |
| 29 | + :c:enumerator:`HPyType_SpecParam_Metaclass` when calling |
| 30 | + :c:func:`HPyType_FromSpec`. |
| 31 | + |
| 32 | +:term:`HPy Hybrid ABI` |
| 33 | + In addition to :term:`CPython ABI` and :term:`HPy Universal ABI`, we now |
| 34 | + introduced the Hybrid ABI. The major difference is that whenever you use a |
| 35 | + legacy API like :c:func:`HPy_AsPyObject` or :c:func:`HPy_FromPyObject`, the |
| 36 | + prdouced binary will then be specific to one interpreter. This was necessary |
| 37 | + to ensure that universal binaries are really portable and can be used on any |
| 38 | + HPy-capable interpreter. |
| 39 | + |
| 40 | +:doc:`trace-mode` |
| 41 | + Similar to the :doc:`debug-mode`, HPy now provides the Trace Mode that can be |
| 42 | + enabled at runtime and helps analyzing API usage and identifying performance |
| 43 | + issues. |
| 44 | + |
| 45 | +:ref:`porting-guide:multi-phase module initialization` |
| 46 | + HPy now support multi-phase module initialization which is an important |
| 47 | + feature in particular needed for two important use cases: (1) module state |
| 48 | + support (which is planned to be introduced in the next major release), and (2) |
| 49 | + subinterpreters. We decided to drop support for single-phase module |
| 50 | + initialization since this makes the API cleaner and easier to use. |
| 51 | + |
| 52 | +HPy :ref:`porting-guide:calling protocol` |
| 53 | + This was a big missing piece and is now eventually available. It enables slot |
| 54 | + ``HPy_tp_call``, which can now be used in the HPy type specification. We |
| 55 | + decided to use a calling convention similar to CPython's vectorcall calling |
| 56 | + convention. This is: the arguments are passed in a C array and the keyword |
| 57 | + argument names are provided as a Python tuple. Before this release, the only |
| 58 | + way to create a callable type was to set the special method ``__call__``. |
| 59 | + However, this has several disadvantages. In particlar, poor performance on |
| 60 | + CPython (and maybe other implementations) and it was not possible to have |
| 61 | + specialized call function implementations per object (see |
| 62 | + :c:func:`HPy_SetCallFunction`) |
| 63 | + |
| 64 | +Added APIs |
| 65 | +~~~~~~~~~~ |
| 66 | + |
| 67 | +Deleting attributes and items |
| 68 | + :c:func:`HPy_DelAttr`, :c:func:`HPy_DelAttr_s`, :c:func:`HPy_DelItem`, :c:func:`HPy_DelItem_i`, :c:func:`HPy_DelItem_s` |
| 69 | + |
| 70 | +Capsule API |
| 71 | + :c:func:`HPyCapsule_New`, :c:func:`HPyCapsule_IsValid`, :c:func:`HPyCapsule_Get`, :c:func:`HPyCapsule_Set` |
| 72 | + |
| 73 | +Eval API |
| 74 | + :c:func:`HPy_Compile_s` and :c:func:`HPy_EvalCode` |
| 75 | + |
| 76 | +Formatting helpers |
| 77 | + :c:func:`HPyUnicode_FromFormat` and :c:func:`HPyErr_Format` |
| 78 | + |
| 79 | +Contextvar API |
| 80 | + :c:func:`HPyContextVar_New`, :c:func:`HPyContextVar_Get`, :c:func:`HPyContextVar_Set` |
| 81 | + |
| 82 | +Unicode API |
| 83 | + :c:func:`HPyUnicode_FromEncodedObject` and :c:func:`HPyUnicode_Substring` |
| 84 | + |
| 85 | +Dict API |
| 86 | + :c:func:`HPyDict_Keys` and :c:func:`HPyDict_Copy` |
| 87 | + |
| 88 | +Type API |
| 89 | + :c:func:`HPyType_GetName` and :c:func:`HPyType_IsSubtype` |
| 90 | + |
| 91 | +Slice API |
| 92 | + :c:func:`HPySlice_Unpack` and :c:func:`HPySlice_AdjustIndices` |
| 93 | + |
| 94 | +Structseq API |
| 95 | + :c:func:`HPyStructSequence_NewType`, :c:func:`HPyStructSequence_New` |
| 96 | + |
| 97 | +Call API |
| 98 | + :c:func:`HPy_Call`, :c:func:`HPy_CallMethod`, :c:func:`HPy_CallMethodTupleDict`, :c:func:`HPy_CallMethodTupleDict_s` |
| 99 | + |
| 100 | +HPy call protocol |
| 101 | + :c:func:`HPy_SetCallFunction` |
| 102 | + |
| 103 | +Debug mode |
| 104 | +~~~~~~~~~~ |
| 105 | + |
| 106 | +* Detect closing and returning (without dup) of context handles |
| 107 | +* Detect invalid usage of stored ``HPyContext *`` pointer |
| 108 | +* Detect invalid usage of tuple and list builders |
| 109 | +* Added Windows support for checking invalid use of raw data pointers (e.g |
| 110 | + ``HPyUnicode_AsUTF8AndSize``) after handle was closed. |
| 111 | +* Added support for backtrace on MacOS |
| 112 | + |
| 113 | +Documentation |
| 114 | +~~~~~~~~~~~~~ |
| 115 | + |
| 116 | +* Added incremental :doc:`porting-example/index` |
| 117 | +* Added :doc:`quickstart` guide |
| 118 | +* Extended :doc:`api-reference/index` |
| 119 | +* Added :doc:`api-reference/function-index` |
| 120 | +* Added possiblity to generate examples from tests with argument ``--dump-dir`` |
| 121 | + (see :ref:`api:hpy unit tests`) |
| 122 | +* Added initial :doc:`contributing/index` docs |
| 123 | + |
| 124 | +Incompatible changes to version 0.0.4 |
| 125 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 126 | + |
| 127 | +* Simplified ``HPyDef_*`` macros |
| 128 | +* Changed macro :c:macro:`HPy_MODINIT` because of multi-phase module init |
| 129 | + support. |
| 130 | +* Replace environment variable ``HPY_DEBUG`` by ``HPY`` (see :doc:`debug-mode` |
| 131 | + or :doc:`trace-mode`). |
| 132 | +* Changed signature of ``HPyFunc_VARARGS`` and ``HPyFunc_ KEYWORDS`` to align |
| 133 | + with HPy's call protocol calling convention. |
| 134 | + |
| 135 | +Supported Python versions |
| 136 | +~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 137 | + |
| 138 | +* Added Python 3.11 support |
| 139 | +* Preliminary Python 3.12 support |
| 140 | +* Dropped Python 3.6 support (since EOL) |
| 141 | +* Dropped Python 3.7 support (since EOL by June 2023) |
| 142 | + |
| 143 | +Misc |
| 144 | +~~~~ |
| 145 | + |
| 146 | +* Ensure deterministic auto-generation |
| 147 | +* Ensure ABI backwards compatibility |
| 148 | + |
| 149 | + * Explicitly define slot within HPyContext of function pointers and handles |
| 150 | + * Compile HPy ABI version into binary and verify at load time |
| 151 | +* Added proper support for object members ``HPyMember_OBJECT`` |
| 152 | +* Changed :c:func:`HPyBytes_AsString` and :c:func:`HPyBytes_AS_STRING` to return ``const char *`` |
| 153 | +* Use fixed-width integers in context functions |
| 154 | + |
| 155 | + |
| 156 | + |
4 | 157 | Version 0.0.4 (May 25th, 2022)
|
5 | 158 | ------------------------------
|
6 | 159 |
|
|
0 commit comments