Hacker News new | ask | show | jobs
by IReadYourCode 4456 days ago
Xtend is statically typed but your Xtend code can be as lean and concise as your groovy code because the Xtend compiler can infer the correct types for you.

Because Xtend is statically typed, the Eclipse Xtend editor has quite an excellent autocomplete. For your cursors's location it can propose you a list of all valid keyword, methods names, filed names, local variable names, Class names, etc.

And by excellent I mean: Autocompletion will not forget things and it won't show invalid proposals. No guessing!

For Groovy this just isn't possible because it is mostly unknown to the editor which methods and fields an object has. It's only known at runtime.

1 comments

> For Groovy this just isn't possible

It's true in general, but in most specific cases it is possible to statically analyse dynamic languages to the point of providing meaningful auto-completion. For example in Python-land there is Jedi (http://jedi.jedidjah.ch/en/latest/), and also commercial Komodo IDE and PyCharm. This is done through static analysis, so that no code is ever run for auto-completion.

So, while it's impossible in general case, it's perfectly possible to create useful auto-completion for dynamic languages. There are such tools for Python, JS and probably others as well.