[Pharo-project] NativeBoost and Cog. A working protype.

stephen at pairhome.net stephen at pairhome.net
Fri Oct 1 07:27:54 EDT 2010

On Oct 1, 2010, at 2:39 AM, "Schwab,Wilhelm K" <bschwab at anest.ufl.edu> wrote:

> Sig,
> I'm pointing out that "do it all in Smalltalk" has limits, both in syntax (C++ is generally a better formula translator than Smalltalk; Smalltalk is better at expressing just about anything else) and in performance, unless you can stop boxing/unboxing the floats, which it sounds like you can't.

Regarding syntax, I'm all in favor of using special purpose languages where it makes sense (but my intuition says that should be done sparingly or else everything will degenerate into an incomprehensible mess).  In this case it would be very nice to think about a language designed specifically for expressing mathematical expressions rather than C++ (which btw I don't agree is better for expressing formulas...it's just different and perhaps closer to conventional mathematical syntax).

Regarding performance, I think it's entirely possible to get similar performance to C++ in Smalltalk (or just about any other language for that matter)...however, I'm not aware of anything that can do this today.  You could deal with the boxing/unboxing overhead with a sufficient amount of inlining based on runtime type analysis.  Once fully inlined, you can apply more traditional optimization techniques.  I don't even think this would be particularly hard to do (and to a degree it's all been done before), but it is a lot of work.

As I said, I'm not aware of anything readily available that achieves these things.  So, to get the performance you seek in a slightly more pleasing syntax (beauty is in the eye of the beholder), C++ may be your best bet for now. 

- Stephen

More information about the Pharo-dev mailing list