Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental example application without AWT implementation #2825

Closed
igordmn opened this issue Mar 3, 2023 · 10 comments
Closed

Experimental example application without AWT implementation #2825

igordmn opened this issue Mar 3, 2023 · 10 comments
Assignees
Labels
desktop enhancement New feature or request examples Example applications refactoring

Comments

@igordmn
Copy link
Collaborator

igordmn commented Mar 3, 2023

Desktop target of Compose Multiplatform uses AWT/Swing under the hood. It adds many advantages, but also adds many issues.

Investigate:

  • if it feasible to replace AWT by something else
  • if it feasible to support GraalVM, or even Kotlin Native for desktop OS'es

We can:

  1. Write a sample application with not simple UI on stable Compose Multiplatform
  2. Try to gradually get rid of AWT dependencies in Compose/Skiko. Just leave stubs at the moment. We are only investigating.
  3. Implement support for GraalVM
  4. [optional] Implement support for Kotlin Native (we already have some prototypes for macOS)
  5. Compare all implementations in terms of performance (RAM, the startup time, FPS)
  6. Make a list of features that we need to reimplement when we get rid of AWT.

Note, that AWT/Swing implementation will still be needed for Swing interop (needed for IDEA interop).

P.S. We have one very simple example without AWT here: https://github.com/JetBrains/compose-jb/tree/master/experimental/lwjgl-integration

@igordmn igordmn added enhancement New feature or request examples Example applications refactoring desktop labels Mar 3, 2023
@sureshg
Copy link

sureshg commented Mar 6, 2023

Thought of sharing this here as compose-jb team is exploring the AOT compilation. Dynamic linking of AWT libraries are now available on Windows and Linux GraalVM native images (changes are merged last week) - oracle/graal@f375678 . I think they are now working on the mac os support and is tracked as part of this issue - oracle/graal#4921

@mipastgt
Copy link

mipastgt commented Mar 7, 2023

It would be interesting to see whether this issue JetBrains/skiko#580 which I originaly reported to bellsoft bell-sw/LibericaNIK#14 here will be fixed by these changes once they land on the mac.

@wakaztahir
Copy link

wakaztahir commented Aug 20, 2023

Any updates ? I'd really prefer Kotlin Native since that'll bring direct native support and sometimes just interacting with OS gets hard in JVM, e.g opening a folder selection dialog

@dima-avdeev-jb
Copy link
Contributor

Any updates ?

It is very interesting experimental research.
But, for now we are pausing it. Because we want to provide another features and bug fixes.
I hope we will continue it later!
Stay tunned!

@jershell
Copy link

jershell commented Jan 31, 2024

When it will to continue i think we can check skiko+(GLFW or SDL) as backend for support native target.
some points

  • provide input methods and base window api
  • crossplatform
  • SDL/GLFW is written in C
  • SDL/GLFW is hardware accelerated

@Laxystem
Copy link

Laxystem commented Feb 3, 2024

Is Kotlin/WASI support also planned/experimented with?

@dima-avdeev-jb
Copy link
Contributor

@Laxystem Do you mean Compose with Wasm?
Yes, Compose Wasm is experimental now.
Here we have one very early experimental example: https://github.com/Kotlin/kotlin-wasm-examples/tree/main/compose-imageviewer#compose-multiplatform-for-web
Latter we will migrate all our examples to WASM too

@Laxystem
Copy link

Laxystem commented Feb 7, 2024

@Laxystem Do you mean Compose with Wasm? Yes, Compose Wasm is experimental now. Here we have one very early experimental example: https://github.com/Kotlin/kotlin-wasm-examples/tree/main/compose-imageviewer#compose-multiplatform-for-web Latter we will migrate all our examples to WASM too

I mean, Kotlin supports two Wasm targets, Kotlin/WasmJS (for the web) and Kotlin/WasmWASI (for everything else, via the WASI libraries).

Afaik Compose/Wasm only compiles to Kotlin/WasmJS. Is compose also experimenting with supporting Kotlin/WasmWASI?

@jershell
Copy link

jershell commented Feb 7, 2024

@Laxystem Do you mean Compose with Wasm? Yes, Compose Wasm is experimental now. Here we have one very early experimental example: https://github.com/Kotlin/kotlin-wasm-examples/tree/main/compose-imageviewer#compose-multiplatform-for-web Latter we will migrate all our examples to WASM too

I mean, Kotlin supports two Wasm targets, Kotlin/WasmJS (for the web) and Kotlin/WasmWASI (for everything else, via the WASI libraries).

Afaik Compose/Wasm only compiles to Kotlin/WasmJS. Is compose also experimenting with supporting
Kotlin/WasmWASI?

I think at the moment there is no way to get the user interface of the application. This is not part of wasi. Depending on the difference in the runtime implementation, it may work with the imported functions.

WebAssembly/WASI#53

@okushnikov
Copy link
Collaborator

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop enhancement New feature or request examples Example applications refactoring
Projects
None yet
Development

No branches or pull requests

9 participants