Distributed newLisp question....

Featuring the Dragonfly web framework
Locked
borgauf
Posts: 3
Joined: Thu May 09, 2013 1:55 am

Distributed newLisp question....

Post 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?

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: Distributed newLisp question....

Post 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:

Locked