Skip to content

Switch identifiers to byte[]#4016

Draft
headius wants to merge 3 commits intoruby:mainfrom
headius:byte_ary_identifiers
Draft

Switch identifiers to byte[]#4016
headius wants to merge 3 commits intoruby:mainfrom
headius:byte_ary_identifiers

Conversation

@headius
Copy link
Contributor

@headius headius commented Mar 19, 2026

To remove the compile-time dependency on JRuby in the Java API, we need to replace RubySymbol identifiers with something implementation-independent. The simplest option is to use the original identifier bytes (byte[]).

Fixes #4009.

@headius headius force-pushed the byte_ary_identifiers branch from a1d2677 to a0aae26 Compare March 19, 2026 17:22
@kddnewton kddnewton added the java Pull requests that update Java code label Mar 19, 2026
@headius
Copy link
Contributor Author

headius commented Mar 19, 2026

This is still a draft and needs to be integrated into JRuby so I know if it's working properly.

* JAVA_STRING_TYPE and related change to IDENTIFIER
* TruffleRuby still uses java.lang.String

Fixes ruby#4009
@headius headius force-pushed the byte_ary_identifiers branch from a0aae26 to 8452788 Compare March 20, 2026 14:37
@headius headius changed the title Swich identifiers to byte[] Switch identifiers to byte[] Mar 20, 2026
* Allocate array of byte[] as byte[length][].
* Default JAVA_BACKEND to "default" with "truffleruby" the custom
  option.
@headius
Copy link
Contributor Author

headius commented Mar 20, 2026

This builds properly now and @enebo is looking at integrating it into our prism service for JRuby's internal parsing.

Co-authored-by: Benoit Daloze <eregontp@gmail.com>
@eregon eregon mentioned this pull request Mar 20, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Pull requests that update Java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eliminate templated STRING_TYPE and use a factory

3 participants