Project

General

Profile

Actions

Feature #18265

open

Self-contained one-binary feature which discuss on ruby kaigi 2021 day 2, 《 Ruby Committers vs the World / CRuby Committers》

Added by zw963 (Wei Zheng) about 1 month ago. Updated about 1 month ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:105757]

Description

https://www.youtube.com/watch?v=zQnN1pqK4FQ

Yes, what i said is this.

  1. Go-language supports to make self-contained one-binary.
  2. Is it useful for ruby?

I personal propose add this feature into ruby 3.X in the future, i consider this is a killer
advantage compare to others dynamic language.

And, this feature is very important for distribute code to the third party.(e.g. client) for two reason:

  1. distribute is easy.
  2. for protect code change unexpectly by client

in fact, my friend switch from ruby to go recent days, the only reason is, it could not find out
a usable solution to distribute code to our client safely.

Because i could not find out a mature similar issue, so, just create this for discuss.

BTW: maybe not so useful, Emacs editor since version 28 can native compilation of Elisp files which has greatly improved performance and start-up time, i don't know if this tech can be borrow from there for ruby.

anyway, i consider both are similarities, i hope that can help.

Following is some links come from Andrea Corallo, the emacs native compilation maintainer.

https://akrl.sdf.org/gccemacs.html
https://akrl.sdf.org/Kludging_LPC_2020.pdf

Hope there have useful info for AoT ruby .rb source code into .rbn(rb native, as .el compile to .eln) use libgccjit.


Files

clipboard-202110232053-mgbon.png (169 KB) clipboard-202110232053-mgbon.png zw963 (Wei Zheng), 10/23/2021 12:54 PM
Actions #1

Updated by zw963 (Wei Zheng) about 1 month ago

  • Subject changed from One-bianry feature which discuss on ruby kaigi 2021 day 2, 《 Ruby Committers vs the World / CRuby Committers》 to Self-contained one-bianry feature which discuss on ruby kaigi 2021 day 2, 《 Ruby Committers vs the World / CRuby Committers》
Actions #2

Updated by zw963 (Wei Zheng) about 1 month ago

  • Description updated (diff)

Updated by Eregon (Benoit Daloze) about 1 month ago

FYI, MRuby supports this. Of course it just embeds the bytecode in the binary, no actual AOT compilation of Ruby code.

Also there are various gems which make this possible for CRuby, notably https://github.com/pmq20/ruby-packer, although I'm not sure how easy/hard it is to use them.

Personally I'm not sure I see the advantage of one executable vs one archive with a clear executable inside.
One executable forces using a virtual file system and potentially extracting .so files in a temporary directly on every execution
(e.g. dlopen()/native library deps need a real file on the filesystem, and that's needed for C extensions which can't easily be statically-linked),
vs the archive working much more similarly to regular Ruby installations.

Updated by duerst (Martin Dürst) about 1 month ago

  • Subject changed from Self-contained one-bianry feature which discuss on ruby kaigi 2021 day 2, 《 Ruby Committers vs the World / CRuby Committers》 to Self-contained one-binary feature which discuss on ruby kaigi 2021 day 2, 《 Ruby Committers vs the World / CRuby Committers》
  • Fixed typo in Subject

  • When proposing a feature, please describe the feature in the text here, not just by reference (e.g. to a Youtube video).

Actions #5

Updated by zw963 (Wei Zheng) about 1 month ago

  • Description updated (diff)
Actions #6

Updated by zw963 (Wei Zheng) about 1 month ago

  • Description updated (diff)
Actions #7

Updated by zw963 (Wei Zheng) about 1 month ago

  • Description updated (diff)

Updated by zw963 (Wei Zheng) about 1 month ago

duerst (Martin Dürst) wrote in #note-4:

  • Fixed typo in Subject

  • When proposing a feature, please describe the feature in the text here, not just by reference (e.g. to a Youtube video).

Updated, so there is exists more describe for now.

for that youtube video, except copy the video content, i can't do more, because I can't understand Japanese

Actions

Also available in: Atom PDF