Sig,

"A proper error handling is an important part of infrastructure-level
project (such as NativeBoost), since then people who using it,
can quickly determine what's wrong with their code."

Well said!!!!  Still working on that grant proposal; I'll be glad when it's 
submitted.  Do you have any sense of when callbacks will be available?  Please 
don't feel any pressure from me, because I have a lot to do before I can make 
proper use of them.

One really crazy idea: inline C.  Is there any way that one could put C code 
into a method, have it compiled and captured somehow as part of the image?  
Perhaps I am underestimating Cog and will soon not need to bother with stuff 
like this, but a recent addition was

void LogOnePlus(double * data, unsigned long size)
/*
        Add one and take log10() over the buffer; in-place transformation!
*/
{
        for(unsigned long i=0; i<size; i++){
        data[i] = log10(data[i]+1);
        }
}

That's a simple calculation, but do it millions of times and it adds up.  Even 
if Cog is sufficiently far reaching to translate such things, there are still 
times when C/C++ does a far nicer job of translating formulas than does 
Smalltalk.  Like I said, it's a crazy idea, and if I have to choose, I'd rather 
have callbacks :)

Bill





________________________________________
From: [email protected] 
[[email protected]] On Behalf Of Igor Stasenko 
[[email protected]]
Sent: Wednesday, September 29, 2010 6:31 PM
To: The general-purpose Squeak developers list; Pharo Development
Subject: [Pharo-project] NativeBoost and Cog. A working protype.

Hello,

just wanna tell you that i adopted NativeBoost under Cog and have a
first running prototype.
It still lacks callbacks support, but its already can be used for
callouts and to run native code.

NativeBoost-CogPlugin does not requires patched for platform-specific code.
Just load it into Cog VMMaker image, generate & build  vm and you done!
Thanks Eliot for providing necessary bits for controlling memory
execution protection.

The NativeBoost-CogPlugin will have some additional functionality,
comparing to its Squeak VM cousin.
  - it using a primitive failure codes, so when primitive fails , you
can determine why and where your native call fails.

  The primitive error codes still not handled/used by language side,
so its a work to do:
  - a marchalling code can use error codes to report that primitive
fails due to coercion error, and it even will tell which exactly
argument
  failed to coerce.
  - of course, you will be able to add own custom error codes, and
handle them as you like to.

 By default, a plugin could report following problems:

        "execution of native code is not enabled by plugin"
        ErrNotEnabled

        "failed to find a native code for primitive method"
        ErrNoNativeCodeInMethod

        "native code generated for different platform"
        ErrInvalidPlatformId

I wanna say thanks to Eliot for providing primitive fail codes in VM.
A proper error handling is an important part of infrastructure-level
project (such as NativeBoost), since then people who using it,
can quickly determine what's wrong with their code.


--
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