Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!news.kei.com!simtel!harbinger.cc.monash.edu.au!news.cs.su.oz.au!tmx!news.tmx.com.au!news
From: Stephan Meyn <s.meyn@oose.com.au>
Subject: Re: C++ VS SMALLTALK
Message-ID: <30A91F8A.D6C@oose.com.au>
Nntp-Posting-Host: 203.5.19.198
Sender: news@online.tmx.com.au (System Administrator)
Mime-Version: 1.0
X-Mailer: Mozilla 2.0b1 (Windows; I; 16bit)
Content-Type: text/plain; charset=us-ascii
Organization: The Message eXchange Pty Ltd
Date: Tue, 14 Nov 1995 23:00:26 GMT
References: <DHIBKn.2rK.0.queen@torfree.net> <47f8mm$hku@what.whytel.com> <30A0F5D7.6C09@oose.com.au> <47qbqm$4pr@bcarh8ab.bnr.ca>
Content-Transfer-Encoding: 7bit
Lines: 28

CK Wong wrote:
> 
> Stephan Meyn <s.meyn@oose.com.au> wrote:
> >I would like to add a
> >third option:
> >consider to do the processing intensive bits in C++ and the rest
> >in Smalltalk. Pack up the C++ stuff in DLL's and call it from
> >Smalltalk. This is not as hard as it appears and you can reap
> >both benefits at the same time.
> >
> My work requires to integrate some C++ code into ParcPlace Smalltalk
> environment.
> The difficulty involved is :
> 
> C++ hashes the function name so that it can support different messages with 
the
> same method name.
> But Smalltalk uses the C function name. Could you enlight me how to resolve 
the
> problem.
You basically will have to write a simple version of an ORB. There is on the 
smalltalk side a mechanism to identify the method name and a handle to the 
C++ object. This is passed thru a flat C based DLL interface where the 
handle, the "selector" and the argument list are mapped to the actual C++ 
call.
This looks pretty pedestrian, but once implemented it becomes fairly easy to 
maintain. 
Stephan
