Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ahoge
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
24 ms
·
181.
▲
by
ahoge
12y ago
You are missing the point. jQuery fixes the DOM API. Dart's "dart:html" already provides a clean nice-to-use API. All those list-like things are actual Lists. Futures and Streams are also baked into the language. Normalizatio
182.
▲
by
ahoge
12y ago
> What does [Dart] do better than similar languages that compile to JS (CoffeeScript, Typescript, etc)? CoffeeScript doesn't really help with scaling. It's basically just a slightly more compact JavaScript dialect. Personally
183.
▲
by
ahoge
12y ago
It will just cause a `pub get` fail (Package foo requires SDK version >=1.5.0 but the current SDK is x.x.x), but it won't prevent the application from running. Only `pub` cares about that pubspec.yaml file.
184.
▲
by
ahoge
12y ago
> Any performance improvements seen by your users won't apply to those using any other browser. It will be still about as fast as regular JavaScript.
185.
▲
by
ahoge
12y ago
The SDK is shipped with a standalone version of the VM which can do I/O (via the 'dart:io' package). You can use it to write command line applications and web servers. Basically, it's like Node right off the bat. I/
186.
▲
by
ahoge
12y ago
An interesting advantage compared to Dalvik (or the JVM) is the ability to make use of SIMD. If your bottleneck would benefit from SIMD, you can gain quite a lot. It does of course require some additional work, but thanks to operator overlo
187.
▲
by
ahoge
12y ago
Generally. Technically, it's a "breaking change". As you can imagine, this didn't actually affect anyone.
188.
▲
by
ahoge
12y ago
That's an ES5 change. With ES3, you can overwrite NaN, Infinity, and undefined.
189.
▲
by
ahoge
12y ago
Yes, a language specification is just a prerequisite for standardization. However, it's also useful for people who want to write their own implementation or tools. It also makes issue handling a bit smoother, because you can always che
190.
▲
by
ahoge
12y ago
From the very first paragraph: "The grammar described here is intended to help you understand the language in more detail, rather than to allow you to directly implement a parser or compiler." A language specification is for peopl
191.
▲
by
ahoge
12y ago
I can't find a language specification anywhere. Can you give me a link? go language spec hit #1: http://golang.org/ref/spec dart language spec hit #1: https://www.dartlang.org/docs/spec&#x
192.
▲
by
ahoge
12y ago
Go also has documentation. Also, Go has a spec. Swift doesn't. That's a pretty big deal, don't you think? Android is fairly open. You can run whatever you want on that platform. If you want to use LuaJIT, no one can stop you.
193.
▲
by
ahoge
12y ago
You can also change it to 4 (which is what most editors use by default) via `tab-size`: https://developer.mozilla.org/en-US/docs/Web/CSS/tab-size
194.
▲
by
ahoge
12y ago
I prefer tabs (tab-size: 4), but I prefer even more if everyone follows the same conventions. Dart, for example, uses 2 spaces. When I write Dart code, I use 2 spaces. And that's the end of that. As history has shown, there is absolute
195.
▲
by
ahoge
12y ago
That's just the most extreme form. As with most things, it's a gradient. If you know that there are things you don't know, you'll probably be more humble. If you feel overwhelmed, because there doesn't seem to be an
196.
▲
by
ahoge
12y ago
> I've learned that there's a strong correlation between knowledge and humility. It's the Dunning–Kruger effect: http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
197.
▲
by
ahoge
12y ago
I don't see how that would be related to SIMD support in JavaScript.
198.
▲
by
ahoge
12y ago
Huh? If JavaScript the compiler target supports SIMD, your SIMD-supporting language can make use of that. Dart will do that. Python, Haskell, or whatever are free to do the same.
199.
▲
by
ahoge
12y ago
> if I need a specific version of specific browsers (which it is) No, you don't need a specific browser. You can polyfill it. (The reference implementation is a polyfill.) If you want the performance benefits, you'll need to
200.
▲
by
ahoge
12y ago
> Unless there is a usecase for averaging gazillion numbers on the client Adding 2 numbers (x4) is just the simplest thing you can do. There are a bunch of other operators and methods: https://api.dartlang.org/apidocs&#
201.
▲
by
ahoge
12y ago
> this really is such a niche feature Yes, it is. However, it's relatively easy to implement and the performance improvements and battery savings are fairly huge. All things considered, it's a pretty good deal.
202.
▲
by
ahoge
12y ago
It requires SSE2 just like Dart's SIMD implementation. SSE2 is supported by virtually every desktop CPU (including VIA and Transmeta). Dart's SIMD stuff works just fine on AMD CPUs which were produced in the last 10 years (the K8
203.
▲
by
ahoge
12y ago
Auto-vectorization is an extremely complicated topic. This stuff is slow. Not a big deal with AOT compilation, but it's of course a huge deal if you only have a few msecs to spare. Also, a machine can't just jumble the operations
204.
▲
by
ahoge
12y ago
Check "Bringing SIMD to the Web via Dart" by John McCutchan: https://www.youtube.com/watch?v=CKh7UOELpPo He's also the guy wrote the proposal for ECMAScript: https://github.com/johnmccutchan&#
205.
▲
by
ahoge
12y ago
It's either <input ...> (SGML flavor) or <input .../> (XML flavor).
206.
▲
by
ahoge
12y ago
It's a sort-of serialized representation of the DOM.
207.
▲
by
ahoge
12y ago
V8 supports asm.js as any other ES3-compliant JavaScript engine. It also has many optimizations in place which benefit from asm.js-style code. Asm.js-style code also simply doesn't do those expensive JavaScript-y things. That's wh
208.
▲
by
ahoge
12y ago
Nah, it's not dying or anything. It just isn't very popular. It never has been. Reader was a niche product.
209.
▲
by
ahoge
12y ago
> Not surprising, given Google's stance for other languages. No, the reason is that Mozilla just added lots of stuff way before it got into the ES specs. https://developer.mozilla.org/en-US/docs/Web/
210.
▲
by
ahoge
12y ago
See slides #19-#28: https://www.dartlang.org/slides/2013/06/dart-streams-are-the... It's Dart instead of JS, but the idea is pretty much the same.
More ›