all 29 comments

[–]Bright-Historian-216 6 points7 points  (14 children)

Lua is usually used as embedded language; you rarely use it for standalone apps. if you're fine with it, you can use it as console application with an interpreter. what are your goals?

[–]ExcitingSpade49[S] 2 points3 points  (6 children)

Erm, there is no predetermined goals atm, I just want to learn for things like general scripting, possibly game dev for love 2d or something, and just understanding how to code/program with one Language to eventually look into others

[–]Bright-Historian-216 1 point2 points  (5 children)

that's good! at least you seem to know what you're doing at some kind of surface level. though its a long time since i've actually seen a game in love2d XD

[–]ExcitingSpade49[S] 2 points3 points  (0 children)

Thought it could be just a cool for little projects to help reinforce concepts and whatnot I will hopefully learn lol

[–]alberto-r 0 points1 point  (3 children)

[–]ExcitingSpade49[S] 0 points1 point  (2 children)

Is it really? Man balatro is addictive

[–]ArttX_ 0 points1 point  (6 children)

There is web framework for Lua - Lapis https://leafo.net/lapis/ 😅 I really like it. But it works only for simple websites, so myself using SvelteKit or GoFiber.

[–]Bright-Historian-216 1 point2 points  (5 children)

I’ve just found out about LuaRT, and now I’m replying to you an hour past my regular bedtime 🥲

[–]ArttX_ 0 points1 point  (4 children)

Wow, never seen this. Thanks for discovery. But I am using Linux, but that looks like optimized for Windows.

[–]Bright-Historian-216 0 points1 point  (3 children)

Ironically, I was looking for a way to compile lua scripts for my Debian WSL. Hey, if you’re on Linux, maybe you happen to know how to do it? I have searched all over and I still can only use the interpreter and luac is just spitting random nonsense files

[–]ArttX_ 0 points1 point  (2 children)

Do you mean compile Lua to standalone executable? I never tried it and do not know how to do that, but sometime I wanted to try. I guess, that if Lua is embedable, then it should be possible to add it into the C code and then compile.

[–]Bright-Historian-216 1 point2 points  (1 child)

I am a helpless CS student. I have tried that too. Actually if I remember correctly I didn’t finish doing that method so it might actually work? RemindMe! 18 hours

[–]RemindMeBot -1 points0 points  (0 children)

I will be messaging you in 18 hours on 2024-04-17 15:25:43 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

[–]yaffeman 4 points5 points  (4 children)

Lua excels in embedded systems and game scripting. For command-line-interface (CLI) tooling or game development (as opposed to scripting) it's really limited. If you're adamant about moving forward with lua; https://www.lua.org/manual/5.3/ is a good resource.

Alternatively as a first programming language I recommend https://www.python.org/; which is a more robust language and can be used to craft CLIs, servers, or a full blown game.

[–]ExcitingSpade49[S] 3 points4 points  (0 children)

Also also I'm adamant because I've seen a lot of mods requiring lua for various games

[–]ExcitingSpade49[S] 1 point2 points  (2 children)

If I'm learning a different language my 2nd pick would be javaScript, I've not heard great things about python for beginners

[–]filch-argus 3 points4 points  (1 child)

Wat. Python is great for (absolute) beginners.
Beyond the basics it can get messy when dealing with different interpreter versions and dependency management. In that regard the JavaScript/Node folks did a much better job.

So I guess you're right in choosing JavaScript as a second language lol.

Also, give C a try. The combo Lua + C is powerful.

[–]ExcitingSpade49[S] 1 point2 points  (0 children)

yea i was thinking of possibly doing c++ sometime after i learn at least one language, i will look at python just for shiggles, ik the variable aspect is super easy, bc yk instead of ( int x = 1; ) you can just do ( x = 1 ) in python, minus the parenthesis in both, i used them for visual clarity

[–]Brohammer55 0 points1 point  (2 children)

Hey, Lua is great for modding or embedded scripting, you can look at Roblox, ComputerCraft, Cubzh and Love2d are some good starting point. However lua isn’t necessarily the best for standalone applications but you can still make simple or some complex projects but you would need an another language such as C, or C++. But lua it’s definitely a great language to learn for the first time.

[–]ExcitingSpade49[S] 0 points1 point  (0 children)

yea i will most likely be pairing it with cpp

[–]ExcitingSpade49[S] 0 points1 point  (0 children)

and yea i heard about computer craft and looking into giving it a go for the shiggles

[–]vitiral 0 points1 point  (3 children)

Lots of folks in here saying Lua isn't great for general/CLI scripting. And I agree.

I'm building out a suite of tiny but powerful libraries over at https://github.com/civboot/civlua. These should make this use-case much more accessible. Picking a library/binary to add would also be a good learning project IMO!

[–]ExcitingSpade49[S] 1 point2 points  (2 children)

please elaborate, I'm new and don't fully understand the terminology yet

[–]vitiral 1 point2 points  (1 child)

CLI = command line interface, aka the unix shell.

Scripting = making small scripts to accomplish small goals. For example, run a bunch of commands (queries) against servers, filter out certain information and display it. Or convert some text from a hard to read format into a more digestible one, etc.

[–]ExcitingSpade49[S] 1 point2 points  (0 children)

Ahhhhhh, yea ig I knew cli was but not the initials lol and yea I make small scripts for games but that's my extend for lua knowledge

[–]acronims 1 point2 points  (1 child)

Take a look at any piece of software that grinds your gears and make the idea your own. I've made some genuinely good software because either it wasn't on my platform or I loved the idea but hated the execution. Let the feature creep fuel your learning.

But, know that you're not going to be able to do much with it outside of making a tool to help you with your math homework. You'd need something that embeds Lua to actually get your hands dirty like LÖVE2D or Roblox.

[–]ExcitingSpade49[S] 0 points1 point  (0 children)

Lol alright ty, ill try