HNHacker News
TopNewBestAskShowJobs

xxgreg

258 karma · joined September 9, 2011

submissionscomments
xxgreg··on V8 Moving to Git
Thx ;)
xxgreg··on V8 Moving to Git
Github has some nice features that chromium.googlesource.com lacks, like being able to list all of the commits that have changed files in a specific sub directory.

Synchronising a mirror automatically is pretty trivial so I imagine they're usually pretty up to date.

xxgreg··on V8 Moving to Git
And since git is distributed it can be hosted on both, and already is https://github.com/v8/v8-git-mirror
xxgreg··on What do you guys think about Dartlang?
> No private pub server. If you want to host Dart packages internal to your company locally; you're out of luck.

You can store packages on a private git server, see the pubspec.yaml docs here:

https://www.dartlang.org/tools/pub/dependencies.html#git-pac...

It is also possible to run your own private pub server. But currently the only available implementation relies on AppEngine. According to the author it's possible to just implement the fetch protocol using static files served over HTTP. I.e. create some directories and put the json and tar.gz files in the correct places.

https://www.dartlang.org/tools/pub/dependencies.html#hosted-...

https://github.com/dart-lang/pub-dartlang/

xxgreg··on Why it makes sense to bike without a helmet
I'd like to see strong evidence too. Where I live there have been a far larger number of pedestrians seriously injured by cars than cyclists - but you're right far more time is spent walking.
xxgreg··on Why it makes sense to bike without a helmet
Ok that leaves pedestrians, who have twice as many head injury's per km. Most likely due to being hit by cars - perhaps cars should have airbags on the outside too...
xxgreg··on Why it makes sense to bike without a helmet
He also cites an Australian study, which concludes risk of head injury per million hours travelled: Cyclist 0.41, Pedestrian 0.80, Motor vehicle occupant 0.46, Motorcyclist 7.66.

So if you want to be consistent you should update your comment to:

If you are cycling or driving wear a helmet.

xxgreg··on Why it makes sense to bike without a helmet
Does this mean you will now wear a helmet while driving, because it gives you 85-88% less chance of serious brain injury?
xxgreg··on Why it makes sense to bike without a helmet
Did you read this bit:

Risk of head injury per million hours travelled

Cyclist - 0.41 Pedestrian - 0.80 Motor vehicle occupant - 0.46 Motorcyclist - 7.66

"but that doesn't mean your not an idiot for doing it without any good reason."

So by this logic someone not wearing a helmet while in a car is also an idiot ;)

xxgreg··on Why it makes sense to bike without a helmet
I think the title is wrong - it should be:

"Why it makes sense to drive wearing a helmet"

Based on:

We can also approach it from the perspective of injuries per million hours from a 1996 Australian study looking at head injury risk before the beginning of any helmet laws:

Risk of head injury per million hours travelled

Cyclist - 0.41 Pedestrian - 0.80 Motor vehicle occupant - 0.46 Motorcyclist - 7.66

xxgreg··on Google offering $1M prize for a much smaller power inverter
Very cool. However inverters are DC->AC. I think the correct term for AC->DC converter like Dart is a "rectifier".
xxgreg··on Is the ‘point’ of solar about to change?
It's called pumped storage. It exists, but only at larger scales than a household system. It's ~80 efficient.

http://en.wikipedia.org/wiki/Pumped-storage_hydroelectricity

xxgreg··on Is the ‘point’ of solar about to change?
"get the maximum energy during the year."

There are already countries where the cost of electricity from PV is below the cost of electricity bought from the grid. In these countries every Watt you generate yourself saves you money.

These users don't want to get the maximum amount of energy per year, they want to minimize the amount of electricity bought from the grid. They want to better match the generation profile of solar to their load profile. i.e. spread generation across the day - instead of getting it in one big peak in the middle of the day. To do this - it is already common to install east and west facing PV.

But I agree lazy journalism - he's speculating about a future which has already happened in some places.

xxgreg··on Tesla Motors plans to debut cheaper car in early 2015 (2013)
To be fair the Tesla is aiming for a Model E range of ~200 miles, vs ~100 for the i3. So getting double the miles for the same price is a good deal.

(Though the i3 does have an ICE range extender option which gives it ~200 miles too)

xxgreg··on Apple's Buttonless Mouse Came From Steve Jobs' Misunderstanding
I remember using one of those mid nineties - I think is was a Sun workstation. It had a metallic mouse pad with a grid pattern etched into it.
xxgreg··on Dart Lang 1.2 Released
"if the VM eventually becomes much faster than the dart2js path, Google can essentially force other browsers' hands by adopting Dart on Google sites"

Or all of the browser vendors could sit down and design a new language based on the experience gained from implementing Dart. This new more easily optimizable language can become a new web standard. After all this is what happened with SPDY and HTTP2.0. This "new language" could also just be a new version of Javascript with a few backwards incompatible changes.

One interesting claim of the DartVM authors is that they have achieved a 10x start up gain over Javascript when using script snapshots. If this turns out to be true, it will add significant pressure for other vendors to implement a similar feature. The only way to get this to work in Javascript is to make backwards incompatible changes. For example only allowing a static top-level structure, as in Dart.

I see the competition from Dart as being good for end users, as it adds pressure on Javascript to evolve. It's also interesting to see the V8 team porting a number of Dart's optimisations to V8.

xxgreg··on Dart Lang 1.2 Released
It works. There are a few people using it server side. There is a Heroku build pack. The HTTP server is a bit slow, sounds like this is being addressed, and shouldn't be a limiting factor. I wrote a postgresql driver, which works ok. More users, issues filed and patches are always welcome ;)
xxgreg··on Dart Lang 1.2 Released
The best bit about Dart is not new features, but many of the footguns that have been removed compared to JS.

Note: Dart doesn't have generators, and Ecmascript is not planning on adding optional types.

xxgreg··on Dart Website Relaunch with 1.0 Release
One big advantage of top-level declarations is it is possible for the VM to use a snapshot for fast start up.

This is not really possible if you must interpret top level code to build up your top-level declarations, as done in JS.

Using snapshots, the Dart authors have said it should be possible to improve script start up time by 10x over V8. This is a big win for large script heavy apps.

Edit: link https://www.dartlang.org/articles/snapshots/

xxgreg··on Dart Website Relaunch with 1.0 Release
FYI - the Angular team have ported Angular to Dart.
xxgreg··on Dart Website Relaunch with 1.0 Release
"pushing comp-sci forward"

nit - The Dart team have explicitly said that they are not doing any features based on new computer science research. The Dart project is built on pragmatic engineering decisions, rather than "pushing comp-sci forward".

This is a good thing in my opinion.

xxgreg··on Dart vs Java — the DeltaBlue Benchmark
Nikolay has also ported the Richards and Tracer benchmark.

http://bonovox.be/blog/dart-vs-java-richards-and-tracer/

xxgreg··on Dart vs Java — the DeltaBlue Benchmark
Yes - benchmarks need to be ported very carefully to make sure they measure something meaningful. What makes you think that there are problems with this port?

It is an old well used benchmark, used for benchmarking object-oriented code with polymorphism.

xxgreg··on Dart vs Java — the DeltaBlue Benchmark
Sure, take all benchmarks with a grain of salt.

However it's worth noting that deltablue has been used to benchmark polymorphism in Smalltalk, Self, the JVM, and V8.

Some of Nickolay's numbers are from a version of the code written at Sun labs, presumably for the very purpose of benchmarking the JVM.

I think it's safe to conclude that in many cases the DartVM already performs similarly to the JVM, albeit with a much better start up time.

Charles Nutter has some interesting follow up comments here:

http://blog.headius.com/2013/05/on-languages-vms-optimizatio...

Basically concluding that it's not static typing that matters, but predictable types.

xxgreg··on Dart Is Not the Language You Think It Is
Yes - It's difficult to describe the difference in one sentence ;)

I agree that there are many shades of the rainbow between a JIT and an interpreter.

"V8 compiles JavaScript source code directly into machine code when it is first executed. There are no intermediate byte codes, no interpreter." https://developers.google.com/v8/design#mach_code

Have a read about V8 and the DartVM's architecture. V8, and the DartVM have a different architecture than IE's Chakra and Firefox's monkeys. They use a method JIT which initially generates very simple native machine code directly from the AST. The machine code includes instructions to identify hot code, which is re-compiled again from the AST. The optimizing compiler converts the source into an SSA form, and IR, but this is not byte/bitcode. This is what Bak et al are referring to when they call this architecture a "source code vm".

Lars Bak on channel 9: Bytecodes are a silly thing in my mind. They can be used for different things interpretation. But interpreters are really slow. But they can also be used as a wire format, for instance in .net or java where that's what you ship over the wire. In javascript the wire format is sourcecode, and for each function you have, inside the running javascript program, you have to cook up the source code again. So that is the primary representation. So we just decided why not generate native code right away because the CPU is pretty fast.

http://media.ch9.ms/ch9/e6aa/354bf580-9c93-4383-bab3-cb6a3dd...

xxgreg··on Dart Is Not the Language You Think It Is
"Dart is purely object oriented"

Languages such as Java and C# have a distinction between objects and primitives such as int and bool. In Dart all types are objects - even null! This is why Dart is pureOO.

Dart has some of the classic higher order functions in it's core library - i.e. map, reduce etc. But it's not a functional language like Haskell.

xxgreg··on Dart Is Not the Language You Think It Is
Dart can run in production mode where type annotations have no effect, or in checked checked mode where they will trigger a runtime error (i.e. behave like an assert). So you're both right ;)
xxgreg··on Dart Is Not the Language You Think It Is
> It would be nice if Google maintained mirrors on Github and accepted pull requests and such, but I don't see that ever happening.

Actually, external contributors John Evans and Ladislav Thon submitted and landed patches via github.

https://chromiumcodereview.appspot.com//10168022 https://chromiumcodereview.appspot.com//10166019

Not all of the code is on github but many libraries are. Web ui is developed via github. See here for a full list:

https://github.com/dart-lang/

xxgreg··on Dart Is Not the Language You Think It Is
Yeah - it would be nice if dart2js supported externs as in the closure compiler. I imagine that will happen at some stage.
xxgreg··on Dart Is Not the Language You Think It Is
The pub package management tool allows you to fetch libraries from a git repo or the local filesystem, see here:

http://pub.dartlang.org/doc/dependencies.html#git-packages

← PreviousPage 5 of 6Next →