ThoughtStorms Wiki

A very interesting talk by StephenKell

At StrangeLoop

Compare :

Is it an awesome idea to do mixed programming using C and Smalltalk?

Dec 22, 2017

Many people write code which is a mix of C plus some higher level language.

For example, Python is very popular for scientific computing and data manipulation these days. But much of that capacity is build on fast libraries written in C.

In fact, many high level languages call C libraries for speed.

However \xe2\x80\xa6

it's not obvious that the C / Smalltalk combination works so well.

As I understand it, the core of Smalltalk is some low level "primitives" which are today written in a subset of Smalltalk that is translated into C. You then compile the C and this gives you the basis of a Smalltalk interpreting machine. Everything else is then bootstrapped on top of that, in Smalltalk.

Some advanced Smalltalk VMs also do Just-in Time compilation of bits of running Smalltalk code into native machine code. Armed with runtime knowledge about their behavior.

It's not clear that there's much room here for the symbiosis you have in CPython.

One of the great virtues of Smalltalk. Which many people love about it. Is how much of its inner workings can be inspected and modified within a running image. Move to using a lot of C libraries and you lose that. All the C stuff becomes opaque and loses malleability. And that really destroys the essence of the language.

Furthermore, the JIT compilers are pretty good. So your hand-coded C won't necessarily improve performance much.

If you want to work with a combination of higher level dynamic OO language wrapping C, you're probably better off going with Python, or perhaps Lua. These are languages whose communities conceive of them in those terms.

The Smalltalk community won't be particularly interested.

However, if you like or are attracted by Smalltalk. But also have a capacity to work at a lower, C-like, level, then I'm sure you could always be welcomed working on the infrastructure for Smalltalk : the initial Smalltalk to C translator and the JIT compilers.