4 ms·
Whoa, interesting... What version are you running? Here's my system: $ ruby -v ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux] $ time ruby -e
by floppy-disk 2y ago
Whoa, interesting...
What version are you running?
Here's my system:
$ ruby -v
ruby 3.3.1 (2024-04-23 revision c56cd86388) [x86_64-linux]
$ time ruby -e ''
real 0m0.122s
user 0m0.102s
sys 0m0.020s
I found an old Reddit thread also hinting at bad start-up times: https://old.reddit.com/r/ruby/comments/aqxepw/rubys_startup_time_seems_to_get_worse https://old.reddit.com/r/ruby/comments/aqxepw/rubys_startup_....
- Borg3 2y agoVery old one :) Because its reliable. Version 1.8.7 here. I want controllable delays. I want controllable threads :) I want portability. Of course, if you need more peformance, you need to go for newer stuff.
- Alifatisk 2y agoI’ll try this out sometime, but probably through docker https://hub.docker.com/r/hublogix/minimal-ruby https://hub.docker.com/r/hublogix/minimal-ruby
- Borg3 2y agoYeah.. old ruby have interesting build system. It first build miniruby with is single selfcontained binary having all core ruby functionality. Then, it is used to run some more .rb build scripts to finaly make fully functional ruby. Actyally that miniruby is pretty usefull. For basic stuff. Also, its very easy to build static ruby containing all extra stuff you care about, like Win32 API for example. I myself have custom ruby binary on Win32 (Cygwin) with GRX library added in, So I can do basic graph stuff directly from ruby :) That stuff is written in it: http://borg.uu3.net/~borg/?gperf http://borg.uu3.net/~borg/?gperf
- Alifatisk 2y ago> It first build miniruby with is single selfcontained binary having all core ruby functionality. > For basic stuff. Also, its very easy to build static ruby containing all extra stuff you care about, like Win32 API for example. Wow, this reminds me abit of MRuby. So I could basically ship a script with the self-contained ruby executable instead of having to force users to install Ruby on their machine? How can I get ahold of miniruby? Or is there any resource somewhere that I can dig into?
- Borg3 2y agoHmm, I think this is not supported, but probably not very hard to do it at least for Windows (PE executable). Hard to say about new Ruby versions like 3.x or even 2.x. 1.8.x have pretty simple building process, just grab the old source. You can use --enable-static builds there. Miniruby is build by default, always, because its part of building process. Also, if you are platform are you targeting? Win32 only?
- Alifatisk 2y agoOkey thank you for the details. I am mainly targetting windows but I wouldn’t mind being able to include mac & linux aswell. I wonder if experimenting miniruby with cosmopolitian would help with that?
- Borg3 2y agoIm not sure what you mean by this... Anyway, if you want to peek at my stuff, take a look at those 2 urls below. One contains various Ruby 1.8.7 Win32 builds (compiled using older Mingw). Other one is my gperf. All this will work on Win2000 and up. In case of gperf, Windows needs to be en_US build. Anything other will simple not work, because Microsoft with they wisdom, localized perf counter names instead aliasing them! Not smart, heh.. http://borg.uu3.net/ftp/pub/archive/ruby/ http://borg.uu3.net/ftp/pub/archive/ruby/ http://ds-1.ovh.uu3.net/ftp/home/borg/gperf.zip http://ds-1.ovh.uu3.net/ftp/home/borg/gperf.zip
- Alifatisk 2y agoWhat I meant is that compiling cosmopolitan with miniruby would maybe make the miniruby executable APE-format (actually portable executable). That would allow me to run the same executable on all these mentioned platforms. But Idk, I’m just thinking loudly and probably missing a huge detail which would make the idea non-working. Also, thanks for the linked resource, I’ll definitely give it a go!
- 2y ago