Lua any good

Started by Pfaber11, September 04, 2021, 20:06:51

Previous topic - Next topic

Pfaber11

Hi guys spent the last day having a look at Lua and it does seem quite nice . Not sure how to implement the jit part of it at the moment but will do hopefully in the next day or so. Anyway do we have an experienced Lua programmer on here and if there is can you give a quick rundown of the pros and cons . What do you think of it ? Have a nice day.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

MikeHart

Are you developing your own engine and want to implement lua into it? Because that is the time when you want to look into the LuaJit.

therevills

As I said on the other thread I'm enjoying Lua/LÖVE (Love2d), for the one button comp, I'm porting a mini version of Diddy over to LÖVE and it seems to be working quite nicely :)

"A bit of Box2D, a sprinkle of Lua, a lot of Love and a splash of Diddy."

https://twitter.com/TheRevillsGames/status/1434062906442715137

:P

Derron

#3
Lua has one issue: it allows everything as parameter, assignment etc.

As stuff is "interpreted during runtime" you only catch wrongly typed params when the corresponding part of the code is executed.
This will most probably happen for tables, "arrays", "lists" ...
Also nil/null checks are what you will have to use quite a lot then.


Lua is quite flexible, so you can easily add new functions to stuff - like counting elements in a list.

I implement the AI in TVTower via Lua - it does a good job there.


Quote from: Pfaber11 on September 04, 2021, 20:06:51
Hi guys spent the last day having a look at Lua and it does seem quite nice .

Pay attention to not jump from language to language - try to always "learn" something new after a jump - every learned lesson (design patterns etc) will help you to advance as a coder. Just changing the language because you eg do not achieve what you want in the former language / kit - will not improve your skills.


For 2D Löve seems to be a good thing.


bye
Ron

Pfaber11

Hi guys thanks for the replies . Yes I see your point about jumping from language to language. I'm still using AGK at the moment and will probably for some time to come if I don't find Lua to my liking .  Have an excellent day.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

Pfaber11

I'm using zerobrane at the moment which uses Luajit by default. I decided if I was going to do this then the sooner the better . So far so good although I have not opened a window yet hopefully will accomplish this today. Thanks for reading
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

iWasAdam

Why not just learn how to program in any language, and give us the results as you actually get some where?

As Derron said - pick one thing and stick to it.

So far you have hardly learned what a language is and can do, and have yet to understand what jit, compiled, interpreted, etc do.

Let alone get the grasp of how fast modern cpus are and where the bottlenecks appear and the best thoughts on how to deal with this.

If you like AGK then bloody stick with it. It's fine and will do everything you want.

Unless you want to jump ship again then go for maya and unreal - cause they are both soo simple  :P

Pfaber11

Well I'm done for the day and I'm making progress . Still so much to learn . I think I'm looking at months rather than weeks to get the hang of this . I have my reasons for switching but if it doesn't work out I'll be back to AGK . Yes using Love2D and seems very good so far . They say that Lua is easy to learn and it probably is compared C++ but in my opinion it's really not that easy in comparison to some other languages. so there we are . I intend to settle on this language as it is easier than most and I'm no brain surgeon . C++ and Java are just too hard for me . What I intend to do is work hard at this and be sort of competent by Christmas  or at least as good as I am with AGK and then I'll have something to build on . If AGK was multi purpose I would of stuck with it but It just seems aimed at games and nothing else . Nothing wrong with that but I really want a more serious bit of kit a good allrounder. Have a nice evening .
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

MikeHart

If you want a good allrounder, then Lua is the wrong tool. Lua is just a scripting language for any engine that implements it. Good luck in finding your allpurpose engine that is powered by Lua. If you do, please let me know. So far I wasn't able to, only found game engines.
Defold, Löve, Corona SDK, Gideon Mobile, etc.

Steve Elliott

I agree with the guys here.  Pfaber11 You're continually looking to switch languages without really committing to getting the most out of the language you're currently using.

If you're you're writing games then what's wrong with using a specialist tool, rather than one of the many general purpose ones out there?  You're then going to have to get a game engine to go with the language, which means something else to learn and something else for you to dislike and abandon.  And yes LUA is not a good choice for all round development, Python would be your best bet if you want a general purpose language and find C, C++ or C# too difficult.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Pfaber11

#10
Well lua was not going too great as in could not find a way of producing exe's with it and in a moment of madness  decided to have a go at python again, at least I know it's no speed freak and what to expect from it . Not gonna set myself any targets and if it takes six months then so be it . My biggest bug bear is the fact there's no goto so I have to think about things differently . Got the exe's working and am able to open a window so off to a good start. I did try python a couple of years ago and failed hope I get further this time . AGK is capable and I will still be using it for the foreseeable future.
Thinking next year to do a series of educational software . Educational / Games sort of thing . We'll see I guess but I think that's the direction I'll be heading in . Have an excellent day.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

therevills

Using Love2d (and Defold) creating an exe for Lua is easy  :)

Pfaber11

I was searching for lua to exe and getting nowhere . just tried love2d to exe and plenty of answers . It looks like Lua may still be suitable for my needs.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz

therevills


Pfaber11

Well I tried Lua for a few days and to be honest really like the language but as I started the path to learning python and it's a lot more sort after I've decided that is the route I shall take to learn a second language. If AGK was more multi purpose I would not be bothering learning anything else as I really like it but I think the more languages I know the better . I intend to stop at python , don't really know what I'm going to do with it yet but we'll see . I think for games and educational learning type games AGK will do quite nicely and for anything else python should fit the bill.
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen. Windows 11 home edition .  2Tb external hard drive dedicated to Linux Mint .
  PureBasic 6 and AppGameKit studio
ASUS Vivo book 15 16gb ram 256gb storage  cpu upto 4.1 ghz