Using electron instead of python for UI redesign


#1

It is mentioned in one of the synfig dev report https://www.synfig.org/2018/05/07/synfig-development-report-51/ that Artem is planning on gradual refactoring of UI & plans to use python instead of C++

I’m not sure whether these questions were answered before choosing python

  1. What are the most popular UI tools available to develop cross platform applications in opensource community?

(HTML + CSS + Javascript) vs Python vs Java vs others

  1. Share of percentage of animators who work on Synfig also work on any of these languages?

(HTML + CSS + Javascript) vs Python vs Java vs others

  1. What percentage of opensource UI contributors come from each of the above languages?

(HTML + CSS + Javascript) vs Python vs Java vs others

  1. What are performance characteristics of each of the UI choices

(HTML + CSS + Javascript) vs Python vs Java vs Others

  1. Image manipulation libraries

(HTML + CSS + Javascript) vs Python vs Java vs Others

  1. Integration with native code (keeping gradual migration in mind)

(HTML + CSS + Javascript) vs Python vs Java vs Others

  1. UI development tooling & ease of development

(HTML + CSS + Javascript) vs Python vs Java vs Others

If I look at each of these choices, Javascript (& its typesafe counterpart Typescript) seems to be far more attractive than python. Electron from github is one such framework & its based on chrome engine (web browser), HTML, CSS (SCSS) & JS (Typescript)

github.com/electron/electron

Tho python a better choice than C++, but not sure if its the best choice for UI revamp. If gradual redesign is a goal, its better to use HTML, CSS (its programming friendly SASS) & Typescript (javascript with typesafety) for this redesign just based on the sheer size of opensource UI developer pool when compared python/any other language for that matter

Since the people who work in UI also work on animating (a significant overlap when compared to python developers who are server side guys, just like me who is a java developer who works on server side most of the time), its better use tools that give maximum benefit

I’m not sure about the performance characteristics of JS vs python, but since a whole browser (chrome) is based off native code & javascript, its performance should not be as bad (again I’m not a image processing expert, so please take my views with a pinch of salt)

Please let me know your views


How can I help out?
#2

The choice of Python is that it is simple, open-source and stable for a long time.
Not only this, but compatible out-of the-box with GTK which is the UI toolkit.
It is also used as an embedded interpreter and can be used without any problem with C++.
And it doesn’t mean of Synfig will not remain C++

Electron is a “young” technology which is changing all the time, as well as Java, introducing incompatibilities at every language upgrade.
What if V8 is not used anymore in a near future?
I’m not even talking about performances in layer system of Chromium engine… developers.google.com/web/funda … rendering/
Better to target stability, portability and easy maintenance, not to use the last gadget in fashion.

UI changes with Python mean extensibility of the interface, possibility to add plugins from third-parties in the UI.
Currently you need to compile C++ with hardcoded elements, not even Glade xml UI are integrated, and so-called plugins just modify .sif before a full reload.

But anyway as Synfig is open-source you can still try to develop you own JS version.
Good luck :wink:


#3

erikhk.net/inkscape_animation_project
It uses svg + javascript but program on an editor in c++


#4

@BobSynfig

Now that I understand Synfig lil bit, I can refute most of your arguments for python

The choice of Python is that it is simple, open-source and stable for a long time

Java is extremely stable & opensource. Javascript too stable & opensource, the whole web runs on it. So everyone is even on this front

Electron is a “young” technology which is changing all the time, as well as Java, introducing incompatibilities at every language upgrade.
What if V8 is not used anymore in a near future?
I’m not even talking about performances in layer system of Chromium engine… developers.google.com/web/funda … rendering/
Better to target stability, portability and easy maintenance, not to use the last gadget in fashion.

I know about Java & this is probably the only major language that has backward compatibility all the way from JDK 1 (Currently its at JDK 10). So this argument is factually incorrect about Java. As far as I know javascript too is backward compatible. Again, since the editor can chose its own environment, this is not an important factor

On the other hand, python3 broke backward compatibility, while java never broke backward compatibility & AFAIK, JS too never broke

w.r.t electron, there are so many projects (visual studio code & many others) who use electron. If it changes from V8 to something else, you will have a migration path. But, you gain a UI developer pool the size of which does not exist in Java/Python/any other language. This tradeoff is quite worth it

Also, you dont need C/C++ as you dont need 60fps in Synfig, you only need it for rendering. Currently synfig anyway does not generate frames at 60fps. For rendering, it uses ffmpeg (or) some other tool & Synfig currently renders about 1 frame per 10seconds @ 1920*1080 resolution in my moderately sized machine. So 60fps is a red herring

So you view that javascript is not performant is no longer an issue for the editor redesign. When you look at every other argument, Javascript far more superior when you consider all other factors

Also, Javascript is used by serious companies & is not a latest gadget (Skype, Slack, Visual Studio Code & many other tools). On the flip side, its not a great idea to not use the right tool for the job as one is used to some old tool. We need to see whats the best tool for the job at hand

UI changes with Python mean extensibility of the interface, possibility to add plugins from third-parties in the UI.
Currently you need to compile C++ with hardcoded elements, not even Glade xml UI are integrated, and so-called plugins just modify .sif before a full reload.

Currently Javascript (and friends) has a well established tradition of frameworks & writing custom elements & standards. Also, since it is an interpreted language writing extensions is simple too

Overall when I relook at all the questions I proposed, I see that (HTML + CSS + Javascript) & a environment (framework?) like electron is a far superior & far cheaper to develop & maintain an app designed for user consumption

  1. What are the most popular UI tools available to develop cross platform applications in opensource community?

(HTML + CSS + Javascript) vs Python vs Java vs others

A. Winner: (HTML + CSS + Javascript) has the highest participation in opensource community in the UI area

  1. Share of percentage of animators who work on Synfig also work on any of these languages?

(HTML + CSS + Javascript) vs Python vs Java vs others

A. Winner: (HTML + CSS + Javascript) as animators double as UI developers aswell in most startups

  1. What percentage of opensource UI contributors come from each of the above languages?

(HTML + CSS + Javascript) vs Python vs Java vs others

A. Winner: (HTML + CSS + Javascript) has the highest participation in opensource community in the UI area. Java & Python have similar participation in opensource community when it comes to non UI areas

  1. What are performance characteristics of each of the UI choices

(HTML + CSS + Javascript) vs Python vs Java vs Others

A. Not an important factor as we always delegate final rendering to external framework like ffmpeg which is written is C/C++

  1. Image manipulation libraries

(HTML + CSS + Javascript) vs Python vs Java vs Others

A. Not sure yet

  1. Integration with native code (keeping gradual migration in mind)

(HTML + CSS + Javascript) vs Python vs Java vs Others

A. Not sure, May be python, may be not

  1. UI development tooling & ease of development

(HTML + CSS + Javascript) vs Python vs Java vs Others

A. (HTML + CSS + Javascript) as HTML is W3C standard for markup, CSS for W3C standard for style & JS is an ECMA script standard


#5

Tastes and colors, choice of language and compiler, no matter…

The fact is that choices have been done years ago when Synfig was developped internally by Voria Studios
osnews.com/story/13241/Inter … uattlebaum

We are not here to do a competition of length of … source code :mrgreen:

To quote myself:

Synfig is open-source you can still try to develop you own JS version.
Good luck