Java version of Inkscape

Flesh out your ideas for new or improved Inkscape features before submitting a request.
JLA

Java version of Inkscape

Postby JLA » Mon Jun 16, 2008 3:23 pm

Why not redo Inkscape in Java? It's a clean and friendly object oriented language. Porting it to different systems requires nothing (or very little at most). I'd certainly help out. And if not "redo" it, would anyone be interested in doing a Java branch?

User avatar
aho
Posts: 180
Joined: Sun Nov 04, 2007 9:51 am
Contact:

Re: Java version of Inkscape

Postby aho » Mon Jun 16, 2008 7:21 pm

Porting about 5mb of source over to Java would take quite a while. So, I don't really see that happening. But there are some rough plans and tests to integrate the JVM/MLVM into Inkscape. The primary motivation is of course scripting. Once that's done things can move over to the VM side bit by bit. And once the renderer is the only actual native non-boilerplate component it might eventually get swapped as well.

By the way the main reason to switch to a managed language is higher stability. There are far less bug sources and if something goes wrong there is an error message which helps tracking down the bug. That's really helpful especially with those obscure ones which happen rarely. Running Inkscape always with gdb isn't really an option. It's simply way too slow. That's why there are many crash bugs which cannot be identified. This "run with gdb" approach only works if you remember what you did and if it's actually reproducible. Additionally, there is a wide selection of scripting options with the JVM/MLVM and there is also state of the art garbage collection. Inkscape for example already uses garbage collection, but of course it isn't nearly as advanced as Sun's.

pelle
Posts: 53
Joined: Wed Mar 05, 2008 8:23 am

Re: Java version of Inkscape

Postby pelle » Tue Jun 17, 2008 12:46 am

I think it makes a lot more sense to improve the current integration with Python instead, focusing on doing that really good and not bloating the application (design, external dependencies, memory footprint, etc) with supporting another language (especially not one as huge as Java). Also Java is quite horrible to use as a scripting/extensions language. My extensions for Inkscape would never have bothered to even try to code in Java, even though I have many years of experience (working full-time) with Java, but a Python newbie.

JLA

Re: Java version of Inkscape

Postby JLA » Tue Jun 17, 2008 1:51 am

I'll admit that Java currently isn't great at extensions/plug-ins, etc. At least I'm pretty awkward in making them. But there are a whole lot of apps that make use of them. But I know nothing about all that new MLVM stuff...maybe that'll make everything different.

While it might be too large of a task to port the whole thing, perhaps a spinoff that only included core functionality might be interesting for someone. I ported an Atari 2600 emulator (about a megabyte in code I guess) into Java, which ended up being around 100 kb of Java code. A lot of stuff didn't need to be ported--e.g. all the ZIP and MD5 routines were already built into Java's standard library...and all the cross-platform infrastructure took up a bunch too. Of course, the Java version had much fewer features. And some of the stuff I essentially had to do from scratch. But I think the code is much cleaner, and it's probably accessible to more programmers. And Swing, as much as some people hate it, integrates a lot better into the native look-and-feel than other cross-platform systems.

User avatar
aho
Posts: 180
Joined: Sun Nov 04, 2007 9:51 am
Contact:

Re: Java version of Inkscape

Postby aho » Tue Jun 17, 2008 7:22 am

>Also Java is quite horrible to use as a scripting/extensions language.

You don't have to script in Java. The JVM paves the way for dozens of scripting languages. Personally I really like scripting with Java itself though. On-the-fly compilation is very fast with Janino and you get full execution speed.

>My extensions for Inkscape would never have bothered to even try to code in Java, even though I have many years of
>experience (working full-time) with Java, but a Python newbie.

Python (Jython) is of course also an option.


Return to “Inkscape Ideas”