4 ms·
Is it possible to work with Flutter using Typescript, or is it Dart only? It really feels like Typescript won the war to be something of a JS replacement a lon
by GordonS 8y ago
Is it possible to work with Flutter using Typescript, or is it Dart only?
It really feels like Typescript won the war to be something of a JS replacement a long time ago - I like the look of Flutter, but I really don't want to learn another language that I won't use for anything else.
BTW, I realise Dart is likely similar to Typescript in many respects, and I wouldn't expect a big learning curve - but I already have enough languages under my belt and don't want anything else to add to the occasional syntax confusion I get.
- mraleph 8y ago> Is it possible to work with Flutter using Typescript, or is it Dart only? You might be thinking that Flutter underneath is using JavaScript - to which Dart compiles. However this is not how Flutter works, there is no JavaScript involved anywhere in the stack. Dart is its own language - and it can run natively, unlike TypeScript - which is just a type system over JavaScript and needs to be compiled to JavaScript to actually run. So no, you can't use TypeScript with Flutter.
- shalabhc 8y agoRandom Dart question - how is the standalone Dart VM implemented? What is it written in, is there a bytecode, etc? And is there a place where more details are available?
- mraleph 8y agoDart VM is written primarily in C++. There is bytecode, but the story here is kinda complicated - there are actually 2 different versions: one is called DBC and is used during development of Flutter applications on iOS, there is another called KBC - that one is more like a classical bytecode, it is currently in development. > And is there a place where more details are available? You can get some high level information at https://mrale.ph/dartvm https://mrale.ph/dartvm Let me know if you want to know something special.
- markdog12 8y ago> there is another called KBC - that one is more like a classical bytecode, it is currently in development I haven't heard of this. Why another bytecode version? Increased performance?
- mraleph 8y agoDBC 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... itself. An optimizing JIT in DBC mode would generate optimized DBC bytecodes, not native code. This all kinda makes sense in the environment for which DBC was created - iOS, where you can't JIT. However in environment where you can generate native code this makes no sense - and even prevents you from reaching peak performance. KBC is an experiment in this space where you have a more classical interpreter which tiers up into native JIT. In KBC mode bytecodes are also given to VM rather than generated internally inside the VM like DBC does. Theoretically KBC should have better startup latency than just JIT (because you can start executing code immediately, rather than spending time to generate native code) and peak performance that matches JITs - because it tiers up into JIT.
- markdog12 8y agoInteresting, thx. I assume K = Kernel?
- GordonS 8y agoAh, I didn't realise that - I guess that puts the kybosh on the possibility of Typescript :)