Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's some very high level view - in reality even tough those languages are in similar categories the experience would be vastly different :

TypeScript - powerful type system but shit underlying stdlib and language (no pattern matching/switch expressions)

Dart - worse than TS because the object model is closed - so no dynamic freedom, but the type system and expressions are weaker then the rest. Also 0 meta programming facilities - Java level of boilerplate and code generators

C# - closest to ML featureset out of the mentioned, but unlike TS doesn't have sum types which will make a lot of things more tedious.



Your understanding of Dart sounds a little outdated. We have a fully sound static type system and the language is pretty expressive, especially with the new pattern matching stuff in 3.0:

https://medium.com/dartlang/dart-3-1-a-retrospective-on-func...


If you’re going to use C# for a compiler, why not go the whole hog & use F#?


No argument from me, just saying lumping in all those languages together sounds reasonable in theory, in practice they are very far apart.

You'll probably have similar overlap between C# and F# implementations as you would with say TypeScript - they are just that different in practice IMO.


I was going to mention F#. The parent and grandparent comments mention C# and ML, and the intersection of the two is... F#.


> no pattern matching/switch expressions

They're still waiting on the do expression proposal for that (https://github.com/tc39/proposal-do-expressions), which has been in the bikeshedding stage for the past five years.


The proposal for pattern matching syntax seems more akin to what they're looking for.

https://github.com/tc39/proposal-pattern-matching


I’m not clear on the benefits of this proposal over just using anonymous functions. Some of the examples just seem contrived.

And the React example makes no sense, you can use a ternary and it is even shorter.

``` return ( <nav> <Home /> {loggedIn ? <LogoutButton /> : <LoginButton /> } </nav> ) ```


Having written quite a lot of Reason react (similar in syntax to the proposed React example) - while in this particular case because the example is so simple the ternary looks nicer, its also nice to just have a longer expression block in the middle of your JSX when you're doing more complex things.


for me the point is to be able to return from inside multiple expressions from the correct scope i.e. the root function without throwing.


What if you want a `switch` instead?


Could you speak more to the dart, and specifically the "Java level of boilerplate and code generators"?

I've used it a bit but I haven't found it very boilerplatey in general, so I'm interested in learning what contexts you run into that.

I'm assuming you're using it with flutter?




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

Search: