Conversation
|
I've threaded the needle and gotten snapshots deployed for this all the way into the Coordinating the release of non-snapshot artifacts will take some additional work. Assuming TruffleRuby is not planning on using this (it depends on JRuby maven artifacts currently) I will proceed to do clean-up from here. This PR is focused more on getting Prism available to use as JRuby's internal parser. Later work will handle packaging a separate build of the prism/wasm stuff for the gem. |
efdead7 to
c7a7da2
Compare
New groupID: org.ruby-lang New artifactID: prism-ruby-parser[-wasm] New root package: org.ruby_lang
c7a7da2 to
442860b
Compare
|
I believe I've made the final changes needed to get this artifact published for JRuby internal parser use.
There's a few open questions that I need some guidance on:
Barring those questions, I could publish our first official Java API for Prism any time. |
This library depends on jruby-base but also needs stdlib for the parsing test. Rather than depend on jruby-complete, use a hard dep for jruby-base and a test-scoped dep for stdlib.
This patch allows publishing the artifact now based on available JRuby releases. * jruby-base 10.0.4.0 is used at compile time and specified as "provided" scope in Maven, to avoid a hard dependency on that specific release. The API requires that some JRuby 10.0.4.0 or higher be provided by the host environment. * jruby-stdlib 10.0.4.0 is used in concert with jruby-base to test the ability to parse Ruby source files required by JRuby 10.0.4.0 at startup. This dependency is only scoped for testing.
This library will eventually be split into a few pieces: * The direct Parser API, probably called prism-parser-api * The native backend, probably called prism-parser-native * The WASM backend, probably called prism-parser-wasm * The Prism gem backend (with line info etc), name TBD But for now, the first three are all in one library and the fourth is still being designed. We will publish this aggregate library as prism-parser. When the component libraries are defined, most likely prism-parser will aggregate (depend upon) the first three artifacts, so this should not impact future releases of JRuby.
442860b to
e558134
Compare
|
I don't see how my changes could cause the failures here: |
Since there is AFAIK no demand for that, I think it would be better to wait. Regarding the usage in JRuby, it seems clear for now there needs to be 2 instances of libprism (as WASM or native), one which only serializes semantic fields and is used as the JRuby parser, and one to implement the Ruby API of Prism (though see #3962 (comment)). The second one has no use of Loader.java. As such I think this would be better published under org.jruby than org.ruby_lang. |
One more reason for that is the Java API so far did not need to bother about compatibility, preferring to keep the code clean and simple. If it's published under |
|
See #4009 for reasons why this will remain under org.ruby-lang namespace and an alternative approach to eliminating the templated string type. |
JRuby needs this and it makes no sense to publish an API that is 99% ruby-lang.org code under org.jruby. As a counterexample, publishing under org.jruby would indicate that the JRuby team is the primary group responsible for Prism issues. That's clearly not the case. The artifact should be published under org.ruby-lang. If it makes you feel better, we can publish as a 0.x release to indicate that it is still in pre-release territory. But as I mentioned in #4009 and our chat, I want this to become a useful API for other JVM consumers of Ruby's source code. There's really no alternative for anyone building JVM-based tooling that wants to keep up with the latest language changes.
I believe that was already settled and I accepted that there would need to be two different builds, one for the internal use of JRuby and one for the gem API.
I believe the ability to write up-to-date Ruby tooling using the JVM is a pretty convincing use case. It's hard to have known users without a published artifact. And if it's going to be identical regardless of which namespace it goes under, I think it should go under the namespace that represents the bulk of the code we're shipping. |
|
Alright. Re versioning, see #4009 (comment). |
Additional tweaks to get a deployable Maven artifact for the java-wasm artifact.
I'll mark this as non-draft when I'm satisfied the artifact is ready to get pushed to Maven Central.
This PR makes the following changes:
org.prismandorg.jrubytoorg.ruby_lang.