NICE!!!!!


________________________________________
From: [email protected] 
[[email protected]] On Behalf Of Igor Stasenko 
[[email protected]]
Sent: Thursday, September 23, 2010 11:21 AM
To: [email protected]
Subject: Re: [Pharo-project] NativeBoost examples (was: Re: DoubleArray)

On 23 September 2010 18:02, Igor Stasenko <[email protected]> wrote:
> 2010/9/23 Henrik Johansen <[email protected]>:
>>
>> On Sep 23, 2010, at 4:03 07PM, Stéphane Ducasse wrote:
>>
>> igor
>>
>> May be a layer for people that are not fluent with assembly would help.
>> Make the path easy from FFI writing.
>>
>> It is already, RTM :)
>> http://code.google.com/p/nativeboost/wiki/NBFnSpecParser
>>
>> Get some patterns so that people can learn by following patterns.
>>
>
> Oh, yeah.. see. I was showing an example how to implement own
> primitive using NativeBoost.
>
> Of course, an FFI API is there, and doing all the magic under the
> hood, so you dont have to know any assemler voodo:
>
> releaseDC: hdc
>        <primitive: #primitiveNativeCall module: #NativeBoostPlugin>
>
>        ^ NBFFICallout stdcall: #(
>
>                int ReleaseDC (
>                  HWND self ,  " handle to window"
>                  HDC hdc     " handle to DC "
>                ))
>                module: #user32
>
> the above is an FFI call to external function ReleaseDC, which can be
> found in 'user32.dll' windoze module.
>

One of Bill's concerns is to be able to customize an external library
search algorithm.
And i can easily extend this api for custom-loading a library:

Suppose, that if you passing a block into #module: argument, instead
of string/symbol,
then this block should answer a ready-to-use external library handle.
So, then above example can be rewritten as:

releaseDC: hdc
        <primitive: #primitiveNativeCall module: #NativeBoostPlugin>

        ^ NBFFICallout stdcall: #(

                int ReleaseDC (
                  HWND self ,  " handle to window"
                  HDC hdc     " handle to DC " ))
                module: [ self whereTheHeckMyModule ]


And you are free to implement #whereTheHeckMyModule in any way you like :)


>> Stef
>>
>> Cheers,
>> Henry
>> _______________________________________________
>> Pharo-project mailing list
>> [email protected]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to