[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: 86
Thread images: 8

File: lua.gif (5KB, 256x255px) Image search: [Google]
lua.gif
5KB, 256x255px
Is this still relevent?
>>
Yup. It's lean, clean, and nice to work with.
>>
>>60131573
I prefer Lua over Python
>>
File: 1493463047499.jpg (18KB, 976x254px) Image search: [Google]
1493463047499.jpg
18KB, 976x254px
>>
>>60132306
So, yes?
>>
I wish there was a scheme as small and easy to embed as lua. Protip there isn't don't even bother trying to prove me wrong
>>
yes, people still make WoW addons
>>
>>60131573
Yea man, there are 50 thousand people playing Garry's Mod right now
>>
>>60131573
It's never been desu.
>>
I heard it was good but lacks the tools needed for widespread use
>>
>>60132946
Mruby
>>
>>60133140
>implying ruby is a scheme
>>
>>60132306
Java translates to Street
>>
>>60132306
So something pajeets avoid, meaning it's probably worthwhile.
>>
>>60131573
Lua is my go-to language for embedded scripting.
>>
>>60131573
It's neat for scripting.
wiki/Category:Lua-scripted_video_games
>>
Lua is absolutely relevant.
You are absolutely not.
>>
>>60133186
pajeets avoid it because it's filled with deluded manbabies

seriously don't step foot in any lua forum, just use rust if you want to surround yourself with evangelists without getting brain cancer
>>
Lua is fucking awesome. BRs did it right.
>>
It has uses. But remember, it is an embedded scripting language. In this case, you don't have to reinvent the wheel, you can simply use the host application's wheel.
>>
>>60131573
yes

never liked it ever, but it's fairly widespread
kind of wish all the things that used lua had python in them instead
>>
>>60136161
but lua is just a better python
>>
>>60131573
Not really.

Lua was never ever ever a good general scripting language, only an embedded one.

Most people are stuck on Lua 5.1 because of LuaJIT, which is a dead project struck in maintenance mode. Lua 5.2 broke working code for no reason with its environment change, and Lua 5.3 introduced 64-bit integers and native bitshifting operators and not much else worth upgrading for.

If you're going to embed a language in your software, use Javascript, even if you hate the language. You can start with a lightweight Lua-style implementation like Duktape or JerryScript, and then when you need speed V8, Spidermonkey and JSCore are there waiting for you with several companies worth of engineers working on all three that won't abandon it like LuaJIT.
>>
>>60136199
This.
>>
>>60136199
>1 indexed lists
>no real lists or arrays
>>
>>60136342
Complaining about 1-indexing is useless bikeshedding, and something a sufficiently mature programmer can learn to deal with.
>>
>>60136342
no interpreted language has real arrays anyway.
>>
>>60136342
Tables are hybrid data structures. In all common implementations since 5.0, tables can have a hash map and array section.
>>
>>60133176
I chuckled
>>
>>60136397
>The programmer should adapt to shitty tools instead of using better tools

>>60136416
Python has real arrays

https://docs.python.org/3/library/array.html
>>
>>60136483
No, python has something that looks like arrays.
>>
>>60136483
So does Lua. If you use a table like an array, it's just an array.

https://www.lua.org/source/5.1/ltable.c.html

And if you absolutely need an array you can use FFI types.
>>
>>60134555
holy moly

What makes it so appealing to use in videogames?
>>
>>60136245
>luajit
Isn't plain lua already faster than every other interpreted language?
>>
>>60136512
Oh wow, that seems silly as fuck. The only reason I can see for jamming arrays and hashes into a hybrid data type is "being friendly to non-programmers".

Being "friendly to non-programmers" is how you end up with shitty languages like PHP.
>>
>>60136483
>an object type which can compactly represent an array

Bravo.
>>
>>60136552
>>60136557
LuaJIT can compare to like slower java/C stuff.
>>
>>60136483
>>The programmer should adapt to shitty tools instead of using better tools
1-indexing in and of itself is a bikeshed feature that matters very little in the grand scheme of things. People complaining about such things can be safely ignored because they care too much about surface-level features and can't be trusted to have valid opinions about real problems a language might or might not have.
>>
>>60136342
>>60136598
1 Indexes actually make perfect sense when you don't have real offsets anyway.
>>
>>60136552
I'm guessing because it was easy enough to work with and understand, allowing even idiots to work with. Now it's just ubiquitous enough for every gamedev to use it as a scripting language.
>>
File: pl-php,pl-python.png (14KB, 900x500px) Image search: [Google]
pl-php,pl-python.png
14KB, 900x500px
>>60136570
>Being "friendly to non-programmers" is how you end up with shitty languages like PHP.
PHP at least has managed a major version upgrade without breaking huge swaths of peoples code for no gain.
>>
>>60136598
>Defining 1 + 1 to equal 3 is a bikeshed feature that matters very little in the grand scheme of things.
There are mathematical reasons for using 0 indexing. 1 indexing also fucks up length calculations
>>
>>60136624
PHP isn't friendly to anyone.

>>60136630
Only if you're actually accessing sequential memory, otherwise it's all arbitrary. 1 indices describe what array-lookalikes actually do, 0 indices do not.
>>
>>60136630
Anything that can be expressed with a 0 index can also be expressed with a 1 index.
>>
>>60136647
Have you not read Dijkstra?

http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
>>
>>60136733
An array with 1 entry does not have a length of 0. It doesn't involve intervals.
>>
>>60136647
>>60136728
0 indexing is for mathematical reasons, not architectural reasons. It doesn't matter whether or not the lists are backed by a contingent block of memory, the math works out for 0 indexed arrays.

Fucking kids these days, probably haven't even studied calculus.
>>
>>60136798
It's 100% for architectural reasons in languages that have sequential memory based arrays. The mathematical stuff came later.
>>
>ROBLOX consistently topping over Gary's mod and almost everything else below the top 8 on Steam's stats
>>
>That is ugly


This is Dijkstra's core argument.
>>
>>60136733
Yes, I read that too. He is correct that 0-indexing makes certain types of expressions more convenient. But that's all it is, a convenience, and only in certain circumstances.

This isn't the only time I've had to deal with Dijkstra-derived stupidity peddled by novices, his diatribe against goto should have a gigantic fucking asterisk next to it as well. I swear I will shoot somebody the next time I have a pull request rejected asking me to justify the use of goto in a state machine or in cleanup code.
>>
File: BQqowsu.jpg (17KB, 720x533px) Image search: [Google]
BQqowsu.jpg
17KB, 720x533px
>>60136872
forgot this
>>
>>60136869
>ROBLOX
JUST
>>
>>60136887
thats weird, like the 4th spontaneous and unrelated not a pipe reference i've seen this month.
>>
File: qZBaN1vxkyzso1_500.jpg (36KB, 500x348px) Image search: [Google]
qZBaN1vxkyzso1_500.jpg
36KB, 500x348px
>>60136915
kek, it is a nice very modular thing. But I picked it out of random
>>
File: lua-poster-090207.png (984KB, 2338x3311px) Image search: [Google]
lua-poster-090207.png
984KB, 2338x3311px
there is literally nothing wrong with lua
>>
File: trumpepe.png (91KB, 680x340px) Image search: [Google]
trumpepe.png
91KB, 680x340px
>>60136604
>1 Indexes actually make perfect sense when you don't have real offsets anyway.
this
>>
>>60136342
You don't need lists or arrays when you have tables.
>>
File: 1424880567220.jpg (113KB, 573x892px) Image search: [Google]
1424880567220.jpg
113KB, 573x892px
lua best
>>
>>60131573
For game development, yes.
>>
>>60139784
wtf i love lua now
>>
>>60136869
>%CURRENTYEAR%
>rococks
>>
>>60136552
See >>60137004
You code the engine and performance critical code using c/c++ and then use lua to script the game.
Lua is relatively fast and easier to write scripts than c.
>>
Python:
> slow
> bloated (500k loc)
> overcomplicated
> the C++ of scripting languages
Lua:
> fastest scripting language
> tiny (10k loc w/out stdlib)
> simple
> the C of scripting languages
>>
>1-indexed
>>
>>60136245
Thanks anon. Next time I want a scripting language to go with my project, I'll use Javascript.
>>
> len(arr)
>>
>>60140395
So?
>>
its cancer
>>
>>60132306
pua in lua
>>
>'scripting language'
>doesn't even have regular expressions
into the garbage
>>
>>60142344
lua patterns are good enough for most uses. also there are regex libs and other powerful pattern matching libs.
>>
>>60132946
S7 works well enough for embedding
>>
>>60137004
C# API is also god-tier
>>
doesn't it not have a proper library and is missing some features
>>
>>60145638
no
>>
>>60142344
It has Lpeg, a popular library for portable expression grammars. It includes regex too. PEG are superior for anything complicated and patterns are good enough for anything simple.
>>
>>60137004
Lua is great. Shame there's three different versions in common use and they're all different and incompatible in various ways.
>>
>>60146179
lol no, this isn't python. Lua 5.1 is standard til the next major version.
>>
I'm still waiting for luajit to work properly when shit is allocated beyond 4gb of address space in a 64bit process.
>>
>>60146290
>Lua 5.1 is standard til the next major version.
Unless you use LuaJIT, which includes 5.2 changes. Or you actually want to follow the real standard which is 5.3. Walking about with semantics and pretending that 5.1 is supported in any capacity is just embarrassing.
>>60146858
Is a pretty fucking good example.
>>
>>60147620
LuaJIT mostly doesn't do 5.2, that's WHY 5.1 is standard. 5.1 is major release + immediate patches. Anything past that is pre-release lua6 stuff and should be learned but avoided in use.
>>
>>60131573
Good for when I'm making my roblox game 10/10
>>
>>60147724
I use Lua 5.3 without any problems
>>
>>60150047
Good for you, kid.
>>
Lua is meh but it's the most documented and fastest scripting language we have available for embedding.

There is wren which looks interesting but the docs are limited.
Thread posts: 86
Thread images: 8


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