I have updated transpiler Python → 11l → C++, and made
some modifications to exs2sfz.py file, so it can be successfully compiled.
Also I performed some performance tests.
Here is the results for NaturalKit.exs:
| Time (in milliseconds) | Factor (relative to CPython) |
---|
CPython | 238 | 1x |
PyPy3.7-v7.3.2-win32 | 842 | 0.28x |
Cython 3.0a6 | 199 | 1.2x |
Python → 11l → C++ | 32 | 7.4x |
[However tested source file was slightly modified: function locate()
was changed to always return empty string. (Anyway this function is very inefficient and should be rewritten.)]
if it were possible to support the struct module
As I said above, the current development process is task-driven. (And I hope it remains so in the foreseeable future.) The reason of this is to keep language
[11l] and transpilers
[Python → 11l and 11l → C++] as small as possible.
So now I will reject all such generic suggestions as ‘support the struct module’. Because I read this as ‘support the struct module entirely’. So, what should I do? Just go through whole struct module documentation and implement every feature of it?
I dislike this approach. Instead I'd like to implement only really needed features for some practical tasks.
So, I have implemented a small part of the struct module:
struct.unpack_from()
(for exs2sfz.py) and
struct.unpack()
(to support code from
here) with types `i`, `I`, `h`, `H`, `b`, `B` and little/big-endian byte order support.
What else do you need in the struct module?