Well live coding is a simple process of reloading code. In Pharo the VM
recompiles a method and replace it’s old instance with a new one while code
executes.

Python you basically reload the module. Because Python does not compile per
method but per module which means executing code lively. This happens
because when you import a module in Python, Python does nothing special
than executing the source code. Not before compilation but during
execution. Hence live coding, the Python VM replaces objects lively. Python
can also compile any size of code including individual methods.

That happens with one line of code importlib.reload(mymodule)

The next challenge in live coding is capture the error and not allowing the
app to exit, that is 2 lines of code and is a python exception. Python
exceptions are heavily used in Python to capture errors.

Debugging is up to the debugger that Python provides as a library with
conditional breakpoints and fully integrated . You can of course ask at any
point for any kind of context, global , local, arguments , instance and
class variables. The debugger also comes with its own REPL. Again
everything is an object.

OOP wise , in Python  everything is an object including procedure.
Procedures like blocks in Pharo are objects with one method. Procedures are
anonymous but if the name really bothers you you can use lamba functions.
Python has bigger syntax than Pharo but anything can be implemented as an
object. Global variables are objects, imported modules are objects etc.

Reflection wise , Python is a fully reflective an object can ask itself or
others about its live state, methods, bytecode and source code.

Meta programming wiseython allows for fully manipulation of objects down to
bytecode level. Python has no need for traits because it allows the live
replacement of its methods with procedures or methods from other objects.

Finally like Pharo , Python comes with a very powerful AST library capable
of fully manipulating the syntax . HyLang is a Lisp made in Python that
compiles to Python bytecode and can use any Python library.

The one thing Python cannot do at least out of the box is privacy. In Pharo
everything is private , methods hide behind messages , variables behind
methods. In Python everything is public and privacy is annotated in naming
only using double underscores.

Python also has properties which are methods that override variable
assignment , similarly how we use getter and sender methods for object
variables in Pharo.

What Python recently got has been optional static types  but I am not sure
if they are real static types , because I am not a fan of static typing
anyway.

I am no expert in OOP but I cannot say I have found a thing that Pharo can
do that Python can’t or is more difficult. Python obviously is very heavily
inspired by Smalltalk .

The very brief look I gave Ruby looked to me that it is even closer to
Smalltalk.

On Sat, 7 Oct 2017 at 01:17, Sven Van Caekenberghe <s...@stfx.eu> wrote:

> Yes, you are right: Pharo/Smalltalk is more or less the same as
> Ruby/Python/C/C++ in terms of power & flexibility of OOP and in live coding.
>
> Come on.
>
> > On 6 Oct 2017, at 23:18, Dimitris Chloupis <kilon.al...@gmail.com>
> wrote:
> >
> > Wise not to mention Ruby and Python and Pick the worst of the worst in
> OOP. Because frankly the competition for Pharo against those two behemoths
> can be quite brutal in the flexibility and power of OOP.
> >
> > And no , these language can do live coding with ease. I know because I
> currently code live coding style with Python for an app I am making. Sure
> it wont provide you with a live system out of the box, but put in 10 lines
> of code and you already ready to go with hardcore live coding. At least
> Python , Ruby being practically a rip off of Smalltalk language may need
> even less.
> >
> > iPython which by the way is by far the most popular Python tool is the
> real deal, a full blow live coding enviroment.
> >
> > To my suprise its not even hard to do live coding with C/C++ including
> using image format. To my shock live coding is actually supported by both
> the OS and the hardware. Hardware has its own exception system , OS has an
> image flie format called "memory mapped files" used for DLLs and a lot of
> essential functionality.
> >
> > For some weird reason however its well hidden and not that much utilised
> by coders. They really love long compile times, dont ask me why.
> >
> > But yeah C++ even though it has come a long way with its template
> system, its still the king of ugly. That sytax, oh the horrors of that
> syntax..... yiaks !!!
> >
> > I am so enternal greatful that Pharo introduced me to live coding and
> opened my eyes to universe of fun and productivity. I cannot imagine coding
> an other way ever again.
> >
> > I really hope that we take this further though.
> >
> > On Wed, Oct 4, 2017 at 1:31 PM horrido <horrido.hobb...@gmail.com>
> wrote:
> > Behold Pharo: The Modern Smalltalk
> > <
> https://medium.com/smalltalk-talk/behold-pharo-the-modern-smalltalk-38e132c46053
> >
> >
> > If you would like to suggest some edits, I'm all ears. Anything to
> improve
> > the impact of the article.
> >
> > Thanks.
> >
> >
> >
> > --
> > Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
> >
>
>
>

Reply via email to