4 ms·
They should have just use C# for Flutter. Without investing significant time, like they did with Dart, they would have a language with a much bigger ecosystem
by zigzag312 2y ago
They should have just use C# for Flutter.
Without investing significant time, like they did with Dart, they would have a language with a much bigger ecosystem that is faster, already has compile time code generation and better support for data than Dart. It supports ahead-of-time compilation and hot-reload. The only feature missing in C# is compilation to JS, but with WASM is that really needed? Biggest downside of C# is probably that it's not invented at Google.
- kernal 2y agoAnd Microsoft should have just used Java.
- refulgentis 2y agoAnd Java should have just been C++ with a really nice garbage collector
- donatj 2y agoAnd C++ should have just been Objective-C with saner invocation syntax.
- refulgentis 2y agoAnd Objective-C should have just been Smalltalk without the C baggage (is this the root NIH syndrome?! I'm guessing no, I'm only 36. maybe LISP enters the picture here?)
- zachrip 2y agoGenuine question, is this comparison really apples to apples? Microsoft wanted to compete with sun right? Does google want to compete with programming languages like this? My gut tells me this is NIH not wanting to compete.
- refulgentis 2y agoIt is apples to apples. Microsoft didn't want to compete with Sun so much as have an application development language with a garbage collector that wasn't owned by Sun. You don't make much money off programming languages inherently. This also elides an obvious riposte (so you mean they should have just used Mono? how did all that work out?) and a metric ton of differences between what C# targets and what Dart targets.
- cogman10 2y agoMS wanted to fracture the Java ecosystem. The Microsoft Java VM was an attempt to lockin developers to MS Java and not sun Java. They created J# and C# because of the sun lawsuit they lost. They still wanted a Java like ecosystem but they would be sure it only ran on Windows servers. MS spent years being hostile to open source software. It's only in about the past decade that they've turned a corner. Here's a famous email from Bill Gates about Java and how to stop it. https://web.archive.org/web/20220630223035/https://www.techemails.com/p/bill-gates-im-literally-losing-sleep-over-java https://web.archive.org/web/20220630223035/https://www.teche...
- riffraff 2y agoUnrelated to the discussion, but wow, the Nathan Myhrvold email seems prescient on so many levels.
- kazinator 2y agoThey did. They called in J++ and gave it extensions, leading to a schooyard scuffle with Sun. When the school principal said Sun were right, they went off sulking and made Dot Net.
- scythe 2y agoMicrosoft had an underlying operating system that they wanted to rewrite substantially in C# on the .NET VM. They had a decent motivation for not having a core piece of Windows dependent on a product from another vendor that was competing in some of the same markets as their core product. Google by contrast isn't nearly as invested in Dart as Microsoft was (and still is) in C#/.NET. Perhaps a better objection is that they should have just used Go — or a Go-binary-compatible language built on some of the same toolchain. (See also: Vala and Guile still don't play nice together as well as they should for two languages from the same project.)
- Salgat 2y agoC# was Microsoft's attempt to learn from Java's mistakes, which they very much succeeded at doing.
- whoknowsidont 2y agoThat's not even remotely historic accurate. Sun vs Microsoft drove MS into creating C#. Please don't fan boy to the point of lying.
- miffy900 2y agoIt's much much more complicated than that. Sun refused to add many language features that Microsoft (then a cautious but also genuine user of Java) wanted. Such as refusal to add delegates/closures: https://benhutchison.wordpress.com/2009/02/14/suns-rejection-of-delegates-for-java/ https://benhutchison.wordpress.com/2009/02/14/suns-rejection... https://stackoverflow.com/questions/1973579/why-doesnt-java-have-method-delegates https://stackoverflow.com/questions/1973579/why-doesnt-java-... J++, which was Microsoft's Java implementation in the 90's added a few language extensions that were clearly not Sun-approved, but driven by internal engineering feedback at MS. C# having struct and class keywords, allowing you to define your own value types, is clearly a result of that missing in Java, which still in 2025 has no such equivalent yet. Also Java's then native code interop solution, JNI, was and still remains complete garbage, and it's flaws were a huge guide for Microsoft when they deveoped .NET and it's native interop equivalent, PI (platform invoke). Thankfully, Java now have FFM [foreign function and memory APIs](https://docs.oracle.com/en/java/javase/21/core/foreign-function-and-memory-api.html https://docs.oracle.com/en/java/javase/21/core/foreign-funct...) APIs (and also JNA which is community driven), which are much better than JNI.
- whoknowsidont 2y agoThe key point is that C# was happening regardless of whatever technical upsides people wanted to see out of it. C# would still exist today and still be just as popular in the Windows ecosystem even if it made all the same exact mistakes as Java.
- refulgentis 2y agoDart's awesome. I'm sure C# is too. I've been unlucky enough to have many years in on both iOS and Android, and Dart is a fantastic language, far better than both incumbents. I worry about judging it as a whole, based solely on their ability to launch pre-compile time code generation that is faster than their current approach. Macros seemed really cool + really difficult to improve past the current codegen. I have a 35K LOC "main" code base that generates 670K lines of code under the current approach. It takes 52 seconds for a cold generation of all 670K. Seconds for warm. shrugs (sounds great to me)
- eseidel 2y agoYeah. Dart's over-rotation on generated code is a googlism. They have a fancy build setup internally which is very good at generated code and caching it. I know that the build_runner authors are looking into perf as we speak, and I'd be happy to put you in touch with them if you'd like to speak with them about debugging your case: https://github.com/dart-lang/build/issues/3800 https://github.com/dart-lang/build/issues/3800 eric@shorebird.dev reaches me (for this or any other Flutter/Shorebird issue).
- eseidel 2y ago[Flutter founder here.] I'm pretty sure we did look at C# (and certainly a whole bunch of other languages). I don't actually recall why we didn't use C# at the time. I remember Go binaries were waaay to big, JS (what we originally wrote Flutter in) startup time was way too slow on iOS, Swift was too deeply tied to Apple (the standard library was closed source at that time), etc. It's possible that C# was too verbose or didn't have a path to hot reload? But that's just a guess. I'm not a C# expert, and Adam Barth drove most of the language evals at the time. That said, I'm also not sure Miguel (creator of Xamarin) would agree. He's a Flutter fan now (and backer of Shorebird, my company). Past discussions: https://x.com/migueldeicaza/status/1778759403451081159 https://x.com/migueldeicaza/status/1778759403451081159 https://x.com/migueldeicaza/status/1559898665350832128 https://x.com/migueldeicaza/status/1559898665350832128
- paulddraper 2y agoI am curious as well. Despite the "not invented at Google" swipe * TypeScript wasn't invented at Google either, but adopted heavily. * Angular was the first major project ever to use TS. * And interestingly enough, Anders Hejlsberg contributed heavily to both.
- eseidel 2y agoTypescript is great! But doesn't get you away from running in a JS interpreter or JIT, which at least on iOS is very slow. We wrote the first 3 versions of Flutter in JS but eventually had to move off due to 10s+ startup times (we wrote a ton of JS). Once we moved to an ahead-of-time compiled language we could write as much code as we wanted and the user didn't have to compile it during launch on their device. Typescript would have that problem still today, sadly. https://www.youtube.com/watch?v=xqGAC5QCYuQ https://www.youtube.com/watch?v=xqGAC5QCYuQ is a talk where we discuss what led to modern Flutter (including 3 attempts in JS). Angular was originally in Dart is my understanding, but eventually forked into two projects. Angular Dart (which is really only still used internally at Google, mostly for Google AdWords which makes all the money) and Angular JS which is what has seen so much popularity more generally.
- api 2y agoI think Go would have been the most logical choice, given that it's Google.
- mdhb 2y agoI think you are missing the fact that Dart is actually an incredibly nice language to work with in a way that Go absolutely is not.
- api 2y agoThe problem is that it’s yet another language. It’s the cognitive load and the inability to easily reuse code across a project.
- Capricorn2481 2y agoThat seems more like an argument against Go. Dart is the language more familiar to the average dev, and you're gonna have an easier time translating that to Java/C# than you are Go.
- eseidel 2y agoWe considered Go! At the time it was much more designed for servers than mobile devices. If I recall correctly the minimum binary size was like 30mb or something.
- deleted 2y ago[deleted]
- whoknowsidont 2y ago>They should have just use C# for Flutter. Dear lord no. We don't need more C# in the world. >It supports ahead-of-time compilation and hot-reload. In name only. Doesn't really well in practice. Go and just look for "C# hot reload not working" in any search engine and look at the variety of contexts it just simply does not work with no resolution.
- CharlieDigital 2y agoC# is a fantastic language that has, in recent years, evolved very quickly for the better. Nice mix of object and functional drawing a lot of influence from F#. It shares a lot of language constructs with TypeScript (and by extension, JS) and has been converging with each release so I'm often surprised that people hate on it or that more startups don't reach for it if they are on Node with TS. Same syntax for key language constructs like async-await, try-catch-finally, generics, etc. Hot reload works pretty well (at least in the contexts that I use .NET (backend APIs)); a lot of the issues were from the early days. `dotnet watch` has been very much usable for the last few years.
- whoknowsidont 2y agoThe improvements are great for people who have to or want to use C# for whatever reason? But how does that move the needle from other tech-stacks that are for more capable, especially on non-Windows environments (and please don't imply that C# is truly cross-platform, it's fine for web API's, it's not fine when dealing with actual system calls). If you're within the Windows garden, those tools certainly make sense to use. But if you're not, there just simply isn't a reason to burden your app/platform with them. To be clear, there's nothing wrong with C#, but the advocacy for it tends to be quite loud and passionate without much technical clarity in what it brings to the table that's lacking in other ecosystems. And again, you might be in for a world of hurt depending on how complex your needs are.
- CharlieDigital 2y agoI'm not advocating it for every use case, I'm advocating it for use cases where it's a good fit (e.g. web APIs, backends where there's a need for multi-threaded code). For teams that need to move up from Node/JS/TS or augment Node/JS/TS, it's likely a better choice than say Rust or Go (nothing wrong with Go, but C# is going to be an easier ramp than Go for JS/TS devs IMO) I would not, for example, advocate it for web UIs or any UIs except for Windows desktop UIs (and even there, I might advocate for JS based options).