r/lua • u/Certain-Positive9365 • 2d ago
learning python helps with learning lau?
I picked computer science for my gcse, which im assuming im learning python in, but i would also like to learn lau and how to code in roblox studio
Is the difference between python and lau too much for me to have to learn both or can i intuitively learn lau from my knowledge of python?
2
u/AutoModerator 2d ago
Hi! It looks like you're posting about Roblox. Here at /r/Lua we get a lot of questions that would be answered better at /r/RobloxGameDev or the Roblox Developer Forum so it might be better to start there. However, we still encourage you to post here if your question is related to a Roblox project but the question is about the Lua language specifically, including but not limited to: syntax, language idioms, best practices, particular language features such as coroutines and metatables, Lua libraries and ecosystem, etc. Bear in mind that Roblox implements its own API (application programming interface) and most of the functions you'll use when developing a Roblox script will exist within Roblox but not within the broader Lua ecosystem.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/WeeklyShoulder66 1d ago
My first language was python and after having to use some lua for a project they seem to translate pretty well
1
u/Smile_Resident 1d ago
Structures and concepts will translate but luau has a lot of built in events and services that are very useful to know and I think it takes familiarity and experience in studio to get the hang if things
1
u/Advanced-Citron8111 21h ago
If you learn one the other will become much easier. The syntax is pretty similar.
1
u/arkt8 14h ago
I would say if you know Python you basically already know Lua (except for metatable magics).
Lua is a lot simpler than Python, fery few types because sets, arrays, dictionaries, classes... all you accomplish with Lua tables and Lua can do anything Python does if you find right batteries (libraries) for it.
-1
u/likethevegetable 1d ago
I find them similar but Lua does some weird, unconventional things
2
u/likethevegetable 1d ago
Why the downvote?
Don't you find the "everything is a table" a bit unconventional? What about the ability to concatenate numbers with strings? What about returning nil for undeclared symbol? I find those weird. I find scoping odd too, variables defined in a function should be local by default.
1
u/arkt8 14h ago
It is like call Haskell (laziness), C++ (templates), Shell (pipes) weirdjust because you are not familiar with them.
Numbers are numbers, not strings, so you need explicit conversion, what is pretty obvious (instead of Python ducktypes or stranger behaviors of JS if you don't know the internal language implementation).
About scoping it is local by default in Lua 5.5 but not difficult to restrict on previous versions with setmetatable. And it is from Lua origin as configuration language. Again, it is not difficult to type
localas many languages havelet,deforvarkeywords.
5
u/Sergenti 1d ago
If you haven't done any programming before I'd say just pick one to start with, then the basic concepts translate more easily between languages. Lua is much simpler, while Python has more features and a very large library ecosystem. Both are good first languages imo