roxen.lists.pike.general

Subject Author Date
Changing Pike code on the fly Linda Messerschmidt <linda[dot]messerschmidt[at]gmail[dot]com> 21-01-2009
Hello,

I am interested in possibly using Pike as the control language for a
mathematical modeling application.  What we're trying to do is enable
the user to control the model in real time by making code changes, so
we need a dynamic language that supports multithreading.

I really like that Pike is thread-safe and similar to C, and that we
can tie it into the existing C++ code to perform the high-performance
calculations.  I did some quick prototyping to get a feel for it and
was very impressed.

However, a sticking point is that I can't figure whether Pike well let
us make dynamic code changes.  For example, if we have an object that
is filtering the output of calculations, we would ideally like the
user to be able to redefine a method of that class and/or even change
the definition of a class completely between steps of the model.

I'm hoping there's an easy way to do this.  If not, I'm guessing it's
probably possible to write a C/C++ wrapper that would create a new
runtime environment for each model step, but that seems inefficient so
I would sure like to know if there might be a better way.

I read the recent posts on the list about setting up different threads
with different contexts, and I wondered if I might be able to adapt
that.  Could we set it up to  to fire off a new thread for each model
step?

(I actually encountered Pike because I remembered that MUDs from years
ago let users edit LPC code and objects on the fly, and that was
ideologically similar to what we're trying to do with this project.  I
followed the breadcrumbs here. :) )

I would really appreciate any feedback on this.  Pike wasn't on the
A-list of languages under consideration, but for some reason I really
like it and I want to see if we can make it work.

-LM