6

As anyone who has used Smalltalk knows, one of the main benefits (other than a late-bound language that discourages many poor practices), is that the system is totally transparent and reflective, which makes understanding APIs and existing code easy, and locating functionality pretty easy.

Is there anything that creates a similar environment for Python?

A few examples of features of a smalltalk development environment, not natively found in python are:

  • search class/method/etc names,
  • examine inheritance hierarchies
  • functionality to show the full interface of a given class/object, and where the properties therein originate
  • an integrated graphical debugger which allows one to examine the full state of everything in the system, and see every instance of a given type, as well as all threads.

Note that I use windows, so anything that works well on windows would be particularly useful.

Mark Booth
  • 14,352
Marcin
  • 530

6 Answers6

8

Having worked with Smalltalk myself for two years, I can tell you I haven't seen any Python IDE available that will give you the level of expressiveness you are looking for in Smalltalk IDEs such as VisualWorks or Squeak.

The key thing about most Smalltalk IDEs is that code + development tools are stored in the same place. So rather than coding in a text editor, then compiling/interpreting it on a VM, It's all done on the same binary. This has obvious benefits as you could connect to a Smalltalk image in a production environment and start coding/debugging on the image itself rather than having to change then publish a new copy as everything is already there. The main drawback I found with this approach is the amount of memory it consumes. You can obviously strip the image down to remedy this, but that takes time.

I will say that it's not impossible to have a Python IDE that does this, but there simply isn't one available as far as I've seen. Despite the dynamic nature of both languages, the approach to development between both languages different given that Python is file based and Smalltalk is image based.

Robert Harvey
  • 200,592
3

ipython adds lots of syntactic sugar over the default Python REPL. In particualr, you get tab-completion, a nice "?" shortcut for the help() function and everything is nicely colorized and easier to read.

Not quite a Smalltalk environment but I find it very helpful.

hugomg
  • 2,102
2

I sometimes find myself using PythonWin's IDE just for the gui available during debugging (run using 'Step-through in the debugger' then show the Stack View). I've never touched smalltalk, though, so I might be way off base...enter image description here

tugs
  • 220
  • 1
  • 3
1

In the early 90s, IBM started pushing Smalltalk as the future replacement for COBOL. This lead to VisualAge Smalltalk, a very nice Smalltalk implementation (still available in 2025 if you have money).

Then in the mid 90s, Java showed up and suddenly Smalltalk was dead, and Java was the future. IBM then came out with VisualAge for Java, which was REALLY cool, and provided a complete Smalltalk-like experience for Java coders. All the code was kept in a repository, everything was pre-parsed, you got a Browser interface just like Smalltalk and could edit your application's classes and methods in it just like Smalltalk.

I believe there's no reason at all why you could not do the same thing for Python, which is at LEAST as much like Smalltalk as Java is.

Sadly, as far as I have been able to find, nobody has yet done this. Arguments about "Python does not use an Image" should not be relevant. If VA can do it for Java, then Python should not be a problem.

Zoot
  • 26
0

There is one fundamental difference between the Smalltalk world and Python world. In Smalltalk, one works with an image, whereas in Python there is a distinct static and dynamic view of the program/project.

The usual way of bridging this difference on the Python side consists of improving the static analysis tooling, and in making interacting with a running program easier by being able to run small chunks of a program often, and examining the running program in a debugger, or tool such as Jupyter Notebook.

Let me talk about PyCharm (https://www.jetbrains.com/pycharm/) as my IDE of choice.

Static

PyCharm has decent static analysis capabilities, and one may put in static type hints to assist it https://www.jetbrains.com/help/pycharm/type-hinting-in-product.html

Dynamic

The road to being able to run small chunks of your program often are unit tests, naturally. If you have these, you should always be able to find/write a test which will recreate the program state you are interested in inspecting.

In Python, we rarely (never?) think in terms of "full state of everything in the system". That is probably a Smalltalkism.

Combination of the two

There is a PyCharm feature which enriches the static view of the program by information collected at runtime during debugging sessions https://blog.jetbrains.com/pycharm/2013/02/dynamic-runtime-type-inference-in-pycharm-2-7/

user7610
  • 429
-1

You can't really expect a Smalltalk-like Python IDE. In Smalltalk, the IDE is an integral part of the runtime (or "image").