tolua 4.0

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

tolua 4.0

Pete Gardner
Any word on the progress of this?

Also, will tolua 3.2 work with Lua 4.0?

Thanks,

Pete Gardner
President, CEO
Helikon Technologies Inc.
http://www.helikon.com




Reply | Threaded
Open this post in threaded view
|

Re: tolua 4.0

Waldemar Celes-3

> Any word on the progress of this?

yes. I've finished the implementation and
now I am testing it.
I will release the new version pretty soon.

-- waldemar

>
>
> Also, will tolua 3.2 work with Lua 4.0?

You can try using the compatibility module -- lua3.
I haven't tried it yet, but it should work.

-- waldemar


Reply | Threaded
Open this post in threaded view
|

Re: tolua 4.0

Waldemar Celes-3
In reply to this post by Pete Gardner
Jonathan Adamczewski wrote:

> I have read on the lua-l list that you will be releasing it soon but
> was hoping that we
> might be allowed access to your current work.  I realise that it may
> not be complete
> but we are prepared to treat it as a beta and help where ever possible
> in it's completion.

For those who want to try the tolua 4.0,
there is a alpha version available at
ftp.tecgraf.puc-rio.br/pub/celes/tolua/tolua-4.0a.tar.gz

I am still working on its performance, and will probably change
the code (not the interface) in the next days.
Also, the docs are not up-to-date.

The main changes are:
- Lua 4.0 compatible (tolua is now reentrant)
- new support for 'bool' type (mapped to Lua  as 1 or nil)
- new support for extracting .pkg instruction from real header file
- fixed bugs reported in this list.
- no support for overloading relational operators: <=, >=, > (it
supports < only)
- the option -a is no longer support (we need the lua state to initalize
tolua)

feedbacks, suggestions and bug reports are very wellcome.

-- waldemar


>


Reply | Threaded
Open this post in threaded view
|

Re: tolua 4.0

Ben Cooley
> Jonathan Adamczewski wrote:
>
> > I have read on the lua-l list that you will be releasing it soon but
> > was hoping that we
> > might be allowed access to your current work.  I realise that it may
> > not be complete
> > but we are prepared to treat it as a beta and help where ever possible
> > in it's completion.
>
> For those who want to try the tolua 4.0,
> there is a alpha version available at
> ftp.tecgraf.puc-rio.br/pub/celes/tolua/tolua-4.0a.tar.gz
>
> I am still working on its performance, and will probably change
> the code (not the interface) in the next days.
> Also, the docs are not up-to-date.
>
> The main changes are:
> - Lua 4.0 compatible (tolua is now reentrant)
> - new support for 'bool' type (mapped to Lua  as 1 or nil)
> - new support for extracting .pkg instruction from real header file
> - fixed bugs reported in this list.
> - no support for overloading relational operators: <=, >=, > (it
> supports < only)
> - the option -a is no longer support (we need the lua state to initalize
> tolua)
>
> feedbacks, suggestions and bug reports are very wellcome.
>
> -- waldemar

I added a keyword "property" to the old tolua 3.2 version that was pretty
useful.  It worked something like this...

C++ class:

class MyClass {

    // Read write property
    int GetValue();
    int SetValue();

   // Readonly property
   int GetValue2();
};

tolua PKG class:

class MyClass {

  property int Value;
  property const int Value2;

};

Then in lua, the Get/Set function pair becomes a propery value which looks
just like a table var.

myinst.Value = 100
i = myinst.Value
i = minst.Value2

I've also noticed that 'tolua' adds a whole lot of string constants
reporting errors, so I took those out.

Ben Cooley
CINEMATIX



Reply | Threaded
Open this post in threaded view
|

Re: tolua 4.0

Jonathan Adamczewski
In reply to this post by Waldemar Celes-3
On Wed, 22 Nov 2000, Waldemar Celes wrote:

I've been using tolua4.0a and am corious about the following two points
that you mentioned -

> The main changes are:
> - new support for extracting .pkg instruction from real header file

How does this work?

> - no support for overloading relational operators: <=, >=, > (it
> supports < only)

Will this change?

Thanks for this brilliant piece of software!

Jonathan.


Reply | Threaded
Open this post in threaded view
|

Re: tolua 4.0

Waldemar Celes-3
> I've been using tolua4.0a and am corious about the following two points
> that you mentioned -
>
> > The main changes are:
> > - new support for extracting .pkg instruction from real header file
>
> How does this work?

in the real (.h)  header file, you can mark pieces of code to be processed
by tolua,
using the labels "tolua_begin" and "tolua_end". For instance:

...
//tolua_begin
struct Message
{
 enum {
  FIRST=1,
  SECOND,
  THIRD
 };

 void hello ()
 {
  cout << "hello world" << endl;
 }
};
//tolua_end
...

then, you instruct tolua to interpret this file, including in the .pkg
file:

...
${filename.h}
...


> > - no support for overloading relational operators: <=, >=, > (it
> > supports < only)
>
> Will this change?

No. For relational operators, Lua now supports tag method for the "less
than" only,
and so now does tolua.

>
>
> Thanks for this brilliant piece of software!
>

thank you for using tolua.

-- waldemar



Reply | Threaded
Open this post in threaded view
|

Re: tolua 4.0

Jonathan Adamczewski
On Wed, 29 Nov 2000, Waldemar Celes wrote:

> > I've been using tolua4.0a and am corious about the following two points
> > that you mentioned -
> >
> > > The main changes are:
> > > - new support for extracting .pkg instruction from real header file
> >
> > How does this work?
> 
> in the real (.h)  header file, you can mark pieces of code to be processed
> by tolua,
> using the labels "tolua_begin" and "tolua_end". For instance:
> 
> ...
> //tolua_begin
> struct Message
> {
>  enum {
>   FIRST=1,
>   SECOND,
>   THIRD
>  };
> 
>  void hello ()
>  {
>   cout << "hello world" << endl;
>  }
> };
> //tolua_end
> ...
> 
> then, you instruct tolua to interpret this file, including in the .pkg
> file:
> 
> ...
> ${filename.h}
> ...
 
Ok, have tried the above and works wonderfully.  A couple of things come
to mind...

- If you use 

${filename.h}

You still need to manually place 

$#include "filename.h" 

in the pkg file.  Does it make sense that the first implies the second?


- How are tolua keywords etc treated within header files?  Obviously I
can't start placing Module and @ willy nilly within the code.  Is there
still the ability to somehow use these within the header? (I must confess
that I have tried neither experimentation nor examinination of the tolua
code in this matter so do feel free to tell me to work it out myself:)


- If $#include "filename.h" is used within a pkg file, #include's are
placed in the output below the #include "tolua.h" line.  This can cause
problems under Visual C++ if precompiled headers are used as it requires
the include stdafx.h as the very first include in the file.  Several
solutions are available (AFAICS)

1. I live with it, doomed to spend the rest of my days editing the tolua
output by hand (ok, I'll stop being a melodrama queen :)

2. I modify the tolua code just for me so that it puts #include
"stdafx.h" at the top of every file (which is almost as bad and terribly
bad form)

3. The code is modified so that all #include's are placed above tolua.h
I think this would make the most sense and it will not produce incorrect
code.


- classes and structs are kept within the module they are designated
in.  I realize that this is probably by design... it might be nice to have
the option.  For example, it makes modules more analogous to namespaces.


I'll look into what changes might be needed over the next couple of days,
but help and opinions on the above would be greatly appreciated.  

Thanks

Jonathan.

(There was something else I had been thinking about but my memory fails
me... No doubt it will come to me straight after I hit send :)




> > Thanks for this brilliant piece of software!
> >
> 
> thank you for using tolua.

Hey, no worries - it makes a lot of what I'm doing impossibly easy (at
least, it does when I remember to regenerate the tolua output after
changing my code ;) I need to stick an automatic trigger in somewhere...)