57

I find it frustrating how the speed of development that dynamic languages should offer gets significantly compromised by the lack of completions and other assets that IDEs would give you in their static counterparts.

It's not just about typing less - it's the productivity boost and plain fun you get by browsing APIs without constantly having to refer to a documentation that is not integrated with the editor.

To date all IDE + dynamic language combinations -which to be fair aren't that much- I've tried were:

  • buggy
  • slow
  • clueless/overenthusiastic (as in showing all completions ever possible)
  • or simply not as complete as, say, Eclipse + Java.

I'm aware that dynamic code analysis is not a trivial task. But one can't help wondering - is this piece of code really so hard to figure out?

So my question is:

Have any particular IDEs (or less all-in-one setups) achieved a totally outstanding support for a dynamic language, or is this still an 'unsolved' problem?

deprecated
  • 3,297

11 Answers11

21

Smalltalk - a highly dynamic language - has always had a superb IDE, in which little things like automatic refactoring, SUnit (the grandparent of all *Unit frameworks), "who sends this message?", "who implements this method?" and the like were pioneered. So yes, IDEs can indeed support dynamic languages to a level that, until very recently, far surpassed those of statically typed languages.

S. Lott says that "Dynamic languages cannot have the same kind of code completion that static languages do. It's essentially impossible."

"Essentially impossible" in a theoretical, absolutist sense? Sure. In a practical sense? Not really. There are many ways to infer type for dynamic languages, statically (k-CFA, RoelTyper), at run time (PICs), and other methods, like using a programmer's recent history - "How Program History Can Improve Code Completion".

Certainly the Pharo and Squeak communities are very happy with their code completion tools.

Frank Shearar
  • 16,751
15

Pretty much everything you know from IDEs was first developed in Smalltak which is a dynamic language. Everything else is just copying them. So clearly, all of these features are possible in dynamic languages.

Today, dynamic languages are behind the static languages. But why?

Until recently it was pretty universally thought that static typing was superior to dynamic typing. Many coders have changed their minds more recently on that point. Focus on IDEs for dynamicly typed languages wasn't there.

I think that the features for IDEs are less useful in dynamically typed languages. When working in Java or Objective-C, I feel that the IDE is necessary to help me work with the language, but the same isn't true of the dynamic languages.

Some parts of the task are easier in a static language. Its straightforward to figure out the type of an expression. Doing the same in a dynamic language requires either whole program analysis or logging the types during runtime. Since a lot of what the IDE revolves around the types, that does have an effect.

Winston Ewert
  • 25,052
10

I ran into that problem with python, sort of. I wanted vim as my editor, but that meant I wouldn't have an IDE environment. So, I rolled my own with vim plugins. Currently, I think I actually have a better environment for development that any IDE I've used in the past.

My setup is hosted on github, feel free to take a look and crib what you like. For a quick overview of the plugins:

  • pathogen
  • python-mode, for rope, pyflakes, and pydoc integration
  • vimpdb for a python debugger
  • project for a list of files in a project
  • taglist for tag jumping
  • supertab for tab-completion
  • snipmate for snippets
  • conqueterm for an integrated shell, either command prompt, bash, python, or ipython

There's some other stuff, but it has all the features that the more popular IDE's have. It didn't cost me a dime, and I get to leverage all of vim's power. Splits, movement commands, registers, jumping, being able to run my entire dev environment with the keyboard...

4

Have any particular IDEs (or less all-in-one setups) achieved a totally outstanding support for a dynamic language,

Considering your evaluation is hard to understand ("totally outstanding"? "clueless/overenthusiastic"?) it's doubtful that any IDE could match the implied standard.

Trivially comparing against Eclipse + Java is silly because dynamic languages are not Java.

or is this still an 'unsolved' problem?

Not quite.

It's probably unsolvable. Your requirements ("lack of completions and other assets") make it difficult to be more precise.

Dynamic languages cannot have the same kind of code completion that static languages do. It's essentially impossible.

Some IDE's do a good job of guessing. Eclipse, for example, has plugins for dynamic languages.

S.Lott
  • 45,522
  • 6
  • 93
  • 155
3

I think this presentation by Steve Yegge is still relevant. in a nut shell there are some half decent Java script ides (intelliJ IDEA), but dynamic languages in general are playing catch-up, not because there is anything inherently harder about making these tools (or indeed languages) it's just the static languages got all the attention first.

jk.
  • 10,306
3

I have found that Wing IDE's support for Python is really outstanding. It does a good job with code completion, and its debugger is as powerful as Visual Studio's is for the non-dynamic C#.

I can attest that it not buggy, slow or clueless. I have never used Eclipse, so I'm ignorant on that point, but I think that the greater question is: is there some inherent barrier to developing a complete and productivity-enhancing IDE for dynamic languages. Given my experience with Python and Wing, I am inclined to say that it is not the case. It is, however, certainly more difficult.

3

I program all day in javascript/php and ruby working on web applications and the best IDE that I have found for this is Aptana. It has code completion for all three of those languages (and python) it picks up my local vars and on top of that when working with html and css it picks up id's in the html for use in the css/javascript, and picks up function names for when I am doing something quick and dirty and writing inline javascript (I know bad, but sometimes useful for proof of concept). It has built in rake tasks and built in support for git and a command line console. It took me a bit to get up but once I did I find that I hardly ever leave my IDE when coding and it saves me tons of time.

Ryan
  • 550
2

Microsoft's Visual Studio is an IDE that is used by many programmers and it supports IronRuby, IronPython and F#. Most would consider Ruby and Python to be a dynamic programming language while F# would be less so.

In response to the comment, F# is a programming language.

F# (pronounced F Sharp) is a multi-paradigm programming language, targeting the .NET Framework, that encompasses functional programming as well as imperative and object-oriented programming disciplines. It is a variant of ML and is largely compatible with the OCaml implementation.

While the exact definition of what exactly defines a "dynamic language" is still up for debate, most would agree that JavaScript is more "dynamic" than C# for example. According to Wikipedia:

The definition of a dynamic language is ambiguous because it attempts to make distinctions between code and data as well as between compilation and runtime which are not universal. Virtual machines, just-in-time compilation, and the ability of many programming languages on some systems to directly modify machine code make the distinction abstract. In general, the assertion that a language is dynamic is more an assertion about the ease of use of dynamic features than it is a clear statement of the capabilities of the language.

I don't want to open a can of worms here. Some would suggest that F# is more correctly described as a functional rather than a dynamic language, and I would not take exception to that. What I believe would be fair to say that is of the various .Net languages, F# is generally regarded as the more appropriate for dynamic programming than C# or VB.

You may want to see: What qualifies a programming language as dynamic?

JonnyBoats
  • 1,793
2

The main difference between statically typed languages and dynamically typed languages is that the system can know, for sure, Just what a symbol reference means at compile time.

This makes it really easy to gather the information you need to make a good IDE directly from the info generated by the compiler at compile time (which is simply moved up to "edit" time for the most part).

If you have a stand-alone method signature that just says the method takes a "Thing" how can an editor help you know what to send? How can it help suggest ways to use the thing?

Duck-typing doesn't help here either--even the most intelligent editor possible won't be able to tell you that simply because your object has a .executeFooOp() method that it can code-complete ".executeBarOp" on that object (Although it could scour the rest of the code base and make some intelligent guesses).

If you know that it's a "String" in the signature, however, you know all the methods that you might call on that string AND you are able to suggest that variable when that user is in the middle of typing a method call that requires a String as a parameter. You could even suggest sub-classes that it could be cast into if you wanted to.

The information just isn't there with dynamically typed languages unless you can do a complete scan of the entire codebase with something MUCH more intelligent than your typical compiler.

Bill K
  • 2,749
0

At least for PHP many IDEs "understand" something like

/** @var $foo ClassA **/

If you document in a standardized way (in this case phpDocumentor) the IDE will make the most of it.

ACNB
  • 267
0

From all IDEs for dynamic languages (languages that resolve type at runtime) the best one is... Visual Studio for Python

  • Bulling type information for Intellisense
  • Navigation
  • Debuging

It's worth to try.

Lukasz Madon
  • 1,496
  • 13
  • 22