[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
What is /g/'s opinion on Lua?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 14
Thread images: 1
File: images (1).png (5 KB, 204x204) Image search: [Google]
images (1).png
5 KB, 204x204
What is /g/'s opinion on Lua?
>>
>>55569112
>index starts with 1
>global scope is default scope, needs 'local' keyword the define something locally
brazilian shit tier
>>
1 2 3 4 5 6
>>
Well designed small emeddable language.
It's great at what it was designed to do, embedding it into a larger application to provide scritability.
Using it for, say, webdev stuff, is retarded.
And LuaJIT is hella fast.

But as this is /g/ all people will complain about 1 based indexing.

>>55569129
>global scope is default scope, needs 'local' keyword the define something locally embedded
That's shit for a big application. For rather small independent scripts controlling a bigger application, this is fine.
>>
It was my first language, but I’m not a huge fan.

But one based indexing is one thing it does right

Why one-based is better in languages without pointers:
>The first element of the array shouldn’t have a key of '0' for the same reason ‘first’ isn’t abbreviated 0st. Same for other ordinals, it’s only logical.
>Arrays should have their length be a valid key; i.e., arr[arr.length] being undefined is retarded
>Closed intervals are more intuitive.

Lua Warts:
>Verbose
>Minimal standard library and types (maybe good, definitely good for footprint)
>Arrays and hash tables are the same thing
>Obtuse operators like ~=
>Fractured ecosystem and smaller user base has lead to four ubiquitous versions (Lua 5.1, 5.2, 5.3, and LuaJIT) that are incompatible. Bitwise functions are done differently on each, for example, except 5.1 has no first party solution.
>
{(function() return 1, 2 end)(), (function() return 3, 4 end)()} == {1, 3, 4} 
except not really because table (array) contents can’t be compared without doing a manual element by element comparison, but they have the same contents
>>
>>55569112

Pretty neat langauge for scripting such things.
Don't know if it's any good for bigger projects.

>>55569451

>Arrays and hash tables are the same thing

I think this is pretty nice.


>Obtuse operators like ~=

I agree, it's not good that Lua uses "~=" for "not equal".

Especiall since many langauges use "=~" for RegEx searching, this is confusing.
>>
All I know about Lua is limited to making things in Roblox.

So I guess it's good, it's the only language I know, can't complain about it.
>>
>>55569240
>>55569451
>>55569693
/thread
>>
>>55569240
Why is using it for WebDav stupid?

What if u want to write an insanely fast web server as a frontend to ur redis cache
>>
>>55569112
It's insanely fast - makes it useful as a way of chaining machine learning pipelines running on gpu or cpu
>>
>>55569693
>>55569451
I was going to point out that "~" is a logical operator for "not", hence ~=, but then I noticed that wikipedia lists "!" for "not" as well. When did this become a thing?

https://en.wikipedia.org/wiki/List_of_logic_symbols
>>
>>55569112
Plus in the Lua you mean?
>>
>>55571026

I don't know, but most langauges use != or <> for "not equal".
>>
>Uses "then" for branching
It's weird.
Thread replies: 14
Thread images: 1

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.