Hi Carl

Given no-one else has had a shot at this I will.

I'm not sure if you were looking at LanguageKit or not, but to explain,
Etoile has a component which lets you create Smalltalk like languages
which operate directly against the Objective-C runtime and which are
compiled to native code. We have a Smalltalk-like implementation which
interfaces directly to Objective-C (Smalltalk calls ObjC, ObjC can call
Smalltalk with no severe limitations). Some of the main language
features differ and behave more like Objective-C, including the API,
which we use GNUstep for.

With LanguageKit, it would be possible to have code written and compiled
in C++ (.cpp), wrap it with an Objective-C++ (.mm) in an Objective-C
class (.m) (C++ and Objective-C have completely incompatible class
structures), and then call the Objective-C code from Smalltalk. Each
file is compiled to an object (.o derived from the C, C++, Objective-C,
Objective-C++ or Smalltalk file) and then combined using a C linker as
per normal.

So I guess to answer your question in the abstract, it is possible to
write code in a Smalltalk-like language, and then use Objective-C++ to
call C++ from Smalltalk indirectly. The C++ code is probably subordinate
in this arrangement, but the Smalltalk is as good as Objective-C.

It should be noted that our Smalltalk-like implementation is rather fast
and optimised because it isn't interpreted, even for integer math
(floating point I'm not sure about) - it can be used as a replacement
for Objective-C when compiled.

Regards
Chris

P.S. David is this all correct? My understanding of LanguageKit is
limited to your blog posts.

On Tue, Mar 20, 2012, at 01:03 AM, Carl Lotten wrote:
> I really felt exited, reading about C++Script
> (http://calumgrant.net/cppscript/), a language as a library. My
> question is how much can be done using objective C++ for interfacing
> with C++ and choosing the same approach as in C++Script,- "language as
> a library".
> The motivation is clear:
> Lots of high performance code is and will be written in C++. There
> exists an interpreter for C++
> (http://root.cern.ch/drupal/content/cling-goes-public). With minimal
> effort (calling a library) using existing high performance code
> written in C++ in an effortless way without bothering about memory
> management possibly in a Smalltalk like syntax. Since you work in a
> native objective C++ environment you would be able to replace step by
> step the performance critical parts of your code sketchwith C++.
> So not being a C++ expert, but nevertheless, for a need to interact
> closely with C++ libraries and a fan of Smalltalk, my question is: Is
> it possible to design a smalltalk like language as a library, let's
> call it ObjectiveC++Script?
> Cheers, Carl
> 
> _______________________________________________
> Etoile-discuss mailing list
> [email protected]
> https://mail.gna.org/listinfo/etoile-discuss
-- 
  Christopher Armstrong
  carmstrong ^^AT^ fastmail dOT com /Dot/ au


_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à