8 ms·
Ah Flutter. I burned a month making silly apps with it, but then I realized that I would probably be better off learning any other programming language than Dar
by LarsDu88 4y ago
Ah Flutter. I burned a month making silly apps with it, but then I realized that I would probably be better off learning any other programming language than Dart (careerwise at least)
- piyush_soni 4y agoYeah. C++/Rust, or (slightly far fetched) C# support would be so awesome!
- account-5 4y agoHow come? What's so bad about dart?
- virtualwhys 4y agoOff the top of my head, no access modifiers (so private variables, for example, are prefixed with `_`, by convention, not enforced by the compiler), no pattern matching (and obviously no exhaustive matching), no record types, no sum types, no json (de)serialization (requires 3rd party libary code gen, wow), mutability everywhere, everything is a statement (i.e. no implicit `return`, AKA everything is an expression), required semi-colons (which they'd like to get rid of but can't due to questionable design decisions made long ago -- for the gory details see here[1]). If you like Java 8 and earlier you'll probably feel at home with Dart. Obviously I'm biased, but I find Dart to be one of the most unpleasant languages I've had the misfortune of being exposed to; this despite Flutter and its instantaneous hot code reloading being quite amazing -- a bizarre mix of promise and despair. [1] https://github.com/dart-lang/language/blob/master/resources/optional-semicolons-prototype.md https://github.com/dart-lang/language/blob/master/resources/...
- kennytilton 4y agoAs a Dart/Flutter outsider myself, I am finding all this "Dart no, Flutter yes" traffic intriguing. I am also a lisper, so no need to sell me on the difficulties of Dart, even if it were the perfect static typed OO, but it sounds like we have a great UI stuck inside an unloved language. Happy opportunity for ClojureDart! btw, in case anyone is wondering, I am not a part of Team CLJD at all. My hack is my own separate effort.
- pjmlp 4y agoEasy, its only purpose to exist is for doing Flutter apps, there is hardly any significat use of Dart outside of Flutter.
- TobyTheDog123 4y agoThat's in no way a bad thing, some may say that means it does one thing (an important thing) extremely well ;) I switched from a purely TS/JS stack (React-Native-Web to cover iOS/Android/Web, Typescript on the backend, with some stuff to share types), and just got way too tired of all the tooling, the configuration, etc. While I use Golang on the backend (compiled to WASM for serverless) I wouldn't be against using Dart on the backend if it had a WASM compiler... ....and upon doing some research to put a link in here, apparently you can as of seven days ago? https://github.com/dart-lang/sdk/blob/main/pkg/dart2wasm/dart2wasm.md https://github.com/dart-lang/sdk/blob/main/pkg/dart2wasm/dar...
- tjpnz 4y agoIt does predate Flutter by five or so years but I do agree that it doesn't have much of a reason to exist outside of that now. I would love to have been a fly on the wall when the decision was made to choose Dart.
- fakedang 4y agoDidn't it have something to do with Dart being pushed as Google's pet language? I have heard arguments that it was chosen because TS is Microsoft's pet, while Oracle was having a picnic with Java (this was around the time of the Google-Oracle saga). Dart was seen as a way for Google to be independent of both, and Kotlin wasn't developed yet at the time, hence Flutter went with Dart.
- pjmlp 4y agoIt is a bit more convulated than that. Dart was being pushed as JavaScript replacement, back when everyone had one. However Chrome team failed to push ChromiumVM and eventually the project was ramped down, by then AdWords had made a massive investment moving from GWT into AngularDart, so they rescued the project. Eventually Flutter, initally prototyped in JavaScript, moved into Dart, and they also decided to change the language semantics from dynamic language with gradual typing (Dart 1.x), to static typing with type inference (Dart 2.0). Somewhere alongside this timeline, many well known names from language design like Gilad Bracha and Kasper Lund, well known for favouring dynamic languages, left the project. Kasper Lund's latest project, is not surprising also a dynamic language, https://toit.io/ https://toit.io/
- hardwaresofton 4y agoThe last time I used Dart, it felt like the worst parts of C# + Java put together somehow. The type system was verbose yet relatively weak in comparison to something like Typescript, it'd already been rewritten once (which isn't a bad thing), and it was almost unusable outside the platform (I remember trying to write tests for something using sqlite.dart and then realizing that you just... couldn't). Flutter is an amazing technical achievement, and to some extent so is Dart (there's a great talk from strangeloop about it) but I just... want to be able to use anything but Dart in there. Being able to use Typescript with Flutter would be heaven (JS compatibility was something in early versions of Dart that was removed).
- kennytilton 4y agoI think you have made the case for ClojureDart. Clojure does not do the Typescript strong typing thing, but it meets the "Not Dart" requirement pretty well. And my specific contrib, Matrix, handles state management and the whole reactive thing pretty well, one area where I see a bit of thrashing in the Flutter community. Check out the examples and esp. the TodoMVC demo, they cover quite a bit of ground.
- satvikpendem 4y agoDart is at least adding new features relatively quickly (just recently they started working on immutable record data structures with pattern matching, which even TypeScript doesn't have yet) and soon they'll have static metaprogramming meaning you can have Lisp like macros to create your own syntax, including algebraic data types as in any functional language. That is really what people are looking forward to. Another thing is Dart is JITed, AOT compiled as well as compiling to JS and WASM. Very few languages can do all 4. JVM ones can't, so no Kotlin (we'll see how well Kotlin Native works), and V8 isn't AOT so no JS or TS either. Only alternative I can think of is Lua.
- kaba0 4y agoIt is easy to iterate fast on language design when you don’t care about backwards compatibility. > Very few languages can do all 4. JVM ones can't Java can (JIT is trivial, for AOT there is among others Graal, for JS and WASM there is TeaVM (which works on class files, so now that I think about it, pretty much every JVM language can do all platforms), but also the very great Closure compiler (j2cl) which has no relation to cloJure, made and used heavily by google)
- danielvaughn 4y agoI don't mind Dart, but I'm about a month into Flutter and so far, their approach to UI seems completely insane. It just feels like there's no coherent philosophy backing it.
- Alifatisk 4y agoI remember reading on the docs that Flutters ui architecture (& philosophy?) was inspired by React
- kennytilton 4y agoI think everybody but MobX and my Matrix hack lives off setState, so to that extent yes. But React embraces the HTML API in the form of JSX. Flutter designers were in an OO world and seemed to just wing it as they got to each widget. I can tell you, wrapping HTML (and React) was much easier, and I have many widgets to go!
- danielvaughn 4y agoOh I should have been more explicit when I said that. I really like the reactive model - the idea that the UI is a function of application state is [chefs kiss]. I love it. However, the idea that you need a “Center” widget just to position an item to the center of its parent…it just feels like GUI development took a major step backwards. I really can’t grasp why that decision was made. I’m open to having my mind changed but so far I’m like, thanks I hate it.
- kennytilton 4y agoI agree "UI = f(state)" rocks. That was the one thing React got right. But they never worked out state management, other than to kick off the Flux monstrosity that Redux ran with, and every other UI I can find. As for what I call the "Lego model" of UI construction, while definitely off-putting, I think the "why" is prolly "simplicity thru decomposition". So we do a bit more typing but have a dead simple approach to building our UIs. The nice thing about any Lisp with its macro capabilities is that we can wrap sth like Flutter to produce a library that remains Flutter, but hides the noise. ClojureDart offers a so-called "widget" macro, and my Matrix library goes a different way, making every constructor such as "scaffold" into a friendlier macro.