[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Lua

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 37
Thread images: 3

File: Lua Logo.png (72KB, 1200x1200px) Image search: [Google]
Lua Logo.png
72KB, 1200x1200px
What is holding Lua back as a programming language.
>>
It's shit overall. The only thing it has going for it is that it's easy to embed
>>
>>60848989
Actual use of Lua is holding it back as a programming language.

Who the fuck uses it?
>>
>>60849000
Video games. Nothing serious.

Lua solves no problems that other languages dont solve better
>>60848992
thats about all it has going for it.
>>
File: brazil.jpg (44KB, 480x437px) Image search: [Google]
brazil.jpg
44KB, 480x437px
This is the 3rd lua thread i've seen today. Those damn Brazilians must be shilling hard. Also pic related is why lua sucks.
>>
>>60848989
Its obsolete for anything accept game scripting. A language like Julia blows Lua away in both speed and features.

Javascript was always a better language than Lua, and implementation like V8 and Spidermonkey run faster than Lua. Prototype OO is much better than using tables for OO.
>>
File: 1405380722556.png (130KB, 413x400px) Image search: [Google]
1405380722556.png
130KB, 413x400px
>>60848989
The fact that it's a scripting language, not a programming language.
>>
it's only used in games like ROBLOX and World of Warcraft

that's all it has going for it
>>
>>60849871
Don't forget Garry's Mod, the game it's almost entirely lua, same for the addons.
>>
>>60848989
Package management
>>
>>60849304
Lua is as fast as C.
>>
>>60850045
that's one of the problems Lua doesn't have. luarocks is pretty good
>>
>>60850020
t. people who think video games are ideas

lua is being held back by:
-metatables, they're dumb, janky, and at the end of the day basically pointless
-global by default
-having to type the entire word 'function' for function definition and lambdas
-shitty looping constructs (numeric 'for', the weird 'in pairs' foreach)
-no support for LCO
-hashmaps, its only data structure (although it is interesting, it's not really ideal)
-no multithreading (which could work very nicely)
-dumb operators/comments (~=, --, and it doesn't have any excuse for either)
-arrays starting from 1 (i have never had a problem with this but it's still dumb)
-vararg functions are weird and the '...' is its own second-class data type
oh and it doesn't really have pointers/references of any kind, but you can throw something in a table and unpack it if you're ghetto

all of these are actually really easy to fix and you could probably make a really neat fork that does all of this, lua is a great language but it's not perfect

>>60850057
no it is not even remotely
luajit can be as fast as compiled languages in general given a trivial-enough problem, but 'lua' (especially the interpreter named after it) is nowhere near as fast as 'c' (given any popular compiler), and luajit is on /average/ around as fast as java, which is a large accomplishment
javascript is like lua but worse in every way, tho.
>>
>>60849000
Roblox
>>
>>60850141
you didnt mention having to explicitly declare variables as local. Ive never understood that, why not make all variables local by default and require explicit global declarations?
>>
>>60850173
>Ive never understood that
You seem like you understand it.
>>
>>60850182
I understand the concept, I dont understand the design choice, having to type local in front of almost all the variables really clutters the syntax, why would they not just make all variables implicitly local by default?
>>
>>60850141
>arrays starting from 1 (i have never had a problem with this but it's still dumb)

I don't know lua, but arrays indexing from 0 makes sense in C only because arrays are pointer and the number is an offset from the base.

If you don't base your "array" on the memory hierarchy, you shouldn't be using offsets as indexing. Starting from 1 makes sense.
>>
>>60849000
literally every videogame

>>60848989
no OOP so everyone has their own implementation using metatable fuckery.
also metatables in general

why cant there be a nice scheme thats as good, lean, and portable as lua (inb4 recommendation that only works with cygwin)
>>
>>60850240
>no OOP so everyone has their own implementation using metatable fuckery.
>also metatables in general

There is a game scripting langauge called Squirrel that is small and fast like Lua but has real OO and C++-like syntax. If I were to need a game scripting langauge I would choose Squirrel over all the metatable bullshit of Lua
http://squirrel-lang.org/
>>
>>60849871
>what is Corona
>>
>>60850238
it fucks up several algorithms
for example (not that this is much of an "algorithm")
i % MAX
this works fine with 0 indexes but with 1s you have to add one to i and then subtract it from the end
that might make sense for mathematicians but in reality arrays starting from 0 just works out most of the time
plus, i think restricted (safe-ish) pointers could work well in lua
i actually wrote an essay on it but never handed it in

>>60850173
i did.
>>60850141
>global by default

>>60850212
there is actually a vague reason:
globals basically disable scoping, therefore, people who don't program don't need to learn scoping until they NEED to.
this is support by the "nil-by-default" concept, which, while it works, causes problems too. i don't really have any specific problems with it myself, though.

>>60850296
>>60850240
you don't need oop in a scripting language.
metatables are retarded, though.
>>
>>60848989
It was designed for being executable json, nothing more. It isn't even fit for major game scripting, due to the non-incremental execution model.

>>60850240
>literally every videogame
>except for most AAA ones, aka the ones that matter
>no AAA engine supports it except for CryTech which is a burning trainwreck except for the renderer
>>
>>60848992
This.

Lua is almost exactly the same thing as JS just with shit syntax, easier to embed, and with no community.
>>
>>60850057
No, it isn't. Don't be daft. It's fast for a scripting language, and it has a competent jit compiler, but saying it's as fast as C is asinine. Not even C++ is as fast as C.
>>
>>60852167
>Not even C++ is as fast as C.
You know that the important parts of C are just a subset of C++ and they share compiler backends at relevant platforms, anon?
>>
>>60852237
C++ doesn't even have restrict pointers.
>>
>>60852237
>You know that the important parts of C are just a subset of C++ and they share compiler backends at relevant platforms, anon?
No. You have it ass backwards. C++ is a superset of C that adds significant run time and compile time overhead, and has been shown in benchmarks to run slower and use more memory than C.

Sure, if you leave out all of the C++ features the compiler might spit out assembly comparable with C output, but at that point you're just writing C, and have proven the only way to get C performance is to write C.

>the important parts of C
This really shows how little understanding you have. Do you know how small C is? What are the "important parts" of C? What makes C so fast is it only throws a thin veil over the assembly being produced and provides syntactic niceties for control and data constructs.
>>
>>60850020
It's also used in Payday 2's BLT modding kit
>>
>>60852380
In the standard, whereas every notable compiler supports __restricts__.
It's a non-matter anyway, since C can't utilize it that great and you'd better fall back to assembly for far greater effects.
Source: The LuaJIT guy, who is obviously better than you.

>>60852451
>knowledge out of my ass
>muh portable assembler meme
>muh non-knowledge about no-cost abstractions
>muh C++ uses more memory meme
nice one, anon
Meanwhile even the stock implementations of std::vector easily beat any poor reinventing-the-wheel C implementation of dynamic arrays.
And that's not even such an impressive example, considering that's just C programmers being retarded.
>>
I've used it a lot lately and I'd like to hear complaints.
I don't like dynamic typing in general but as a dynamically typed language it's simplicity in tables makes it extremely good for any sort of scripty thing. I much prefer it over python for instance. What it lacks (in my environment) is libraries. I'm writing some control portions of an embedded system. It's not my normal duties but it ended up this way.

What I miss directly is a neat way to handle nil value cases. It's very basic on that front and since you have so many variables that might not be initialized they need more than the
local a = potentiallyNil or 1

I understand how the lack of clutter in featureset is an advantage but I'm missing something there.

The sandbox is great though. And it performs well. Especially compared to its competition (see:not C).
>>
>>60850141
>metatables
Agree. They're a mess. I don't use them because they're really not that useful usually. Maybe if they weren't a mess I'd use them.
>global by default
Very odd choice. But I don't think it holds the language back that much realistically.
>typing function
Most of us type fun+completeKey. I do like how it makes functions more greppable compared to a lot of languages. It's not a big deal.
>shitty looping
Disagree strongly. The [exploded tuple] in func(table) construct is great.
Don't see how numeric for is an annoyance at all. They're very clean.
>hashmaps
Sure. It's fit for purpose though. And it's not like you can't make a list or any other structure yourself though.
>multithreading
Optimization in a scripting language is weird. I support the decision to have the language be more pure in its targeted objective.
>operators
It's perfectly fine. Why are you picking on such irrelevant things?
>arrays starting at 1
Lua doesn't have a lot of libraries. It's kinda pointless to adhere to the convention if it bothers you this much. You can start from 0.
>lack of references
Yep that one really bothers me.
>>
>>60848989
Better alternatives exist. The only reason why Lua is commonplace is because of its use in WoW (where I'll admit that it was really elegantly used), which made it the default scripting language that /v/tards learn. Hence why it is used in most games that expose a scripting language to the players.

Putting that aside, I'd rather use embedded scheme than lua.
>>
nobody trusts a language created by monkeys.
>>
>>60853755
>where I'll admit that it was really elegantly used
It isn't. WoW had multiple performance and security/cheating problems thanks to not thinking it through.

Also, see >>60851989, don't make the mistake to think https://en.wikipedia.org/wiki/Category:Lua-scripted_video_games means Lua is cut-out for video games. Many just fell for the hype and some are said to have run into similar problems as Blizzard.

Coroutines a shit, for scripting games you want proper incremental execution (meaning a couple of bytecodes per update cycle) and proper latent function support.
>>
>>60850296
>squirrel
That's interesting. Looking at the syntax, it almost appears as if it took cues from Lua and a C type language.
>>
>>60849858
I don't know how this isn't the first reply.
Thread posts: 37
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.