Is Lua any good?
>>58749574
>Is X good?
If you have to ask...
Yes.
It's literally the best scripting language.
> Small
> Clean
> Fast
> LuaJIT is god-tier.
>>58750139
>It's literally the best scripting language.
Now, now. That would be Python.
It takes more than a good JIT compiler to make a garbage language usable.
>>58749574
Is the best side language to use for C interop
>>58750139
>Clean
while the Lua syntax might be clean, the source code for the JIT compiler is like spaghetti that went through a blender
I like it. The "everything is a table" design is neat.
roblox virus tier shit
>>58749574
yeah, lua is fun. there are some minor annoyances, like that fact that it's missing some keyword that basically every language has (forgot which one).
>array index starts at 1
>>58750630
switch?
>>58750636
I'm conflicted on this. Indexing that starts at one feels more natural, but I've been conditioned to start at zero by practically every other language.
>>58750636
The correct way.
I like the way Ada does it. Array indicies can start wherever the fuck you want. Whatever makes sense for your situation.
>>58750439
>Python
Personally I prefer Ruby. But hey, to each their own. Wouldn't want to start an internet argument over something so small, haha.
>>58750636
>>58750662
>0 indexed arrays that aren't null terminated
Fucking posers you are.
>>58750662
that's because most programming languages treat the index as an offset from the first element. when Lua has the first index at 1 it feels like you're skipping the first one
>>58749574
no
Just use C
It's the only language you will ever need
>>58750675
What did you say, you little punk-ass little bitch? Don't you fucking dare compare Python to the fuckery that is Ruby ever again.
I want to try Lua to STM32 and what to instal except geytoo to run board?
I dont get all those benches and frameworks.
>>58750630
The major thing I miss is operators like += -=. I did some programming in Icon which completely spoiled me. Assignment in Icon is done with := and every single other infix operator can go before that likea <:= bwhich meansa := a < b*.
That's an odd example but you get the idea. If I ever do manage to design a real language and not just some joke esoteric thing, it's going to take heavy cues from Icon.
*in icona < b'produces' b if that expression is true and fails (not entirely unlike exceptions) if the expression is false so that assigns b to a if a < b and fails otherwise)
>>58750661
On the subject of switch statments, this is a good read https://eev . ee/blog/2016/09/18/the-curious-case-of-the-switch-statement/ (fucking spam filter, sorry)
I do not like switch statements personally. I think they are bad from a design perspective because they have a weird unique syntax that only works inside a special block. Languages should strive to have consistent rules throughout imo.
how does lua manage memory?
>>58749574
Not as good as Perl.
>>58750496
You're just not on Mike's level. He's been doing this shit for a while (I guess he's in his early 40s, he programmed the fastest floppy drive reader of his time when he was 16).
>>58751056
Primitive non-tables are kept on the stack (Lua's concept of a stack, not the C stack), and are freed when the function returns (unless there are upvalues). Tables and userdata are garbage collected, and you can write a function to trigger on the objects destruction.
For making Roblox games.
I dont know, its an interesting language but I always feel like im using it wrong. Its also used almost exclusively as a embedded language. Overall I would say its a good language that fills it niche well.
>>58751506
Have you taken a look at the source? While I agree it's very efficient it seriously looks like it went through an obfuscator.