Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] Interoperability for JVM languages

Hi all,

I'd like to get some advice on the best way to support JVM-based languages in Eclipse. I'm working on the Scala IDE for Eclipse, and while we have something working, I believe it's fragile and slow.

I'll use Scala as an example, but any other JVM-language would do. The main goal is to support mixed Java/Scala projects. The Java editor should know about Scala compilation units, offer code completions based on Scala types, highlight errors, etc. Additionally, the Java builder should work when Java sources depend on Scala sources.

One solution is to generate Java Elements based on Scala sources. Just as AspectJ tooling, we're using weaving to intercept calls and generate them based for Scala. However, it would be much cleaner if there was an extension point: we're not sure if we're intercepting all relevant calls, or if we're cutting in the "best" place. Additionally, we can't (or don't know how to) take advantage of laziness in the Java model, so we resolve all types up-front. This is slow, and the JDT sometimes blocks the UI thread waiting for these elements.

The builder part is tricky as well: To support Java programs that depend on Scala types, the Scala compiler should run first. However, the Java builder does not always rebuild the relevant sources, so we need to trigger it (making non-API calls), essentially marking some Java compilation units as needing a rebuild.

Given that JVM-based languages are getting more popular, it would be much better to have a clean way to interoperate. We'd like to help to push this further, if there's interest.

I'm sure this isn't the first time this comes up, but I'd like to see what's your thinking (feasible? desirable?).

thanks,
iulian



--

--
Iulian Dragos

------
Reactive Apps on the JVM
www.typesafe.com

Back to the top