https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
webassembly
  • e

    ESchouten

    10/21/2020, 7:00 PM
    Good progress is being made on Kotlin/WASM 👏🏻 https://github.com/JetBrains/kotlin/commit/35baa8d6453469516cfef34c85f7d16794843841 https://github.com/JetBrains/kotlin/commits/rr/skuzmich/wasm https://github.com/JetBrains/kotlin/pull/3859
    🕵️‍♂️ 5
    🎉 16
    b
    • 2
    • 1
  • h

    hikamaeng

    10/23/2020, 1:35 PM
    Hi, Can I convert .klib to .wasm? (in intelliJ as possible)
    a
    b
    • 3
    • 7
  • f

    Frankablu

    11/23/2020, 12:12 AM
    Hi, I've got a Kotlin/JVM program which I would like to port to wasm. What's wrong with the deprecated version? When's the new version coming out? Would I be better compiling to JS in the mean time? (Even if I go offline I'll be back online tomorrow)
    g
    b
    • 3
    • 8
  • a

    Ananiya

    12/04/2020, 11:07 AM
    Hello 👋, I have few confusion here.:blob-nervous: 1. Is the new kotlin/wasm (not via llvm) tends to be the fastest of all even when compared to jvm or slow ? 2. Are any plans to add new build system which runs on wasm or use gradle? :blob-smile:
    b
    s
    j
    • 4
    • 7
  • p

    pabl0rg

    12/19/2020, 12:06 PM
    Hi, does anyone here know if something like Perceus (reference counting) would work in Kotlin for Wasm? https://www.microsoft.com/en-us/research/uploads/prod/2020/11/perceus-tr-v1.pdf
    s
    • 2
    • 4
  • r

    Robert

    03/04/2021, 1:08 PM
    @bashor I saw your announcement (https://discuss.kotlinlang.org/t/state-of-webassembly-in-kotlin/18348); how are things coming along since then? Or if @udalov @Svyatoslav Kuzmich [JB] can better answer it, or someone else, also okay. Don’t know how to ask actually :-)
    e
    s
    t
    • 4
    • 4
  • k

    kailan

    04/16/2021, 2:07 PM
    Hey team, is there a roadmap for the new Kotlin/Wasm compiler backend, or is just a case of “it will be ready one day”?
    b
    d
    +2
    • 5
    • 15
  • k

    kailan

    04/16/2021, 5:10 PM
    This question still stands if anyone is able to shed some light:
    j
    • 2
    • 1
  • b

    bashor

    05/20/2021, 2:21 PM
    Feel free to apply and please help us to spread the message 😉 https://twitter.com/bashorov/status/1395383088599998466
    👍 3
    :kotlin-intensifies: 4
    🔥 6
    s
    • 2
    • 1
  • k

    kailan

    05/20/2021, 2:48 PM
    I’m not familiar with Kotlin’s development process…. will this new compiler backend be developed in the open or will it be private until finished?
    s
    • 2
    • 2
  • d

    Dmitry Romanov [JB]

    06/23/2021, 9:16 AM
    https://blog.scottlogic.com/2021/06/21/state-of-wasm.html
    👀 3
    a
    j
    n
    • 4
    • 6
  • s

    sdeleuze

    07/18/2021, 4:07 PM
    It would be nice to mention Kotlin/Wasm in https://github.com/appcypher/awesome-wasm-langs#kotlin-top even if not yet properly released, just to raise awareness. https://webassembly.org/getting-started/developers-guide/ should probably be updated when the first release will be available as well.
    b
    • 2
    • 1
  • f

    ftomassetti

    07/25/2021, 8:06 AM
    Is there any plan to have the possibility to compile Kotlin code to wasm file using wasi which I can run with wasmtime and similar?
    s
    • 2
    • 2
  • s

    sdeleuze

    07/25/2021, 8:02 PM
    Any take on this from a Kotlin perspective ? https://twitter.com/assemblyscript/status/1419110937261449216?s=21
    n
    a
    s
    • 4
    • 24
  • s

    sdeleuze

    07/28/2021, 7:05 AM
    Interesting to see Dart starting to support Wasm as well https://medium.com/dartlang/experimenting-with-dart-and-wasm-ef7f1c065577
    👍 7
    :thank-you: 1
    n
    g
    • 3
    • 5
  • e

    ESchouten

    08/12/2021, 7:45 PM
    No idea if someone finds this interesting, however A big WASM PR got merged in master today - https://github.com/JetBrains/kotlin/pull/3859 Last month WASM Garbage collector milestone 3 PR got merged - https://github.com/JetBrains/kotlin/commit/a468792 I wonder if someone could get some demo project working (for shits and giggles, no high expectations) Perhaps based on an 8 month old Kotlin WASM project by @Svyatoslav Kuzmich [JB] https://github.com/skuzmich/kotlin-wasm-benchmarks
    💪 1
    👀 4
    :thank-you: 8
    👍 1
    :kotlin-intensifies: 1
    b
    • 2
    • 2
  • r

    Robert

    08/31/2021, 10:17 PM
    Is there any update on the current state? Any alpha release?
    👀 9
    s
    • 2
    • 1
  • s

    Sam

    09/10/2021, 3:32 PM
    Is Kotlin’s WASM backend going to include a garbage collector or is the WASM GC spec finally moving?
    a
    s
    • 3
    • 2
  • a

    Arslan Armanuly

    09/24/2021, 7:44 PM
    WASM backend when?😡
    s
    d
    • 3
    • 6
  • s

    Svyatoslav Kuzmich [JB]

    09/24/2021, 8:25 PM
    Hi people! Would anyone like to share what applications you would be interested in developing using Kotlin/Wasm? My initial guess is that it could become a good fit for sharing domain logic using multi-platform and/or building client-heavy web apps. I would like to know what you think.
    a
    m
    +8
    • 11
    • 13
  • e

    ESchouten

    10/06/2021, 9:59 PM
    The latest Kotlin 1.6.20 devbuilds contain wasm as multiplatform target! https://github.com/JetBrains/kotlin/blob/master/libraries/tools/kotlin-gradle-plug[…]src/test/resources/testProject/new-mpp-wasm-js/build.gradle.kts
    :kotlin-flag: 1
    :thank-you: 2
    🕵️‍♂️ 5
    :kotlin-intensifies: 28
    👀 8
    😍 1
    n
    d
    • 3
    • 2
  • b

    Big Chungus

    10/21/2021, 2:54 PM
    I was hoping to see some kjs kwasm interop
    s
    r
    • 3
    • 9
  • t

    tunedal

    10/21/2021, 4:40 PM
    How much does the Wasm backend improve the size of the generated code compared to the JS IR backend?
    s
    t
    • 3
    • 7
  • d

    Deactivated User

    10/21/2021, 5:29 PM
    Despite it was a bit short, really nice presentation. Congratulations 👏 Is it possible to try out the WASM compiler right now in an easy way? Like adding a maven repo, and specifying a Kotlin version? Would get feedback / bug reports at this time be useful, or it is in early stages?
    s
    e
    • 3
    • 2
  • s

    sdeleuze

    10/24/2021, 2:26 PM
    Congrats for the presentation, I am wondering if you plan to provide interop with other WASM modules without JS being involved. For example, provide the ability to use WASI modules published on https://wapm.io/. I think of use cases like being able to use a crypto library developed in Rust and published via WASM interop (here WASI) and be able to use it from Kotlin/Wasm.
    👀 7
    s
    • 2
    • 1
  • n

    napperley

    12/12/2021, 4:43 AM
    Lets say hypothetically Kotlin WASM gains the ability to port a Kotlin Native library (incl ones that provide a Kotlin binding to a C library) over to the platform. How would the porting process work? This hypothetical situation came about out of what was done with Rust and the LVGL ( https://lvgl.io/ ) library to port it to WASM ( https://forum.lvgl.io/t/rust-bindings-for-littlevgl/2386/12 ).
    s
    b
    • 3
    • 16
  • n

    napperley

    12/14/2021, 12:02 AM
    I have some questions about WASM interop: 1. Will K/W eventually support having bi-directional WASM module interop ( https://developers.google.com/web/updates/2018/03/emscripting-a-c-library )? 2. Are WASM Interface Types separate from WASM modules? 3. With C libraries (eg LVGL: https://lvgl.io/ ) would WASM modules be the way to go with WASM interop for K/W? 4. What is next on the K/W roadmap for WASM interop? 5. Are there any future plans to provide a viable path for porting K/N libraries (that act as a Kotlin binding to a C library) to K/W?
    s
    • 2
    • 7
  • n

    napperley

    12/14/2021, 2:11 AM
    Will be very interesting to see what happens with LVGL since it might pave the way for how C libraries are ported to WASM: https://forum.lvgl.io/t/support-for-wasm-backend/7584
    • 1
    • 1
  • n

    napperley

    12/17/2021, 11:44 PM
    Which WASM runtime(s) will K/W support?
    s
    • 2
    • 21
  • g

    Glen

    12/22/2021, 7:14 PM
    Hello here. Just found something interesting: Wasm modules being translated to C. Source: https://github.com/turbolent/w2c2
    n
    s
    a
    • 4
    • 11
Powered by Linen
Title
g

Glen

12/22/2021, 7:14 PM
Hello here. Just found something interesting: Wasm modules being translated to C. Source: https://github.com/turbolent/w2c2
cc @napperley
n

napperley

12/22/2021, 10:08 PM
Unusual considering that developers normally do it the other way round.
What are the use cases for converting WASM modules to C?
s

Svyatoslav Kuzmich [JB]

12/22/2021, 11:26 PM
I guess it could be useful as a step of AOT compilation. C can be compiled to any target and has many mature optimising compilers.
Played around with it a little bit. It seems to skip memory sandboxing, OOB loads cause segfaults.
a

Arkady Bazhanov

12/23/2021, 9:16 AM
Firefox does this as a sandboxing technique: https://hacks.mozilla.org/2021/12/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/
Rather than hoisting the code into a separate process, we instead compile it into WebAssembly and then compile that WebAssembly into native code. This doesn’t result in us shipping any .wasm files in Firefox, since the WebAssembly step is only an intermediate representation in our build process.
We accomplished this with wasm2c, which performs a straightforward translation of WebAssembly into equivalent C code, which we can then feed back into Clang along with the rest of the Firefox source code. This approach is very simple, and automatically enables a number of important features that we support for regular Firefox code: profile-guided optimization, inlining across sandbox boundaries, crash reporting, debugger support, source-code indexing, and likely other things that we have yet to appreciate.
n

napperley

12/24/2021, 12:53 AM
Essentially the C compiler is being used apply optimisations, provide debugging and other tool support, before the code is converted to WASM again. One wonders why the optimisations aren't being applied at the WASM level.
s

Svyatoslav Kuzmich [JB]

12/24/2021, 9:27 AM
I though C from tools like w2c2 is meant to be compiled to Native code. Converting code to Wasm multiple times in the build chain could accumulate the Wasm overhead. Do you know anyone doing this?
a

Arkady Bazhanov

12/24/2021, 11:21 AM
before the code is converted to WASM again
No, it’s not. It’s compiled to native code and shipped as part of Firefox. This is not about WASM support in Firefox, this is about Firefox team using WASM internally as an intermediate step to achieve sandboxing for different parts of the Firefox itself (like parsers and such), which interact with user data.
n

napperley

12/24/2021, 10:14 PM
Very odd considering that Firefox on Linux can be installed as a FlatPak or Snap package, which has a built-in sandbox (an isolated container). Other OS's may have a similar self contained packaging format.
s

Svyatoslav Kuzmich [JB]

12/24/2021, 11:13 PM
I think it is more about sandboxing subsystems within Firefox so that bug in one subsystem would not cause vulnerability in the other.
➕ 1
View count: 4