Squeak as DLL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Squeak as DLL

askoh
Administrator
I want to create an addon using Squeak for a Computer Aided Design (CAD) software in Windows. That means that the CAD will control Squeak and communicate back and forth. In other languages, the addon would be a DLL called by the CAD. Can Squeak become such a DLL? How can it be done? Are there examples?

Any other ideas would be appreciated too. Thanks in advance.

All the best,
Aik-Siong Koh
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Squeak as DLL

Herbert König
Hi Aik-Siong Koh,


a> I want to create an addon using Squeak for a Computer Aided Design (CAD)
a> software in Windows. That means that the CAD will control Squeak and

very curious: which CAD? What do you plan to do? I'm in road design.

a> Any other ideas would be appreciated too. Thanks in advance.

Long term I plan to connect to ACAD, ICAD, ACAD LT+LTE via writing
LISP in Squeak and make the CAD load the Lisp.

With DLL imho you have to do some work in every CAD you support with
every release.

I have no good idea of how to access Squeak from Lisp. First access
would just be to start Squeak from Lisp. Right now I have no better
idea than let Lisp write a file which Squeak polls for.

Com imho is not present in every CAD and also differs too much.
And I don't want to close the door to non M$ OS.

Any thoughts welcome!

Cheers,


Herbert                            mailto:[hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Squeak as DLL

Igor Stasenko
I think it would be MUCH easier to write a .dll which communicating
with squeak vm using sockets instead of rewriting squeak VM to be
compiled as dll.
There are too much gory details need to be changed to be able to build
squeak as dynamic library for general purpose.
Squeak VM can be built as browser plugin (dll), but to what i saw it
is really different to making squeak a simple dynamic library.


2008/7/26 Herbert König <[hidden email]>:

> Hi Aik-Siong Koh,
>
>
> a> I want to create an addon using Squeak for a Computer Aided Design (CAD)
> a> software in Windows. That means that the CAD will control Squeak and
>
> very curious: which CAD? What do you plan to do? I'm in road design.
>
> a> Any other ideas would be appreciated too. Thanks in advance.
>
> Long term I plan to connect to ACAD, ICAD, ACAD LT+LTE via writing
> LISP in Squeak and make the CAD load the Lisp.
>
> With DLL imho you have to do some work in every CAD you support with
> every release.
>
> I have no good idea of how to access Squeak from Lisp. First access
> would just be to start Squeak from Lisp. Right now I have no better
> idea than let Lisp write a file which Squeak polls for.
>
> Com imho is not present in every CAD and also differs too much.
> And I don't want to close the door to non M$ OS.
>
> Any thoughts welcome!
>
> Cheers,
>
>
> Herbert                            mailto:[hidden email]
>
>
>
>


--
Best regards,
Igor Stasenko AKA sig.


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Squeak as DLL

askoh
Administrator
In reply to this post by Herbert König
My main work is related to
freeCAD: 3D CAD with Motion Simulation
http://ar-cad.com
has the application and open source. All the code there is in VisualWorks.

A partner and I have created Alibre Motion addon using the motion engine.
http://askoh.net/misc/motion/motion1/motion1.html
We used Visual Basic and COM to interface Alibre Design and the VisualWorks motion engine. Others are helping me to create addons for Solidworks using VB, Rhinoceros using C++, AutoCAD using Lisp. My partner and I have put all the common features into a SDK, so only the CAD dependent code needs to be done to create motion addons.
http://askoh.net/motionsdk/intro/Install_and_run_VB_example.html
http://askoh.net/motionsdk/Programming/Programming_Intro.html
http://askoh.net/motionsdk/Documentation/Documentation_Available.html
http://askoh.net/motionsdk/intro/Actua_Motion_Core_SDK_Setup_20080506.exe

Another partner and I are porting freeCAD to Squeak and Croquet.
http://www.youtube.com/user/kayef8
Hence, I have interest to create addons with Squeak.

I have tried DotNet Bridge with Squeak to control AutoCAD to do CAD automation. It works pretty well but it is Squeak controlling all the time. It may be possible to extend it to work both ways.

I would really like to create addons with Squeak. So I am willing to help any effort to make that possible.

All the best,
Aik-Siong Koh
Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Squeak as DLL

askoh
Administrator
In reply to this post by Igor Stasenko
Thank you very much for your expert advice. Can you elaborate a bit why a Squeak.dll is so different from Squeak.exe? What holds back the browser plugin from becoming a CAD plugin/addon?

Thanks,
Aik-Siong Koh


<quote author="Igor Stasenko">
I think it would be MUCH easier to write a .dll which communicating
with squeak vm using sockets instead of rewriting squeak VM to be
compiled as dll.
There are too much gory details need to be changed to be able to build
squeak as dynamic library for general purpose.
Squeak VM can be built as browser plugin (dll), but to what i saw it
is really different to making squeak a simple dynamic library.

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Squeak as DLL

Igor Stasenko
2008/7/27 askoh <[hidden email]>:
>
> Thank you very much for your expert advice. Can you elaborate a bit why a
> Squeak.dll is so different from Squeak.exe? What holds back the browser
> plugin from becoming a CAD plugin/addon?
>

Well, you have to rewrite the initialization, which starts in main()
function and then after a dozen steps, like loading image, creating
window, setting up a message loop, calls interpret().
Also, interpret() function is not reentrant, once you called it, it
never returns.

And there i no API, like in other languages (Lua / Python) which will
give you control on initialization & managing interpreter, memory ,
events from host application. You'll have to invent all by own.
And there is a lot of platform-specific code, which assuming it runs
as standalone process.

> Thanks,
> Aik-Siong Koh
>
>
>
> I think it would be MUCH easier to write a .dll which communicating
> with squeak vm using sockets instead of rewriting squeak VM to be
> compiled as dll.
> There are too much gory details need to be changed to be able to build
> squeak as dynamic library for general purpose.
> Squeak VM can be built as browser plugin (dll), but to what i saw it
> is really different to making squeak a simple dynamic library.
>
>
> --
> View this message in context: http://www.nabble.com/Squeak-as-DLL-tp18655393p18671688.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Squeak as DLL

Herbert König
In reply to this post by Igor Stasenko
Hello Igor,


IS> I think it would be MUCH easier to write a .dll which communicating
IS> with squeak vm using sockets instead of rewriting squeak VM to be
IS> compiled as dll.

yeah, you'd have to plug a simple dll into the CAD which transfers all
input it receives from the socket to the CAD's command line and in the
other direction offers a function in the CAD to send some data (maybe
only strings) out through the socket.

Plus a few functions in the CAD to set up the socket. No changes in
Squeak at all. That's all you need as long as you don't need a very
dynamic access with the CAD.

But:
With AutoCAD they have made dll's incompatible, called it arx and have
you sign some ugly license to use the SDK.

Our application supports AutoCAD + LT from 2000 to 2009 (soon) and
could have one version of the lisp code (no version specific code).

For the C code, we have to keep around several compilers and a lot of
ifdef's in the C code. 2010 will bring us the next C version.

Even for the small dll as described above that will be a lot of work
and one point of the SDK license is to not make the program available
under LT or other CAD platforms.


Cheers,

Herbert                                        


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Squeak as DLL

Herbert König
In reply to this post by askoh
Hi,

thanks for a lot of information.

Please see my reply to Igor's post why C variants are an alternative I
try to avoid. Especially as I'd have to pay the programmers.

a> I have tried DotNet Bridge with Squeak to control AutoCAD to do CAD
a> automation. It works pretty well but it is Squeak controlling all the time.
a> It may be possible to extend it to work both ways.

You are much advanced to me and your demands on the CAD are much
higher than mine. We need the CAD more or less as an engine to
statically draw plans and pick objects. In cases we dynamically drag
parameterized constructions Lisp was fast enough 5 years ago.

a> I would really like to create addons with Squeak. So I am willing to help
a> any effort to make that possible.

Igor's suggestion about sockets seems very valid here. From your links
you seem to be using VB6. I verified from ACAD 2002 to 2007 they use
VBA6, ACAD2000 doesn't specify its VB version.

So writing a VB6 dll to access sockets sockets and using that dll in
VBA should make it possible to communicate with any Squeak. And you
don't have to sign the arx license.

OTOH for you it might be easier to make your DotNet bidirectional.
IMHO also no ugly license.

If rumours that ACAD 2010 will drop Lisp prove correct I see a chance
for a Lisp across ACAD, ACAD LT and BricsCad (maybe even PowerCAD)
that will support some basic socket functionality.

A bit OT I guess but maybe we have some more CAD related people
around.

Cheers,

Herbert