On 5/5/2011 8:19 PM, Igor Stasenko wrote:
> On 6 May 2011 01:03, Jimmie Houchin<jlhouchin at gmail.com> wrote:
>> On 5/5/2011 4:25 PM, Igor Stasenko wrote:
>>
>> On 5 May 2011 21:39, Jimmie Houchin<jlhouchin at gmail.com> wrote:
>>
>> On 5/5/2011 12:21 PM, Igor Stasenko wrote:
>>
>> On 5 May 2011 18:57, Jimmie Houchin<jlhouchin at gmail.com> wrote:
>>
>> [Big Snip]
>>
>> Well said.
>> Except that i'm not sharing your view that its hard to interface with
>> foreign libraries.
>> Its not hard at all. Of course to connect two different worlds, you
>> need to have knowledge
>> in both of them. But this requirement not a bit different when you
>> take any other pair of languages and try to
>> connect them.
>>
>> Thanks,
>>
>> I have no knowledge of either the knowledge or the challenges involved in
>> using external libraries in Pharo or Squeak. I have no knowledge of
>> FFI/Alien or using C/C++/C# or compilers.
> So, read about it. It doesn't bites. :)
Yes, I know. But like many, my time is limited. I program my app in my
spare time. I have a full-time+ job and a very large family who want
some of my time.
>> As I said, I am totally unaware of the limitations of the system, but that
>> it did what I need, and would have liked to do that from Pharo/Squeak. I
>> know Dolphin has/had certain capabilities. But I don't prefer to use
>> non-open source software if at all possible for development. I also am very
>> preferential towards cross-platform software. Dolphin fails on all accounts.
>> I would choose my Python/Pharo blend over Dolphin any day. I know it
>> introduces some pain, but I am willing to accept the pain. I like tools that
>> allow me to use them where ever I am and whatever I am doing.
>>
>> However, that said, when I look at the facilities Python offers for such
>> capabilities it on appearances looks quite impressive.
>>
>> http://docs.python.org/library/ctypes.html
>>
>> """
>> ctypes is a foreign function library for Python. It provides C compatible
>> data types, and allows calling functions in DLLs or shared libraries. It can
>> be used to wrap these libraries in pure Python.
>>
>> 15.18.1.1. Loading dynamic link libraries
>>
>> ctypes exports the cdll, and on Windows windll and oledll objects, for
>> loading dynamic link libraries.
>>
>> You load libraries by accessing them as attributes of these objects. cdll
>> loads libraries which export functions using the standard cdecl calling
>> convention, while windll libraries call functions using the stdcall calling
>> convention. oledll also uses the stdcall calling convention, and assumes the
>> functions return a Windows HRESULT error code. The error code is used to
>> automatically raise a WindowsError exception when the function call fails.
>>
>> Here are some examples for Windows. Note that msvcrt is the MS standard C
>> library containing most standard C functions, and uses the cdecl calling
>> convention:
>>>>> from ctypes import *
>>>>> print windll.kernel32 # doctest: +WINDOWS
>> <WinDLL 'kernel32', handle ... at ...>
>>>>> print cdll.msvcrt # doctest: +WINDOWS
>> <CDLL 'msvcrt', handle ... at ...>
>>>>> libc = cdll.msvcrt # doctest: +WINDOWS
> So? Why do you think that you cannot do the same in Pharo?
> Have you digested what is available before doing it in Python?
I never said it couldn't be done in Pharo or Squeak. What I said is that
I lack the skills to do so in Pharo.
It isn't a two lines of code an your off and running. Which is what
Python provided me. Ok, in total, my Python code is more like 500 lines.
It interfaces the COM DLL and serves the data to my Pharo app which
provides all of my business logic. The Python app is simply an interface
and gateway. No business logic.
>> """
>> It has examples for windows and linux.
> I feel that you are seriously under-informed.
> Just try googling for:
>
> Squeak + FFI
> Alien
>
> NativeBoost
>
> and just check what you can do using it:
>
> http://www.squeaksource.com/NBOpenGL/
>
> also check mail archives.
>
> Forgive me, but i really can't understand , why you can't just look
> for what you need by yourself?
> Are google.com banned by your ISP?
>
> For me this subject is interested in aspect, why this information
> (while being available openly) didn't catch your
> attention , so you using python instead.
> (Okay, you might miss some functionality like being able to
> automatically generate bindings to COM interfaces).
> But again, i am sure that if you surf the net or ask right questions
> on mailing list, you will probably discover that
> there is already work being done in that direction.
> And at last, if you feel that there is missing some key functionality
> which you want, and you expect that it is also
> could be useful to community, you can always implement it and share
> with people (instead of using Python ;).
> So, next who will come after you won't find himself in a desert with
> couple of oasises few hundred miles away.
Oh, I've Googled and searched and read the mailing lists. I've had
off-list conversations with people who have used Alien/FFI about what I
need. It is presently beyond my current skill and knowledge and time to
acquire said knowledge. I am not saying it isn't doable. I am saying at
the moment it isn't anything I have the time to pursue. I already have
in place a working solution. It isn't as nice as I would like, or an
all Pharo solution. But it is working.
The current working solution is simply version 1.0 of my application.
When it is up and running and I have further time I will explore other
options.
Ok, as far mentioning this before here I go. :)
My messages
squeak-dev
11/17/2009 1:23 PM Re: My own Squeak direction
Presently I am writing an app that I would love to do in Squeak but cannot.
Why Squeak?
Simply because I love working within a live environment.
I love the tools available for writing the code.
I love being able to fix a problem live and continue on. Not starting
all over.
But I am constrained. I am provided two options for my application.
1. Interface with a Windows COM library.
2. Interface with Java libraries.
____________
squeak-dev
6/20/2010 11:52 PM Re: Interesting survey about smalltalk
I would love to be using Squeak for my financial application. Numerical
performance isn't currently what is stopping me. My problem is that I
require interfacing with a Windows COM dll and in a future version with
a Java library. Hopefully at some point I will be able to port to
Squeak. I would much prefer it to using Python, which is what I am
currently using.
____________
pharo-devel
9/29/2010 8:54 AM Re: Calling Python from Pharo
I have been much in the same situation. I am developing a financial
technical analysis application in Pharo. Part of my requirements are the
use of a Windows COM dll. I do not have the ability to use that dll from
within Pharo. (My skills are too limited) I have written the front
end/back end of my application in Python interfacing the dll and the
financial server. I am writing the middle part of the application in
Pharo using Seaside. My Python app will call my Seaside app with the
necessary data and my Seaside app will provide the Python app the
necessary actions. This also enables me to provide a web interface to my
application.
___________
12/31/2010 4:24 PM And for complete disclosure. My plans for my app
version 2.0 which eliminate interfacing any external library but rather
accessing a different protocol via http.
Proper Smalltalk lots of classes
I am porting the FIX protocol to Squeak/Pharo.
http://www.fixprotocol.org/
...
I haven't been silent (dating back to Nov. 2009), and I have done some
due diligence. My decisions weren't made out of ignorance of what
options are available, but rather my ignorance and ability to use some
of the options.
I am interested in writing my application. Not down and dirty
interfacing of external libraries. That isn't where my knowledge or
skill lies. It isn't where I want to spend my time. Which is why I
commented about the Python library which allowed me to interface a COM
DLL in two lines. The ctypes library I referred to above, I chose not
to use because it wasn't as easy as the already working solution I had.
The Python library generated
As I stated, I am not a professional programmer. I have no computer
science background. I have no C/C++/C# skills. The more time I spend
doing low level stuff or learning how to do so, the less time I have to
spend on what my app is intended to do, the business logic.
My goal is more along the lines of getting my business up and running
and hiring knowledgeable people like you to do the things that enable
people like me.
I find Smalltalk enabling for the guy with an idea. Its the most
enabling and empowering tool I've found for my ideas. I would like to
see it improve in its enabling ability.
I get excited about executing my ideas.
If I had no options but to learn Alien/FFI or ctypes, or C/C++/C#/F3, in
order to build my application. I would. But it would delay me
considerably. I have more ideas, than time.
I would like to see Pharo's story for interfacing external libraries to
be better than Pythons. It would be very enabling for those of us with
less skills, and less time for those who have the skills.
Thanks.
Jimmie