
mruby - ryansama
https://github.com/mruby/mruby
======
skrebbel
Could anyone explain to me what the difference with normal ruby is?

"Lightweight", does that mean:

    
    
        Small but slow?
        Big but fast?
        Quite small and quite fast, but with a half-assed library?
        Big, slow, but low RAM usage?
    

I understand from another comment that this is intended for embedded systems.
Does that mean running it on a microcontroller without OS? Cause the moment
you can flash Linux, you can use Ruby MRI, no?

~~~
heretohelp
>I understand from another comment that this is intended for embedded systems.

Nope, he said embedding. He means things like Lua where you have a scripting
language embedded in a program that is running on a faster lnaguage. Common in
video game dev.

>Does that mean running it on a microcontroller without OS?

Nope, not necessarily. It being portable means it's plausible but it's an
unlikely usage scenario. More likely, it means being able to use it across a
variety of POSIX derivatives.

>Cause the moment you can flash Linux, you can use Ruby MRI, no?

Also not true. What a micro-distribution of Linux can run on is not
necessarily something MRI Ruby can also run on.

~~~
skrebbel
Okok, I was wrong. Now, what's mruby for?

~~~
india
Think of it as a replacement for Lua. Something you will be able to include as
a scripting subsytem in most other languages.

~~~
ksec
But LuaJIT 2 is insanely fast, even the Heavy / Fast Ruby isn't even anywhere
near its speed. So why would one choose mRuby over Lua?

~~~
Cloven
Heavy Ruby is not designed for speed, and much of its heaviness causes
slowness. It's entirely possible/likely that mruby will be in the same
ballpark as luajit2 soon after release.

------
anemic
I've been waiting this for a long time. There's also TinyRB
(<http://code.macournoyer.com/tinyrb/>) but it's too small subset of ruby to
be useful and seems abandoned.

But my first impressions are not very positive (stripped x86_64 executables
with -Os):

    
    
      -rwxr-xr-x 1 user group 708480 Apr 20 11:27 mrbc
      -rwxr-xr-x 1 user group 713056 Apr 20 11:27 mruby
      -rwxr-xr-x 1 user group 712128 Apr 20 11:27 mrubysample
    

compared to lua-5.2.0:

    
    
      -rwxr-xr-x 1 user group 147864 Apr 20 11:28 lua
      -rwxr-xr-x 1 user group  99168 Apr 20 11:28 luac
    

I'm not a big fan of lua as a language but it has been the only option to do
scripting on small embedded systems. I've manged to compile size-optimized
version of lua on arm to the size of about 80kb but mruby just might be too
big for my embedded usage.

~~~
stcredzero
Lua "cheats" by leaving out regular expressions and including a lightweight
(but still powerful) matching facility.

~~~
batista
Plus, no unicode support. This needs lots of code to support properly. Does
mruby include it?

------
masuidrive
I will release MobiRuby that's mRuby + iOS. <http://mobiruby.org/>

~~~
anshul
Would really love to see something like this.

------
manojlds
I am seeing this sort of thing frequently in GitHub - people start working on
something and it gets "released" before they are ready with it and the authors
have to scramble to say that this is not ready, ward off degrading comments
etc.

The js.js blog post mentions this and in mrbuy , the README has just been
updated. Is social coding being taken to the extreme?

~~~
simondlr
Why don't they use something like bitbucket (free private repos) until it is
ready to be launched?

~~~
readme
I seriously doubt that whether the repositories were private was a financial
consideration. More likely, they wanted others to be able to find the project
and join in.

People who develop software of this caliber can easily afford the expense of a
private Github repository if they want one.

------
rkwz
>mRuby is the light-weighted implementation of ruby language complied with ISO
standard to execute various environment. It can run as 'interpreter form' or
'compile and execute on vm form' according to its module construction.

Can anyone tell me how it's different from other ruby implementations? What
does 'execute various environment' mean? Can I run it inside JVM like JRuby?

------
termie
Matz talks about mruby here
<http://www.youtube.com/watch?v=OubzA8Q25jQ#t=1508s>

Here is more info on RiteVM
[http://www.reddit.com/r/ruby/comments/k9jce/ruby_ritevm_faq_...](http://www.reddit.com/r/ruby/comments/k9jce/ruby_ritevm_faq_and_timeline_updates/)

~~~
obtu
Is RiteVM related? The reddit faq mentions both embedded systems and embedding
via C API, I don't know which is the goal of that project. (sorry if that was
covered in the talk, I'd rather not watch youtube right now)

------
geoffroy
Matz presentation : <http://news.ycombinator.com/item?id=3867079>

------
piyushpr
Matz talked about this in RubyConfIndia in March. Glad that it is here
finally.

------
sirclueless
When I visit <http://www.mruby.org> Google translate tells me, "This domain
has been captured by. Com name."

As an aside, this sent me on a little adventure to <http://www.mruby.com>
which is ... quite a treat.

~~~
ryansama
The domain registrar is basically "Name.com" in Japanese. Google translate
often fails hard on Japanese to English.

~~~
harisenbon
And Onamae.com is one of the best registrars that we have here (for all its
issues)

------
nichtdoerthe
Here's a blog post on using mruby as embedded language in a nosql database
(AvocadoDB), like Lua within Redis.

[http://www.avocadodb.org/2012/04/20/using-mruby-as-
alternati...](http://www.avocadodb.org/2012/04/20/using-mruby-as-alternative-
to-server-side-javascript)

------
wsxiaoys
Great job, i have been wondering ruby as an embedding/portable small language
for a long time.

------
cageface
I am a big Ruby fan but I don't really see how this is _enough_ of an
improvement over Lua to pose a serious threat.

~~~
mattmanser
I thought the hivemind was that Lua was bloody awful?

Disclaimer: I have never even read some Lua, honest question

~~~
statictype
It's not _elegant_ but it's incredibly compact and isolated. I embedded it as
a language in an iPhone game (as have many others). Making it bridge with
Objective-C was fairly straight-forward and the memory/speed footprint was
acceptable for a mobile device.

~~~
stcredzero
I find it elegant. It's like Javascript with the warts removed.

~~~
atombender
It's like JavaScript with _different_ warts. Examples: Bad at Unicode, arrays
start at 1, regexps is a second-class citizen, weird OO, arrays are
implemented as hash tables (like PHP), hash tables are weird, no int type,
Java-like inflexibility wrt extensibility (no generalization for iteration,
for example) etc.

