dart和python哪个好_如何看待dart2侧重client-side开发?

嗯,关于Google选择dart作为flutter开发语言的原因,知乎上似乎有一个版本,说是dart组离flutter组近……也许这是一个原因,但是这么简单粗暴的理由要用来做这种决策,有些太过于草率了

今天随手翻了翻flutter的faq,这个问题的答案就在faq里面,我直接拷贝了:

Why did Flutter choose to use Dart?

Flutter used four primary dimensions for evaluation, and considered the needs of framework authors, developers, and end users. We found some languages met some requirements, but Dart scored highly on all of our evaluation dimensions and met all our requirements and criteria.

Dart runtimes and compilers support the combination of two critical features for Flutter: a JIT-based fast development cycle that allows for shape changing and stateful hot reloads in a language with types, plus an Ahead-of-Time compiler that emits efficient ARM code for fast startup and predictable performance of production deployments.

In addition, we have the opportunity to work closely with the Dart community, which is actively investing resources in improving Dart for use in Flutter. For example, when we adopted Dart, the language did not have an ahead-of-time toolchain for producing native binaries, which is instrumental in achieving predictable, high performance, but now the language does because the Dart team built it for Flutter. Similarly, the Dart VM has previously been optimized for throughput but the team is now optimizing the VM for latency, which is more important for Flutter’s workload.

Dart scores highly for us on the following primary criteria:Developer productivity. One of Flutter’s main value propositions is that it saves engineering resources by letting developers create apps for both iOS and Android with the same codebase. Using a highly productive language accelerates developers further and makes Flutter more attractive. This was very important to both our framework team as well as our developers. The majority of Flutter is built in the same language we give to our users, so we need to stay productive at 100k’s lines of code, without sacrificing approachability or readability of the framework and widgets for our developers.

Object-orientation. For Flutter, we want a language that’s suited to Flutter’s problem domain: creating visual user experiences. The industry has multiple decades of experience building user interface frameworks in object-oriented languages. While we could use a non-object-oriented language, this would mean reinventing the wheel to solve several hard problems. Plus, the vast majority of developers have experience with object-oriented development, making it easier to learn how to develop with Flutter.

Predictable, high performance. With Flutter, we want to empower developers to create fast, fluid user experiences. In order to achieve that, we need to be able to run a significant amount of end-developer code during every animation frame. That means we need a language that both delivers high performance and delivers predictable performance, without periodic pauses that would cause dropped frames.

Fast allocation. The Flutter framework uses a functional-style flow that depends heavily on the underlying memory allocator efficiently handling small, short-lived allocations. This style was developed in languages with this property and does not work efficiently in languages that lack this facility.

这么一大段写得很清楚,我觉得理由也足够充分,就这么说,dart就是客户端java,可以看到很多java世界里面我们曾经见过的专业术语全部出现,比如不要重复造轮子,面向对象, 跨平台等Plus, the vast majority of developers have experience with object-oriented development, making it easier to learn how to develop with Flutter.

像这种话,我相信正常人都能猜出来它在说啥,然后dart faq里面有一段关于dart和java的关系:

Q. Isn’t Dart a lot like Java?

Dart has some similarities with Java. See the Intro to Dart for Java Developers codelab for examples of some of the differences between Dart and Java.

其实多翻番,很多问题人家都回答了,比如这个

Q. Why isn’t Dart more like Haskell / Smalltalk / Python / Scala / other language?

Various reasons, depending on the language being asked about.

For languages that are quite different from JavaScript: it’s important for Dart to compile to efficient JavaScript. Our experience in GWT is that if the source language is too different from JavaScript, it creates some cases where complex output code is needed to emulate the source language’s behavior. This can cause performance to vary in ways that are not transparent to the programmer.

For languages that are less mainstream: we expect that modeling Dart on these would, on the whole, hurt our adoption. Our team includes fans of these languages, and if we thought Dart could take up our favorite cool language features and push them to widespread adoption we might be tempted, but really we think we’ve got our hands full introducing a new language at all.

For languages that are “more dynamic” than Dart: Dart deliberately trades off some of this arbitrary runtime modification for the goal of better performance and tools.

再想想最近oracle跟google的官司,判决安卓上用java api怎么滴不行

dart就是google版的java,只是换了个名字而已,实际上google和sun,java和dart之间都有千丝万缕的联系,比如google和sun都是斯坦福大学出厂的,google在最初起步的时候,得到了sun的支援,java的hotspot jvm和dart,都有一个共同的作者,那个人叫做lars bak等等,这种轶事联系进去,dart跟java相似应该是很正常的事

然后google针对java无法在客户端使用,也列举了不少原因,比如常见的慢,这个就是latency方面的优化,一个是gc pause降低,目前没有找到关于dart gc部分的benchmark,不好说,但是肯定会做类似优化,google在这个领域有足够多的经验,其次过于aot,可以启动速度变快等等,怎么看都像是一个java的客户端版本,用上了java的语法,针对客户端的需求做优化

google是一家脚踏实地用技术解决问题的公司,这才是一家技术公司应该有的样子,做的很多事都在解决实实在在的问题,比如会java的人多,但是java在客户端的性能暂时还不行,怎么办?解决它,flutter就是google解决该问题的产物,而不是只懂得说,java慢啊,所以不要用java了,因噎废食,java慢就想办法解决它,技术的进步就是在解决一个又一个实际问题中的产物

在我看来,这意味着用java/dart这种语法来搞游戏的曙光,我们决定把握该机会,投身其中

vive la dart

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值