412 points · by numo16 · 13y ago · 130 comments
Disclaimer: I used to work on IronPython.
You guys deserve some recognition. I'm not too frequent a user lately, but I'm continually impressed.
But i have to admit, nothing beats visual studio in awesomeness / completeness
6 months into it, I all but stopped caring, and overall, I felt like it actually created problems for me. But I'd like to understand what problems others feel it solved for them.
That's really nice. I wish there would be something comparable for debugging JNI/Java code.
It is mentioned.
1: http://www.youtube.com/watch?v=wvJaKQ94lBY&feature=c4-overvi...
Stack walking works by rewriting the native stack. Basically we just let the native stack walker do its job, then strip out all python##.dll frames except for PyEval_EvalFrameEx. For that one we read the "f" argument and then parse the PyFrameObject to which it points, and replace the frame with our own using data from that frame object.
We parse the data structures ourselves, but use symbols to do so, which is why it'll work on any CPython build with symbols. This is why you can inspect objects even when process is stopped somewhere in native code, and it's impossible to eval using the interpreter.
We still use sys.settrace for breakpoints and Python stepping. Python-to-native stepping works by setting native breakpoints on code paths inside Python interpreter that can potentially invoke some user code (e.g. type_call invokes tp_init, which may point to a user function). When those breakpoints are hit, we eval the function pointer and see if it's outside of python##.dll, and if so, then set another breakpoint there. When it's hit, your step is complete.
So no, there are no special hooks added to the interpreter. We do end up relying quite a bit on internal implementation details, since we need to do things such as set breakpoints inside static functions, and read their arguments. However, because we use symbols for that, this works on any CPython build, including debug ones, and even customized ones so long as you don't rename anything that we rely on. E.g. adding a new field to PyObject is kosher, but renaming ob_type to something else would break us.
To accomplish that we require that we have symbols for the Python interpreter (which are typically available on python.org). The debug engine uses a combination of the native equivalent of sys.settrace, strategic breakpoints, and using the symbols to walk core Python data structures. There's a bunch of fun tricks for evaluating code when stopped at a Python frame and creating strings, ints, etc... when users type them into the watch window.
If you'd like to dig in more the source is at http://pytools.codeplex.com/SourceControl/latest under Python\Product\Debugger\DkmDebugger.
http://visualstudiogallery.msdn.microsoft.com/07d54d12-7133-...
At the moment, I use PyCharm for python projects because I'm usually working on OSX (and prefer the local unix-y environment instead of the Windows-virtual-machine thing.) However, I started with PTVS years ago and really like it.
MSFT adding IDE support for Python is a good thing -- as developers, we need more options, not less.
They're never gonna go it. They stand to win nothing from that.
/sarcasm
At this point both XCode and VS are pretty equal but XCode I also like and have no problem with. Both are unique to the OS though. Both are also extremely bloated but needed for C/C++ dev. Eclipse is also a bit cludgy. That python to native screenshot on the site looks intruiging.
I do use MonoDevelop on Mac for Unity dev and it does support debugging but would love to use VS on Mac one day.
All in all when I do python dev I like less in my IDE at times, just a good autocomplete/intellisense and I usually despise integrated source control into IDEs preferring to do it with outside tools such as terminal/cmd, sourcetree or tortoises. SCM integration in IDEs always seems to kill performance and gets out of sync, especially in the latest MonoDevelop (startup indexing kills the usefulness - http://answers.unity3d.com/questions/356129/monodevelop-perf...).
ButI agree. VS is an awesome IDE and the more operating systems it would be available on the better.
(I've had MVPs yell at me for discussing data analysis with Python, even on Windows.)
I prefer Windows for a dev platform (really, I do), but I've only once written a webapp that was hosted on Windows. I'd much rather prefer unixy servers.
How does it compare to VS Express? Why would there be two different free Visual Studio offerings...just to keep things locked down and rule out support for add-ins?
Anyway microsoft doesn't provide support for their core languages (C#/C++/VB) for the shell, so the main consequence is that, in the shell you basically get all the languages microsoft /doesn't/ directly support in visual studio, but nothing else. Whereas in the express editions you have an IDE you can't extend, but each edition supports one of microsoft's core languages.
Our PTVS + integrated/isolated shell basically gives you a virtual "Python Express". However recently msft has moved away from the "Express" model to "Scenario" models. ie, VS for Phone, VS for Desktop, VS for Web, etc. and each includes all the tools and multiple languages you might need for that workload. We're hoping to include PTVS into the desktop & Web scenarios in the future.
[disclaimer: project lead]
Yup, try PyCharm, PyDev, Wing, Komodo, Spyder, ... I did a comparison last year (which I can't unfortunately share :( I can ask) -- bottom line, all pretty darn good, each has its strengths and weaknesses. Take away: it's a great time to be a Python dev on Windows (finally?).
WRT to PTVS itself, the key feature is being VS based; the mixed-mode debug for example takes advantage of support in VS. But at the same time, if you're looking for a cross-platform, very very very lightweight tool, this isn't the IDE you're looking for.
In other areas like code editing, the differences are often qualitative. For example all Python IDEs have code completion, but try entering this in your favorite one:
def f(x):
def g(y):
return x + y
return g
a = f(1)(2)
b = f(3.0)(a)
c = f(u'a')(str(b))
d = (a, b, c)[input()]
And then see what completions it gives you for a., b. etc.It would be interesting if some independent third party would do a detailed point by point study and published it.
As far as I can remember, there was some resistance to going through that route before (v1.5 didn't have this, I think).
Get all the editing capabilities of Vim, but don't lose integrated debugging, code completion, code nav, type info popups, etc. that an IDE provides.
As an example, the Zeus IDE automatically generates ctags information for all files in the current workspace and it has this feature.
The ctags approach offers and additional bonus in that you can also do a wildcard search.
NOTE: I'm the author of the Zeus IDE.
(esc;qgrep -rn thing .) is faster for me than reaching for the mouse.
Have you tried it in VS 2010+? You might be surprised. I've seen it correctly handle polymorphic Boost lambdas, and that's a rather impressive feat of TMP. Also, I've just tried the scenario that you've described (if I understand it correctly - "Find all references" on a class template), and it does list all the explicit instantiations in the project.
Can somebody point me in the right direction?
Integrated package:
https://pytools.codeplex.com/downloads/get/697389
Isolated Shell downloads:
http://www.microsoft.com/en-au/download/details.aspx?id=3066... http://www.microsoft.com/en-au/download/details.aspx?id=3067...
good luck
Using RubyMine now as a Rails dev, after years of Visual Studio use as a ASP.NET dev, and having the familiar ReSharper-like tools and interface in RubyMine is awesome.
RubyMine is an incredibly powerful IDE (like most of the JetBrains IDEs), with lots of Ruby specific goodness.
Never used it myself though, so I can't speak for it.