Ooops
October 24, 2021, 23:53:02

Author Topic: Lua any good  (Read 1394 times)

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 817
  • Bonjour
Lua any good
« on: September 04, 2021, 20:06:51 »
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.

Offline MikeHart

  • Hero Member
  • *****
  • Posts: 817
Re: Lua any good
« Reply #1 on: September 04, 2021, 21:40:04 »
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.

Offline therevills

  • Hero Member
  • *****
  • Posts: 661
Re: Lua any good
« Reply #2 on: September 05, 2021, 00:33:53 »
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

Offline Derron

  • Hero Member
  • *****
  • Posts: 3674
Re: Lua any good
« Reply #3 on: September 05, 2021, 12:57:04 »
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.


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
« Last Edit: September 05, 2021, 12:59:52 by Derron »

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 817
  • Bonjour
Re: Lua any good
« Reply #4 on: September 06, 2021, 10:02:19 »
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.

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 817
  • Bonjour
Re: Lua any good
« Reply #5 on: September 06, 2021, 10:09:57 »
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.

Offline iWasAdam

  • Hero Member
  • *****
  • Posts: 2479
Re: Lua any good
« Reply #6 on: September 06, 2021, 10:24:05 »
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

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 817
  • Bonjour
Re: Lua any good
« Reply #7 on: September 07, 2021, 02:59:21 »
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.

Offline MikeHart

  • Hero Member
  • *****
  • Posts: 817
Re: Lua any good
« Reply #8 on: September 07, 2021, 05:09:59 »
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.

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 3237
  • elgol
Re: Lua any good
« Reply #9 on: September 07, 2021, 08:47:56 »
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.
Windows 10 64-bit, 16Gb RAM, Intel i5 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
MacOS Big Sur 64-bit, 8Gb RAM, Intel i5 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB
Linux Mint 19.3 64-bit, 16Gb RAM, Intel i5 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb)
Raspberry pi 3, pi 4, pi 400, BBC B, C64, ZX Spectrum

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 817
  • Bonjour
Re: Lua any good
« Reply #10 on: September 18, 2021, 13:07:49 »
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.
« Last Edit: September 18, 2021, 13:33:32 by Pfaber11 »
HP 15s i3 1.2 upto 3.4 ghz 128 gb ssd 16 gb ram 15.6 inch screen.

Offline therevills

  • Hero Member
  • *****
  • Posts: 661
Re: Lua any good
« Reply #11 on: September 19, 2021, 02:59:17 »
Using Love2d (and Defold) creating an exe for Lua is easy  :)

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 817
  • Bonjour
Re: Lua any good
« Reply #12 on: September 19, 2021, 11:06:33 »
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.

Offline therevills

  • Hero Member
  • *****
  • Posts: 661
Re: Lua any good
« Reply #13 on: September 19, 2021, 11:36:42 »
Also should have posted this: https://love2d.org/wiki/Game_Distribution

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 817
  • Bonjour
Re: Lua any good
« Reply #14 on: September 21, 2021, 12:24:48 »
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.

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal