website icon indicating copy to clipboard operation
website copied to clipboard

Document architecture (how it works)

Open FeodorFitsner opened this issue 4 years ago • 7 comments

  • diagram

FeodorFitsner avatar Jul 07 '22 15:07 FeodorFitsner

Yes please. I’m trying to understand this. If I run a native Windows Flet application, how many processes are there, and how many layers of communication? Is there a Dart-based process communicating with a Python process? Is there a Dart webserver communicating by Websockets to an Electron GUI?

jamesdbrock avatar Jun 15 '23 11:06 jamesdbrock

Oh there's some good information in here. https://github.com/flet-dev/flet/blob/main/docs/flet.md

Flet hides that complexity by replacing Flutter's declarative model (re-build a UI tree on app state changes) with an imperative (modify UI tree as program progresses).

Really? That's too bad.

jamesdbrock avatar Jun 15 '23 11:06 jamesdbrock

Ok Flutter is an alternative to Webkit. So there is no Webkit involved here. It looks like there is a Flutter Dart process with bindings to the C++ Flutter engine, and then a separate Flet Python process which communicates with Flutter Dart through JSON and sockets? And I guess that the subject of that communication is UI events and VDOM diffs?

I was hoping that Flet has direct Python bindings to the C++ Flutter engine? No?

jamesdbrock avatar Jun 16 '23 06:06 jamesdbrock

https://flet.dev/blog/flet-mobile-update/#flet-new-desktop-architecture

jamesdbrock avatar Jun 19 '23 05:06 jamesdbrock

https://github.com/flet-dev/flet/blob/main/docs/flet.md

Flet hides that complexity by replacing Flutter's declarative model (re-build a UI tree on app state changes) with an imperative (modify UI tree as program progresses).

Flet hides the simplicity of Flutter’s declarative model by replacing it with complex imperative modifications to the UI tree?

jamesdbrock avatar Jun 21 '23 05:06 jamesdbrock

The flutter guys explained it pretty well. For them, having to modify the states by oneself could sometimes be problematic. I find this true in Flet's case.

@FeodorFitsner, you master Flutter and Flet architectures, what can you say on this today please? And also, why do you name it as 'hiding complexity'? And by the way, could it be easy for Flet to switch on to the imperative style ?

The language runtime is also to be taken into consideration:

This approach relies on certain characteristics of a language runtime (in particular, fast object instantiation and deletion). Fortunately, Dart is particularly well suited for this task.

The question is, is python suited too? I think Yes. But we can't really know if we don't give it a try.

ndonkoHenri avatar Jun 21 '23 07:06 ndonkoHenri

@FeodorFitsner any updates here? Can we have detailed "under the hood" docs?

That would help people to use the tool with peace of mind (cause it is pretty uncomfortable to use a tool without good architecture knowledge), and what's more important, that should help people to start actually contributing to the project.

I'm trying to have some fun with it now, and I'm having a hard time understanding how the thing works.

ypankovych avatar Dec 24 '23 23:12 ypankovych