Live data from Hacker News

mruby

github.com

51–59 of 59 posts

Re: mruby

#51
post #23

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.

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

Re: mruby

#52

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

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.

Re: mruby

#53
post #41

Earlier 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…

The GP mentioned arbitrary precision integers, which Python has. I believe they're called Long, and integers that overflow are cast to Long (represented as 123L).

Re: mruby

#54
post #33

Earlier 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…

What? No mention of indexing starting at 1, not 0? :)

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

#55
post #49
post #36

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

Oh on arm you will definitely will want to check out luajit precisely for the number performance - see this comment for details : http://news.ycombinator.com/item?id=2617835 - luajit will use integers where it can.

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

#56
post #40

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

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?

Re: mruby

#57
post #56
post #40

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

LuaJIT 2 is fast because the Lua world has Mike, who is a genius.

That said, Lua is fucking weird.

Re: mruby

#59
post #56
post #40

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

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.
Post reply on HN