Hacker News new | ask | show | jobs
by yagodragon 2161 days ago
I believe Dart is a more exciting language than Go. It's the most well designed scripting language out there, that can also be AOT compiled into native binaries. It's a better JS and a better Java at the same time. It would be also a killer language for backends and simple websites. Just imagine a better node.js built around Dart's excellent tooling.

What made Go more successful than Dart was a mix of decisions, luck, and momentum. On an alternate reality, Dart would swap places with Go. Dartium VM would have replaced Javascript on the Web and everyone would have been happy. Go would be seen as an obscure language with missing features that doesn't really do anything better than java/C#/C++

5 comments

> I believe Dart is a more exciting language than Go.

Almost every language is, that's not difficult.

Dart is a better ES5, but a worse ES6. If you compare Dart to the JavaScript that existed when it was created, it’s great. If you compare it to modern JS, it’s crap. Modern JS is really, really good. The main problem with it is that the ecosystem is only just so-so. People still complaining about JS in 2020 are mostly just showing their own ignorance of what the language is now.
Dart is statically typed. I still miss the type system in JavaScript, and as much as I like TypeScript after I get it working, it has too many configuration options.
So that was your proclamation. Now let's hear your arguments...
The lack of a standard lib puts pressure on the ecosystem to provide simple functionality like leftpad for every project. Managing those is diffcult.
Left pad specifically is part of the standard library now: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Yes, there are still shortcomings, but to me, the biggest shortcoming is too much legacy crap that doesn’t use the standard library. For example, Express predates the standard request, response, and URL classes, so it invents its own. Plus Node doesn’t even fetch FFS. If everyone actually wrote things in modern JS, the situation would be better.

> It's the most well designed scripting language out there

You misspelled Kotlin.

Strangely, both of you managed to misspell Julia.
Kotlin is statically typed only runs on the JVM though, I thought?
Sure, it’s theoretically possible. I don’t actually know anyone out there who’s using it, I’m curious do you?
> I believe Dart is a more exciting language than Go.

For certain types of tasks, you want to choose a language that is not moving fast and breaking things. Such a language tends to be less "exciting" than others.

Look at Common Lisp which fits this description much more than Go and is still a million times more interesting and powerful. Go just really is a below average language.
> which fits this description much more than Go

Was that true from the start or is it just that it's much older? How fast did Common Lisp move during its own first ten years, before the ANSI standardization?

Well, Go has only one implementation, right? So it's kind of always been standardised.
Funny, I find Dart to be horrid and verbose, and oddly daunting, mostly because of the expected massive surface area your code has to traverse, and these odd "let's pretend async is sync" erm "features" that the JS community decided was OK Koolaid to drink... I promise you a future that you can async await. Spare me. I want to know the truth, not a lie. Did that request return a 200 or what?

I don't want a better node.js nor any node.js at all, really. Node.js called and it wants it's browser back. It's an event loop, for crying out loud, and has no business trying to pretend that it understands operating system processes and threads and such...

Dart reminds me of the worst of large corporate committee-ware. Go is at least a decent and respectable programming language, even if it IS garbage-collected...

I suppose I will get flagged for having strong expressed emotions about Dart. I dislike working with it, immensely, and this was even before Flutter... let's please avoid discussing Android Studio, chip heat dissipation, and global warming... Clearly the Goog has no influence on the fact that you need 6 cores running at 1.whatever gigahertz to open Farty Birds or whatever is hip. Flag away. Sorry, "null safety"... is that like "if (cat ==== 'undefined') {break exception omg try catch}?"

.... What does Dart do better than it's nearest competitor? What does Dart compete with again?

Can you list your reasons to dislike Dart in a format without the vitriol?
Sorry, posting after a few drinks again...

Silly stuff like "I like wide-code-formatting, not vertical stacks with 4 characters on a line or something. (cultural)

"Too many moving parts" in almost every implementation of anything, (as in "modern" javascript/front-end frameworks and their build-toolchains) such that its built for a large corp to use lots of warm bodies to "divide et imperis". (I can understand this with regards to Flutter, half of the complication of this cross-platform thing being Googles fault, of course. Android Studio needing it's own dedicated 32-core terabyte-ram compute cluster, naturally, and trying to find cross-platform layout containers etc without being verbose = good luck!)

Particular pain points? Let's go with some Flutter stuff, as it's arguably the primary use case folks will encounter Dart for, now that the Dart VM isn't going to be embedded in all the browsers suddenly, as was proposed at one point.

Arguably, I'm doing it all wrong, as someone will point out. Elaborate (client-side) modeling that will only work if everything is completely fleshed out:

We have our classes, but OH let's make the state a separate object and let's basically have you haul 3 paragraphs of junk around to represent one thing and some related stuff that should probably be part of the same object... Hey, who knows, maybe it'll be like CSS in some future revs in which you have to look for 20 class blocks extending the same class, but that's in Crystal etc, and it's raison-d-etre seems pretty established (extensibility) but it does make localization a PITAS.

...and then we have factory methods, and we can't really debug passing stuff through them until we get data, but it's not as simple as if(this.readyState == 4 && this.status ==200) {boom, does it look like JSON? is it an array instead? what do we have here?} so there's this "build an elaborate model on the client side, but then you are basically only validating and attempting to JSON.parse whatever your (likely http) API spits out.

factory TextLine.fromJson(Map<String, dynamic> json) {} Never mind that I have to finish tiling all model bits to pull something through and see what I have, although the flutter hot-reload helps speed things up a bit, which you then end up pulling data through what pretends to be fancy/modern but is actually no better than the browsers HTTP XHR methods

//the future Stream<List<Album>> fetchCards(int limit, int skip) async* { http.Response response = await http .get('https://mobile.somesite.com/albums/'+ limit.toString() + '/' + skip.toString() ); List responseJson = json.decode(response.body); yield responseJson.map((m) => new AlbumCatalog.fromJson(m)).toList();

Syntax is generally fine, text is better than SVG, but somehow working with Dart makes me feel depressed, in a Javascript kind of way... (lot's of tooling and attempts to not be what it really is underneath, hence my gut reaction to arrow functions and pretend-classes in Javascript, etc...)