14. IWST
2013
@
Annecy
NativeBoost Example
14
Regular Smalltalk method
with one argument
15. IWST
2013
@
Annecy
NativeBoost Example
15
A pragma indicating that
#primitiveNativeCall of #NativeBoost plugin
should be executed when this method is executed
31. IWST
2013
@
Annecy
NBExample getenv: ‘PATH’
Insights into NativeBoost Internals
31
Virtual Machine (VM)
NativeBoost Plugin
Fail if no native code
associated with #getenv:
32. IWST
2013
@
Annecy
NBExample getenv: ‘PATH’
Insights into NativeBoost Internals
32
Virtual Machine (VM)
NativeBoost Plugin
1. generate native code for marshalling, ...
2. associate it with #getenv:
3. restart the method execution
33. IWST
2013
@
Annecy
Virtual Machine (VM)
NativeBoost Plugin
Insights into NativeBoost Internals
33
activate the native code
associated with #getenv:
NBExample getenv: ‘PATH’
34. IWST
2013
@
Annecy
Conclusion
34
• NativeBoost-FFI is:
• Language-side: extensible, high-level code only
• Fast compared to other Smalltalk FFI
• Needs optimizations on Callbacks but that would
require strongVM support
35. IWST
2013
@
Annecy
Future Work
• Improve NativeBoost Callback performance
• Reuse Alien’sVM Callback support?
• Better integration of NativeBoost with the JIT
• Do not leave JIT-mode when activating a NB
method
35
36. Camillo Bruni, Luc Fabresse, Stéphane Ducasse, Igor Stasenko
IWST 2013
Language-side
Foreign Function Interfaces
with NativeBoost