News for hackers. Stuff that matters.
Re:Fuchsia: a new operating system by greenhouse_gas on Friday March 31, 2017 @05:14PM (#14008314)
How is it in turns of speed?

On one hand, the website says that it's compiled to native code (so it can be same speed/faster than Java), but on the other hand, it's based on a soft-type language, which makes optimization difficult (even with V8, JS is still slower than native code).

Side question:

I understand that Dart was soft-typed because it was supposed to replace/compile to JS, but what advantage does soft-types have against "implied-types" (like auto or go's := ) combined with operator overloading (to allow string+int, for example)?

Re:Fuchsia: a new operating system by kjksf on Friday March 31, 2017 @05:32PM (#14008502)
Even the original, untyped, Dart was designed to be easier to optimize that JavaScript (e.g. it's class based, not prototype based, so the runtime doesn't have t work as much to optimize object access).

Recently Dart has added a strong mode (https://github.com/dart-archive/dev_compiler/blob/master/STR..., http://news.dartlang.org/2017/01/sound-dart-and-strong-mode....).

One of the reasons for strong mode is to enable better optimizations (https://www.dartlang.org/guides/language/sound-faq#why-stron...).

Re:Fuchsia: a new operating system by throwayedidqo on Saturday April 01, 2017 @12:01AM (#14010330)
I'm going to save these links for the next time I get downvoted for saying that js object system and dynamic typing suck for performance :).

When JS performance threads come up I always mention that JS will never be as fast as Go/Java. Some people have a tantrum when I explain these issues. The sources I usually cite are dense and people just continue to downvote without reading them.

Re:Fuchsia: a new operating system by markdog12 on Friday March 31, 2017 @06:06PM (#14008762)
You might want to watch this talk on AOT compiling Dart, I'll link right to the perf benchmarks: https://youtu.be/lqE4u8s8Iik?t=9m28s

I think it's a work in progress, but main benefit at least at the time was faster startup.

Re:Fuchsia: a new operating system by tomatsu on Saturday April 01, 2017 @10:39AM (#14012316)
AOT compiling was initially all about iOS (where JIT isn't allowed), but you can now do that everywhere with "application snapshots" which were recently added with Dart 1.21.

Unlike the script snapshots, application snapshots also include CPU-specific native code in addition to the serialized token stream of the source code.

So, you don't just skip the parsing stage, you also skip the warmup phase. Your application starts instantly and it runs at full speed from the get-go.

https://github.com/dart-lang/sdk/wiki/Snapshots

Re:Fuchsia: a new operating system by IshKebab on Saturday April 01, 2017 @06:42AM (#14011490)
I tried out their demo apps on Android and they were pretty fast but there were still some hiccups. It's definitely not as fast as good Java apps but it is pretty close. Also the animations are on the level of iOS apps - far superior to Java Android apps.
Re:Fuchsia: a new operating system by SureshG on Friday March 31, 2017 @07:53PM (#14009461)
Dart has strong mode (this is enabled by default for its Angular2 projects) - Check this talk on sound Dart for more details https://www.youtube.com/watch?v=DKG5CMyol9U
Re:Fuchsia: a new operating system by bitmapbrother on Friday March 31, 2017 @05:34PM (#14008515)
Dart supports strong typing.