简体   繁体   English

kotlim 和 compose 有什么区别?

[英]What difference kotlim and compose?

I started studying kotlin and came across a lot of questions that I can't find: what is the difference between kotlin multiplatform and compose multiplatform?我开始研究 kotlin 并遇到了很多我找不到的问题:kotlin multiplatform 和 compose multiplatform 有什么区别? can they work together in the same project?他们可以在同一个项目中一起工作吗? what is more primary?什么更主要?

All I understood from the official documentation is that kotlin multiplatform is a framework for development on a variety of systems and compose multiplatform is an adaptation of compose from android我从官方文档中了解到的是 kotlin multiplatform 是一个在各种系统上开发的框架,而 compose multiplatform 是对 android compose 的改编

Kotlin Multiplatform is a language definition and set of tools that lets you write Kotlin and compile it to a wide range of platforms: JVM/Android, JS, iOS, Macos, Windows, Linux, etc (WASM in progress). Kotlin Multiplatform 是一种语言定义和一组工具,可让您编写 Kotlin 并将其编译到各种平台:JVM/Android、JS、iOS、Macos、Windows、Linux 等(WASM 正在进行中)。 It is agnostic about what you do with it.它不知道你用它做什么。 Also, some code can be compiled for all targets (common Kotlin), and some is platform-specific.此外,一些代码可以针对所有目标(通用 Kotlin)进行编译,而一些代码是特定于平台的。

Compose UI is a library for writing UI's. Compose UI 是一个用于编写 UI 的库。 The vast majority of effort and the only really "production ready" implementation is for Android. However, compose for Desktop running on the JVM is being used by many teams.绝大多数工作和唯一真正“生产就绪”的实现是针对 Android 的。但是,许多团队正在使用运行在 JVM 上的 compose for Desktop。 Compose UI for web exists, although I'm not sure how much use that gets.存在 web 的 Compose UI,但我不确定它有多少用途。 Compose for iOS is in the works.正在为 iOS 撰写。 We published an app with it recently ( https://touchlab.co/droidcon-nyc-ios-app-with-compose/ ), but I wouldn't use it for a production project yet, but in the not-too-distant future potentially.我们最近用它发布了一个应用程序 ( https://touchlab.co/droidcon-nyc-ios-app-with-compose/ ),但我还不会将它用于生产项目,但在不太-遥远的未来可能。

All of the non-android platforms use Kotlin Multiplatform to build Compose UI.所有非安卓平台都使用 Kotlin Multiplatform 来构建 Compose UI。 It's sort of like SwiftUI uses Swift. They're related, but Swift is it's own, much more mature, thing.有点像 SwiftUI 使用 Swift。它们是相关的,但 Swift 是它自己的,更成熟的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM