In this Engineering Notebook post I'll explore changing Leo while Leo is 
running.

Imo, changing Leo "on the fly" is impossible, but thinking about what would 
be necessary might suggest potential improvements to Leo

*Background*

Live coding is supposedly a killer feature of smalltalk. I have my doubts, 
discussed below.

Live coding has another meaning in the arts.  See this wikipedia page 
<https://en.wikipedia.org/wiki/Live_coding> and this page 
<http://donkirkby.github.io/live-py-plugin/>.

pylivecoding <https://github.com/kilon/pylivecoding>is a python module that 
purports to support live coding in python.  From its readme file:

QQQ

pylivecoding is a live coding environment implementation inspired by 
Smalltalk.

Essentially this library reloads modules and updates all live instances of 
classes defined in those modules to the latest code of the class definition 
without losing any of the data/state. This way you can change code in your 
favorite code editor and IDE and immediately see the results without any 
delays after you save the module.

QQQ
All "live" classes must be subclasses of livecoding.LiveEnviroment(), which 
is just a wrapper for python's reload statement. Imo, the pylivecoding 
"architecture" could work only in small apps.

*Barriers to changing running apps*

All apps, regardless of language, are *inherently inflexible*:

1. The architecture can't change.  In particular, APIs are contracts that 
can't easily be broken.  Refactoring implies restarting the app.

2. Objects (instances of classes) contain data that must be retained. In 
general, changing any module might change the data that the module computes.

Live coding apps (in the arts) give the *illusion* of flexibility:

1. The app's architecture and primitives remain fixed (and inaccessible to 
the artist). 
2. The artist's code is *rerun completely *whenever the code changes.

* Summary *

Live coding in the arts gives the illusion of dynamism. 

It's not possible to change the architecture of an app on the fly, 
regardless of language.

Reducing the static data in some of Leo's classes might simplify Leo. Or 
not. I'll discuss this topic in another post.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/b7259dc6-b88c-4f4c-ae25-09df25b69660n%40googlegroups.com.

Reply via email to