Recent

Author Topic: New Lua for Lazarus is out  (Read 13712 times)

malcome

  • Jr. Member
  • **
  • Posts: 80
New Lua for Lazarus is out
« on: February 05, 2015, 10:53:02 am »
Hi, New Lua for Lazarus is out.

https://github.com/malcome/Lua4Lazarus

Usage:
    See sample projects. (Needs lua53.dll, lua53.so, etc.)

    -New Lua 5.3 header unit for FPC.
    -Sample of using database(TDbf).
    -Sample of using ActiveX.
    -Sample of using extension module in Lua.
    -Sample of using multithread.
    -Sample of printing a report with drawing PDF.

Contribution:
    1. Fork it
    2. Create your feature branch
    3. Commit your changes
    4. Push to the branch
    5. Create new Pull Request

License:
  New BSD

Thanks.

Roland57

  • Sr. Member
  • ****
  • Posts: 422
    • msegui.net
Re: New Lua for Lazarus is out
« Reply #1 on: February 05, 2015, 11:16:44 am »
Hello! I can't wait to test it. But are Lua 5.3 binaries (for Windows) available somewhere? I looked for it without success. It probably wouldn't so difficult to build it myself (with MINGW-GCC?) but I never tried.
My projects are on Gitlab and on Codeberg.

malcome

  • Jr. Member
  • **
  • Posts: 80
Re: New Lua for Lazarus is out
« Reply #2 on: February 05, 2015, 11:27:34 am »

Roland57

  • Sr. Member
  • ****
  • Posts: 422
    • msegui.net
Re: New Lua for Lazarus is out
« Reply #3 on: February 05, 2015, 12:03:40 pm »
Thank you.  :)
My projects are on Gitlab and on Codeberg.

Roland57

  • Sr. Member
  • ****
  • Posts: 422
    • msegui.net
Re: New Lua for Lazarus is out
« Reply #4 on: February 05, 2015, 08:33:57 pm »
I looked at the examples : all tested successfully. Impressive!

As far as I am concerned, I am interested in using Lua scripts in my Pascal programs, as it is described in this discussion:

http://www.pascalgamedevelopment.com/showthread.php?32398-Using-a-Lua-script-in-a-FreePascal-program

Would it be possible to do that with your units?
« Last Edit: February 05, 2015, 08:43:05 pm by Roland Chastain »
My projects are on Gitlab and on Codeberg.

malcome

  • Jr. Member
  • **
  • Posts: 80
Re: New Lua for Lazarus is out
« Reply #5 on: February 05, 2015, 11:52:28 pm »
Hi, Roland.
Probably yes, if you do not use incompatibilities with the previous Lua version.

Roland57

  • Sr. Member
  • ****
  • Posts: 422
    • msegui.net
Re: New Lua for Lazarus is out
« Reply #6 on: February 06, 2015, 12:17:39 am »
OK, thank you for your answer. I will see if I succeed to do it.
My projects are on Gitlab and on Codeberg.

Roland57

  • Sr. Member
  • ****
  • Posts: 422
    • msegui.net
Re: New Lua for Lazarus is out
« Reply #7 on: February 06, 2015, 09:59:43 am »
Hello!

I expected to have several things to change in my current code to compile it with your unit, but I didn't change anything (except the unit name) and it works perfectly.  :)

I replaced the Lua script, in order to illustrate a new feature of Lua 5.3 (the euclidian division by the "//" operator).

With your permission I post the example here.
My projects are on Gitlab and on Codeberg.

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: New Lua for Lazarus is out
« Reply #8 on: March 04, 2015, 11:38:17 pm »
How would you do the opposite - creating a Pascal fundtion which can be called from Lua?
Lazarus 3.0/FPC 3.2.2

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: New Lua for Lazarus is out
« Reply #9 on: March 05, 2015, 07:55:17 am »
How would you do the opposite - creating a Pascal fundtion which can be called from Lua?
As how it's done in any other languages. Lua tutorial & manual has a section explaining C, which is the same in Pascal providing you use cdecl calling convention. Lua convention for exchanging parameters and function results remains the same.

hengky

  • New Member
  • *
  • Posts: 11
Re: New Lua for Lazarus is out
« Reply #10 on: July 05, 2017, 06:37:10 pm »
how can we use library in lua script with lazarus

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: New Lua for Lazarus is out
« Reply #11 on: July 05, 2017, 06:42:18 pm »
how can we use library in lua script with lazarus

As Leledumbo explained.

You may find this helpful for ideas:

https://macpgmr.github.io/MacXPlatform/PascalDynLibs.html

These articles cover the big 3 in calling code languages: Python, .NET, and C languages via a header file.


lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: New Lua for Lazarus is out
« Reply #12 on: July 05, 2017, 07:50:07 pm »
how can we use library in lua script with lazarus

here is a package I made with a lot of code that show how to use lua
https://github.com/lainz/lainzcodestudio

Check the project wiki also..
« Last Edit: July 05, 2017, 07:55:48 pm by lainz »

 

TinyPortal © 2005-2018