Re: [Doris] PyGame/PyOpenGL
Brought to you by:
trout
|
From: Brian H. <ho...@bo...> - 2004-04-30 23:06:46
|
Crap, I typed a response to this and it got ate by my mailer
somewhere. Anyway...
> You mean just playing around?
Yes.
> I think it's because Lua defaults the value to nil if it doesn't
> find something, whereas Python recognises that its a typo. You can
> change Lua to find none existant globals using a metamethod,
> perhaps just in the debug version. Should we add this as an option
> to Doris?
Possibly, but it only sort of helps -- you still have to find the
error at run-time, and you have to go through some hoops when you DO
want to declare a global variable. It changes things enough that it
sort of stops being a Lua program.
> ..which is incredibly slow. I've never liked Java.
Agreed, but with GL this isn't an issue. If you write the widgets one
time they should work everywhere the same.
> One thing you need to do is update the GLUI packages in Doris so
> the binding can be auto generated. What else do you see will take
> all this time?
I can't stand the .pkg system. I really dislike tolua() and would
prefer to use manual bindings, to be honest. Having two sets of
headers is silly, and having it export all by default is also silly. I
would much prefer to do something like a tag for exporting to Lua,
e.g.
LUA_EXPORT void function( void );
Is something like this possible?
> What needs doing? I thought you'd just have to swap over the half
> dozen callbacks to let the widgets operate and set GL up. I'm
> pretty sure there is code to use GL with SDL already. What else
> needs doing?
Well, all the back end stuff has to get going as well.
> I think some sort of class support and more though about modules
> and structure, using support from function environments, needs
> adding at this point. These could be offered as part of Doris?
I was envisioning a type system that could be done almost entirely
with a preprocessor, something like:
deftype $vec2 =3D
{
x =3D "number", y =3D "number"
}
function add_vecs( $vec2 a, $vec2 b )
return $vec2{ x =3D a.x + b.y, y =3D a.y + b.y }
end
The preprocessor can easily type variables if a type exists, and if
none exists it just works like old fashioned Lua.
Doing:
$vec2 a =3D $vec2:new()
a.z =3D 3 -- generates compile time error
Modifying the lexer to ignore all "$" would be pretty easy I think as
well.
Brian
|