[Pharo-project] NB Bug?
Igor, is this a bug? When parsing methods that send native functions withouth arguments , void, theres a DNU. For example in the following method: ^ self pangoCairoNbCall:#(PangoCairoFontMap pango_cairo_font_map_get_default ( void ) ) I fixed it like this: usesMethodArguments "first check wether my single argument is void" ^(fnSpec arguments size = 1 ==> [fnSpec arguments first class ~= NBVoid]) and:[ fnSpec arguments anySatisfy: [:type | type loader usesSTStack ] ] Fernando
On 14 December 2011 01:17, Fernando Olivero <fernando.olivero@usi.ch> wrote:
Igor, is this a bug?
When parsing methods that send native functions withouth arguments , void, theres a DNU. For example in the following method:
^ self pangoCairoNbCall:#(PangoCairoFontMap pango_cairo_font_map_get_default ( void ) )
I fixed it like this:
usesMethodArguments "first check wether my single argument is void" ^(fnSpec arguments size = 1 ==> [fnSpec arguments first class ~= NBVoid]) and:[ fnSpec arguments anySatisfy: [:type | type loader usesSTStack ] ]
Well, the function signature syntax are not strictly following C. Just use empty parens for functions with no arguments. This is quite archaic C syntax, which is really not important to support. Or i can add this patch if you insist. :) -- Best regards, Igor Stasenko.
On 14.12.2011 02:10, Igor Stasenko wrote:
On 14 December 2011 01:17, Fernando Olivero<fernando.olivero@usi.ch> wrote:
Igor, is this a bug?
When parsing methods that send native functions withouth arguments , void, theres a DNU. For example in the following method:
^ self pangoCairoNbCall:#(PangoCairoFontMap pango_cairo_font_map_get_default ( void ) )
I fixed it like this:
usesMethodArguments "first check wether my single argument is void" ^(fnSpec arguments size = 1 ==> [fnSpec arguments first class ~= NBVoid]) and:[ fnSpec arguments anySatisfy: [:type | type loader usesSTStack ] ]
Well, the function signature syntax are not strictly following C. Just use empty parens for functions with no arguments. This is quite archaic C syntax, which is really not important to support.
Or i can add this patch if you insist. :)
So you would say f.ex. http://david.tribble.com/text/cdiffs.htm#C99-empty-parm is incorrect? Cheers, Henry
Fernando, i added you as developer to NativeBoost project. Please submit your fix there. -- Best regards, Igor Stasenko.
On 15 December 2011 10:28, Henrik Sperre Johansen <henrik.s.johansen@veloxit.no> wrote:
On 14.12.2011 02:10, Igor Stasenko wrote:
On 14 December 2011 01:17, Fernando Olivero<fernando.olivero@usi.ch> Â wrote:
Igor, is this a bug?
When parsing methods that send native functions withouth arguments , void, theres a DNU. For example in the following method:
^ self pangoCairoNbCall:#(PangoCairoFontMap pango_cairo_font_map_get_default ( void ) )
I fixed it like this:
usesMethodArguments "first check wether my single argument is void" ^(fnSpec arguments size = 1 ==> Â [fnSpec arguments first class ~= NBVoid]) and:[ fnSpec arguments anySatisfy: [:type | type loader usesSTStack ] ]
Well, the function signature syntax are not strictly following C. Just use empty parens for functions with no arguments. This is quite archaic C syntax, which is really not important to support.
Or i can add this patch if you insist. :)
So you would say f.ex. http://david.tribble.com/text/cdiffs.htm#C99-empty-parm is incorrect?
in what context we're talking about? if this declaration in C code, then of course it could mean that it does not defines the arguments yet. But if we speaking about signature of function for callout, then i think it is clear what it stands for. I had thoughts about adding handling the sole 'void' keyword in function params, but then i thought, what the heck, it doesn't makes creating callouts harder or easier. Unlike from C/C++ code it carries no additional functional load. Nothing.
Cheers, Henry
-- Best regards, Igor Stasenko.
On Thu, Dec 15, 2011 at 2:14 PM, Igor Stasenko <siguctua@gmail.com> wrote:
On 15 December 2011 10:28, Henrik Sperre Johansen <henrik.s.johansen@veloxit.no> wrote:
On 14.12.2011 02:10, Igor Stasenko wrote:
On 14 December 2011 01:17, Fernando Olivero<fernando.olivero@usi.ch> wrote:
Igor, is this a bug?
When parsing methods that send native functions withouth arguments , void, theres a DNU. For example in the following method:
^ self pangoCairoNbCall:#(PangoCairoFontMap pango_cairo_font_map_get_default ( void ) )
I fixed it like this:
usesMethodArguments "first check wether my single argument is void" ^(fnSpec arguments size = 1 ==> [fnSpec arguments first class ~= NBVoid]) and:[ fnSpec arguments anySatisfy: [:type | type loader usesSTStack ] ]
Well, the function signature syntax are not strictly following C. Just use empty parens for functions with no arguments. This is quite archaic C syntax, which is really not important to support.
Or i can add this patch if you insist. :)
So you would say f.ex. http://david.tribble.com/text/cdiffs.htm#C99-empty-parm is incorrect?
in what context we're talking about? if this declaration in C code, then of course it could mean that it does not defines the arguments yet. But if we speaking about signature of function for callout, then i think it is clear what it stands for.
Are you? Since in C () means an unspecified argument list this could be the way of declaring a varargs function, e.g. printf: arguments <cdecl: printf ()> could insist on arguments being an array and automatically marshall all the elements in it.
I had thoughts about adding handling the sole 'void' keyword in function params, but then i thought, what the heck, it doesn't makes creating callouts harder or easier. Unlike from C/C++ code it carries no additional functional load. Nothing.
Cheers, Henry
-- Best regards, Igor Stasenko.
-- best, Eliot
On 15 December 2011 23:21, Eliot Miranda <eliot.miranda@gmail.com> wrote:
On Thu, Dec 15, 2011 at 2:14 PM, Igor Stasenko <siguctua@gmail.com> wrote:
On 15 December 2011 10:28, Henrik Sperre Johansen <henrik.s.johansen@veloxit.no> wrote:
On 14.12.2011 02:10, Igor Stasenko wrote:
On 14 December 2011 01:17, Fernando Olivero<fernando.olivero@usi.ch> Â wrote:
Igor, is this a bug?
When parsing methods that send native functions withouth arguments , void, theres a DNU. For example in the following method:
^ self pangoCairoNbCall:#(PangoCairoFontMap pango_cairo_font_map_get_default ( void ) )
I fixed it like this:
usesMethodArguments "first check wether my single argument is void" ^(fnSpec arguments size = 1 ==> Â [fnSpec arguments first class ~= NBVoid]) and:[ fnSpec arguments anySatisfy: [:type | type loader usesSTStack ] ]
Well, the function signature syntax are not strictly following C. Just use empty parens for functions with no arguments. This is quite archaic C syntax, which is really not important to support.
Or i can add this patch if you insist. :)
So you would say f.ex. http://david.tribble.com/text/cdiffs.htm#C99-empty-parm is incorrect?
in what context we're talking about? if this declaration in C code, then of course it could mean that it does not defines the arguments yet. But if we speaking about signature of function for callout, then i think it is clear what it stands for.
Are you? Â Since in C () means an unspecified argument list this could be the way of declaring a varargs function, e.g.
printf: arguments   <cdecl: printf ()>
could insist on arguments being an array and automatically marshall all the elements in it.
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. -- Best regards, Igor Stasenko.
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... Best regards Stefan -- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
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. -- Best regards, Igor Stasenko.
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
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
On 16 December 2011 13:39, Norbert Hartl <norbert@hartl.name> wrote:
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.
Yes, i understand what you saying about. :)
Norbert
-- Best regards, Igor Stasenko.
Stefan Marr-3 wrote
LuaJIT2's FFI... specifically the 'cut&past part'
Wow, that's awesome! Why would it ever be any harder than that? -- View this message in context: http://forum.world.st/NB-Bug-tp4192637p4204556.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
On Dec 16, 2011, at 2:05 PM, Sean P. DeNigris wrote:
Stefan Marr-3 wrote
LuaJIT2's FFI... specifically the 'cut&past part'
Wow, that's awesome! Why would it ever be any harder than that?
before starting pharo I was wondering if I should not develop a smalltalk on top of lua. Somedays I think that I should have. Because we still do not have a vm that can be embedded in C and all the restâ¦. :( Stef
-- View this message in context: http://forum.world.st/NB-Bug-tp4192637p4204556.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
2011/12/16 Sean P. DeNigris <sean@clipperadams.com>:
Stefan Marr-3 wrote
LuaJIT2's FFI... specifically the 'cut&past part'
Wow, that's awesome! Why would it ever be any harder than that?
Yes really simple to use ! -- Serge Stinckwich UMI UMMISCO 209 (IRD/UPMC), Hanoi, Vietnam Matsuno Laboratory, Kyoto University, Japan (until 12/2011) http://www.mechatronics.me.kyoto-u.ac.jp/ Every DSL ends up being Smalltalk http://doesnotunderstand.org/
participants (11)
-
Ben Coman -
Eliot Miranda -
Fernando Olivero -
Henrik Sperre Johansen -
Igor Stasenko -
Norbert Hartl -
Schwab,Wilhelm K -
Sean P. DeNigris -
Serge Stinckwich -
Stefan Marr -
Stéphane Ducasse