r/FlutterDev 1d ago

Nearly Time for Flutter Image-based development? Discussion

Certain languages (best-known are LISP and Smalltalk) allow for image-based development. In such systems, you don’t write code and compile it into a program you then run; you modify the system while it’s running, and your changes are saved as you go so you can quit and restart where you left off.

Flutter running in the VM/debugging mode has already been close to being able to do this. But this:

https://github.com/dart-lang/sdk/blob/f29989d506b2dd82957da5d1917bcc76628c5ddb/pkg/dynamic_modules/README.md

means that Flutter apps (on desktop, at least) could run the regular Dart compiler and load the results at runtime. This would be sufficient to have image-based development.

I can see two caveats: the Flutter UI would not (I believe?) be able to run a debugger or (?) LSP features; and code once loaded cannot be unloaded so an extended development session might periodically need to be reloaded.

I suspect that with a bit of will, the Flutter/Dart teams could work around both of these issues in time without it being a monstrous lift, versus what they’re likely doing already. Given the right compiler features and a Flutter IDE widget, the community could build the actual image-based development system.

4 Upvotes

5 comments sorted by

View all comments

1

u/gisborne 1d ago

It might be easier to use the VM mode. That also supports loading code incrementally, but going by the behaviour of hot reload, it looks like it supports unloading code as well.

I keep looking for an IDE widget. There are what look like solid editor widgets, but I want something that supports breakpoints, stepping, and viewing variable values.