Live data from Hacker News

mruby

github.com

41–50 of 59 posts

Re: mruby

#41
post #33

Earlier quoted context omitted.

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…

-- 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 doing something like indexing into an array, etc.

Also, Python has separate integer and floating-point operations:

    >>> type(1)
    
    >>> type(1.0)
    

Re: mruby

#42

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.

www.mruby.com

Matt Ruby, Comedian, writer, and 37signals’ first employee.

Probably not a coincidence.

Re: mruby

#43
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…

Honestly, I'm pretty impressed it's only 7-10 times the size. Ruby is a comparatively huge language, and the compiled size will more likely get smaller than larger from here.

Re: mruby

#44
post #4

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?

Yes, it would be nice to know what tradeoffs mruby makes and how they differ from the ones made by other ruby implementations

Re: mruby

#45

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.

Yeah, it's not bad. Though having array indices begin with 1 annoys me.

Re: mruby

#46

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.

Depends on the audience. There are probably lots of people who know Ruby and would like to be able to use it where they currently can't. It might not be likely to win the hearts of the C++ game engine hackers, but that might not necessarily be the goal.

Re: mruby

#47
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.

Re: mruby

#48
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…

Agree strongly about the floating point being a problem. I much prefer languages like Erlang, Python, and Ruby where the default numeric type is arbitrary precision integers.

Re: mruby

#49
post #36
post #33

Earlier quoted context omitted.

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…

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

Re: mruby

#50
post #33

Earlier quoted context omitted.

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 see, thank you. None of this sounds like a show-stopper to me, but it's good to have a more complete view of a language I'm not intimately familiar with.

Yes, none are show stoppers. Lua suits perfectly for for the use it was designed: small embeddable scripting. I hope no one is writing millions of lines of lua code! For me even small amount just does not "feel right" the way for example ruby does. That's why I've been eagerly waiting for mruby but unfortunately it does not (yet) fill the void.
Post reply on HN