grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
In0perable has quit [Excess Flood]
Inoperable has joined #ruby
grokify has joined #ruby
grokify has quit [Ping timeout: 246 seconds]
caedmon has quit [Ping timeout: 265 seconds]
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grokify has joined #ruby
<isene>
How do I find the path of a specific gem from within a ruby script?
gonix has quit [Read error: Connection reset by peer]
mdemo has joined #ruby
<ox1eef_>
isene: Gem.latest_spec_for("foo").gem_dir - seems to be extremely slow, though.
<ox1eef_>
Gem.loaded_specs.find { _2.name == "foo" }.gem_dir is considerably faster, but that's assuming you have loaded the gem into the Ruby process already.
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Ping timeout: 246 seconds]
cartdrige has joined #ruby
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
some14u has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_ht has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
some14u has joined #ruby
grokify has joined #ruby
some14u has quit [Client Quit]
<isene>
ox1eef_: To specify, what I need is for the main executable to load all the functionality that is located as separate scripts under the "lib" folder where the gem is installed
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Ping timeout: 256 seconds]
<ox1eef_>
isene: Dir.glob(File.join(Gem.latest_spec_for("foo").gem_dir, "lib", "**/*.rb")).each do { require(_1) } - I don't quite get it though. Why are you doing this?
<ox1eef_>
If you want to load 'lib/foo.rb' from 'bin/foo.rb', then you could use __dir__ but there's no need since rubygems should take care of that for you.
markong has quit [Ping timeout: 260 seconds]
dviola has quit [Ping timeout: 264 seconds]
dviola has joined #ruby
grokify has joined #ruby
grokify has quit [Ping timeout: 256 seconds]
FullMetalStacker has quit [Remote host closed the connection]
FullMetalStacker has joined #ruby
caedmon has joined #ruby
crax23 has joined #ruby
caedmon has quit [Ping timeout: 260 seconds]
cartdrige has quit [Ping timeout: 268 seconds]
grokify has joined #ruby
FullMetalStacker has quit [Remote host closed the connection]
grokify has quit [Ping timeout: 260 seconds]
FullMetalStacker has joined #ruby
ur5us has joined #ruby
some14u has joined #ruby
some14u has quit [Client Quit]
grokify has joined #ruby
grokify has quit [Ping timeout: 246 seconds]
goldfish has joined #ruby
caedmon has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
caedmon has quit [Client Quit]
caedmon has joined #ruby
grokify has joined #ruby
caedmon has quit [Client Quit]
caedmon has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
caedmon has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
neshpion has joined #ruby
<neshpion>
what is jruby and mruby and picoruby and truffleruby
<adam12>
neshpion: Different versions of a Ruby interpreter.
_ht has quit [Quit: _ht]
<neshpion>
what sets them apart from each other?
<havenwood>
neshpion: JRuby is a full featured implementation of Ruby on the JVM. It's an alternative JVM language to others like Scala, Clojure and Kotlin.
<neshpion>
it's more portable?
<havenwood>
TruffleRuby can also run on the JVM but also can be backed by GraalVM/SubatrateVM. It's more experimental than JRuby but runs C-extenions, unlike JRuby which uses Java extensions that are broadly available for popular gems. The big TruffleRuby wins are performance due a JIT more advanced than most all out there and language interop.
<havenwood>
neshpion: It runs where JRuby runs, so very portable and runs on Android, etc.
<havenwood>
I mean, runs where Java runs*
<havenwood>
MRuby is not an alternative implementation of CRuby, but a subset of the language targeting embedding. PicoRuby is MRuby with a smaller footprint for devices wiht extremely limited resources.
<havenwood>
You can embed MRuby inside C code, or inside other compiled languages like Crystal, Nim, Zig, whatever.
<havenwood>
MRuby can run on a toaster.
<neshpion>
MRuby in the kernel when
<havenwood>
It backs portable projects like DragonRuby for games, since it can run on many platforms.
goldfish has quit [Read error: Connection reset by peer]
<havenwood>
neshpion: You can already include MRuby in kernel C or Rust code, FWIW.
<havenwood>
I mean, they might reject the PR, but there's no technical limitation.
<neshpion>
also by CRuby do you mean the default ruby implementation e.g. that rbenv lists as simply 'ruby'?
<havenwood>
Yes, CRuby is another name for the Reference C implementation of Ruby.
<neshpion>
or simply by its verison number*
<neshpion>
ok
grokify has joined #ruby
some14u has joined #ruby
<havenwood>
Most folk run CRuby in production. MRuby has growing popularity for embedded devices and portability but most folk aren't writing web apps in it and it certainly can't run Rails.
<havenwood>
JRuby can run Rails well and TruffleRuby can run it as well.
<neshpion>
what's rbx
<havenwood>
There are also up-and-coming implementations like Artichoke Ruby (in Rust, aims to be able to target small WASM binaries) and Natalie (compiles to C++, so small binary executables).
<havenwood>
Rubinius (rbx) was a largely Ruby (and C++) implementation of Ruby that is no longer being developed.
<havenwood>
It's now a "language platform" but I don't know anyone using it anymore.
<havenwood>
TruffleRuby is now the "mostly Ruby" implementation and was able to harness a fair bit of rbx code.
<havenwood>
In Ruby 3.2 you can create a WASM+WASI Ruby VM and ship your code with it for serverside stuff but it's not very appealing to send 10+ MB to the browser.
<havenwood>
It's interesting how most Ruby VMs now have some sorta WASM options at least on the roadmap.
<adam12>
I'll be curious what happens with TruffleRuby now that Chris is stepping out.
<havenwood>
adam12: It's well maintained at the moment. Chris had been working at Shopify on various other Ruby projects.
<havenwood>
adam12: A few years back Willem from Shopify reached out to Square asking about promising Ruby research and was forwarded to me. I recommended they hire Seaton, who oddly didn't seem to be on their VM research radar, and they did.
<adam12>
havenwood: Interesting.
<havenwood>
adam12: eregon and andrykonchin are pushing TruffleRuby forward pretty nicely, for now
<havenwood>
They're fantastic maintainers, so as long as Oracle stewards the project it should be in good shape.
<havenwood>
Nirvdum and others are still around too.
neshpion has quit [Quit: neshpion]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
some14u has quit [Client Quit]
<caleb>
havenwood: is Seaton ok? His last tweet is kind of worrying
<caleb>
with the wording permanent rest and all
grokify has joined #ruby
<isene>
ox1eef_: Here's the full reason. My programming language written i Ruby; XRPN (https://github.com/isene/xrpn) is similar to Forth in that all the functionality is comprised of specific words. Each word is a separate ruby file that is loaded during runtime. The basic set of functions - some 260 are residing in a subdir called "cmd". But the user can add his own functions - on the fly, while an XRPN
<isene>
program is running - by dropping it into ~/.xrpn/cmd. So, the XRPN executable must read both the files in the "cmd" subdir under where the gem is installed and the files in ~/.xrpn/cmd. And there is a similar "global" and "local" directory called "lib" that reads more core stuff needed by XRPN.
<adam12>
Actually, I wonder if they are deprecating datadir? Hm.
<adam12>
Nevermind, just Gem.datadir is being deprecated.
neshpion has joined #ruby
legahc has quit [Quit: %bye%]
cnsvc- has quit [Quit: %bye%]
legahc has joined #ruby
cnsvc has joined #ruby
<ox1eef_>
isene: I don't understand why you have to bypass Rubygem's require method for that. Avoid 'Gem.latest_spec_for', it is incredibly slow.
<ox1eef_>
If you want to do hot reloads, have you thought of Kernel#load instead?
<ox1eef_>
But yeah, I don't get the bigger picture. I don't see why you couldn't require the base of your language, and then load ~/.xrpn/cmd on demand.
<ox1eef_>
The 'listen' gem might be useful for your usecase, it can detect changes in a diectory and fire a callback when it does. It leverages what's native to the OS, so the performance is usually good.
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
grokify has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
grokify has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
markong has joined #ruby
grokify has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Ping timeout: 246 seconds]
moldorcoder7 has quit [Ping timeout: 268 seconds]
reset has quit [Quit: reset]
grokify has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
<havenwood>
caleb: I certainly hope so but don't have any insight. On initial read I assumed Chris was simply stepping back from Ruby after many years of intense focus.
<havenwood>
I don't know anything else. His impact has been huge for TruffleRuby and Ruby generally. Amazing maintainer, teacher, researcher, contributor to medical science, etc.