# What I'm missing about HLAs

**URL:** <https://discuss.saleae.com/t/what-im-missing-about-hlas/2968>\
**Category:** Extensions\
**Created:** [July 16, 2024, 6:13am UTC](https://discuss.saleae.com/t/what-im-missing-about-hlas/2968 "2024-07-16T06:13:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![BitBob](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.saleae.com/bitbob/32/2292_2.png) [@BitBob](https://discuss.saleae.com/u/BitBob)\
**Post date:** [July 17, 2024, 10:29am UTC](https://discuss.saleae.com/t/what-im-missing-about-hlas/2968/2 "2024-07-17T10:29:17Z")

</div>

I’ll let Saleae provide an official response, but my guess is that the embedded python environment for HLAs is a restricted subset of a full python install, and the version is fixed at build time of the Logic 2 application itself to be compatible across all supported PC targets (Windows, MacOS, and Linux) and all users that use it and who are on various different Logic 2 releases as well.

I’m guessing they could upgrade from 3.8 to 3.10+ for newer python feature support, but not sure if/when they’d choose to do this. Each bump in version might cause compatibility issues with existing users, installations and/or marketplace HLA extensions. Again, I’ll defer to Saleae to manage their own upgrade roadmap 🙂. However, you can promote the idea in a feature request: [Logic 2 - Ideas and Feature Requests - Saleae](https://ideas.saleae.com/b/feature-requests/)

… and in this case, you and anyone else who agrees could upvote this existing one:

> **[Update Python to version 3.10 for Software Extensions - Logic 2 - Ideas and...](https://ideas.saleae.com/b/feature-requests/update-python-to-version-310-for-software-extensions/)**
>
> The new Structural Pattern Matching feature of Python 3.10 would come in really handy for HLAs!

Likewise, I’m guessing they hand selected the pre-bundled libraries & packages and haven’t prioritized figuring out a portable way to allow user-driven upgrades and/or new package dependencies. Maybe they could at least support ‘local HLAs’ that could extend python vs. marketplace HLAs, but the release version of python will still be fixed at build time of the Logic 2 application as it’s embedded within it.

Note: It looks like that idea was also already submitted (upvote if interested):

> **[HLA: support Python dependencies - Logic 2 - Ideas and Feature Requests - Saleae](https://ideas.saleae.com/b/feature-requests/hla-support-python-dependencies)**
>
> Support using external Python dependencies in HLAs. Alternatively, support using a different Python executable from an environment controlled by the user.
> 
> Originally posted here discuss.saleae.com/t/third-party-libraries-with-hlas where the package...

The Automation API is not as tightly coupled, and thus allows you more freedom to extend w/ ‘pip’ and/or update the base language release version as desired. In theory, they could expose the full HLA interface through some type of gRPC APIs, but not easily done and could have negative performance impacts using a ‘lite’ network layer vs. optimized built-in bindings within the executable itself (and some people already complain about the extra overhead of electron vs. a native UI).

Meanwhile, I think you can technically ‘hack’ your own Logic 2 python installation to add more libraries/packages, but then your HLA will only work on installations ‘patched’ the same way, and wouldn’t work as a marketplace extension. Also, your still limited to the base version of python pre-installed in the Logic 2 application (unless you really hack it at a much lower level 😉). Here’s a post discussing this concept, and a suggested work around:

> [@Third party libraries with HLAs](https://discuss.saleae.com/t/third-party-libraries-with-hlas/595/2):
>
> Hi Scarzer, Thank you for the kind words! We don’t currently have a supported way of installing Python dependencies. This is made harder on Linux, as you discovered, by the fact that the AppImage installs to a separate temporary directory each run. For an easier workaround in the meantime, you can modify the sys.path in your extension file to include the directory that you installed the Python package to: import sys MY\_ADDITIONAL\_PACKAGES\_PATH = '/packages/install/location' if MY\_ADDITIONAL\_P…

As for better VScode integration & IntelliSense support, check out this:

> [@Logic 2 python api stubs](https://discuss.saleae.com/t/logic-2-python-api-stubs/2295):
>
> Would you consider publishing python api stubs for the full saleae HLA interface? When developing python HLA extensions, it is useful to have intellisense / autocomplete. Python supports [stub files](https://peps.python.org/pep-0484/#stub-files), that can be used for this. Attached is an initial setup for this, which is manually extracted from [API Documentation](https://github.com/saleae/gitbook-docs/blob/master/extensions/api-documentation.md) Drop the attached files in a folder ‘saleae’ and autocomplete / type hints should mostly be working. Example of it in action: [saleae.zip](https://discuss.saleae.com/uploads/short-url/6wkpaBt3nFviI1BkpLI8AORqup7.zip) (1.5 KB)

Finally, was your desired HLA frame layering something like:

> [@HLAs - Overlapping frames](https://discuss.saleae.com/t/hlas-overlapping-frames/505):
>
> I am working on an HLA to parse serial packets, and had this idea to show parts of the packet, and then an additional frame that says what the entire packet is generally. Right now it seems that returning frames in the same time, whichever one is return last will get painted on top. The idea being that in the case of fragments or bad packets, I can still at least display whatever data was successfully parsed. Does this exist somehow already, or could it be planned?

If so, then not sure on latest status of the planned feature to support such capability.

Hope these pointers help you enough for now, while maybe Saleae (@timreyes or @markgarrison?) can chime in with more specifics or any longer term Logic 2 roadmap plans.

---

_[View the full topic](https://discuss.saleae.com/t/what-im-missing-about-hlas/2968)._
