Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
28  
+1 Every single PHP IDE I have tried was just horrible in comparison to Visual Studio + C#/C++. –  Matěj Zábský Jan 24 '12 at 12:15
5  
Not sure about the overarching question, but you might want to take a look at the JetBrains IDEs. Their approach is "we already have a great IDE, let's make it work for $LANGUAGE". The problem with the ones you tried might have been taking the following approach instead: "$LANGUAGE doesn't have an IDE, someone should make one". –  millimoose Jan 24 '12 at 12:20
2  
I found indeed IDEA just wonderful, especially for working with Java and project-related tasks. But as for JavaScript it doesn't seem to recognise the 'methods' defined in the namespace or its contained objects. –  vemv Jan 24 '12 at 12:29
    
IntelliJ IDEA, or any of JetBrains' language specific IDE's. –  sylvanaar Jan 24 '12 at 14:41
1  
@FrustratedWithFormsDesigner I've used Komodo. It's has much better auto-complete than any other RoR IDE I've seen... but I've seen very few IDEs for Ruby that even attempt to implement auto-complete. That said, it's better than nothing –  Earlz Jan 24 '12 at 16:20
show 6 more comments

11 Answers

up vote 18 down vote accepted

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.

share|improve this answer
2  
+1 from me. Despite working in the Java world these days, I still reminisce about how much more productive you are in Smalltalk compared to any other language I know. The integration of IDE and code in your image, having code being "alive" all the time (Smalltalkers will know what I mean), is simply unsurpassed. With Pharo and Seaside injecting new life into what many people think of as a "has-been language", as good as Eclipse is as an IDE, I go back to fiddle with Smalltalk more and more. Smalltalk's excellent naming conventions definitely help with predictive code-completion. –  Amos M. Carpenter Jan 25 '12 at 5:02
add comment

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.

share|improve this answer
1  
So you are saying that if you type everything that a statically compiled language would require you to type then you can find the same info about it that you could with any statically typed language--true I suppose but why not just skip the extra step and go to a statically typed language? –  Bill K Jan 24 '12 at 21:25
    
Because again at least php does some automatic casting for simple types. And also because doing so a dynamic language lets you decide where to specify a type. With agile development you might want postpone decisions like "Do I use a class as type or an interface?" –  ACNB Jan 28 '12 at 8:46
    
@ACNB: Plenty of "static" languages also allow automatic casting and type inferrence. Eg, C++, C#, and the like. –  Arafangion Mar 25 '13 at 0:45
add comment

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.

share|improve this answer
    
In fact Yegge's presentation was the root cause of my question: if the heuristics and other described techniques are there, where are all the cool implementations? On IntelliJ: see the comment I left on my original post (and let me know if I'm wrong) –  vemv Jan 25 '12 at 8:04
    
2014 - still no match for best static IDEs –  Den Jan 24 at 13:43
add comment

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.

share|improve this answer
add comment

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?

share|improve this answer
4  
Can you explain what do you mean by "F# [...] is a dynamic language", and how is it more dynamic that, say, C#? –  MainMa Jan 24 '12 at 15:28
1  
Seconded, I wouldn't consider F# a dynamic language. Heck, C# might be (I'm not sure if F# has a readily available equivalent) "more dynamic" having dynamic built-in by now. But either way, neither is generally dynamically typed, and most other features (not to mention cultural stuff) associated with "dynamic languages" is missing too. –  delnan Jan 24 '12 at 16:38
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
2  
In Squeak and Pharo, RoelTyper does a reasonably good job of inferring something's type by looking at what messages you send to it. Otherwise, Shivers & Might's k-CFA provides tunable type inference, in the sense that you can trade off cost against accuracy. –  Frank Shearar Jan 24 '12 at 16:00
12  
I think that the features for IDEs are less useful in dynamically typed languages - Funny, I think exactly the opposite. Since so many dynamic languages don't require you to declare variables beforehand, misspelling a variable is a serious concern... a concern which is alleviated by a good IDE. Meanwhile, the rest of the major features - syntax coloring, refactoring tools, debugging features - are equally useful in all languages. –  BlueRaja - Danny Pflughoeft Jan 24 '12 at 18:30
2  
@Winston: Then you've never done a project in a non-declarative language with multiple people :) It's especially annoying when the language is case-sensitive. Example from personal experience: The word "Work-Order" is sometimes spelled as one word ("Workorder"), so when creating a variable, some people will write workOrder and some will write workorder. These are two separate variables in Python >_< –  BlueRaja - Danny Pflughoeft Jan 24 '12 at 19:26
1  
@BlueRaja-DannyPflughoeft, on the contrary, I've done projects in Python with multiple people. When you say you have issue is it: you run and get an exception because you are referencing a variable that doesn't exist, your code fails initial testing because you store your data in the wrong place, or you get undetected errors resulting in buggy code escaping to production? –  Winston Ewert Jan 24 '12 at 19:43
1  
"Many coders have changed their minds more recently on that point." Why is this? –  Pubby Jan 25 '12 at 1:14
show 4 more comments

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...

share|improve this answer
add comment

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.

share|improve this answer
    
Can you point out specifically, in what ways VS for Python is better than, let's just pick one out randomly, Hopscotch? –  Jörg W Mittag Jan 25 '12 at 2:10
add comment

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.

share|improve this answer
    
Why the down vote on an answer that speaks about dynamically typed language development inside an IDE that has achieved from my experience 'a totally outstanding experience.' Which is what the op asked for? –  ryan Jan 25 '12 at 16:42
add comment

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.

share|improve this answer
    
"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." – Yes, but it doesn't have to. If the IDE works at runtime instead of at compile time, then it doesn't need to know this information at compile time. At runtime, the information is available, otherwise the program couldn't even run. –  Jörg W Mittag Jan 25 '12 at 2:08
1  
The ide can't work at runtime--or more accurately could only run on one possible branch at a time. Runtime is situational, a given symbol MAY mean one thing on one pass and another thing on another pass, so if your "Editor" is "Running" (How does that even work???) on "One Pass", how does it get info from "Another Pass" to do text completion? For that matter, what if you are writing a library that is to be plugged into a yet-unwritten module? –  Bill K Jan 25 '12 at 16:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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