RU version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
83% Positive
Analyzed from 854 words in the discussion.
Trending Topics
#wasm#kotlin#playground#cool#hand#compiler#dart#pass#writing#doesn

Discussion (25 Comments)Read Original on HackerNews
> hands off to two of its own IRs before writing WASM-GC by hand
So it's not "one pass" lol. Do you know what a pass is?
Not that it matters - this AI is claiming "one pass" as though that's a good thing, but it's usually not. One-pass compilers can't typecheck forward references.
"The frontend — lexer, parser, semantic analysis (it’s called mkf) — hands off to two of its own IRs before writing WASM-GC by hand."
So those frontend tools do the writing, not the developer?
That's not "by hand". One might say "writes WASM-GC directly". But no that also doesn't happen, it goes through an IR first?
Personally I wouldn't put too much trust in a developer that even can't get their terminology correct. Well either that or I foobar'd my understanding of the writeup?
Anyway, looks like an interesting project.
Is the expectation that people write kotlin in their browser? How do people work this into their development workflow? Is this just a neat demo?
(The program builds as-is in the Kotlin Playground, at least for the JVM platform; the other platforms don't seem to have kotlinx.coroutines available.)
[1] https://github.com/JetBrains/kotlin-playground
Oh didn’t know that! What is the best for ”compiles to wasm in browser” featureset?
Note the JetBrains playground includes features that are actually useful for a code playground, letting you configure compiler version and flags, which is likely more relevant than a faux-IDE UI for the use cases people use playgrounds for. It also supports importing packages, while this doesn't. This doesn't seem like a human even attempted to use it for anything, otherwise they would have realised how lacking it is. Unfortunately it seems like people who prompt slop can't be bothered to dogfood it... or maybe pigfood it?
"From scratch in C" means literally nothing here. LLMs can output C too. It may or may not be safe, efficient C, but writing C that compiles is trivial. Prompting "write it in C" poses no greater difficulty than any other language.
The official Kotlin playground uses WASM, for example (JVM drop down-> choose "WASM")
https://play.kotlinlang.org
I'd challenge the 'by hand' assertion though.
also check out his similar work, https://miniswift.run/ which has the same issues.
- repo: https://github.com/modulovalue/dart-live
- demo: https://modulovalue.com/dart-live/
It's on my todo list to support compiling dart code through the wasm bundle to wasm directly. Right now it's running the dart arm simulator on the web because it supports hot reload.
I'm wondering if there are any cool use-cases that motivate having the compiler itself run in wasm. I did it mostly for fun and besides building tooling for compiler developers themselves or IDEs, I can't come up with much.
There was one guy that wanted a sandboxed environment for agents as he couldn't find anything else. A few other people used the dart live project to build playgrounds for their own packages.
Who's the target audience for minikotlin? I'm just curious.
In any case, cool project, thanks for sharing!