topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday October 8, 2024, 5:03 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Anybody use Lua?  (Read 10221 times)

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,021
    • View Profile
    • Donate to Member
Anybody use Lua?
« on: November 01, 2005, 06:36 PM »
http://www.lua.org/
Looks kinda nifty, I've been hearing of a lot of folks using it as an embedded script engine 'specially for games. But apparently you can use it for stand-alone scripting and a brief look at LuaForge seems there's API wrappers and Gui libraries, etc. And what's this about being able to use C functions and call dlls? Hmmm... downloading the manual now. Any thoughts? How easy is it to get your head around for scripting? Can you compile a script ? (Oop.. answered that one, apparently the binary distro comes with luac.exe which will compile your script.)

Mark0

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 652
    • View Profile
    • Mark's home
    • Donate to Member
Re: Anybody use Lua?
« Reply #1 on: November 01, 2005, 07:11 PM »
I have used Lua for some projects, basically for adding a scripting interface to an existing application.
May last work was DogLua, a plugin to implement scriptable capabilities for Project Dogwaffle, a paint and animation program (inspired by the work done with gluas for The GIMP).

I find Lua an amazing tool for this kind of things. It build from the ground up to be an light-weight extension language. so it feets very well. You can expose a C (or other compiler language, I have used PowerBASIC for example) function to the embedded Lua environment simply "registering" it, that is passing a pointer to the code and a name to identify the function in Lua. The parameters passing is made very easy trough a virtual task, so you can pass and return any number of parameters.

A note on LuaC; what you get isn't really compiled code, but just a bytecode, that's the exact same that is always executed by Lua. Passing a compiled chunk instead of a source to Lua you just skip the parsing step (very fast, anyway).
Recently Mike Pall has made available LuaJIT, that as the name suggest is Just-In-Time "real" compiler for Lua code. I used it in the last version of DogLua, and the speedup from the standard vanilla version was about 3-6x depending on the situations. An incredible good job!

Bye!

Mark0

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 652
    • View Profile
    • Mark's home
    • Donate to Member
Re: Anybody use Lua?
« Reply #2 on: November 03, 2005, 07:00 AM »
And be sure to check the Lua tutorials on Lua-users wiki:
Link: Lua-Users wiki: Tutorial Directory

Bye!

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,021
    • View Profile
    • Donate to Member
Re: Anybody use Lua?
« Reply #3 on: November 03, 2005, 12:48 PM »
Thanks for the reply, you worked on DogLua? I just downloaded the freeware Dogwaffle haven't got around to playing yet, also Lua has been made into a Litestep scripting module and since I use Litestep... Yep. I found the Tutorial and #3 of the first page fits me...
Programmers who may have used scripting languages, but not Lua
I knew Basic inside and out back when we had mammoth ivory keyboards and more recently have been using Batch scripts and AutoIt/Autohotkey for more uses than I can count. Now on the 5th page...

P.S. LuaJIT appears to be source only. Do you know if binaries are available? I'm also going to eventually need GUI stuff, do you have any recommendations for that? IUP? GTK?

NoWhereMan

  • Participant
  • Joined in 2005
  • *
  • default avatar
  • Posts: 23
    • View Profile
    • Donate to Member
Re: Anybody use Lua?
« Reply #4 on: November 03, 2005, 01:02 PM »
I do, well, at least I did use Lua :P
It's a nice language... 5.x  is very powerful

Mark0

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 652
    • View Profile
    • Mark's home
    • Donate to Member
Re: Anybody use Lua?
« Reply #5 on: November 03, 2005, 04:42 PM »
P.S. LuaJIT appears to be source only. Do you know if binaries are available?
Here attached you'll find an EXE+DLL Win32 binary of LuaJIT 1.03.

Bye!

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,021
    • View Profile
    • Donate to Member
Re: Anybody use Lua?
« Reply #6 on: November 04, 2005, 01:30 PM »
Thanks! :Thmbsup:

dajo

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 32
    • View Profile
    • Donate to Member
Re: Anybody use Lua?
« Reply #7 on: November 06, 2005, 10:59 AM »
Lua is the scripting language of the powerful unicode-capable text editor SciTe.
http://scintilla.sourceforge.net/SciTE.html

Some of the stand-out features of SciTe:
  • Code Folding
  • Syntax Highlighting
  • Unicode support
  • Lightweight feel (Starts quickly, very responsive)
  • Extremely customizable
  • Free (if that's a feature)

And here's a good overview for using SciTE for Windows Scripting:
http://dev.remotenetworktechnology.com/SciTE/

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,021
    • View Profile
    • Donate to Member
Re: Anybody use Lua?
« Reply #8 on: November 07, 2005, 11:24 AM »
I used SciTe for a while with AutoIt as they have a custom build for it (http://www.autoitscript.com/autoit3/scite/) Very nice, Iwill try it for Lua.