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 t…
Lua "cheats" by leaving out regular expressions and including a lightweight (but still powerful) matching facility.
mruby
51–59 of 59 posts
Re: mruby
#52Earlier quoted context omitted.
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.
I find it elegant. It's like Javascript with the warts removed.
Re: mruby
#53Earlier quoted context omitted.
-- Comment syntax is that a big deal? - bit wise: LuaJIT? - Just like in Python and Javascript, what's the issue? Doubles do just fine as integers if you code so that you always wind up with other integers. - OOP - This I agree is a community fragmentation issue.
One issue is that it's easy to end up with things that aren't round numbers by mistake (if you do any sort of division, for example, or are getting results from an external library, etc., and strategies for reducing errors that rely on the programmer not screwing up are generally doomed to failure.) That has several problems: floats are imprecise, you introduce the potential for additional runtime errors if you're do…
Re: mruby
#54Earlier quoted context omitted.
Why aren't you a fan of lua? From what I've seen, it looks great.
Just a quick list of annoying things: - comments start with -- - no bitwise operations in language - default numeric data type is floating-point. it's possible to change it to integer but it raises uncertainty with compatibility of external libraries - OOP in lua is quite programmer-specific: everyone seems to have their own best practises Of course lua has good features too, like coroutines and good C API. Squirrel…
I just started doing some Lua coding. So far nothing really off-putting, just a need to watch for habits picked up form other languages.
Biggest complaint is the lack of metaprogramming (e.g eval).
Re: mruby
#55Earlier quoted context omitted.
for the comments: that's a matter of taste, IMHO. for bitwise ops: look at 5.2, it has it now. 32-bit operations. floating point arithmetic: in practice, I haven't seen it as a problem as soon as I stay within the 32-bit range - then the numbers can be represented exactly, so the abstraction works well. OOP: can't say for it, I did not do it much. For the "fast" - check luajit ( http://luajit.org/ ) - it is near-nati…
oh yeah, the array indexing starting with one is the one I forgot from my list! I'm developing for an arm processor with no floating point support. so it's best to avoid the software fallback at all costs. I'm aware of luajit but "plain" lua is still fast enough for my uses. FFI is definitely a killer and beats SWIG hands down. need to upgrade to 5.2 asap...
I did not experiment with this myself though, but hopefully it might ease your woes with no FPU - http://luajit.org/performance_arm.html shows 85x speedup for md5, which I suppose would be integer algorithm.
Out of curiosity, what is the platform, if not a secret ?
Re: mruby
#56Earlier quoted context omitted.
Okok, I was wrong. Now, what's mruby for?
Think of it as a replacement for Lua. Something you will be able to include as a scripting subsytem in most other languages.
Re: mruby
#57Earlier quoted context omitted.
Think of it as a replacement for Lua. Something you will be able to include as a scripting subsytem in most other languages.
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?
That said, Lua is fucking weird.
Re: mruby
#58http://www.avocadodb.org/2012/04/20/using-mruby-as-alternati...
Re: mruby
#59Earlier quoted context omitted.
Think of it as a replacement for Lua. Something you will be able to include as a scripting subsytem in most other languages.
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?