Open
Conversation
If gpg fails you can't install locally, and the rest are not interesting for local builds.
Both forms are still in the same provider, but separated into two classes. The ParserProvider logic for JRuby may need some tweaks to support two separate SPIs so this is a first step to isolating them. The native parser will be returned if: * A dynamic library file provided to initialize exists, and * the wasm parser has not been specifically requested. The wasm parser will be returned if: * It was specifically requested, or * a dynamic library that exists has not been provided to initialize. In the future this selection should happen closer to the JRuby level so we can use either or both more easily.
The native and wasm versions were split off into separate classes, so most of these imports are only needed in the base class now.
The parser should be stateless and a new machine is constructed for each call, so we should be able to reuse the same Prism instance across parses.
This will primarily be used with JRuby 10+, which requires Java 21.
WASM is inherently single-threaded, so we cannot allow multiple threads to be parsing with a single chicory-prism instance at the same time. For now, we synchronize that access. A pool of instances or a soft thread-local could be used in the future if that becomes a bottleneck.
Formally add WASM support with Chicory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WASM support is ready to land and the upstream PR ruby/prism#3902 has been merged into prism itself.
There will be additional tweaks but we can start moving forward with wasm support in the jruby-prism artifact.