Skip to content

Large update to WASM Prism backend with Chicory#3902

Draft
headius wants to merge 19 commits intoruby:mainfrom
jruby:topic/javawasm_changes
Draft

Large update to WASM Prism backend with Chicory#3902
headius wants to merge 19 commits intoruby:mainfrom
jruby:topic/javawasm_changes

Conversation

@headius
Copy link

@headius headius commented Feb 3, 2026

This PR includes a large set of changes to update the WASM backend using latest versions of Chicory and help from @andreaTP to clean it up and get it ready for a public release.

The changes here should not affect the existing native-library Java wrapper, but we will need to agree upon a package name and Maven groupID that represent a domain we have some control over (org.prism does not qualify since prism.org is completely unrelated to this project).

I would like to get Maven artifacts published for the native and WASM wrappers before JRuby 10.1 is released in the next few weeks.

headius and others added 18 commits January 21, 2026 17:00
Nodes need access to RubySymbol and support APIs at least.
* It is a resource used as source code (in wasm) that is compiled
  for the project artifact.
* Added to Rake CLOBBER
Allow the buffer functions to manage the internal pointer and use
consistent argument order for calloc.
Primarily for testing purposes.
This is not all of the boot files but is sufficient to demonstrate
a memory fault in the AOT WASM parser.
This is only intended to ever be used with JRuby 10+, which already
requires Java 21.
* org.jruby.parser is base package for JRuby parsers
* org.jruby.parser.prism is for parsers based on Prism
* org.jruby.parser.prism.wasm is for the WASM Prism wrapper
@headius headius force-pushed the topic/javawasm_changes branch from 6d3a2f3 to 2235128 Compare February 3, 2026 20:24
Copy link
Collaborator

@kddnewton kddnewton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally fine with all of these changes. Would ruby-lang.org work?

@headius
Copy link
Author

headius commented Feb 3, 2026

@kddnewton Something based on that domain would be fine, but no hyphens in Java package names. Too bad ruby.org is being squatted.

I would propose the following:

  • Maven Group ID and Artifact ID: "org.ruby-lang" and "prism"
  • Package name: "org.ruby_lang.prism"

We'd need to register the group ID with the Maven Central folks (https://central.sonatype.org/register/namespace/#for-dns) and make sure anyone who wants to be able to publish Maven artifacts has access.

For the moment I've got the WASM bits all under the following:

  • Group and Artifact: "org.jruby", "chicory-prism" (could be changed to a ruby-lang group and "prism-wasm" or similar).
  • Package name: org.jruby.parser.prism for general bits and org.jruby.parser.prism.wasm for the wasm logic specifically.

This moves all of the non-JRuby Java code from the org.prism
package to the org.ruby_lang.prism package (corresponding to the
ruby-lang.org domain and prism project).
@headius
Copy link
Author

headius commented Feb 4, 2026

@kddnewton @enebo I believe this could be merged now and additional work done as smaller one-off PRs.

This PR includes:

  • All updates for Chicory and the WASM build to create a fully functional AOT WASM parser library.
  • Move all Java code out of "org.prism" and into appropriate packages. General Prism wrappers are moved to "org.ruby_lang.prism" and the JRuby-specific WASM library wrapper is under "org.jruby.parser.prism.wasm".
  • Prepare the WASM wrapper library for release under Maven coordinates "org.jruby:chicory-prism" (name may change after discussion)

I have not:

  • Set up a separate Maven build and artifact for the base Prism wrapper library (the native version and code under java/).
  • Registered a group name for publishing the base wrapper library (org.ruby-lang group ID will need to be registered with Ruby Central)

This PR is now complete and sufficient to get an artifact for the WASM wrapper released to Maven Central for JRuby's use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants