Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!elroy.jpl.nasa.gov!aero!obrien From: obrien@aerospace.aero.org (Michael O'Brien) Newsgroups: comp.lang.smalltalk Subject: Re: C to Smalltalk Message-ID: <82085@aerospace.AERO.ORG> Date: 24 Aug 90 19:50:11 GMT References: <1780@abvax.UUCP> <81923@aerospace.AERO.ORG> <381@scubed.SCUBED.COM> Sender: news@aerospace.aero.org Reply-To: obrien@aerospace.aero.org (Michael O'Brien) Distribution: usa Organization: The Aerospace Corporation Lines: 51 |> > |> >In article <1780@abvax.UUCP>, jaz@icd.ab.com (Jack A. Zucker) writes: |> >|> I know this is a naive question, but is it possible to |> >|> call smalltalk methods from C using either the Digitalk |> >|> or Park Place products ? |> > |> In article <81923@aerospace.AERO.ORG> obrien@aerospace.aero.org (Michael O'Brien) (That's me folks) replies: |> > Goodness knows what ParcPlace has planned for the future - they |> >are enough of a business now not to let much out - but in the current |> >release it's definitely impossible. |> In article <381@scubed.SCUBED.COM>, warner@scubed.com (Ken Warner) writes: |> ------- THIS IS NOT A FLAME ---------- |> |> I am curious. What sort of things did you (Jack) want to do that you feel are |> best done in this way. And why could you not go the "other" way by calling C |> functions via primitives from Smalltalk? Obviously I'm not Jack, but on my part, I found early on that if you could call a given package from C, you could usually call it from any damn thing. My first big Smalltalk project was to do a user interface to a giant Prolog system. Prolog could call C, or thought it could, and so I could have had the interface bound into the Prolog system - except that Smalltalk couldn't be called by C. In the end I wound up doing it in reverse: Quintus Prolog defined a funky pseudo-RPC interface to allow itself to be called by C (i.e. going the opposite way). I put protocol stuff into the ParcPlace VM to do the job and away we went. Luckily UI things operate on a time scale that allowed the RPC overhead. |> |> One wild blue approach to calling Smalltalk from C (just off the top of my |> early morning head) would be to supply a set of entry points into a VM by |> installing a set of of primitives. Then link the VM into a C object. Pretty |> wild huh? I wonder what it would take to do this. I have a real strong feeling |> that this can't be done with the current VM. It's just a thought for the sake |> of brain-storming. Well, I don't think this would really work, since for one thing the load module would wind up with two "main()"s. And Smalltalk wouldn't get to initialize its image, and, and, and... -- Mike O'Brien obrien@aerospace.aero.org