Hacker News new | past | comments | ask | show | jobs | submit login

I really like Dart, and it's clearly far superior to its competitors in the "old imperative" space, like Python, Javascript (though Typescript obviously has fancier types), Java, and even Go IMO.

The frustrating thing is that it's so close to the functional features that Rust embraced (mainly that everything is an expression), but it just brushes against it. Like, with Python and Javascript, you know they're shit. Nobody expects to be able to write a switch that evaluates to a lambda or whatever in Python. But Dart is just so close to greatness but just misses!

They even added switch expressions recently, but with a different syntax to switch statements! So close!

Still, overall it's a great language and really deserves more market share. In particular the dev tooling is the best of any language I've used. The LSP server is instantaneous. Nothing else comes close.




> The frustrating thing is that it's so close to the functional features that Rust embraced (mainly that everything is an expression),

Dart has had a challenging history. Most of the original designers of the language have moved on to other things. They had a very conservative vision for the language, basically a 50/50 blend of Java/JavaScript. Pretty close to TypeScript but with a much simpler type system and less nice JS interop.

That's not really what the world seems to want today, so the current language team is trying to evolve the language into something more modern. But doing that while being sensitive to minimizing user breakage and migration cost is a really hard problem.

We've been able to make a lot of progress: sound type system, non-nullable types, pattern matching, etc. But some stuff is a lot harder. I think most of us on the language team would prefer type annotations on the right like "var x: int", but that's a huge migration cost for relatively little value. Likewise, having everything be an expression would be really nice but is also a really difficult change to make.


I was going to say "isn't Munificent still around?" :D

I wonder if you could make a "syntax v2" kind of thing, so it's a totally new syntax that you opt into (e.g. by a pragma at the top of files, or globally) that gets converted into the same IR.

Probably only worth doing once though to fix all of those things. And as you say, that's a ton of work for marginal benefit.


We talked about that many times over the years. It's not totally off the table, but it's a hard sell. It would effectively invalidate every existing blog post, StackOverflow answer, LLM, etc. that has been written for or trained on the old syntax.

The benefit would be real, but probably not large enough to outweigh that cost.

Path dependence rules everything.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: