We are done with NNBD transition for a few years now. Dart 2.12 (released March 2021) introduced null-safety. That started a 2 year transitionary period during which you could mix nullsafe (language versions 2.12 or…
At some point in my life (when I briefly worked on LuaJIT for DeepMind) I have written a stack walker which can stitch together native and Lua frames: for each native stack frame it checks if that is actually an…
> - it is truly native, in the sense I can directly talk to native APIs on each platform without going through bridging code and there's no special runtime I thought Compose Desktop is running on JVM an renders through…
> The fact that I can’t then immediately go Who said you can't? :) This actually works in Dart: Dog? dog; bool isDog = dog is Dog; if (isDog) { dog.bark(); } i.e. boolean variables which serve as witnesses for type…
The reason why languages promote variable types based on control flow is because developers en masse actually expect that to happen, e.g. facing the code like Dog? maybeDog; if (maybeDog != null) { maybeDog.bark(); } If…
In Dart 3 you have patterns and sealed class families to achieve that. See my comment above[1]. The syntax is unfortunately more verbose, but if all goes well we will address that issue this year. [1]:…
In Dart 3 instead of declaring the variable and then comparing you can simply write an if-case pattern: if (value case final value?) { // value is a fresh final variable }
In Dart you use class hierarchies instead, rather than enums (which in Dart are way to define a compile time constant set of values). So the original example becomes: sealed class MySomething<T> { } final class One…
> Dart+Flutter look promising until you notice that they run Skia WASM inside the dart VM which itself runs in WASM which runs inside a JS VM and performance is abysmal. That's not how Flutter works on either of the…
[disclaimer: I work on Dart, though not on the language team] With primary constructors this will become something along the lines of: sealed class Message(); class IncrementBy(final int value) extends Message; class…
> it was built on top of v8 Was never built on top of V8 in any shape of form. Dart VM does not even share any code with V8. Dart 1 was designed by people who originally started V8 (Lars Bak and Kasper Lund), that's the…
Dart does not have arrays, it has lists. Try replacing "Dart array" with "Dart list" instead.
It would be interesting to see 1-1 comparison with LuaJIT interpreter _without corresponding runtime changes_. That would given a meaningful baseline for how much you potentially loose/gain using this approach. Current…
> The JIT still performs better, but the AOT code starts up faster. I should update that side note because a lot of things has changed. It should probably say something like: > Theoretically, Dart VM JIT should have…
The extension has recently reached Stage 2 - most of the questions around type system have been resolved. V8 has a working implementation. We have build `dart2wasm` compiler targeting this and it shows good numbers.
> what's interesting is that static typing buys you somewhat minimal gains in performance. There are a lot of caveats here. You could potentially claim "minimal gains in peak performance if you can apply adaptive JIT…
We are planning to fix it some time in the future, we really only expected moderate usage of `dart2native` and only on Linux. Turns out that there is demand for using it all over the place, which includes Mac and…
[I work on Dart VM team] `dart2native` just concatenates two binaries together: AOT runtime binary and AOT snapshot binary. AOT snapshot is an ELF binary which contains native code generated from your original Dart…
> 2. Dart has optional typing, which is to say it supports type hints but is essentially dynamically rather than statically typed. Dart has not been optionally typed since Dart 2 (released in 2018).
The operator itself would throw an error. Dart is planning to have a sound non-nullability which means that if something has static type `SomeType` then it is guaranteed to be a value that is actually `SomeType` and not…
It's a non-null assertion operator which would throw an error if `e1 == null`.
[disclaimer: I work on Dart team] Short answer: there are a lot of different editors in the world, but Dart team is not large enough and does not posses necessary expertise to develop top-notch integration with all of…
In the two experiments that we did LLVM brought only marginal benefits so we could not warrant the huge dependency and associated maintenance costs. We already have a good compilation pipeline, which was developed for…
DDC stands for Dart Development Compiler. It is a fast modular compiler that you use for quick edit&refresh development in the browser. It does not do any global optimizations, unlike dart2js - which is what you use for…
It's actually the very same main.dart.js (dart2js compiler does not have ability to target a specific browser, its output is supposed to work in every supported browser). 359kb is its compressed size, 990k is its…
We are done with NNBD transition for a few years now. Dart 2.12 (released March 2021) introduced null-safety. That started a 2 year transitionary period during which you could mix nullsafe (language versions 2.12 or…
At some point in my life (when I briefly worked on LuaJIT for DeepMind) I have written a stack walker which can stitch together native and Lua frames: for each native stack frame it checks if that is actually an…
> - it is truly native, in the sense I can directly talk to native APIs on each platform without going through bridging code and there's no special runtime I thought Compose Desktop is running on JVM an renders through…
> The fact that I can’t then immediately go Who said you can't? :) This actually works in Dart: Dog? dog; bool isDog = dog is Dog; if (isDog) { dog.bark(); } i.e. boolean variables which serve as witnesses for type…
The reason why languages promote variable types based on control flow is because developers en masse actually expect that to happen, e.g. facing the code like Dog? maybeDog; if (maybeDog != null) { maybeDog.bark(); } If…
In Dart 3 you have patterns and sealed class families to achieve that. See my comment above[1]. The syntax is unfortunately more verbose, but if all goes well we will address that issue this year. [1]:…
In Dart 3 instead of declaring the variable and then comparing you can simply write an if-case pattern: if (value case final value?) { // value is a fresh final variable }
In Dart you use class hierarchies instead, rather than enums (which in Dart are way to define a compile time constant set of values). So the original example becomes: sealed class MySomething<T> { } final class One…
> Dart+Flutter look promising until you notice that they run Skia WASM inside the dart VM which itself runs in WASM which runs inside a JS VM and performance is abysmal. That's not how Flutter works on either of the…
[disclaimer: I work on Dart, though not on the language team] With primary constructors this will become something along the lines of: sealed class Message(); class IncrementBy(final int value) extends Message; class…
> it was built on top of v8 Was never built on top of V8 in any shape of form. Dart VM does not even share any code with V8. Dart 1 was designed by people who originally started V8 (Lars Bak and Kasper Lund), that's the…
Dart does not have arrays, it has lists. Try replacing "Dart array" with "Dart list" instead.
It would be interesting to see 1-1 comparison with LuaJIT interpreter _without corresponding runtime changes_. That would given a meaningful baseline for how much you potentially loose/gain using this approach. Current…
> The JIT still performs better, but the AOT code starts up faster. I should update that side note because a lot of things has changed. It should probably say something like: > Theoretically, Dart VM JIT should have…
The extension has recently reached Stage 2 - most of the questions around type system have been resolved. V8 has a working implementation. We have build `dart2wasm` compiler targeting this and it shows good numbers.
> what's interesting is that static typing buys you somewhat minimal gains in performance. There are a lot of caveats here. You could potentially claim "minimal gains in peak performance if you can apply adaptive JIT…
We are planning to fix it some time in the future, we really only expected moderate usage of `dart2native` and only on Linux. Turns out that there is demand for using it all over the place, which includes Mac and…
[I work on Dart VM team] `dart2native` just concatenates two binaries together: AOT runtime binary and AOT snapshot binary. AOT snapshot is an ELF binary which contains native code generated from your original Dart…
> 2. Dart has optional typing, which is to say it supports type hints but is essentially dynamically rather than statically typed. Dart has not been optionally typed since Dart 2 (released in 2018).
The operator itself would throw an error. Dart is planning to have a sound non-nullability which means that if something has static type `SomeType` then it is guaranteed to be a value that is actually `SomeType` and not…
It's a non-null assertion operator which would throw an error if `e1 == null`.
[disclaimer: I work on Dart team] Short answer: there are a lot of different editors in the world, but Dart team is not large enough and does not posses necessary expertise to develop top-notch integration with all of…
In the two experiments that we did LLVM brought only marginal benefits so we could not warrant the huge dependency and associated maintenance costs. We already have a good compilation pipeline, which was developed for…
DDC stands for Dart Development Compiler. It is a fast modular compiler that you use for quick edit&refresh development in the browser. It does not do any global optimizations, unlike dart2js - which is what you use for…
It's actually the very same main.dart.js (dart2js compiler does not have ability to target a specific browser, its output is supposed to work in every supported browser). 359kb is its compressed size, 990k is its…