People,
Is anyone doing this?
Anyone thought about doing it?
- I would be interested in helping! - I am prob not clued-up enough to
do it by myself . .
Phil.
People,
Is anyone doing this?
Anyone thought about doing it?
- I would be interested in helping! - I am prob not clued-up enough to
do it by myself . .
Phil.
On Thu, Mar 25, 2021 at 7:33 AM Philip Rhoades <phil@pricom.com.au> wrote:
People,
Is anyone doing this?
Anyone thought about doing it?
- I would be interested in helping! - I am prob not clued-up enough to do
it by myself . .Phil.
Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
--
Regards
Vineeth B S
Is anyone doing this?
Anyone thought about doing it?
- I would be interested in helping! - I am prob not clued-up enough to do it by myself . .
Do you mean compiling MRI to WASM, or compiling Ruby programs to WASM?
Compiling MRI to WASM should be possible with Emscripten.
Now compiling Ruby programs to WASM or regular ASM... that's a
different story. Of course any Ruby program can be written in (W)ASM
in _some way_, after all, MRI itself is compiled to ASM, and the Ruby
code that runs inside is thus proved to be possible under ASM
limitations...
However, because the crazy metaprogramming Ruby allows, there might
not be much room for translating Ruby programs into (W)ASM without
resorting to reimplementing some sort of Ruby interpreter.
I heard there are efforts to make a compiler to translate a _subset of
Ruby_ to machine code, so some bits of Ruby that don't use
metaprogramming or other complicated features could be optimized. But
that's a _subset of Ruby_...
There is also the Crystal lang that might be of interest, a Rubyish
language that compiles to machine code.
--
pudim (she/her)
Vineeth,
I did look at Artichoke after you responded but I never got around to thanking you for the link - so thanks!
Phil.
On 2021-03-25 19:25, Vineeth Sathish wrote:
GitHub - artichoke/artichoke: 馃拵 Artichoke is a Ruby made with Rust
On Thu, Mar 25, 2021 at 7:33 AM Philip Rhoades <phil@pricom.com.au> > wrote:
People,
Is anyone doing this?
Anyone thought about doing it?
- I would be interested in helping! - I am prob not clued-up enough
to do it by myself . .Phil.
Unsubscribe:
<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>--
Regards
Vineeth B S
--
Philip Rhoades
PO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.au
I think it could be an awesome project.
Ruby will always be just outstanding for flexibility and elegance. If there
is a sea change coming here with web tech, with WASM gaining ground, I
think a Ruby oriented project would be really exciting.
On Sun, Oct 17, 2021 at 7:47 AM Philip Rhoades <phil@pricom.com.au> wrote:
Vineeth,
I did look at Artichoke after you responded but I never got around to
thanking you for the link - so thanks!Phil.
On 2021-03-25 19:25, Vineeth Sathish wrote:
> GitHub - artichoke/artichoke: 馃拵 Artichoke is a Ruby made with Rust
>
> On Thu, Mar 25, 2021 at 7:33 AM Philip Rhoades <phil@pricom.com.au> > > wrote:
>
>> People,
>>
>> Is anyone doing this?
>>
>> Anyone thought about doing it?
>>
>> - I would be interested in helping! - I am prob not clued-up enough
>> to do it by myself . .
>>
>> Phil.
>> Unsubscribe:
>> <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
>> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
>
> --
> Regards
> Vineeth B S--
Philip RhoadesPO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.auUnsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
--
A musician must make music, an artist must paint, a poet must write, if he
is to be ultimately at peace with himself.
- Abraham Maslow
Sean Felipe,
I think it could be an awesome project.
Ruby will always be just outstanding for flexibility and elegance. If
there is a sea change coming here with web tech, with WASM gaining
ground, I think a Ruby oriented project would be really exciting.
Agreed!
P.
On 2021-10-18 03:36, Sean Felipe Wolfe wrote:
On Sun, Oct 17, 2021 at 7:47 AM Philip Rhoades <phil@pricom.com.au> > wrote:
Vineeth,
I did look at Artichoke after you responded but I never got around
to
thanking you for the link - so thanks!Phil.
On 2021-03-25 19:25, Vineeth Sathish wrote:
GitHub - artichoke/artichoke: 馃拵 Artichoke is a Ruby made with Rust
On Thu, Mar 25, 2021 at 7:33 AM Philip Rhoades >> <phil@pricom.com.au> >>> wrote:
People,
Is anyone doing this?
Anyone thought about doing it?
- I would be interested in helping! - I am prob not clued-up
enough
to do it by myself . .
Phil.
Unsubscribe:
<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>--
Regards
Vineeth B S--
Philip RhoadesPO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.auUnsubscribe:
<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>--
A musician must make music, an artist must paint, a poet must write,
if he is to be ultimately at peace with himself.
- Abraham Maslow
--
Philip Rhoades
PO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.au
There were a few projects about compiling MRuby or Ruby itself with Emscripten or WASI and while I haven't explored them very much, from my experience there are 2 issues:
- The resulting binary size is definitely a large issue. Artichoke is 2.68MB uncompressed, 789kiB compressed, plus a similarly sized boilerplate code (Emscripten): https://artichoke.run/ . Compiling MRI may be possible, but a similar project for Python with its math libraries is 18.67MB/6.78MB: https://pyodide.org/en/stable/console.html
- No real DOM access. We are limited to exchanging buffers. I haven't seen a real gateway library written for those. If your code is mostly focused on computation this is fine, but for the regular web development this may not work as of now.
I'm a developer of Opal which is a self-hosted Ruby/JavaScript implementation of the language (no WASM involved). There are certain issues where we currently lag behind:
- The resulting code size is also not so great: it's 1.60MB uncompressed, 309kB compressed for https://try.ruby-lang.org/. In my production codebase I managed to get down to 662kB/145kB while including a Ruby-native DOM wrapper (opal-browser) but excluding the compiler - the size optimizations I performed are available on my GitHub.
- Strings are immutable and mostly don't support encodings. We are going to tackle the immutability issue someday, but unfortunately this will ultimately cost us a little bit of performance.
- Regexp support is limited to what a browser supports, which is certainly less than Ruby. There was an attempt of compiling Onigmo to WASM and integrating it with Opal, but native JS regexp is orders of magnitude faster.
- Performance is not so great. This won't matter for typical web development, but for tasks like compiling Opal corelib by an Opal-compiled Opal on V8 takes 35s, while on MRI it takes 2.5s. There is a headroom for improvements, but WASM solutions will certainly win here.
- The control flow is sometimes an issue when you are doing something very very unconventional. We are improving on this from version to version.
On the other hand, the codebase is mature (more than 10 years in development) and there are various modern web development libraries available, like for example https://hyperstack.org/ (React-based), GitHub - AndyObtiva/glimmer-dsl-opal: Glimmer DSL for Opal (Pure-Ruby Web GUI and Auto-Webifier of Desktop Apps) (desktop app development paradigm for the Web), https://github.com/isomorfeus/isomorfeus-project (also React-based) or aforementioned GitHub - opal/opal-browser: Browser support for Opal. (pure DOM access). And chances are your favorite pure-Ruby library will happily compile to JavaScript unchanged. And you are able to interface any JS library very easily.
On 10/17/21 18:36, Sean Felipe Wolfe wrote:
I think it could be an awesome project.
Ruby will always be just outstanding for flexibility and elegance. If there is a sea change coming here with web tech, with WASM gaining ground, I think a Ruby oriented project would be really exciting.
On Sun, Oct 17, 2021 at 7:47 AM Philip Rhoades <phil@pricom.com.au> wrote:
Vineeth,
I did look at Artichoke after you responded but I never got around to
thanking you for the link - so thanks!Phil.
On 2021-03-25 19:25, Vineeth Sathish wrote:
> GitHub - artichoke/artichoke: 馃拵 Artichoke is a Ruby made with Rust
>
> On Thu, Mar 25, 2021 at 7:33 AM Philip Rhoades <phil@pricom.com.au> > > wrote:
>
>> People,
>>
>> Is anyone doing this?
>>
>> Anyone thought about doing it?
>>
>> - I would be interested in helping! - I am prob not clued-up enough
>> to do it by myself . .
>>
>> Phil.
>> Unsubscribe:
>> <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
>> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
>
> --
> Regards
> Vineeth B S-- Philip Rhoades
PO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.auUnsubscribe:
<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>--
A musician must make music, an artist must paint, a poet must write, if he is to be ultimately at peace with himself.
- Abraham MaslowUnsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
Very interesting stuff ... I've tinkered with Opal in the past and it was
fun ! Thanks for the details.
On Mon, Oct 18, 2021 at 2:59 AM hmdne <hmdne@airmail.cc> wrote:
There were a few projects about compiling MRuby or Ruby itself with
Emscripten or WASI and while I haven't explored them very much, from my
experience there are 2 issues:- The resulting binary size is definitely a large issue. Artichoke is
2.68MB uncompressed, 789kiB compressed, plus a similarly sized
boilerplate code (Emscripten): https://artichoke.run/ . Compiling MRI
may be possible, but a similar project for Python with its math
libraries is 18.67MB/6.78MB: https://pyodide.org/en/stable/console.html- No real DOM access. We are limited to exchanging buffers. I haven't
seen a real gateway library written for those. If your code is mostly
focused on computation this is fine, but for the regular web development
this may not work as of now.I'm a developer of Opal which is a self-hosted Ruby/JavaScript
implementation of the language (no WASM involved). There are certain
issues where we currently lag behind:- The resulting code size is also not so great: it's 1.60MB
uncompressed, 309kB compressed for https://try.ruby-lang.org/. In my
production codebase I managed to get down to 662kB/145kB while including
a Ruby-native DOM wrapper (opal-browser) but excluding the compiler -
the size optimizations I performed are available on my GitHub.- Strings are immutable and mostly don't support encodings. We are going
to tackle the immutability issue someday, but unfortunately this will
ultimately cost us a little bit of performance.- Regexp support is limited to what a browser supports, which is
certainly less than Ruby. There was an attempt of compiling Onigmo to
WASM and integrating it with Opal, but native JS regexp is orders of
magnitude faster.- Performance is not so great. This won't matter for typical web
development, but for tasks like compiling Opal corelib by an
Opal-compiled Opal on V8 takes 35s, while on MRI it takes 2.5s. There is
a headroom for improvements, but WASM solutions will certainly win here.- The control flow is sometimes an issue when you are doing something
very very unconventional. We are improving on this from version to version.On the other hand, the codebase is mature (more than 10 years in
development) and there are various modern web development libraries
available, like for example https://hyperstack.org/ (React-based),
GitHub - AndyObtiva/glimmer-dsl-opal: Glimmer DSL for Opal (Pure-Ruby Web GUI and Auto-Webifier of Desktop Apps) (desktop app development
paradigm for the Web), https://github.com/isomorfeus/isomorfeus-project
(also React-based) or aforementioned
GitHub - opal/opal-browser: Browser support for Opal. (pure DOM access). And chances are
your favorite pure-Ruby library will happily compile to JavaScript
unchanged. And you are able to interface any JS library very easily.