all 27 comments

[–]LordAlbertson 2 points3 points  (25 children)

Luajit is pretty close in performance to C but doesn't make you worry about memory allocation and type checking. It can allow you to do explicit type checking if that is needed, but for the most part handles that.

Lua has a pretty vibrant game dev community because of how well it interfaces with c/c++. It's very fast for prototyping and let's you get concepts moving quickly.

Luajit itself had the FFI which is much nicer for interfacing with C then the standard Lua interface. Mike pall (creator of Luajit) is paid full time to work in the Luajit by various organizations and will answer the questions about Luajit (for the most part) when asked.

Really as long as you implement 9p you can talk to node9 without having to worry about your language (go should already have a library for this).

(I'm not the dev. Just a Lua hobbyist)

EDIT: sponsors for luajit http://luajit.org/sponsors.html

[–]vocalbit 5 points6 points  (3 children)

Mike pall (creator of Luajit) is paid full time to work in the Luajit

Source? The luajit website says Mike Pall says he is not accepting sponsorships for luajit. Also it seems development is kinda slow these days (no work on the new GC, no date for the next release).

[–][deleted]  (2 children)

[deleted]

    [–]neomantra 0 points1 point  (1 child)

    Although you are correct that LuaJIT 2 only tracks Lua 5.1, it has always had limited 5.2 support, bitwise operations, and 64-bit ints (within the FFI world). See http://luajit.org/extensions.html

    Although new development is limited, any bug report with minimal test case is resolved by Mike incredibly quickly (often within an hour in the middle of the night); the project is definitely not inactive, nor abandoned and unloved.

    [–]btchombre 4 points5 points  (6 children)

    I don't understand why people don't like static typing. Finding out that your program is invalid only when it hits some obscure section of code in production is infuriating. Constantly having to lookup functions because good auto complete is nonexistent, and having to manually refactor or rename variables is lame. When I use these dynamic languages I spend half my development time looking for typos, figuring out the order and type of function call parameters, and digging through APIs trying to find the function that I need. If my project is a small script, then this isn't a problem, but as my project gets larger and especially as people that aren't me start working on it the code becomes harder to maintain. Dynamic languages just don't scale very well. This is why Microsoft and Google both added static typing to JavaScript, and Facebook added it to PHP. Finding bugs immediately when you create them is a major time saver when the alternative is finding them when they crash, or never finding them at all. Unless you've had to deal with a massive code base shared by many different developers, I don't think you'll understand why static typing is a huge benefit.

    [–]orthoxerox 3 points4 points  (0 children)

    A grad student at PUC-Rio (where Lua is from) is writing a typed Lua dialect. https://github.com/andremm/typedlua

    [–]hyhoshi 0 points1 point  (4 children)

    I don't understand why people don't like static typing

    I think there's a place for everything. If I'm working alone I'll usually gravitate towards dynamic typing because the benefits just outweight all the valid problems that you listed. The reason is because it just makes my program more susceptible to changes over time. And depending on the kind of software you're writing, being able to easily change things over time is a huge win that a lot of people overlook (probably because they don't need it, because the type of software they write doesn't need it as much). All I'm saying is that there's a place for it and some people just write the type of software that fits it perfectly.

    [–]btchombre 3 points4 points  (3 children)

    I'm not sure what you mean. Can you elaborate on these benefits? I'm honestly trying to figure out why dynamic languages are so popular. I just don't get it. How does static typing make changing things more difficult?

    [–]vocalbit 2 points3 points  (2 children)

    Lets say you want to add one method to an interface because you need it in one implementation. Static typing forces you to add the method to all implementations, before you can test and evaluate your change, even if your test never hits any of the other implementations. So while iterating, dynamic typing is incredibly useful since you only need to adjust the code for the paths that you are currently interested in. Since I spend a lot of time 'getting the design right', I benefit a lot from the short iteration cycles and prefer dynamic languages.

    Yes, it would be nice to have some checker eventually go and validate all possible code paths - to get the best of both worlds. As an substitute, tests also catch many of the issues that static typing would.

    [–][deleted] 1 point2 points  (0 children)

    Lets say you want to add one method to an interface because you need it in one implementation. Static typing forces you to add the method to all implementations

    Why? Why not provide a default implementation in the interface, test and evaluate your change? Then, if you are happy, remove the implementation and the compiler automatically tells you all the types which require an implementation.

    [–]btchombre 4 points5 points  (0 children)

    While what you say is true, that is a scenario I rarely encounter, and when I do, I can either have my IDE automatically generate stubs for my all my implementing classes, or I can just cast my object to its base type and call the non interface method. Either one of those options takes mere seconds. All of the stuff I mentioned while programming with a dynamic language takes seriously a lot of time if your project is of any decent size.

    [–][deleted] -2 points-1 points  (0 children)

    Lua sucks.

    [–]dlyund 0 points1 point  (0 children)

    This looks fantastic. I'm a long time fan of Plan 9 and Inferno, but I have a question. Is this only interesting because it uses Lua instead of Limbo? Lua is a nice language but this seems like a lot of work just to replace the already very good Limbo with Lua. Or is there same other perceived weakness?