[Pharo-project] [ANN] NativeBoost 1.2 version released (#development)
Hi, there i prepared new Metacello configuration of NativeBoost. Here the list of changes: Integer>>#| in AsmJit now - added a recursion detecting/handling via notifications - NBExternalHandle / NBExternalAddress is no longer subclasses of NBExternalStructure - more safer way to handle finalizing external objects survived from old session - avoid recursion when printing external struct fields - default alignment of external struct is machine word size - correct padding between struct fields (need to test) - ** fix ** conceptual bug when passing a struct by value. Now copying its contents on stack, instead of passing pointer - rewrote accessing struct fields, allowing nested structs - added #size_t type and NBSizeT marshaller - use stack pointer directly by getting it's address (via stackPointerAddress() available in Cog), so accessing ST stack is faster.. - added recursion guards in NBInterpreterProxy and in NBNativeCodeGen to prevent runaway train(s) - NBExternalType >> #typeSize answers the number of bytes which value of full type (including ptr arity) variable takes place in memory. NBExternalType >> valueSize is the number of bytes for base type (excluding pointers) takes in memory. NBExternalType >> stackSize taking into account stack argument alignment ------------------------- The main change is handling correctly passing structs by value. Before i was wrongly assuming that if function takes struct: int foo ( struct x a) you need to push the pointer to struct.. but in fact you need to copy struct contents on stack! This means that all function signatures which were written based on this wrong assumption should be changed to pass a pointer (if function takes a pointer to struct). So, don't be so haste to use it with Athens with new version of NB. It will definitely break (and i know where) because of this mistake. Fortunately, most of the libraries avoid passing structs by value, so most of the bindings should still keep working fine after update. But be warned about it! Thanks Luc for pointing out on this issue. Another improvement is because of more correct handling of structs, now NB allows nested structs. I blessed this version as #development. If no serious bugs will be found, after testing it with Athens and NBOpenGL (+ add your projects) i will change blessing to #release. -- Best regards, Igor Stasenko.
On 5/28/12 12:14 AM, Igor Stasenko wrote:
Hi, there
i prepared new Metacello configuration of NativeBoost.
Here the list of changes:
Sounds good. I will modify my test of gmp bindings to use it. BTW, for anyone interested, here is a way of creating "batch" bindings to the gmplib big integer add call: http://pastebin.com/naj05wEe makes two successive calls to the same (could be a different) function from within the same method. This avoids the overhead of the marshaling of parameters and making successive calls via the VM. With this technique, you could perform a reasonably complex task in an external lib with a single method. Extra assembler code can be placed in the same block, for extra speedy goodness. Now, in order to keep the Squeak Wayâ¢, we need a way of writing the code in slang instead of assembler. L -- Squeak from the very start (introduction to Squeak and Pharo Smalltalk for the (almost) complete and compleate beginner). https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all
On 28 May 2012 10:17, Lawson English <lenglish5@cox.net> wrote:
On 5/28/12 12:14 AM, Igor Stasenko wrote:
Hi, there
i prepared new Metacello configuration of NativeBoost.
Here the list of changes:
Sounds good. I will modify my test of gmp bindings to use it.
BTW, for anyone interested, here is a way of creating "batch" bindings to the gmplib  big integer add call:
makes two successive calls to the same (could be a different) function from within the same method. This avoids the overhead of the marshaling of parameters and making successive calls via the VM. With this technique, you could perform a reasonably complex task in an external lib with a single method. Extra assembler code can be placed in the same block, for extra speedy goodness.
Now, in order to keep the Squeak Wayâ¢, we need a way of writing the code in slang instead of assembler.
Yes. I also want to use some kind of assembler DSL, instead of hardcoding the platform-specific instructions everywhere. Of course , i want to make it flexible, so if you still need to invoke platform-specific instruction, you should be able to do that. -- Best regards, Igor Stasenko.
Hi all, Thanks Igor! Excellent and fast job ;-) I will test this new version soon. #Luc 2012/5/28 Lawson English <lenglish5@cox.net>
On 5/28/12 12:14 AM, Igor Stasenko wrote:
Hi, there
i prepared new Metacello configuration of NativeBoost.
Here the list of changes:
Sounds good. I will modify my test of gmp bindings to use it.
BTW, for anyone interested, here is a way of creating "batch" bindings to the gmplib big integer add call:
makes two successive calls to the same (could be a different) function from within the same method. This avoids the overhead of the marshaling of parameters and making successive calls via the VM. With this technique, you could perform a reasonably complex task in an external lib with a single method. Extra assembler code can be placed in the same block, for extra speedy goodness.
Now, in order to keep the Squeak Wayâ¢, we need a way of writing the code in slang instead of assembler.
L
-- Squeak from the very start (introduction to Squeak and Pharo Smalltalk for the (almost) complete and compleate beginner). https://www.youtube.com/**playlist?list=**PL6601A198DF14788D&feature=** view_all<https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all>
Update: i synchronized Athens Cairo backend with latest changes in NativeBoost. ConfigurationOfAthens version 1.2 is now working with NB v 1.2 (same version numbers are just coincidence) -- Best regards, Igor Stasenko.
thanks a lot for all that good work. On May 31, 2012, at 2:33 AM, Igor Stasenko wrote:
Update: i synchronized Athens Cairo backend with latest changes in NativeBoost.
ConfigurationOfAthens version 1.2 is now working with NB v 1.2
(same version numbers are just coincidence)
-- Best regards, Igor Stasenko.
participants (4)
-
Igor Stasenko -
Lawson English -
Luc Fabresse -
Stéphane Ducasse