HNHacker News
TopNewBestAskShowJobs

ahoge

1,026 karma · joined December 11, 2011

submissionscomments
ahoge··on Valencia region government completes switch to LibreOffice
>let's assume that MS Word will give you a 1% performance increase over LibreOffice

That's a pretty big assumption.

I've used both products. I didn't notice any noteworthy differences when it came to regular usage. I actually think the new-ish Ribbon UI is extremely confusing and slow to navigate.

This certainly isn't like Gimp vs Photoshop.

ahoge··on Sayonara, V8
>I wasted a handful of weeks digging around in debug builds looking at bailout log entries and trying to decipher their IR using the broken log viewer they recommend, and the net result was that my code ended up faster for a few weeks until V8 changed again.

You have the same problem with any other modern JavaScript VM. There is always lots of magic and some heuristics which can easily break. As a result, performance is hard to predict.

For what it's worth, Dart fixed that. Predictable performance was one of its main goals/constrains.

ahoge··on Toward Modern Web Apps with ECMAScript 6
>ECMAScript 4 had to be dropped when people realized that turning JavaScript into a JS-Java hybrid increased complexity rather than decreasing it.

AS3 (which completely conforms with the ES4 draft specification) is a lot nicer to use than JavaScript (ES5.1 included). It gives you means to organize your code and your tools also have a clue what you're doing.

TypeScript is very similar.

ahoge··on The De-evolution of My Laptop Battery
http://en.wikipedia.org/wiki/Lithium-ion_battery#Battery_lif...

> The rate of degradation of lithium-ion batteries is strongly temperature-dependent; they degrade much faster if stored or used at higher temperatures.

That might be related. MacBook Airs get really hot even if you aren't doing anything too taxing.

ahoge··on JavaScript right on the hardware
Language specifications are important for interoperability. They are very useful for people who write tools like smart IDEs or linters. They are also interesting for people who want to create their own VM or compiler. There are various JavaScript and Java VMs. There are also various C and C++ compilers.

But there are also users who read them if they think that some particular behavior is puzzling. Then they check the spec to see if this stuff really is supposed to happen or if this is something which wasn't properly specified.

For example, there was a 50:50 split when it came to the behavior of SVG masking. As it turned out, that part of the spec was just confusingly written and the compliant behavior was actually really silly. The spec was changed and now every browser does the same intuitive thing.

Without this "central authority" there wouldn't have been a way to get this fixed.

Dart is another interesting example. They had a specification since the beginning and every part of the ecosystem follows it. This way, different teams (and even different companies) can create all kinds of tools which all have the same precise understanding of the language. Naturally, this also helps with identifying spec issues.

Without a specification, you have to reverse-engineer the behavior and you might end up being forced to replicate some really nasty crap. Some of JavaScript's warts were set in stone this way.

ahoge··on JavaScript right on the hardware
There still isn't any language specification, is there?

JavaScript, TypeScript, and Dart have one.

ahoge··on We Give a F*** How the Site Loads
One of our clients once complained that one of their web fonts weren't loaded.

The file in question was blocked by their stupid proxy because its name was "brandSansExtended", which happens to contain the substring "sex".

ahoge··on Sum of 1 to 1000000000 in different programming languages
Yep, there are only doubles in JavaScript. With doubles, integer values work fine up to 2^53. After that point, things get silly.

    >>> Math.pow(2, 53) === Math.pow(2, 53) - 1
    false
    >>> Math.pow(2, 53) === Math.pow(2, 53)
    true
    >>> Math.pow(2, 53) === Math.pow(2, 53) + 1
    true // derp
ahoge··on How serious is Google about Dart?
JavaScript turned out poorly because the first version was quickly thrown together (within 10 days, supposedly) by a single person.

Furthermore, this person didn't care about tooling and he also didn't have any clue about optimizing virtual machines.

Anyhow, any language or piece of technology needs to reach a certain state of maturity before it can be standardized. Once you standardized something, things are pretty much set in stone.

ahoge··on How serious is Google about Dart?
>Explain how a technology 100% designed and controlled by a single company is good for the open web.

Are you talking about JavaScript? ;)

http://en.wikipedia.org/wiki/JavaScript#History

ahoge··on How serious is Google about Dart?
>if all the early design decisions were made in secret

Sounds like any other language or any other piece of technology. No one starts with standards. This always happens some time after 1.0.

http://en.wikipedia.org/wiki/JavaScript#History

first shipped in beta releases of Netscape Navigator 2.0 in September 1995

In June 1997, Ecma International published the first edition of the ECMA-262 specification.

> you can fork Dart if you want

You don't have to. The tools and the VM will continue to work. In the late 90s, I used a compiler from 1989. It still worked fine and it still works fine today (e.g. via DOSBox).

I really don't know why everyone here seems to think that these kind of tools will self-destruct if left alone. They really don't do that.

> How are you going to get your Dart fork into a browser?

You don't have to. You can still compile to JavaScript. You can still use the VM on the server, for command line stuff, or on Android devices (there will be an ARM VM soon).

It would be only a problem if you wouldn't be able to use browser with native Dart support for client-side web development, because compilation takes a few seconds and because you wouldn't be able to debug from within the IDE.

ahoge··on How serious is Google about Dart?
>With Dart, Web authors may end up not shipping the JS fallback

Why wouldn't you? Minifying Dart or compiling Dart to JavaScript is basically the same. You invoke the very same command line tool just with different switches.

Why would you do one thing in your build/deploy script but not the other? Especially if doing so makes it incompatible for a significant chunk of your users. Most people won't even drop a 5% chunk (e.g. something like IE8).

>or not testing it [in other browsers]

I don't see how that's specific to Dart.

ahoge··on How serious is Google about Dart?
>I could not understand the decision to drop Chrome Frame.

They didn't drop Chrome Frame. It was a stopgap solution from the very beginning. It gave companies 4 (!) more years to fix their infrastructure. It did what it was supposed to do.

If you haven't done anything within those 4 years, giving you another 2 won't help either. You're clearly waiting for everything to fall apart.

ahoge··on Poll: Do you encrypt your email?
The only way to fix email is to make encryption mandatory.
ahoge··on Chrome 28 arrives with Blink, rich notifications for apps
> All those ES6 features are obviously in the standardization process.

Today they are, yes. Just like text-overflow:ellipsis (which was introduced with IE6) is now part of CSS3.

ahoge··on Chrome 28 arrives with Blink, rich notifications for apps
> Dart - obviously a way to create a two-tier web with Chrome being the only option for performance.

The performance of the generated JavaScript is okay. Typically, it's somewhere around 75% of the performance of handwritten JavaScript and it's still getting better.

Those -25% may sound like a big deal, but it's comparable to the performance from JS engines from last year.

ahoge··on Chrome 28 arrives with Blink, rich notifications for apps
> Every time Firefox introduces a cool new feature, they emphasize how it's standard, or being put into the standardization process [...]

No, not really. They just added `let`, iterators/generators, destructuring assignment, etc in 2006 without asking anyone. Today, you can even use it without opting-in (via: type="application/javascript;version=1.7"). This stuff is supposed to be in ES6 in the future.

Same deal with APNG. They just added it in 2008. It also isn't standardized.

Firefox also supports "jar:" URLs for some reason. Here is a demo: http://kaioa.com/b/0907/jartest.html

Well, all browser vendors are like that and it's generally a good thing. If one of those experimental things turns out to be useful, other browsers will adopt it. Good examples for that are things like JavaScript, XHR, or text-overflow:ellipsis.

ahoge··on How we perceive time: stop it slipping away by doing new things
> When your eyes shift from one position to the other, they take time to move and land on the other location. But here’s the kicker: you never see your eyes move.

http://en.wikipedia.org/wiki/Saccadic_masking

You can see your eyes move if you use the front cam of a mobile phone, because the stuff on screen is usually a bit laggy.

ahoge··on Chrome 27, Firefox 22, IE10, And Opera Next, Benchmarked
>Destructuring references is not yet supported on Chrome

Eh. Yea, Firefox got support for that (and `let` and generators/iterators), because they added it in 2006 (Firefox 2.0) as an experimental feature.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_...

ahoge··on Why to use Twitter, Facebook and Google Plus share links and not buttons
Which title? Anyhow, it's "JavaScript" with a capital 'S'.
ahoge··on Let's deploy via Git
They also offer VPS ("vServer") for about 8€/month. You can ssh into those, can't you?
ahoge··on AngularJS announces Dart port
During development, you can just use Dartium (a special build of Chromium with native Dart support). With Dartium, you can debug directly from within the IDE. There are also source maps if you ever need to debug it elsewhere.
ahoge··on What's wrong with JavaScript
> Dart VM will never be in IE , Firefox or Safari.

Same deal with CoffeeScript or TypeScript. But that shouldn't stop anyone since you can just compile to JavaScript. Minifying Dart and compiling Dart to JavaScript is almost the same thing. In both cases it's a single line which calls the compiler. If you already doing one of those things, adding the other one to your build script won't hurt one bit.

You can also use the Dart executable like Node. You can use it to write command line applications or web servers.

You can also embed the VM into other applications. Like V8, the VM itself is just a library.

There will be also a Dart VM for ARM CPUs a bit later this year.

> i would chose haxe instead of Dart , since it is compatible with some parts of javascript and one can use the DOM api directly

You can also interact with JS stuff if you use Dart. DOM stuff is done via 'dart:html', which provides a very idiomatic API. For example, all list-like things are actual Lists, which is very convenient. It's similar to jQuery, I'd say.

> Dart is great in theory but has little future.

It's great in practice, too. If you don't care about IE8, that is.

Also, Google is committed to Dart. They are also already using it for a bunch of new projects.

ahoge··on What's wrong with JavaScript
Dart fixes all of JavaScript's "WAT" quirks. There is proper lexical scoping, a lexically scoped `this`, no type coercion, no monkey-patching, and so forth. It also has a "method_missing" thing called "noSuchMethod".

But most importantly: It scales.

Structure is declared and not imperatively constructed. Your tools can tell what's going on without actually running the code.

ahoge··on Dart vs Java — the DeltaBlue Benchmark
> the homoiconi[ci]ty of JSON and JS

There is a package for making interacting with JSON more seamless and JavaScript-like:

http://pub.dartlang.org/packages/json_object

> Google being the main sponsor just makes me slightly wary of it

In that regard, I clearly prefer Google over Oracle or Microsoft. I was also happy with Sun back in the days.

ahoge··on Haskell in Production: 12 Months Building ApiEngine
The left and right cursor keys generally work.
ahoge··on Haskell in Production: 12 Months Building ApiEngine
> modern-looking web pages

Well, herein lies the problem: It's not a web page, it's a slide deck.

But I do agree in general. The slides alone are often not very interesting or useful without the talk. Hopefully, it was recorded.

ahoge··on Dart vs Java — the DeltaBlue Benchmark
> That said Dart isn't that JS2.

To me, it is. Dart fixed everything which was wrong with JavaScript. There is proper lexical scoping, a lexically scoped `this`, no type coercion, build-in classes/inheritance, built-in dependency handling, built-in annotations/doc-comments, and good tooling is also possible.

It really does scale and it's very nice to work with. Plus, there are a bunch of nice features like lambdas, mixins, and named arguments.

> Javascript as web bytecode just doesn't sound right to me.

Yea, it's kinda icky, but there doesn't really seem to be a way around it. Fortunately, dart2js' output is reasonable in terms of size and performance. Unfortunately, it doesn't work in IE8.

ahoge··on Dart Is Not the Language You Think It Is
>[JavaScript's] implementors and community have been quite unwilling to fix these issues [...]

You can't really fix things. It would break the web. You can only add stuff on top.

>JavaScript's scoping and variable hoisting are unnecessarily broken [...]

It will get a bit better with ES6's `let` keyword. Annoyingly, that keyword was introduced with Firefox 2.0 (October 24, 2006) but you still can't use it.

Even Node.js needs a switch.

ahoge··on Dart Is Not the Language You Think It Is
I literally meant none of JavaScript's flaws from the "WAT" talk.

Anyhow, JavaScript doesn't have any kind of generics or types. Do you really prefer that?

← PreviousPage 12 of 16Next →