6 ms·
I have a question, how come people do not use Dart in place of this? It runs on the server, it is a typed language, it's faster than v8 javascript (since that
by syspec 5y ago
I have a question, how come people do not use Dart in place of this?
It runs on the server, it is a typed language, it's faster than v8 javascript (since that is part of the reason for it's existence to eek out more performance)
From what I've seen it can be distributed very as well, and your app is self contained ala Go.
---
So my question is, why don't more people use Dart where they would use a "Node + 'Typescript compiled to JS'" combination, which seems like it has a lot of headaches once your project grows in size
- mixedCase 5y agoDart is an extremely limited language compared to TypeScript (it doesn't even have sum types), and has access to a much smaller ecosystem. Its runtime isn't much better either, like for example Go's or Haskell's is. Deno has a partial implementation of Node's API, and even without it it's still the same underlying runtime concepts, so porting is easier than porting to another language like Dart.
- s_tec 5y agoIf your team has invested a lot of time & energy into mastering the Javascript ecosystem (including things like Typescript), it makes sense to use the same language on the server side as well. Server machines are cheaper than good developers, especially if you can share resources between the backend & frontend. As for Deno specifically, it's definitely closer to the "browser" way of doing things than Node is, which is super attractive. The main reason to stick with Node is the huge library ecosystem, but Node itself feels kinda weird & old, since the language has moved in a different direction while Node has remained stagnant (poor support for promises & ES modules, for instance).
- inbx0 5y agoHow come more people don't use ReasonML in place of this? It runs as OCaml on the server, it is a typed language, it's faster than v8 JavaScript. Or F#? Not a fan of the functional? Then maybe Kotlin? Nim? No? There are a ton of great languages out there, many arguably better than TS in many ways. But for a language to be popular, being great is not enough. I'm not sure what it is that makes TS so popular, but I am pretty sure that you have to look past mere language qualities for it.
- syspec 5y agoWell in this case, the Dart VM and V8 are a made by the same people. That's why I asked.
- spartanatreyu 5y agoOne major thing to consider when thinking about replacing JS with another language: All JS already works inside TS so it's really easy to slowly transition your project over time between the two languages without losing any functionality or needing to take time off to make the transition. In practice this means, new code can just be written with TS and any existing code updates can be made in TS. After that you can decide whether to even touch the remaining JS which still works.
- oscargrouch 5y agoBecause Typescript eventually won that race? (The race to be a fine, typed and sane counterpart to Javascript). Somehow Typescript convinced people from the Javascript side of the fence that they could mix both and eventually upgrade from it. While Dart also tried the same feat, it failed doing so. Nowadays Dart is only being considered to anything because the team behind it are top-notch and implemented themselves a platform where Dart could be the king. Giving their talent they were able to create a great platform, where they would made even more success if they used Javascript or Typescript as a development language. But giving they wanted to save all their years of work on Dart, and giving its not a bad technology per-se, it just had a adoption problem, Dart lives on Flutter. If you want to use Flutter go for Dart, but picking Dart to anything outside Flutter will just alienate the developer crowd as giving even Typescript is some sort of a niche language in terms of adoption, nevermind forcing people to learn Dart.
- m00x 5y ago> Because Typescript eventually won that race? (The race to be a fine, typed and sane counterpart to Javascript). Dart is doing fine, I'm not sure what race you're talking about? > If you want to use Flutter go for Dart, but picking Dart to anything outside Flutter will just alienate the developer crowd as giving even Typescript is some sort of a niche language in terms of adoption, nevermind forcing people to learn Dart Dart is incredibly similar to Javascript/Typescript. You can learn it over a weekend + lookups in Google whenever you see a difference. Your points are extremely weak.
- graftak 5y agoAs is the dart type system compared to that of typescript.
- oscargrouch 5y agoWhere you were in 2012? Dart was heavily marketed as a Javascript successor by Google, this was even before ES5 changes, so Javascript was a even weaker language in terms of design, giving people were doing more and more full applications in the language. The problem is, Javascript did a catch-up, and the Typescript technique of compiling to Javascript made it more appealing as a successor, not mentioning the design of the language (I know that Dart had this too, but having its own JIT it were more appealing in terms of speed back then). Meanwhile Google abandoned the project that would allow the Dart VM and bindings to WebKit to coexist with V8. And now that only the Dart-to-JS path could be followed to develop for the Web, Typescript championed this path as it was the only way for them from the beggining. So if you were following those events, you would know what sort of race i was talking about. I agree with you that "Dart is doing fine", but is only doing so because of Flutter. As in, people learn Dart to target Flutter, not the other way around. Im not implying that Dart is a bad language, or technology, because thats not true. Its only a problem of adoption, and it will have a hard time outside of the Flutter bubble. If it were not for Flutter, Dart would continue is path to a slow death, not because its a bad language or technology, but because of how the events turned out to be, and a little bad luck.
- jitl 5y agoDart has nothing to offer over other languages, and a lot of deficiencies. Why not use Kotlin? It's like Dart, but has a much bigger ecosystem.
- hannofcart 5y agoI have only seen Dart code in Flutter code bases, and my comment here might be the result of incomplete knowledge. However, from what I can see, Dart seems to resemble the Java way of doing things a lot. Specifically, the over-use of is-a inheritance. Just scrolling through the list of examples in the Flutter samples directory illustrates this point. https://github.com/flutter/samples https://github.com/flutter/samples Use of inheritance seems to be the canonical way of doing things in Flutter and it seems to permeate the code base, both in the use of core Flutter APIs as well as associated library ecosystem. I find them rather hard to read and reason about. It's easy to be a bit confused on encountering a function in an object that inherited the function from a superclass 3 levels up in the hierarchy. To be clear, I completely recognize that it's unfair of me to attribute to Dart (the language) issues/patterns I see with a library/framework ecosystem (Flutter). But this is mitigated by the fact that Flutter is by far what the lion's share of Dart code is written for today. Please correct me if I'm wrong.
- jonathanaird 5y agoThe canonical way of doing things in Flutter is composition NOT inheritance. This is the whole point of Widgets. Inheritance is used in ways that generally make sense and don’t result in huge complex inheritance trees.
- hajile 5y agoDart has top-level, first-class functions that don't require wrapping everything in a class. It then proceeds to waste this by wrapping everything up into classes and hoping nobody will use inheritance.
- jonathanaird 5y agoWidgets are essentially data classes, simple wrappers for configuration information. They need to be classes because of the way the internals of the framework works. And no one is hoping you don’t use inheritance. The recommended style is very clear. You’re free to do things however you want but you have to take responsibility for doing things in a weird way.