On Wed, Mar 15, 2017 at 09:31:45AM +0100, Raffaello Giulietti wrote:
> Suppose my code directly accesses "my.dll" which, in turn, depends > on "her.dll" which my code does not need directly and suppose that > library is located in folder "<path-to-her-folder>". How can I > enforce the UFFI to perform the search there? On Linux, I use a shell script "gopharo" to run the VM: #!/bin/sh PHAROVMPATH=$(dirname `readlink -f "$0"`) LD_LIBRARY_PATH="$PHAROVMPATH" exec "$PHAROVMPATH/pharo" $@ LD_LIBRARY_PATH is customizable. In my case, I place 3rd party files like libsqlite.so, libunqlite.so together with the standard VM files. Pierce |
In reply to this post by kilon.alios
It is true that you can kill an image or two doing this. A reason why I added this little thing https://github.com/Pharophile/HOImageSaver and use it quite often. I also got a debug and assert VM to build for Windows, so I have the full symbols table available. Running Pharo and, say CodeBlocks IDE side by side, and connecting GDB in CodeBlocks through attach to process using the Pharo PID works pretty well to figure out what is going on. I am also using Snagit a lot to capture screenshots with values etc for future reference. Using a remote Pharo image from another image that will stay untouched may be a better way to go in the future but will not really work if one has a breakpoint triggered in the remote one anyway,.. But I found the process of wrapping a library pretty much painless compared to the sea of wrapping code one gets from Swig for example. Once we will have wrapped a couple external libraries with UFFI I expect some patterns to emerge and our ability to wrap things to be enhanced drastically, to the point that we will see incredible growth in terms of capabilities. We will then really up our game on how to load code from a central repo, a la npmjs, or mavencentral, or gems, or pip. Because it sucks big time in a couple of occasions. With any tech, there is always this hype cycle with the disullusionment after the "peak of excitement" and that is needed to reach the productivity. I would urge all Pharo users to keep pushing and not let go of the vision, because there is really nothing like Pharo around. I just got remembered of how good it was yesterday: a given job stopped processing its input because the underlying format of the file changed under its feet. It was a matter of 30 minutes between diagnostic and fix, and I was able to deliver the output for a critical meeting by the client. There is zero way I would have been able to inspect, diagnose, and fix that fast with something else. Using Pharo makes someone a kind of maverick but the vista is quite good. Phil On Thu, Mar 16, 2017 at 3:48 PM, Dimitris Chloupis <[hidden email]> wrote:
|
In reply to this post by Pierce Ng-3
Hi Pierce,
sure, this works on any Unix-like system. On 17/03/17 03:37, Pierce Ng wrote: > On Wed, Mar 15, 2017 at 09:31:45AM +0100, Raffaello Giulietti wrote: >> Suppose my code directly accesses "my.dll" which, in turn, depends >> on "her.dll" which my code does not need directly and suppose that >> library is located in folder "<path-to-her-folder>". How can I >> enforce the UFFI to perform the search there? > > > On Linux, I use a shell script "gopharo" to run the VM: > > #!/bin/sh > PHAROVMPATH=$(dirname `readlink -f "$0"`) > LD_LIBRARY_PATH="$PHAROVMPATH" exec "$PHAROVMPATH/pharo" $@ > > LD_LIBRARY_PATH is customizable. In my case, I place 3rd party files like > libsqlite.so, libunqlite.so together with the standard VM files. > > Pierce > > |
In reply to this post by philippeback
The one things I love about Pharo is Live Coding. The ability to change the code while it executes without all this recompile-restart nonsense. I also was under the assumption you were when it came to live coding that none is doing better than Smalltalk and Lisp. So just for fun I went on to experiment how easy it would be to re implement live coding in C++ and Python. I was not expecting much if anything. With Python it was super easy, I only need a main loop, wrap the loop inside an exception that in case of an error would catch the error , not stop the execution but rather using the import tools that come with Python will import the module. Worked like a charm. I use this to develop a blender addon. But the really shock was how easy it was to do this with C++. I thought that memory leaks would make live coding with C++ impossible , I was dead wrong. Apparently OS exceptions can capture even crashes, they wont allow the executable to crash. Instead of python modules I use DLLs on windows , .dylibs on MacOS and .so on Ubuntu. Executable is a tiny loop reloading the dlls and providing to them a pointer to a very large array that contains the entire memory of the app, DLLs handle the memory to share it between objects etc. https://github.com/kilon/LiveCPP Next step is integrating iPython and also python debugger and testing unit testing with live coding. So yes definetly learn Pharo because it has many hidden gems , if you are newcomer. But if you miss Pharo , like me, when you code in other language, despair not, its very easy to recreate at least live coding. |
CONTENTS DELETED
The author has deleted this message.
|
In reply to this post by raffaello.giulietti
Not that well on macOS.
Yes it works but you want to launch Pharo from thr Dock and not via the command line. But yes put the DLLs in with the VM files should work in all main OSs Mark On 17/03/2017 08:44, [hidden email] wrote: > Hi Pierce, > > sure, this works on any Unix-like system. > > > > On 17/03/17 03:37, Pierce Ng wrote: >> On Wed, Mar 15, 2017 at 09:31:45AM +0100, Raffaello Giulietti wrote: >>> Suppose my code directly accesses "my.dll" which, in turn, depends >>> on "her.dll" which my code does not need directly and suppose that >>> library is located in folder "<path-to-her-folder>". How can I >>> enforce the UFFI to perform the search there? >> >> >> On Linux, I use a shell script "gopharo" to run the VM: >> >> #!/bin/sh >> PHAROVMPATH=$(dirname `readlink -f "$0"`) >> LD_LIBRARY_PATH="$PHAROVMPATH" exec "$PHAROVMPATH/pharo" $@ >> >> LD_LIBRARY_PATH is customizable. In my case, I place 3rd party files like >> libsqlite.so, libunqlite.so together with the standard VM files. >> >> Pierce >> >> > > > -- Mark |
In reply to this post by CodeDmitry
Python is my No2 does not have to be yours, obviously. I prefer it because of its minimalistic ideology and huge third party library ecosystem that makes it dead easy to code in. But in the end I use it because that's what Blender uses for scripting.
Of course Pharo remains my No1 ;) I hate web development for the usual reasons hence I try to stay as far away from it as possible. Pearl syntax looks too ugly to me. I also use C++ because that's what Unreal uses. My post was not an advertisement for those two languages , just to mention that live coding is possible. I actually hate C++. But it's a necessary evil in my case. On the subject of C macros , there is scons which is a Python library and I suspect there are a ton more out there. Blender which is more than one million lines of C code used it but I think now the rely more on CMake.You could probably build one in Pharo too easily for personal usage. I do not rely on C macros or scons because Unreal has its own build system which handles many common issues with the compiler for me. There is a ton of technology for any kind of problem, just a google away. On Fri, 17 Mar 2017 at 12:37, Dima Makhnin <[hidden email]> wrote:
|
In reply to this post by philippeback
Tx phil for these cool words. We are pushing and we need inputs too because from time to time I have the impression that we are focusing a bit too much on our own system but this is natural :) Stef
-- Using Opera's mail client: http://www.opera.com/mail/ |
Free forum by Nabble | Edit this page |