Developing Eclipse plugins without Java - eclipse

Is it possible to create Eclipse plugins/program Eclipse RCP apps without Java? (preferably in Jython)

This will be possible in the next Eclipse major release e4:
One of the goals of e4 is to provide support for writing plugins in other languages.
The quote is from http://wiki.eclipse.org/E4/JavaScript which summarizes the current state of using javascript to implement eclipse plug-ins in e4.
This issue in eclipse's bugzilla issue #227058 also has some discussion on that, but I believe it is outdated.
I am currently not aware of activity regarding other languages.

No. An Eclipse plugin is an OSGi bundle, and that requires interacting with a variety of things that can't implemented in Jython as far as I can see.
If you want to avoid Java, you can look at other things that target the JVM, but you will have to figure if you can produce and consume the specific items needed to call the necessary things and be called in the necessary ways.

OSGi bundles may be written in other JVM languages like Scala. Eclipse plug-ins, as of now, does not support any language other than Java. The Eclipse Plug-in Development Environment heavily makes use of JDT which ties it to Java. However there are some plans I heard that plug-ins might be supported in other languages. But I don't see that coming in near future.

You can write your main code in Jython and use Java interfaces to call then from Java. Take a look at this for details. Also, I am writing a utility library (github.com/abhin4v/jywrapper) to do the same. It has very little documentation right now, but you can look at the examples provided.

Related

writing netbeans RCP apps on scala

Have anyone tried to write a Netbeans RCP application in scala (Instead of Java). The reason for my question there is an API in Scala which wraps JavaFX. Likewise is there any API to make to develop Netbeans RCP based apps written in scala.
For wrapping JavaFX there is ScalaFX. Netbeans Rich Client Platform is not small, and a Scala wrapper seems impractical to me (I am not aware of any); just call the Java code from Scala. Java/Scala interoperability is generally decent, so while you might occasionally have to write a little bit of Java as an interface, you can pretty much just use Scala for any Java project.
(Getting the build process to work might be a little tricky, though; expect to invest a little time there.)
I personally dont see any useful use case to use JVM language to develop NB RCP/Plugin. NB It self provides a IDE where you can use the drag-drop feature, codegen, annotation based IDE to created it. If you want to have a syntax sugar in writing NB RCP then i feel its waste of time where we already have a good IDE. JVM is not going to do any much difference that the existing environment.
If you see that you need a NB like modular, GUI based framework in Scala ecosystem that, I personally feel writing binding wont solve that problem. Scala need some framework like Griffon.

Eclipse 4: Default commands

I apologise for the very amateur question about E4 but I am a bit confused about a couple of things about RCP development using the new Eclipse 4 framework. I read in this tutorial that one can no longer use any default commands the way we could in 3.x especially for common things like Save, Save As... in the File menu. It says that in E4 we have to write our own commands. The reason I am confused is because the thing I liked about Eclipse previously is that a lot of things are already implemented and we can just extend that to our own needs. But it feels like now everything must be written from scratch.
That led me to considering reusing the command code already written for Eclipse Juno. I had the Live Editor open so I could see the list of commands etc but I don't really see any Handlers implemented for any of them. Then I used the Spy on Eclipse Juno and checked out some of the menu items and they all seem to point to Actions. That really confused me as I thought Juno was based on E4.
I could be completely wrong so I am sorry for asking such a silly question. I only just started using E4 and need to decide whether one of fairly young Eclipse 3.x projects should be migrated to 4.x.
AfaIk, in Juno the compatibility layer translates the 3.x based implementation of the IDE into E4 concepts. This is also the reason why the reusable commands are not yet available.
If you have an 3.x based RCP it should also run using the compatibility layer (and you can reuse the commands mentioned in your question) if no incompatible APIs have been used.
Here is more information (also a tutorial from Lars Vogel): http://www.vogella.com/articles/Eclipse4CompatibilityLayer/article.html

How to develop Eclipse plugins in clojure?

I was wondering if there is a way to develop Eclipse plugins in Clojure. To be clear, the question is not about using Eclipse to write Clojure code.
Both Eclipse and Clojure run on the JVM and I feel there should be way to leverage the power of Clojure (and it's libraries) to develop plugins. I was specifically looking at using Korma, but overall I would like to move complete plug-ins to clojure if there is a natural way to do it.
Counterclockwise, the Eclipse plugin for Clojure, is written in mixed Java and Clojure. It uses clojure.osgi 1.2.10 yet.
So it is a live proof of concept that it is possible. And AFAIK, Counterclockwise is used successfully by hundreds of people.
There are some constraints, tho: Clojure's namespace is "global" to some "root classloader". E.G. if you package Clojure inside a bundle named, say, myapp.clojure, then you'll probably have a bunch of other bundles which will require myapp.clojure. Say for example myapp.bundle1, myapp.bundle2. When you do so, and, from each bundle, load in memory (require) the bundles namespaces, each one will be loaded from within the right ClassLoader (namespaces of myapp.bundle1 will be loaded within the context classloader of myapp.bundle1, and namespaces of myapp.bundle2 will be loaded within the context classloader of myapp.bundle2). This is great, because it allows java interop to work okay.
But just remember that in the end, namespaces loaded from bundle1 & bundle2 will be held by the "global namespace world" in bundle myapp.clojure.
To be honest, this has not yet proven a problem for Counterclockwise. Because inside the same Feature, having the bundles share one single Clojure instance is almost okay.
The potential drawbacks are:
if you use third party libraries, e.g. tools.logging, you will not be able to have namespaces in myapp.bundle1 depend on version X of tools.logging, and at the same time have myapp.bundle2 depend on version Y of tools.logging. That is, inside your feature where you have a shared clojure via bundle myapp.clojure, you work as if OSGi rules did not apply, as webapps work, for example.
does not scale well if massively applied: if every Eclipse Feature were to repackage its own version of Clojure, there would be some waste of memory. But this drawback is more theoretical than practical, yet. And this is a problem that can be addressed later, when the need for it emerges.
Note that for an Eclipse RCP Product, as opposed to an Eclipse plugin, these drawbacks vanish.
If you want to see how Counterclockwise has repackaged clojure, and uses clojure.osgi, you can look at its sourcecode:
http://github.com/laurentpetit/ccw.clojure.git
http://github.com/laurentpetit/ccw.git
HTH,
-- Laurent
It seems it's not available in Eclipse 3.x, but is planned for Eclipse 4, as mentioned in http://wiki.eclipse.org/E4/Languages .
There's also a post here on Stack Overflow asking about development of Eclipse plugins in languages other than Java that may have more information that you'd find useful.
It's perfectly possible to write Eclipse plug-ins in Groovy or Scala. Since Clojure produces .class files, it should be no different. However, plugins are normally exported using PDE Build, which only handles Java by default, so you will have to write a customCallback.xml file which can compile Clojure (see http://www.michel-kraemer.com/scala-projects-with-eclipse-pde-build-2 for Scala build).

Difference between IDE and Framework

What is a difference between an IDE and Framework with respect to Java?
Basically :
The IDE is the software you use to develop ; for example, Eclipse is an IDE (code editor, debugger, build tools ... )
The Framework is a set of both libraries and best practices that help you not re-invent the wheel, and provide a set of guidelines on how to develop.
Quoting wikipedia, an IDE :
is a software application that
provides comprehensive facilities to
computer programmers for software
development. An IDE normally consists
of:
a source code editor
a compiler and/or an interpreter
build automation tools
a debugger
While a Framework :
is an abstraction in which common code
providing generic functionality can be
selectively overridden or specialized
by user code, thus providing specific
functionality. Frameworks are a
special case of software libraries in
that they are reusable abstractions of
code wrapped in a well-defined
Application programming interface
(API), yet they contain some key
distinguishing features that separate
them from normal libraries.
An IDE is an application used to write and compile code. A framework is generally a software component that someone else wrote that you can use/integrate into your own project, generally to avoid re-inventing the wheel.
A framework is a tool that is closely attached to the language you are using and usually extends upon or adds the the language features.
An IDE (Integrated Development Environment) provides automation support for the language you use with regards to syntax highlighting of keywords, errors, building projects, cleaning them, intgegration with VCS, etc. and usually provides default support for popular frameworks used for your language.
Java makes use of frameworks like Hibernate, Struts and Spring to extend the language and NetBeans or Intellij IDEA bring support for these tools to your Java project in a structured manor.
As per all answers I can come to a conclusion that Visual Studio is an IDE and .NET is a framework.
And also a framework(list of .dll) can be integrated into an IDE. Mean framework is a part of an IDE.

using eclipse for other languages than java?

I came to know that eclipse can be used for other languages as well. But will it give the same comfort level as using java? Is there anybody who has used eclipse for other languages?
I've used Eclipse for both C/C++, Ruby, Erlang, and a few others. None of these are as tightly integrated with Eclipse as Java is, but CDT (C/C++) gives Visual Studio a good run for its money. I usually use Emacs for the other ones.
Yes, you can use Eclipse for many languages other than Java. I personally use Eclipse to code in C++, Perl, PHP, and do JavaScript as well inside of it. While it also supports plugins for connecting and executing queries against databases, I tend to prefer other options there such as Toad or Oracle SQL Developer. There are numerous other plugins to support many other languages that you can find either through the Update Manager or a simple Google search, many of which are excellent.
As a side note, if you're not using Mylyn, you're missing out.
Eclipse is used as a base for other language and tool:
for example As3 with FlashBuilder; PHP, Javascript with Aptana studio, C,Python,... with other plugins, etc...
You can found here for example some plugins for other languages.
I've used it for Javascript (jQuery): compile-time checks are a godsend to the barren lands of javascript.
For Java developement I feel most comfortable using Eclipse.
I tried using Eclipse for coding with Python. There is PyDev, an Eclipse plugin that can be used to work with the Python code in Eclipse. Though PyDev provides features like Code Completion, Syntax highlighting etc, I felt comfortable to use editors like gvim or emacs rather than Eclipse
for working with Python code. YMMV
Yes, Eclipse supports many other languages.
But you knew that already when you saw http://www.eclipse.org/downloads/
So, I guess that you are asking how well it supports them...
It is possible to have Eclipse without Java. Imagine taking that and then adding Java support. Compare that with CDT for C++ and - in my experience - they are pretty much the same.
Yes, Eclipse is slanted at Java, and I doubt that anyone will deny that, but at the same time it tries to be fair and generic and pretty much achieves it. Any few % less other language support doesn't matter when you realize that no other IDE compares.
Bottom line, whatever your language, you will be hard pushed to beat Eclipse.
And that's before I get started on the myriad plugins ...
Not only programming, debugging with Eclipse is sweet. Beside Java, the other languages I mostly work on Eclipse are PHP and Python.
While I was working on the Eclipse Web Tools Platform (WTP) project we often said that the Java Development Tools (JDT) were the model that we referenced for features for Web related languages. I think JDT has set the bar and many other projects that implement language specific tooling try to reach the JDT bar. I don't know that any have or that copying everything about JDT is the point but I do think the Java tools are exemplary development tools.