Dart 3.4: WASM and Macros preview
60 points by markdog12 1 year ago | 20 comments- blopker 1 year agoWhile this release is more about bug fixes, with no stable features, I'm so excited for macros. Dart is an amazing language, but the json story is way too weak for a modern ecosystem.
Dart is my favorite language right now. The tooling is incredible because they learned from Go's success. Because it compiles to native, it's great for CLI programs. It can also ship as a single binary for servers.
It's good at so many things, but it's not the best at any one thing. I think that's why it hasn't gotten the same usage as other languages.
- leecommamichael 1 year agoI enjoyed writing Dart in my last role. Supposedly Go was developed as a better C++ for networked apps. Dart feels like the same goal for GUIs. The language authors even bothered to copy the syntax/semantics of initializer-lists on constructors.
- Alifatisk 1 year agoI enjoy Dart, I just wish they had support for cross-compilation.
- Alifatisk 1 year ago
- josephg 1 year agoI’m excited to see wasmgc in the browser - which should let a lot more languages compile to small, fast webassembly bundles.
What’s the state of wasmgc? Is it supported by the major browsers yet? How big are dart apps compiled to wasm?
- markdog12 1 year ago> What’s the state of wasmgc? Is it supported by the major browsers yet?
https://docs.flutter.dev/platform-integration/web/wasm#backg...
> Chromium and V8 released stable support for WasmGC in Chromium 119. Note that Chrome on iOS uses WebKit, which doesn't yet support WasmGC. Firefox announced stable support for WasmGC in Firefox 120, but currently doesn't work due to a known limitation.
You can also check here: https://webassembly.org/features/
> How big are dart apps compiled to wasm?
I just did `dart compile wasm main.dart -O4` with an empty dart file and got a 68k wasm file. That gzip's to 24K.
- markdog12 1 year ago
- 1 year ago
- troupo 1 year agoIt's somewhat weird to see Dart still chugging along. A language that cannot figure out what it's for.
Was it a better Javascript? Oh, old history
Was it just a failed project that Google Analytics team used? Oh, old history
It's for Flutter and app development? Not anymore
It's native cross-platform compiled language for apps and backend with a hodgepodge of features haphazardly thrown in? Yes, for now.
- hgyjnbdet 1 year agoI quite like the language and hope it continues to chug along. As a beginner who wanted to create a cross platform app it was a no brainer for me over the ever increasing amount of web frameworks, or writing the same app in multiple native languages.
Might be my ignorance as a beginner but I don't see a hodgepodge of haphazard features, but the beginning of a true cross platform language.
- isoos 1 year agoWhy do you think it must be one thing or the other? It can be better than Javascript, used for Flutter and app development, and also cross-platform compiled and used for backend.
- markdog12 1 year agoWas it a better Javascript? Yes.
Was it just a failed project that Google Analytics team used? No.
It's for Flutter and app development? It's a general-purpose programming language.
It's native cross-platform compiled language for apps and backend? It's a general-purpose programming language with multiple compilation targets, including native.
hodgepodge of features haphazardly thrown in? Certainly not.
- jimbob45 1 year agoDart beat TypeScript to existence by a solid year. The web should run on Dart right now but Google fumbled the ball.
Web search was synonymous with Google until they enshittified their product to irrelevancy a few years back. Where once using Bing was unthinkable, several of my coworkers now happily use it.
They then proceeded to fumble the incredible lead they had with AI just a few years ago. At this point, I wouldn't be surprised if they let their Chrome monopoly slip through their fingers as well.
It's ridiculous how Google's BoD hasn't axed everyone in a leadership role at that company given how many gems they've let slip through their fingers.
- satvikpendem 1 year ago> The web should run on Dart right now but Google fumbled the ball.
It's clear you didn't see the fervor around this around a decade ago [0][1], as it was universally panned as a move that would only strengthen Google's browser monopoly (as if sites started using more Dart, other browsers would have no choice but to add in Dart support). Personally I am very glad that we don't have a built-in Dart compiler in the browser, compile to JS languages are more flexible and now we have an even more robust and even-handed solution in the form of WASM, as now any language can compile to an open standard, not just Dart (which also has WASM support now).
Another argument in favor of not having Dart in Chrome is allowing its development to be much more flexible, as this article shows, rather than being hampered by the standards committee [2].
[0] https://news.ycombinator.com/item?id=3600874
- hgyjnbdet 1 year agoWhilst I can agree mostly with your last three points I don't think any company, even apple, could at this point replace JavaScript on the web. It's too ingrained. Sure there's typescript but that's not a whole sale replacement, the end result is still JavaScript.
- jimbob45 1 year agoDart’s JS VM was reportedly faster than vanilla JS. It could have wholesale replaced JS if Google had really leaned into it.
- jimbob45 1 year ago
- troupo 1 year agoEarly Dart was a significantly worse language even compared to early Typescript. And remained so for a very long time.
Plus what the sibling comment said about Google monopoly.
- satvikpendem 1 year ago
- TobTobXX 1 year ago> It's for Flutter and app development? Not anymore
What do you mean?? Did you read the article, because it is clearly about Dart and Flutter.
- troupo 1 year agoI meant that now it's backend, and frontend, and apps, oh my.
- thayne 1 year agoI assume it is a reference to Google laying off all their dart and flutter engineers [1]. So I'm not sure who is still maintaining either project.
[1]: https://techcrunch.com/2024/05/01/google-lays-off-staff-from...
- satvikpendem 1 year agoThis is wrong, they didn't lay off core developers on the Dart or Flutter teams, only some devops people maintaining infrastructure for them.
- isoos 1 year agoClearly not all, that would be a different announcement.
- satvikpendem 1 year ago
- troupo 1 year ago
- 1 year ago
- hgyjnbdet 1 year ago