Kotlin/Wasm: Today and Tomorrow - Zalim Bashorov, JetBrains ๐Ÿ”— **Source:** [Kotlin/Wasm: Today and Tomorrow - Zalim Bashorov, JetBrains](https://www.youtube.com/watch?v=Zy2SrhV5ESA) > [!note]+ Document Notes > tags: [kotlin-wasm, webassembly, javascript, programming-languages] > author: Zalim Bashorov > source: YouTube > reference: https://www.youtube.com/watch?v=Zy2SrhV5ESA > date created: 2024-12-28 15:20 > > # ๐Ÿท๏ธ Title: Kotlin/Wasm: Today and Tomorrow > <!-- deep-read:sections start --> ## ๐Ÿงฐ Action Inbox - [H1] Try Kotlin/Wasm playground online โ€” immediate hands-on experience #kotlin-wasm - [H2] Set up browser for wasmGC support โ€” enable experimental features #setup - [H3] Explore Compose Multiplatform for web โ€” UI framework testing #compose ## ๐Ÿงญ Table of Contents - [๐Ÿ“ Summary](#-summary) - [๐Ÿ“– Main Content](#-main-content) - [๐Ÿ—’๏ธ Notes](#๏ธ-notes) - [๐Ÿ“š References](#-references) - [๐Ÿ—ฃ๏ธ Paraphrase](#๏ธ-paraphrase) - [๐Ÿ“ฐ Newsletter](#-newsletter) - [โœ… Action Items](#-action-items) - [๐Ÿงช Hypotheses](#-hypotheses) - [๐Ÿ“Š Methodology](#-methodology) - [โ“ Questions](#-questions) - [๐Ÿ”ฎ Future Research](#-future-research) - [๐Ÿ’ก Implications](#-implications) - [๐Ÿง  Learning Styles Assessment](#-learning-styles-assessment) - [๐Ÿ“Š Accessibility Assessment](#-accessibility-assessment) - [๐ŸŒ DEIB Assessment](#-deib-assessment) - [โœ… Logical Validity](#-logical-validity) - [๐Ÿ›ก๏ธ DARVO Analysis](#-darvo-analysis) - [๐ŸŽฏ Conclusion](#-conclusion) ### ๐Ÿ”— References - [Kotlin/Wasm Playground](https://kotl.in/wasm) - [Compose Multiplatform Demo](https://composemultiplatform.org/wasm) ## ๐Ÿ“ Summary - JetBrains introduces Kotlin/Wasm as experimental compilation target for WebAssembly - Why it matters: Enables sharing Kotlin code between JVM, Native, JavaScript, and WebAssembly platforms - Key stakeholders: Kotlin developers, web developers, JetBrains ecosystem - Risks and tradeoffs: Requires experimental WebAssembly features, limited browser support currently - Bottom line: Kotlin/Wasm shows promise but needs broader browser adoption of wasmGC proposal ## ๐Ÿ“– Main Content Kotlin/Wasm represents JetBrains' effort to bring Kotlin's null safety and multi-platform capabilities to WebAssembly. The implementation relies heavily on experimental WebAssembly proposals, particularly the Garbage Collection (GC) proposal and exception handling, which are currently in phase 3 of the standardization process. The compiler generates WebAssembly binaries directly for fast compilation during development, while using Binaryen for release optimizations. Key technical dependencies include the wasmGC proposal for memory management, exception handling for Kotlin's exception model, and typed function references for better performance. Current limitations include requiring manual browser configuration to enable experimental features, though this should improve once proposals reach phase 4. The ecosystem already includes support for major Kotlin libraries like Coroutines, Ktor, and notably Compose Multiplatform for UI development. ## ๐Ÿ—’๏ธ Notes #### โฑ๏ธ [00:00](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=0) โ€” [H1] Introduction to Kotlin/Wasm - Key idea: Zalim Bashorov leads the Kotlin/Wasm team at JetBrains - Evidence: "I've been working on Kotlin at JetBrains for quite a while, more than 10 years now" #### โฑ๏ธ [02:15](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=135) โ€” [H2] Kotlin Language Overview - Key idea: Kotlin provides null safety and multi-platform compilation targets - Evidence: "It's probably best known for its built-in null safety which turns the billion dollar mistake into compile time check" #### โฑ๏ธ [04:30](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=270) โ€” [H3] Kotlin/Wasm Goals - Key idea: Fast compilation with direct binary generation for development builds - Evidence: "We built the new compiler from scratch targeting WebAssembly, we want to have first fast compilation" #### โฑ๏ธ [06:45](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=405) โ€” [H2] WebAssembly Proposals Used - Key idea: Kotlin/Wasm depends on four key experimental WebAssembly proposals - Evidence: "Exception handling proposal introduces something like exceptions, we use this proposal to support exceptions in Kotlin" #### โฑ๏ธ [08:20](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=500) โ€” [H3] Garbage Collection Proposal Benefits - Key idea: wasmGC eliminates need for custom memory manager in WebAssembly - Evidence: "Thanks to this proposals we don't need to bring to webassembly our memory manager so it helps a lot" #### โฑ๏ธ [10:15](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=615) โ€” [H2] Browser Support Setup - Key idea: Chrome provides easiest setup through Origin Trial registration - Evidence: "Chrome has the best support for wasmGC so far and also Chrome provides easier way to set up" #### โฑ๏ธ [12:30](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=750) โ€” [H1] Phase 4 Standardization News - Key idea: WebAssembly GC proposals moving to phase 4 next week - Evidence: "Next week actually on Tuesday next week they will be vote for moving typed function reference and GC proposal to phase four" #### โฑ๏ธ [13:45](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=825) โ€” [H2] Online Playground Experience - Key idea: Kotlin/Wasm playground provides immediate browser-based testing - Evidence: "The easiest way to try Kotlin wasm is to try it in action using our online playground" #### โฑ๏ธ [15:20](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=920) โ€” [H3] IDE Integration Features - Key idea: Full IDE support includes refactoring, navigation, and debugging - Evidence: "We think it's important having great IDE support out of box, so it's not only about editing code" #### โฑ๏ธ [17:10](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=1030) โ€” [H2] Library Ecosystem Support - Key idea: Major Kotlin libraries already support WebAssembly target - Evidence: "There's Coroutines, Ktor, datetime, Compose multiplatform" #### โฑ๏ธ [19:35](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=1175) โ€” [H1] Compose Multiplatform Demo - Key idea: Jetpack Compose UI framework runs smoothly in browser via Kotlin/Wasm - Evidence: "It works smoothly and shows high frame rates so looks good" #### โฑ๏ธ [22:15](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=1335) โ€” [H2] Server-Side WebAssembly - Key idea: WebAssembly has potential beyond browsers for server-side use cases - Evidence: "We think it has a big potential on server side specifically with Lambda use cases" #### โฑ๏ธ [24:30](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=1470) โ€” [H3] WASI Support Plans - Key idea: Built-in WASI support coming in Kotlin 1.9.20 - Evidence: "Starting from 1.9.20 we'll provide a built-in support for WASI" #### โฑ๏ธ [26:45](https://www.youtube.com/watch?v=Zy2SrhV5ESA?t=1605) โ€” [H2] Q&A Session Begins - Key idea: Safari support progressing with JavaScript Core engine work - Evidence: "There is some work on wasmGC, many things already done, I think kind of 80 percent of tasks is done" ## ๐Ÿ“š References - [Kotlin/Wasm Documentation](https://kotlinlang.org/docs/wasm-overview.html) - [WebAssembly GC Proposal](https://github.com/WebAssembly/gc) - [Compose Multiplatform](https://www.jetbrains.com/lp/compose-multiplatform/) ## ๐Ÿ—ฃ๏ธ Paraphrase - Kotlin/Wasm brings JetBrains' popular programming language to WebAssembly, enabling code sharing across all major platforms while maintaining Kotlin's null safety and expressiveness - The implementation leverages cutting-edge WebAssembly proposals for garbage collection and exception handling, eliminating the need for custom memory management and providing better performance - While currently requiring experimental browser features, the technology shows strong promise with full IDE support, growing library ecosystem, and impressive demos like Compose Multiplatform running in browsers ## ๐Ÿ“ฐ Newsletter **Kotlin Expands to WebAssembly with Experimental wasmGC Support** JetBrains has unveiled Kotlin/Wasm as a new experimental compilation target, bringing Kotlin's beloved null safety and multi-platform capabilities to WebAssembly. This development enables developers to share code across JVM, Native, JavaScript, and now WebAssembly platforms using a single language. The implementation showcases impressive technical achievements, including direct binary generation for fast compilation and seamless integration with experimental WebAssembly features like garbage collection. Developers can try it immediately through the online playground, and major libraries like Coroutines and Compose Multiplatform already provide support. While browser support currently requires manual configuration, upcoming WebAssembly standardization votes should enable broader adoption. The technology demonstrates particular promise for server-side applications with WASI support planned for Kotlin 1.9.20. **Try it now:** [Kotlin/Wasm Playground](https://kotl.in/wasm) Resources: [WebAssembly Docs](https://webassembly.org/), [Kotlin Multiplatform](https://kotlinlang.org/docs/multiplatform.html), [Compose Multiplatform](https://www.jetbrains.com/lp/compose-multiplatform/) ## โœ… Action Items #### DevRel - Developer advocacy: Create WebAssembly-focused Kotlin tutorials, conference presentations on wasm adoption - Education: Develop workshops for Kotlin/Wasm migration, office hours for browser setup - Developer experience: Improve playground UX, streamline browser configuration docs - Developer marketing: Campaign highlighting multi-platform code sharing benefits - Community management: Monitor wasmGC proposal feedback, facilitate browser compatibility discussions #### Community - Maintainers: Support library authors adding wasm targets, governance for experimental features - Contributors: First-issue programs for wasm-specific improvements, browser testing initiatives - Sponsors: Fund WebAssembly standardization efforts, support critical library migrations - Ecosystem: Coordinate with browser vendors on proposal implementation timelines ## ๐Ÿงช Hypotheses - Kotlin/Wasm adoption will accelerate significantly once wasmGC proposals reach phase 4 standardization - Compose Multiplatform's browser performance will compete favorably with React-based frameworks - Server-side WebAssembly use cases will drive more interest than client-side web development - The need for experimental browser configuration currently limits mainstream adoption ### ๐Ÿ“Š Methodology - Survey developers on browser setup barriers and willingness to use experimental features - Benchmark Compose Multiplatform performance against established web frameworks - Track library ecosystem growth and migration patterns from JavaScript to Kotlin/Wasm ### โ“ Questions - How will Kotlin/Wasm performance compare to optimized JavaScript frameworks at scale? - What's the timeline for Safari and Firefox to fully support wasmGC by default? - Can the server-side WebAssembly ecosystem mature faster than client-side adoption? ### ๐Ÿ”ฎ Future Research - Long-term viability of WebAssembly for complex web applications - Developer productivity impacts of multi-platform Kotlin development - Performance characteristics of wasmGC versus manual memory management ### ๐Ÿ’ก Implications - Practice: Enables true multi-platform development with single language and codebase - Policy: May influence WebAssembly standardization priorities and browser implementation timelines - Security: wasmGC provides memory safety benefits over manual WebAssembly memory management - Education: Requires new curricula covering WebAssembly concepts and browser configuration - Funding: Investment in WebAssembly tooling and standardization becomes more critical ### ๐Ÿง  Learning Styles Assessment Reading level estimate: 12th grade (technical presentation with domain-specific terminology) #### ๐Ÿ‘€ Visual learners - Present: Architecture diagrams showing compilation targets, browser setup screenshots - Improve: Data flow diagrams for wasmGC integration, visual timeline for proposal phases #### ๐Ÿ”Š Aural learners - Present: Original conference presentation video with clear narration - Improve: 5-minute audio summary focusing on key benefits and setup steps #### ๐Ÿ—ฃ๏ธ Verbal learners - Present: Clear definitions of WebAssembly concepts, analogies to familiar JVM concepts - Improve: Glossary of wasmGC terminology, comparison tables with other compilation targets #### ๐Ÿงฉ Kinesthetic learners - Present: Interactive playground for immediate hands-on experience - Improve: Step-by-step browser configuration checklist, sample project templates #### ๐Ÿง  Logical learners - Present: Phase-based standardization timeline, clear technical dependencies - Improve: Decision tree for choosing compilation targets, performance comparison metrics #### ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Social learners - Present: Q&A session with community interaction, discussion of ecosystem collaboration - Improve: Developer forums focused on Kotlin/Wasm, peer code review opportunities #### ๐Ÿง˜โ€โ™€๏ธ Solitary learners - Present: Self-guided playground exploration, individual experimentation opportunities - Improve: Progressive learning path from basic concepts to advanced implementation #### ๐ŸŒฟ Naturalistic learners - Present: Ecosystem perspective on library compatibility and platform integration - Improve: Sustainability discussion of standardization processes, technology lifecycle thinking ### ๐Ÿ“Š Accessibility Assessment #### Screen reader semantics - Present: Clear heading structure, descriptive technical terminology - Improve: Alt text for architecture diagrams, ARIA labels for code examples #### Keyboard navigation - Present: Standard video player controls, accessible playground interface - Improve: Keyboard shortcuts for common playground actions, skip links for long code sections #### Contrast and readability - Present: High contrast code syntax highlighting in playground - Improve: Ensure 4.5:1 contrast ratio for all technical diagrams #### Text resizing and reflow - Present: Responsive design supports 200% zoom - Improve: Prevent code block horizontal scrolling at higher zoom levels #### Media and captions - Present: Video captions available for presentation - Improve: Downloadable transcript, audio descriptions for visual demonstrations #### Forms and interactions - Present: Clear labels for playground configuration options - Improve: Inline validation for browser setup requirements ### ๐ŸŒ DEIB Assessment #### Cultural breadth - Present: International conference context, global developer community focus - Improve: Examples from diverse geographical regions, multi-language documentation links #### Inclusive language - Present: Technical presentation uses neutral terminology - Improve: Plain-language explanations of complex WebAssembly concepts #### Neurodiversity support - Present: Well-structured presentation with clear section breaks - Improve: Visual indicators for key concepts, consistent formatting patterns #### Representation - Present: Technical content focused on technology rather than individual representation - Improve: Showcase diverse developer use cases and application domains #### Psychological safety - Present: Encouraging tone about experimental technology adoption - Improve: Clear expectations about experimental status, supportive community guidelines ### โœ… Logical Validity #### Strong reasoning - Deductive strength: Clear logical progression from WebAssembly proposals to Kotlin implementation benefits - Inductive strength: Evidence from existing multi-platform success supports wasm target viability - Causal reasoning: Links experimental proposal adoption to current browser support limitations - Analogical strength: Effective comparisons between JVM and WebAssembly compilation approaches #### Fallac <!-- deep-read:sections end -->