Open listepo opened 2 years ago
/cc @robert-ancell for input (IIRC we discussed this briefly during the initial bringup?), and @cbracken.
There are a few elements of support we could consider if we wanted to do this:
doctor
check for the necessary tooling (is it just valac
, or are there other components?). This would required if we want to allow plugins to be written with Vala without causing a lot of problems.Some important considerations here:
My first question would be what sort of apps and plugins did you have in mind? This is only going to be useful if a significant part of the application or plugins is to be written in native code as opposed to Dart/Flutter. In my experience I've almost never used plugins with Flutter preferring to use Dart and falling back to Dart+FFI if it that isn't possible.
Changing the application from C to Vala should be do-able right now, this just requires rewriting the template in Vala as all the exposed Flutter APIs should be wrappable with a .vapi. This could be done with a separate github project that is then copied into projects that want to use it. This could be assessed for popularity to decide if this would warrant becoming an official template option in Flutter.
Writing plugins in Vala should also be do-able if they are pre-compiled to C for distribution. Again, if significant plugins made use of this then the next step would be to consider if Flutter should natively support valac and remove the pre-compile stage.
I have used a lot of Vala in the past and it's a language I do love - much better than fighting C. Dart reminds me a lot of Vala particularly in writing a lot of asynchronous code.
Writing plugins in Vala should also be do-able if they are pre-compiled to C for distribution.
Interesting, so it's straightforward to do just the transpiling step and stop with the C output?
If someone in the community wants to write up a step-by-step guide to writing a plugin that way and then link to it from here, that would be a good starting point to gauge interest.
Interesting, so it's straightforward to do just the transpiling step and stop with the C output?
Yes, valac --ccode
will just spit out a .c file for the .vala input and can be compiled just like any other C code.
The triaged-desktop
label is irrelevant if there is no team-desktop
label or fyi-desktop
label.
It would be very nice to be able to create apps and plugins for linux with Vala. C/C++ is very good, but the entry threshold is very high.