slang-users mailing list

[2001 Date Index] [2001 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: What's faster ?


Richard van Zon <rvanzon@xxxxxxxxxxxx> wrote:
>but I go for the popping method...
>I only looked for a way that I can make the compiler
>clear that for example 2 integer parameters are

The other method is just as good as long as your MAKE_INTRINSIC table
entry specifies that the function takes 2 integers.  For this reason,
it is preferable to allow slang to handle the popping and argument
checking for you.

>Or is it safe to just use the add_intrinsic functions with a parameter
>count ?

Use, e.g.,

   #define V SLANG_VOID_TYPE
   #define I SLANG_INT_TYPE
     .
     .
   MAKE_INTRINSIC_2("func", func, V, I, I),
     .
     .
   #undef V
   #undef I

This is preferable to using the pop functions.
   
>btw: I tested some stuff with LUA (another interpreter), but the embedding
>method of S-Lang is much better, I must say. maybe nice to hear :-)

That is good to hear.  I have heard that LUA is quite fast; however, I
think that if you take advantage of slang's array syntax then slang
can be as fast as compiled C for many purposes.

Thanks,
--John


[2001 date index] [2001 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]