bigdecimal icon indicating copy to clipboard operation
bigdecimal copied to clipboard

Integrate JRuby implementation into the gem

Open headius opened this issue 2 years ago • 1 comments

We managed to solve #169 by introducing a "stub" gem for the "java" platform, which contains only the .rb files and no extension. This allows JRuby to install the gem and include it in releases, but long-term it would be better if we can either:

  • Integrate our implementation into this repository OR
  • Release our implementation as a jruby-bigdecimal gem and depend on that gem in the bigdecimal-java gem

I have not started any of the work necessary to pull our BigDecimal implementation out of JRuby, which will take some clever trickery as we have code that expects it to be available all the time... when that happens we can move forward on this issue.

headius avatar Sep 09 '23 09:09 headius

Revisiting this after discussions in #417.

JRuby's BigDecimal implementation still lives in JRuby as a handful of .java files and a few .rb files largely copied from this repository. Fixes and features require a full JRuby release, which makes integrating JRuby into ruby/bigdecimal development (features, specs, CI) rather difficult. The features added in #417 were problematic because they were Ruby changes that depend on internal native functions not available in JRuby's BigDecimal.

Moving JRuby's BigDecimal to a separate jruby/bigdecimal repository might also be an option, but since it would have to eventually be released as the "java" version of the "bigdecimal" gem, it might be better to keep it here.

A first step toward this would be to examine the remaining failure cases when running BigDecimal tests and specs against JRuby, and we can go from there to see how to get full compatibility and move the implementation out of JRuby.

headius avatar Sep 04 '25 16:09 headius