Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do Static vs. Dynamic Types Have Anything to Do With Making it More Difficult To Write an IDE?

Edit: Just to clarify, I didn't intend to suggest it might be impossible to write an IDE for dynamic languages. /edit

In my specific experience I'm thinking about years of conversations/comments about JavaScript, many of them on stack, but every now and then somebody says this, that the reason JS doesn't have a decent IDE is because dynamic types make it too hard to do.

I've thought about this in terms of writing a parser for JS and I don't understand where the types have anything to do with features like auto-complete or going straight to the definitions of stuff. If anything I would imagine scope and availability through passed params in a dynamic language would be considerably easier to establish without the type-checking concern. Especially in JS where the rules are actually pretty simple in most cases.

Until I started hearing people cite dynamic types as if it were a technical blocking issue, I just assumed that in most dynamic scripting languages you can run from a console, reduced verbosity and the ease of testing in a live execution environment makes debug easier, thereby reducing demand for IDEs.

So which is it? Something about static types that makes it easier to parse code for establishing scope/availability or am I right about reduced demand?

like image 984
Erik Reppen Avatar asked Feb 18 '23 21:02

Erik Reppen


1 Answers

IDEs were invented in dynamic languages. Refactoring was invented in dynamic languages. Automated Refactoring Tools were invented in dynamic languages.

Dynamic languages had graphical IDEs with builtin support for pair programming over the network when static languages didn't even have graphics. Or IDEs. Or networking support.

Smalltalk and Lisp IDEs still are ahead of what's available for Java or C#, for example. In fact, Eclipse was a Smalltalk IDE once!

The quality of an IDE is dependent on how much effort is spent making it good. The Smalltalk and Lisp communities spent decades of research, dozens of PhDs and truckloads of money building powerful IDEs. So did the Java community. (Actually, they spent truckloads of money buying Smalltalk companies …)

The JavaScript community didn't. That's the whole difference.

There are some things that need a different approach between the two. Take something like IntelliSense / Content Assist / Autocompletion, for example. Statically trying to determine what identifiers are in scope in a dynamic language is basically equivalent to solving the Halting Problem, so you can't do that. Your IDE needs to be dynamic as well, then it doesn't need to do static analysis, it can just look at the running code and see what identifiers are in scope.

like image 96
Jörg W Mittag Avatar answered Feb 21 '23 11:02

Jörg W Mittag