[Vm-dev] Re: Interfacing with the i/o pins on the Raspberry Pi et
kilon.alios at gmail.com
Wed Aug 5 10:37:38 UTC 2015
I am using sockets for my implementation since its simpler to code. But
that impose some speed limit, its ok for invoking code that responds down
to a milisecond but if your goal is microsecond then a C lib would make
more sense. There was a guy doing it this way with nativeboost (which AFAIK
does not work on Squeak but you could use the Squeak FFI) but not for
Python but for the R programming language.
Bare in mind that a lot of python libraries contain python code , so they
not just C++ wrappers .
It makes more sense to invoke python libs from python .
Thats what I did with my implementation, I let python run its own libraries
and my project all it does is say to python what to do. This way I can use
any python library from Pharo. There is some extra care that should be
taken with libraries that mess with threads , I had my issues for example
using pyQT but thats the usual issues you have with threading and
Most Python libraries use the Python C API which can wrap C and C++ for
python, gives you the ability to manage refernce counting which is what
cpython uses for its GC and wrap C/C++ types to python objects.
I have been recommended to use openQwaq implementation for running python
scripts but the documentation and the code was not so clear and I decided
to implement my own. Also my goal was to make writting python code optional
for users. I prefer using python libraries as if they are pharo libraries
which I managed to do with some basic regex parsing and overiding MNU ;)
On Wed, Aug 5, 2015 at 4:12 AM Ben Coman <btc at openinworld.com> wrote:
> On Wed, Aug 5, 2015 at 4:54 AM, tim Rowledge <tim at rowledge.org> wrote:
> > The only related area notably affecting me is that a lot of Pi stuff has
> python libraries. Right now we can’t call them so I have to dig into the
> code (oh, yurgh) and replicate relevant functionality. Tedious. I have
> noticed that a lot of python libraries are merely shims around C++ code but
> we can’t call that either without a C shim - and anyway the python code
> often does extra bits around the edges.
> Kilon Alios (aka Dimitris Chloupis) has developed a Pharo/Python
> bridge that is perhaps malleable for use with Squeak.
> cheers -ben
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev