den_d_ has joined #jruby
enebo[m] has quit [*.net *.split]
rdubya[m] has quit [*.net *.split]
den_d has quit [*.net *.split]
den_d_ is now known as den_d
rdubya[m] has joined #jruby
enebo[m] has joined #jruby
KeyJoo has joined #jruby
KeyJoo has quit [Quit: KeyJoo]
_whitelogger has joined #jruby
<kares[m]> interesting that the ruby spec suite ends up hanging - even when restarted
<headius[m]> Jules Ivanic (Gitter): We have our own instruction format and compiler/optimizer, which feeds into the interpreter, and eventually JITs to JVM bytecode
<headius[m]> kares: Gitter integration just started working
<headius[m]> your messge and mine went through
<kares[m]> headius: that is weird since I do not see it among integrations
<headius[m]> I see it
<headius[m]> in the room anyway
<headius[m]> "Gitter Integration"
<kares[m]> oh really?
<kares[m]> interesting
<kares[m]> we should see the same but smh don't :)
<headius[m]> wow, unnecessary image scaling
<kares[m]> nice, had that sidebar hidden
<kares[m]> was checking the setting dialog - existing integrations only has IRC
tlarevo has joined #jruby
tlarevo has quit [Remote host closed the connection]
claudiuinberlin has joined #jruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<headius[m]> Ah yes
travis-ci has joined #jruby
<travis-ci> jruby/jruby (master:2b8d40d by kares): The build has errored. https://travis-ci.org/jruby/jruby/builds/521592224 [230 min 33 sec]
travis-ci has left #jruby [#jruby]
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (master:4438f66 by kares): The build has errored. https://travis-ci.org/jruby/jruby/builds/521610778 [220 min 35 sec]
FlorianDoubletGi has joined #jruby
<FlorianDoubletGi> Hi everyone ,
<FlorianDoubletGi> We can do something like `a_ruby_datetime.to_java(java.time.ZonedDateTime)` but once we have a java `ZonedDateTime` ( for example ) can we do something like `.to_ruby` to get back a ruby `DateTime` ? :/
<FlorianDoubletGi> One solution could be to do something like `DateTime.parse(myJavaZonedDateTime.format(DateTimeFormatter.ISO_DATE_TIME))` but here i'm looking for a more efficient way to do it, if it's possible. Thanks !
drbobbeaty has joined #jruby
<headius[m]> You know it occurs to me, we do have the ability to coerce to different types, and since we depend on Java 8 now one of those types could be Java 8 date time
<headius[m]> kares does our to_java already handle the java 8 date time?
<kares[m]> headius: we already coerce to Java 8 date-time types
<kares[m]> yep we did that around 9.2.1
<headius[m]> So if you specify it it, ok
<kares[m]> yeah that works they're asking for the other way around
<headius[m]> Maybe we need to finally introduce a to_ruby protocol
<headius[m]> I have thought about this before. The problem is ideally we want something we can cache, so we want to know both what types we can coerce to, and then have a method to actually do the colors
<headius[m]> This plays into dispatch and other things too
<headius[m]> I suppose it would be simple enough to add a from_java to Time or Date too
<headius[m]> Or we can just break joda compatibility in 9.3
travis-ci has joined #jruby
<travis-ci> jruby/jruby (master:4438f66 by kares): The build was canceled. https://travis-ci.org/jruby/jruby/builds/521610778 [209 min 24 sec]
travis-ci has left #jruby [#jruby]
<kares[m]> headius: for 9.3 it might be viable to try to break, altough its possible to maintain backwards compatibility
<kares[m]> somehow Java 8 types are more verbose than joda's DateTime
<headius[m]> There's a few places that will be a problem but yeah most things I think we can convert transparently
<kares[m]> but it should be doable ... truffle does it
<headius[m]> Well, they just use it internally. Who knows how the polyglot stuff deals with dates and times
<kares[m]> the question is mostly about having some factory methods somewhere to convert from Java types -> to Ruby
<headius[m]> Stephen C who wrote jodha also worked on the java 8 stuff
<kares[m]> which we kind of have e.g. RubyArray ctor accepts a Collection
<kares[m]> same for RubyHash
<headius[m]> Too bad you can't get to railsconf, I feel like we need a jruby core meeting
<headius[m]> Maybe we should just come to you
<kares[m]> yeah I would have love to catch up with you guys
<headius[m]> Or I should have been more on the ball and tried to officially arrange something during railsconf
<kares[m]> no biggie
<kares[m]> I forgot about it as well
<kares[m]> than realized a few weeks back that I might go -> forgeting I made other plans near by :)
<kares[m]> I am sure you guys will be around in EU
<kares[m]> anyway tha requirements feels like having a factory the problem is that there's at least 3 date/time types we Java convert ruby Time/DateTime to
<headius[m]> I will submit something for joker in St Petersburg, and then see what's happening around the same time or just make a few stops on the way home
<headius[m]> So, this fall at the latest
<JulesIvanicGitte> > We have our own instruction format and compiler/optimizer, which feeds into the interpreter, and eventually JITs to JVM bytecode
<JulesIvanicGitte> Can we launch the compile phase during a Docker image build ? So, the docker image already contains the compiled version ?
<FlorianDoubletGi> Ok I understand, so for now it's not directly possible. thanks @headius and @kares
<kares[m]> its mostly a JIT (just-in-time) not ahead of time :)
<headius[m]> Jules Ivanic (Gitter)
<headius[m]> Oops
<headius[m]> So what you really want is an ahead of time compiler, which we do have in a way but it's not well integrated into Ruby code loading and such
<kares[m]> Florian Doublet (Gitter): we could add some APIs on RubyTime
<kares[m]> feel free to open a feature request
<headius[m]> kares I think the right way forward for pre compiling is 2 always search for .RB but then look for a precompiled .class next to it
<headius[m]> We already have disabled the logic to look for both, and that was never really the right way to do it anyway
<kares[m]> Florian Doublet (Gitter): sounds like you want this in Ruby land, you're scripting the conversion not using it from Java, right?
<headius[m]> If people want to pre compiled for obfuscation, we can scrub the Ruby source and make it explicitly load the class file
<kares[m]> headius: oh, its disabled? thought its enabled
<kares[m]> warbler uses it
<headius[m]> You have to turn it on or it doesn't look for class files
<kares[m]> wait, no since it replaces .rb with .class loads
<headius[m]> 0 bug reports
<kares[m]> yeah - it would not make sense
<headius[m]> We disabled it cuz it was yet another file system hit in load service
<headius[m]> But if we require that the Ruby source or some Ruby source is always there, then it would be trivial to look for a class file next to it
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (master:4438f66 by kares): The build passed. https://travis-ci.org/jruby/jruby/builds/521610778 [216 min 33 sec]
<headius[m]> Jules Ivanic (Gitter) are you interested in this for start-up or obfuscation or what?
<JulesIvanicGitte> > Or we can just break joda compatibility in 9.3
<JulesIvanicGitte> +1
drbobbeaty has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<JulesIvanicGitte> > its mostly a JIT (just-in-time) not ahead of time :)
<JulesIvanicGitte> Ok thanks for the answers :)
<FlorianDoubletGi> > Florian Doublet (Gitter): sounds like you want this in Ruby land, you're scripting the conversion not using it from Java, right?
<FlorianDoubletGi> @kares yes that's it :)
<FlorianDoubletGi> (edited) > Florian Doublet (Gitter): sounds like you want this in Ruby land, you're scripting the conversion not using it from Java, right?
<FlorianDoubletGi> @kares yes that's it :) => @kares yes that's it :)
<FlorianDoubletGi> > Florian Doublet (Gitter): sounds like you want this in Ruby land, you're scripting the conversion not using it from Java, right?
<FlorianDoubletGi> (edited) @kares yes that's it :)
<FlorianDoubletGi> > Florian Doublet (Gitter): sounds like you want this in Ruby land, you're scripting the conversion not using it from Java, right? => > Florian Doublet (Gitter): sounds like you want this in Ruby land, you're scripting the conversion not using it from Java, right?
<FlorianDoubletGi> @kares yes that's it :)
<headius[m]> We have talked about implementing a more extensible protocol for automatic type conversions
tlarevo has joined #jruby
<kares[m]> that can be done using `Time.new` but maybe a `Time.from_java` would be better
<kares[m]> I mean not now - but `Time.new` could be smart about detecting Java types
<kares[m]> altough its a bit ugly to do so ...
<headius[m]> Yeah, that is much cleaner in Ruby code, but I feel like being explicit is better 🤷‍♂️
tlarevo has left #jruby [#jruby]
<headius[m]> Actually, maybe it would make more sense to just add to_ruby to a key Java class?
<headius[m]> It kind of feels like we have to do this for all sorts of types, but really we just want to weigh convenience methods for equivalent classes in Ruby. That's a limited number.
<JulesIvanicGitte> > Time.new could be smart about detecting Java types
<JulesIvanicGitte> I prefer explicitness other “smartness"
<JulesIvanicGitte> plus, it’s not an official Ruby behabior
<JulesIvanicGitte> (edited) ... Ruby behabior => ... Ruby behavior
<headius[m]> org.jruby.RubyTime.newTime(JRuby.runtime, javaDateTime) 😀
<headius[m]> How's that for explicit
<JulesIvanicGitte> ahah
<JulesIvanicGitte> the annoying kind of explicitness
<kares[m]> since we're talking ruby land here and most of the Java types follow the to_x conventions e.g. `List#to_a`, `Map#to_h` or `java.lang.Integer#to_int` ... I would be inclined for the Java date-time types to add `to_time` (`to_date`) where appropriate
<kares[m]> that way we do not "pollute" the ruby types nor existing APIs need a special behavior
<kares[m]> and I think we're already loading Java class exts on demand (as those types are used) so this is fairly straightforward and could land in next 9.2 release
<kares[m]> also, reminds me that I wanted to have `BigDecimal#to_d` to get a Ruby Decimal
<headius[m]> Right that seems good
drbobbeaty has joined #jruby
shellac has joined #jruby
<CharlesOliverNut> Apparently Square still has JRuby and a bunch of folks at Ruby Kaigi use JRuby or are interested
<kares[m]> nice!
<CharlesOliverNut> Ruby is apparently still the primary language at Square too
<kares[m]> oh really?
<CharlesOliverNut> yeah, according to havenwood it is actually influencing how they build stuff in their JVM languages
<CharlesOliverNut> need to get out there to chat
<CharlesOliverNut> Also hear there's some JRuby at Shopify but unclear how much
<kares[m]> I have seen a report from a Shopify person
<kares[m]> but I did not ask whether its work or just experiments
<kares[m]> Shopify would be such a great fit but than again they already have an architecture around CRuby
<headius[m]> yeah what I heard some time ago was heavily threaded email services or something
<headius[m]> it's always startup that kills us
<headius[m]> I really want to see if we can get JRuby to native compile with GraalVM
<headius[m]> we could precompile stdlib + gems to JVM bytecode and AOT the whole thing and probably start up like crazy
<kares[m]> okay, java.math.BigDecimal#to_d is ready, now let's experiment with `to_time`
<headius[m]> 👍
<headius[m]> the gitter connection is a bit flaky
<headius[m]> my thumb shows up but not kares message
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (ji-bigdecimal:12e20d9 by kares): The build has errored. https://travis-ci.org/jruby/jruby/builds/521688353 [174 min 48 sec]
<JulesIvanicGitte> @FlorianDoublet work:
<JulesIvanicGitte> :)
<JulesIvanicGitte> 🙂
<JulesIvanicGitte> (edited) @FlorianDoublet work: ... => @FlorianDoublet's work: ...
<JulesIvanicGitte> and the `to_ruby` part:
<FlorianDoubletGi> 😄
claudiuinberlin has joined #jruby
claudiuinberlin has quit [Client Quit]
<kares[m]> if you read above, we decided to try having to_time on the Java types
<kares[m]> in terms of `to_java` we'll likely just ship the single method (various toX methods are available on the Java side)
<kares[m]> incidentally I also managed to find a bug with Time to Java Instant conversion
claudiuinberlin has joined #jruby
travis-ci has joined #jruby
<travis-ci> jruby/jruby (ji-bigdecimal:6f5fda0 by kares): The build has errored. https://travis-ci.org/jruby/jruby/builds/521690414 [236 min 7 sec]
travis-ci has left #jruby [#jruby]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<JulesIvanicGitte> @kares :+1:
lucasb has joined #jruby
<kares[m]> okay, so here's the `to_time` PR proposal for Java DateTime types: https://github.com/jruby/jruby/pull/5703
<JulesIvanicGitte> oh great!
<JulesIvanicGitte> amazing how fast you are 🙂
<kares[m]> don;t get used to it ...
<FlorianDoubletGi> cool !
xardion has quit [Remote host closed the connection]
subbu is now known as subbu|away
xardion has joined #jruby
shellac has quit [Ping timeout: 246 seconds]
<JulesIvanicGitte> > don;t get used to it …
<JulesIvanicGitte> :D
<JulesIvanicGitte> (edited) ... …
<JulesIvanicGitte> :D => ... …
<JulesIvanicGitte> 😄
subbu|away is now known as subbu
claudiuinberlin has joined #jruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #jruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
subbu is now known as subbu|away
lucasb has quit [Quit: Connection closed for inactivity]
drbobbeaty has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
subbu|away is now known as subbu
drbobbeaty has joined #jruby
<headius[m]> hah