I won't go away over functionVoid() vs. functionName(), in part, because I already ran into the problem and fixed it above FFI, so I assume/expect/hope that NB would get (more or less) inserted as an alternative output syntax. That said, I think NB should try to be helpful. From the replies so far, variable args is the real zinger. My hunch is that the default should be to take an empty arg list as just that, with some additional cue to NB that a variable list is in order. The suggestion of noting that a Smalltalk collection has been passed is one way to help that along. Is the ... in int printf(const char *format, ...); valid C syntax? If so, should we support functionName(...)? However, I suspect that one would sooner want to send a message (#hasVariableArguments???) to flag the handful of functions that might be ambiguous. Bill ________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] on behalf of Norbert Hartl [norbert@hartl.name] Sent: Friday, December 16, 2011 6:39 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] NB Bug? Am 16.12.2011 um 11:47 schrieb Igor Stasenko:
On 16 December 2011 11:02, Stefan Marr <smalltalk@stefan-marr.de> wrote:
On 16 Dec 2011, at 10:49, Igor Stasenko wrote:
oh please. that's even less obvious usage :) there's a lot of different stuff in C syntax which you can play with. But it doesn't means that you need to routinely support everything in FFI callout specs.
as i said, the function signature syntax are close to C syntax, but not strictly C.
Igor, what is your goal with that? Have something working, or have something usable?
If your goal is to have something usable, then your direct competitor is LuaJIT2's FFI http://luajit.org/ext_ffi.html and you should show similar ambitions. (Note specifically the 'cut&past part') Otherwise, it will always remain just a nice try, an experiment that never got finished/productized.
My understanding is that your boss got other plans for Pharo...
well, there are things which i would like to have, like integrating with Cog (so a call to generated native code will be performed directly , instead via primitive), non-blocking and callbacks. This is much more important to have than subtleties, how to define a function which takes no arguments by using '()' or '(void)'.. Kind of 'triangle has three corners' vs 'triangle has three edges' discussion.
Igor, importance lies in the eye of the beholder. You are doing great stuff and you don't want to waste your time with things you consider unnecessary. But you need to decide what is the goal of NativeBoost. If you like to keep the pace and realize cool demos then you shouldn't listen to other people. If you think you like to make it an accepted piece of software that has a lot of users then you need listen to them. People posting in this thread are your potential users. They tell you things the fail over. If this happens more often you'll loose them because they don't want to waste their time with non-working stuff (the term non-working also lies in the eye of the beholder). Basically it is that easy. If you don't care about the (probably stupid) wishes of your users it stays your private pet project. Norbert