3 ms·
Curious what platforms you're interested in integrating with. We're experimenting here and looking for feedback. As a fun demonstration of the effectiveness of
by timsneath 6y ago
Curious what platforms you're interested in integrating with. We're experimenting here and looking for feedback. As a fun demonstration of the effectiveness of FFI, you can now build Petzold-style native Windows code with Dart:
https://github.com/timsneath/win32/blob/master/example/hello.dart https://github.com/timsneath/win32/blob/master/example/hello...
And here's a 500-line version of the Kilo console text editor built with Dart:
https://github.com/timsneath/dart_console/blob/master/example/kilo.dart https://github.com/timsneath/dart_console/blob/master/exampl...
Unlike the original, it runs on both Windows and UNIX-based operating systems.
- vetinari 6y agoI'm actually more interested in Linux side of things. That doesn't prevent me from looking how things are done on Windows, of course. To be fair, last time I looked into dart, the idea of FFI was ports, which was too overcomplicated and undercapable, if you needed something like Gtk or Vulkan. Looking into it now, I see the dart:ffi package is shaping up nicely, so I will have another look at dart again.
- malkia 6y agoTim, it should be possible that the main .exe (or binary on linux/osx) to export functions, and they can be found back through the flutter_engine.dll/.so, right? (At least on windows it's possible for the exe to __declspec(dllexport) things, not sure on Linux). But even if not, if there is a way to (given might be slow and tedious) to compile what would've been flutter_engine.dll statically linked to your main (host) app, and maybe somewhat hinting here is how to find the "GetProcAddr/dlsym/etc." functions - if one is to look for them. Further on, the generated from dart .so file can be embded (as resource? or slapped at the end of the binary/.exe?) + slapping all other resource - resulting in single app :) I know it's possible, just not so easy to support it (I guess). It's similar to have java/python can be packed into one executable with all C/C++ ffi functions they call (at cost of some build time and effort to achieve so). Then you'll have killer platform for video conferencing (zoom, bluejeans, etc.), messaging (slack, etc.) - and just single binary to deploy. (Oh, on top of that slap a web server into it, and make it that if called with specific command-line option, now it acts as web-server, and the app is visible through the web).