To load such code switch to old compiler in settings browser. It supports old FFI syntax. Then you can manually adopt all ffi calls to UFFI and commit new version. 2017-10-29 15:09 GMT+01:00 Paulo R. Dellani <dellani@pobox.com>:
Dear all,
I would like to give ZeroMQ a try in Smalltalk, but am unable to load it on a new image successfully. In Pharo 5, I loaded the package ConfigurationOfZeroMQ from the repository in smalltalkhub <http://smalltalkhub.com/#%21/%7Epanuw/zeromq> and evaluated the following to load the code:
ConfigurationOfZeroMQ loadBleedingEdge
It seems to load everything well, but when I try to look at the source code of the methods that call the C routines from libzmq using the system browser, the system exhibits the following error message:
UndefinedObject(Object)>>doesNotUnderstand: #keywords RBFFICallPragma(RBPragmaNode)>>selectorParts RubSHTextStylerST80(SHRBTextStyler)>>visitPragmaNode: RBFFICallPragma(RBPragmaNode)>>acceptVisitor: RubSHTextStylerST80(SHRBTextStyler)>>visitNode: [ :each | self visitNode: each ] in RubSHTextStylerST80>>visitMethodNode: in Block: [ :each | self visitNode: each ] OrderedCollection>>do:
(its a long stack, cutting here)
When loading ZeroMQ on Pharo 6, a window pops-up with the title 'Syntax Error: Literal constant expected' showing the source code of a method defining a call to a routine from a C library:
apiDeleteDC: aHDC <apicall: Literal constant expected -> bool 'DeleteDC' (Win32HDC) module:'gdi32.dll'> ^self externalCallFailed
If I update the syntax, re-writing the code above as
apiDeleteDC: aHDC ^self ffiCall: #( bool DeleteDC (Win32HDC aHDC) ) module:'gdi32.dll'
the compiler accepts it and the process can go on, but eventually the system will become unstable...
Any ideas on how to solve this problems? Is this syntax still supported in Pharo5 & 6?
Cheers,
Paulo
On 10/25/2017 03:47 PM, Sebastian Heidbrink via Pharo-users wrote:
ForwardedMessage.eml
Subject: Re: [Pharo-users] Exchanging information between 2 pharo applications (2 images running on two different computers)
From: Sebastian Heidbrink <sheidev@yahoo.de> <sheidev@yahoo.de>
Date: 10/25/2017 03:47 PM
To: pharo-users@lists.pharo.org Hi Cederik,
you should have a look at http://smalltalkhub.com/#!/~panuw/zeromq ZeroMQ is a networking library. Nice thing about it is that all the networking related workload is dealt with in a second process. That can save you some resources within Smalltalk.