Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mraleph
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
mraleph
1mo ago
No, we (Dart team) recommend to deploy everything in AOT mode. JIT mode is only for development, and its performance has not been a priority for a while now.
2.
▲
by
mraleph
11mo ago
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 above) and non-nullsafe
3.
▲
by
mraleph
2y ago
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 interpreter frame or a trace
4.
▲
by
mraleph
2y ago
> - 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 Swing/AW
5.
▲
by
mraleph
3y ago
> 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 witn
6.
▲
by
mraleph
3y ago
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(); }
7.
▲
by
mraleph
3y ago
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]: https://news.ycombinator.co
8.
▲
by
mraleph
3y ago
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 }
9.
▲
by
mraleph
3y ago
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 exte
10.
▲
by
mraleph
3y ago
> 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 platforms it sup
11.
▲
by
mraleph
3y ago
[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 Decreme
12.
▲
by
mraleph
4y ago
> 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 only connect
13.
▲
by
mraleph
4y ago
Dart does not have arrays, it has lists. Try replacing "Dart array" with "Dart list" instead.
14.
▲
by
mraleph
4y ago
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 measurement pres
15.
▲
by
mraleph
4y ago
> 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 best peak performa
16.
▲
by
mraleph
4y ago
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.
17.
▲
by
mraleph
4y ago
> 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 compila
18.
▲
by
mraleph
6y ago
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 Windows and requires things
19.
▲
by
mraleph
6y ago
[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 code. The approach is not
20.
▲
by
mraleph
6y ago
> 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).
21.
▲
by
mraleph
7y ago
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 something else. Thus
22.
▲
by
mraleph
7y ago
It's a non-null assertion operator which would throw an error if `e1 == null`.
23.
▲
by
mraleph
7y ago
[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 them. So it makes sens
24.
▲
by
mraleph
7y ago
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 the JIT mode and we us
25.
▲
by
mraleph
7y ago
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 deployment. If y
26.
▲
by
mraleph
7y ago
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 uncompressed size. Fir
27.
▲
by
mraleph
7y ago
There is some information at https://mrale.ph/dartvm/ but there is nothing really comprehensive right now.
28.
▲
by
mraleph
7y ago
> but it also compiles to ARM binary via LLVM for iOS applications [disclaimer: I am TL for Dart Native Compilers] We currently don't use LLVM for compiling Dart to native and we actually never used it in production - though we pr
29.
▲
by
mraleph
7y ago
DBC is an interesting beast, the way it was implemented in Dart VM was not like a normal interpreter (e.g. you interpret and then you tier up into JIT which generates native code), but kinda like a pseudoarchitecture. DBC tiers up into... i
30.
▲
by
mraleph
7y ago
Dart was actually really opinionated right from the start. Type annotations that has no bearing on execution; reified generics and dynamic typing at the same time; mirrors and noSuchMethod... even having semicolon - as opposed to not having
More ›