Hacker News new | ask | show | jobs
by floppy-disk 723 days 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_....
1 comments

Very 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.

I’ll try this out sometime, but probably through docker

https://hub.docker.com/r/hublogix/minimal-ruby

Yeah.. 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

> 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?

Hmm, 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?

Okey 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?