Page 1 of 1

Distributed newLisp question....

PostPosted: Thu May 09, 2013 2:08 am
by borgauf
I'm a total beginner, but I've read extensively about Lisp, functional programming, and distributed computing. I keep hearing that Lisp languages can rewrite/update their own code while running, but I can't wrap my brain around that. For example, the famous "Lisp at JPL" essay talked about redoing/refactoring running code that was out in space. So, here's a problem: Imagine two separate programs running on two separate computers are doing a collaborative "game of life" where algorithms change and morph because each program is helping the other. This would be a sort of distributed, synergetic evolution, but the changes to data and code would be swapped back and forth real-time and incorporated real-time. This is the sort of stuff I'm interested in, and just from reading about newLisp, it seems possible with newLisp. Is this true? . . . Or do I need to wake up, get real, and go back to Visual Basic programming?

Re: Distributed newLisp question....

PostPosted: Thu May 09, 2013 10:36 am
by cormullion
A running newLISP program can load code and execute it, so it's not difficult in theory. And you can use the debugger too. For example, consider this file:

Code: Select all
(define x 0)
(define (ticker)
        (sleep 10000)
        (println "x is " x))

(define (main)
  (while (< x 20)
         (ticker)))

(main)
(println "finished")
(exit)


You can modify this while it's running, by changing the value of x using the debugger.

Here's another post that you might find interesting: