Re: Future of Euphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message

Ray Smith wrote:

> FOX has a much broader array of Widgets, with trees,
> grids, MDI etc and is an excellent toolkit. It has one 
> benefit over wxWindows as it sits directly on top of 
> XWindows and is much smaller.

Fox is a nice library, and (as you mention) more lightweight than wxWindows. 
Fox and FLTK is that they draw their own controls instead of using native 
controls. This can be good or bad depending on your point of view.

> The big stumbling block in wrapping FOX is that it is "highly" 
> object oriented and I'm not sure how to wrap it correctly 
> for Euphoria.

If you read the documentation for SWIG, you can get a good idea of how C++ 
classes can be wrapped. Basically, you have two problems to deal with:

  1. Routines that accept variable numbers of parameters
  2. Routines that have the same name in different classes

In wxBasic, I solve this by pusing the parameters onto a temporary stack, 
along with the argument count, and doing a dynamic lookup of each routine at 
runtime, walking down the inheritance tree. So if you called:

   baz = foo.bar( 1, 2, 3 )

it would look something like:

   pushValue( 1 )
   pushValue( 2 )
   pushValue( 3 )
   pushArgCount( 3 )
   call_routine( foo, "bar" )
   baz = popValue()
   
> I have stayed away from wxWindows as I have been 
> waiting (and hoping!) that one day I'd read my email and 
> see a message from Mr Cuny with an announcement of 
> his success in wrapping wxWindows!!!! :)

I've been heading down the Open Source path, and it's hard enough to get 
people to contribute to your project when you use a mainstream language, to 
say nothing of Euphoria! 

There are, of course, exceptions to the rule. For example, Wings3D is written 
in Erlang, and is such a good application that people are willing to learn an 
entirely new language just to support it.

I've also moved away from a number of the Euphoria philosophies. For example, 
passing by reference is not supported in Euphoria. Yet it's essential to much 
of the code that I write. So instead, I have to create a global to hold my 
sequences, and then pass the index into that global. That is, instead of:

   procedure foo( sequence s )
      s[Name] = "Foo"
      s[Age] = 32
   end procedure

(which won't work), I'd end up writing something like:

   global sequence the

   procedure foo( index i )
      the[index][Name] = "Foo"
      the[index][Age] = 32
   end procedure

Virtually all my programs would end up with some scheme like this to get 
around the pass by reference problem.

And don't get me started on 'compare()'...

Not being able to link into C libraries was also a pain. It forced many 
things to be 'reinvented' for Euphoria when a free C library with that 
functionality already existed. 

With the release of the source code, there's a different problem: I can't 
release an "improved" version of Euphoria without significant limitations. I 
understand the reasons for this, and I'm *very* happy that Robert chose to 
release the source code. But for me, it's just not worth the hassle.

Still, I'd love to see Euphoria support wxWindows, and will do what I can to 
help make that happen.

-- David Cuny

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu