5

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.

11
  • 1
    What's wrong with the help() function that's already part of Python?
    – S.Lott
    Dec 26, 2011 at 19:39
  • 10
    @S.Lott: Have you ever user a proper smalltalk environment? Comparing help() with a smalltalk environment is like comparing unorganised stone tablets with the Library of Congress. Sure, the data is there, but the difference is organisation and navigation.
    – Marcin
    Dec 26, 2011 at 20:07
  • Are you saying that only Smalltalk's environment is acceptable? I'm not clear on how to answer the question if that's the case. I was hoping for clarification as to what -- specific -- issues you had with help. It would be helpful to update the question with something more specific. If you make knowledge of smalltalk a pre-requisite for answering the question, you may not get the kind of help you're looking for.
    – S.Lott
    Dec 26, 2011 at 20:16
  • 8
    @S.Lott: I think his definition of "looks like a Smaltalk environment" is clear enough.
    – hugomg
    Dec 26, 2011 at 21:04
  • 1
    @Marcin: I'm sorry the question is unclear. I'd love to be able to help. I've use a large, large number of IDE's. However, since you refuse to specify what's important to you, I cannot offer help. Since you have relatively few answers, you can take that as a hint that your question isn't very clear. Or you can complain that people ask for details before they try to offer incomplete or inaccurate help. If you want help, consider meeting people half way. Or. If you don't want help, try complaining.
    – S.Lott
    Dec 27, 2011 at 2:48

5 Answers 5

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.

5
  • 1
    OK, good to hear from someone who clearly gets the question. I don't think that the mere fact of having code stored in files really forces much on us - at the abstract level with python we work with packages rather than files (that isn't to say that python IDEs don't in practice adopt a file-based world view).
    – Marcin
    Jan 5, 2012 at 11:04
  • A bit of history. The Smalltalk boys and girls that developed VisualAge IDE where asked to develop a Java based implementation of their IDE, which everyone knows as Eclipse. Some of the features you see in that will look the same, it's simply nowhere near as expressive. I struggled to get into Smalltalk in the beginning coming from a Java background, but it grew on me and got me back into Python again. The Smalltalk developers I've worked with were more keen on Ruby than Python though, which was interesting :) Jan 5, 2012 at 11:22
  • @Marcin, I agree with what your saying and it would be good to have an IDE for Python that does this. Even the code stored on Smalltalk image is backed up by it's own version controlled changelog files. That level of expressiveness your looking for is difficult to attain when components such as the debugger/compiler etc are not running in harmony with the code. So having everything in the same place is really what makes it work. Above and beyond that, the Smalltalk community have done a good job of doing it properly as it's very easy and productive to work with. Jan 5, 2012 at 11:25
  • 2
    I think we are in agreement. I think Ruby is more smalltalk like, but their culture is more like the worst of lisp weenies: poor documentation, hostile to anyone who mentions the plank in their eyes.
    – Marcin
    Jan 5, 2012 at 11:35
  • 1
    The point of that last comment, I should clarify, was not to have an unnecessary crack at ruby users, but rather to say that I think the python culture is closer to that of the smalltalk community.
    – Marcin
    Jan 5, 2012 at 11:45
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.

7
  • Thank you - any experience with using this on windows?
    – Marcin
    Dec 26, 2011 at 21:48
  • @Marcin: It only runs on Windows.
    – S.Lott
    Dec 27, 2011 at 12:06
  • 1
    Well, the command line REPL works on LINUX at least (thats what I use anyway).
    – hugomg
    Dec 27, 2011 at 13:23
  • Sorry. Yes, I was thinking this was Iron Python.
    – S.Lott
    Jan 4, 2012 at 17:36
  • 1
    Feel free to tidy up you comments any time then. *8')
    – Mark Booth
    Jan 4, 2012 at 17:44
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

0

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

2
  • 1
    I don't see why not. Python has extremely good reflective capabilities. Whether or not the IDE is "integral" (which I don't think is true - you can dump out all of that code from your image if you want) is neither here nor there.
    – Marcin
    Jan 4, 2012 at 21:46
  • 1
    @Marcin, as I said in my own answer, it's not entirely impossible to develop a Python IDE to give you this feature. It simply comes down to two different approaches to developing software. One being file based, there other being image based. So I wouldn't say Nemanja's answer is wrong, but I would also argue that it's not impossible to have an IDE that can do this. Jan 5, 2012 at 10:59
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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.