HNHacker News
TopNewBestAskShowJobs

ahoge

1,026 karma · joined December 11, 2011

submissionscomments
ahoge··on Asm.js in Firefox Nightly
asm.js is currently only a usable target if you use C.

You also can't compile JS to asm.js, for example.

You get C-like performance by writing C.

ahoge··on Asm.js in Firefox Nightly
VB uses garbage collection. You can't compile it to the JS subset of asm.js.
ahoge··on Asm.js in Firefox Nightly
V8 is about 100 times (seriously) faster than IE6's JS engine. So, yes, "backward compatible with IE6" doesn't really mean anything.

After executing 5 million statements, IE will ask you if you want to continue. It will ask you many times. You'll probably sit there all day long clicking the whatever button.

ahoge··on Start — Dart web framework inspired by Sinatra
> Languages that compile to JS are very common in 2013 web dev.

Here is a nice list:

https://github.com/jashkenas/coffee-script/wiki/List-of-lang...

ahoge··on Start — Dart web framework inspired by Sinatra
Dart is supposed to be "boring". Their intention was to create a language which is familiar to anyone who used Java, C#, AS3, JavaScript, or any other C-like language in the past.

From my own experience, I'd say that this strategy worked exactly as intended. I was able to write code after skimming through some of the examples. To be honest, I only bothered with Dart because it used C-like syntax.

Also, it compiles to surprisingly fast JavaScript [1]. Support by all browser vendors isn't necessary. You can use it either way. The lack of support really doesn't change anything. You'd use a build/deploy script either way, wouldn't you?

[1] https://plus.google.com/u/0/114943499066504644906/posts/WXNL...

ahoge··on I’m done with the web
> Ember [being 49kB in size is] still far too big for many. Yet we conveniently forget that loading just a few images will quickly surpass that 49K of code.

50kB of compressed and minified JS aren't the same as a 50kB JPEG. The JS must be parsed and compiled which is a far heavier operation than decoding an image.

The last time I looked, it took about 100msec to parse and compile 100kB of minified and gzipped JavaScript on a desktop. However, after all of this you still won't get the full speed. It needs to run for a bit and then the hot parts of the code will be replaced with more optimized code. Again, this takes some precious resources.

An image, on the other hand, is decoded within a few msecs and that's the end of that.

Size is just one metric. It won't tell you the whole story.

ahoge··on Why people shouldn’t love you for who you are
Oh, this one is fun. As far as everyone else is concerned, you're only defined by your actions. What you do is who you are.

You can do whatever you want.

What a twist!

ahoge··on Asm.js: A Low Level, Highly Optimizable Subset of JavaScript for Compilers
>The fact that I have to buy a new computer to play 8-bit games that were available on DOS and run fine on 386 is kind of ridiculous (but hey, they're over the internet).

320x200 with 16 or 256 colors and maybe 15 fps?

Your magical nostalgia glasses are perhaps a little bit too thick.

ahoge··on From jQuery to JavaScript and back again
FWIW, they fixed that crap in Dart. All those array-like things are indeed just regular arrays.
ahoge··on Caffeine Jitters
Guarana is just a different source of caffeine.

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

ahoge··on Preventing users from pouring water into coffee machine beans compartment
>some people still drink [...] instant

They probably just don't know how to operate the machine.

ahoge··on I’m Tired Of Companies Ripping off our site, So I’m Calling Them Out
I'd be more worried about the horrible loading times. That's what will hurt your conversion rates, not those copycat sites.
ahoge··on Why you should use WebGL
WebGL is supported by Opera Mobile and Firefox for Android. The next version of the Backberry browser and Chrome for Android will support it, too.

It's very unlikely that IE will ever support WebGL, because Microsoft is against OpenGL in general. If you start with OpenGL, you probably won't bother with DirectX, which means you won't tie yourself to their ecosystem. That's obviously not in their interest.

Fortunately, IE has been constantly losing market share for the last 4 years.

ahoge··on Flight: A lightweight, component-based JavaScript framework from Twitter
There is no difference. There is one identifier which ties them together. If you change that identifier on one side, but not the other, it will stop working.

It doesn't matter if that identifier is a class or something else.

Well, if it's a class people may feel inclined to reuse that identifier on the CSS side, which is a bad thing, because now you've tied 3 parts together instead of just 2. If I use classes for this, I prefix them with "js-" to indicate that they are only meant for scripting purposes.

ahoge··on Flight: A lightweight, component-based JavaScript framework from Twitter
The best thing you can do is to connect those parts by one semi-generic identifier. There is no actual difference between using a class, an id, a data-attribute, or a ng-* attribute as hook. If you want to rename it, you have to rename it. If you want to move things around, you have to move them around. There is no way around it.

Your template will also use names of properties, arrays, and objects directly. There also isn't a way around that.

At some point you have to connect your pieces. They can't float around in mid-air forever.

The presentational things you mentioned are different. We can separate those things more, we can use abstractions, and we can make it extremely reusable.

ahoge··on The PNG image file format is now more popular than GIF
256 colors (well, 256 RGBA tuples) aren't always enough. Just look at the kind of images used by those heavy parallax websites.

Larger photo-based images will always look terrible, no matter which kind of dithering is used.

ahoge··on The PNG image file format is now more popular than GIF
That only works for background images. Plus, the UA will send a request for the webp image even if it can't read the format. It needs the mime type to figure that out.
ahoge··on The PNG image file format is now more popular than GIF
Mozilla is still against it. Makes me kinda angry, actually. They killed MNG/JNG, because it added like 100kB to the installer and because we should just use Flash instead (seriously). It's now a decade later and we still don't have a lossy RGBA format.

If quantized PNG8s aren't good enough, you can only use gigantic PNG32 files, which are over 5 times larger than JNG or WebP files. I've seen websites which were over 5MB thanks to that limitation. It's ridiculous.

I wish they had at least kept JNG. It's a fairly simple JPG/PNG mashup format. If you already use JPG and PNG libraries, supporting JNG won't add much weight.

ahoge··on Flight: A lightweight, component-based JavaScript framework from Twitter
>My template knows that submission should be handled by `addTodo()`? Or even worse, looping.

Most template engines support loops. Would be very weird without that capability, really.

Also, you have to add hooks to buttons and the like somehow. There isn't much of a difference between adding a class like "js-addWhatever" or using Angular's in-your-face approach.

ahoge··on Flight: A lightweight, component-based JavaScript framework from Twitter
There are a alternatives:

https://github.com/jashkenas/coffee-script/wiki/List-of-lang...

I, for one, really like Dart. It's very nice to use.

ahoge··on Stupid Languages
That's how JS works. You can pass as many extra parameters as you want (they get discarded) and you can also omit as many parameters as you want (it's like passing undefined).

The array-like `arguments` object will always reflect what was actually passed to the function though.

ahoge··on Latency – the sine qua non of AR and VR
http://en.wikipedia.org/wiki/Saccadic_masking
ahoge··on How I Made my Blog 2.3x Faster
It's actual data from one actual (and very common) use case.

Also, the document itself is just one fairly small piece of the whole puzzle.

ahoge··on The Future of Games on the Web
You can't protect your assets in a Flash game either.

In general, your assets are only protected by copyright.

ahoge··on Json ⊄ js
It's 2^53 (9 quadrillion).

Math.pow(2, 53) === Math.pow(2, 53) + 1 // true

Math.pow(2, 53) === Math.pow(2, 53) - 1 // false

ahoge··on Rice Cooker Hacks - The Ebert Way
In the anime, they actually explained how to cook bread in a rice cooker at the end of one episode.
ahoge··on The Dart VM is now 50% faster than V8 on the two Octane benchmarks
One could argue that every application which would benefit from OSR is essentially a micro benchmark.

I can't disagree with that, because that statement is absolutely true. The only difference between those two kinds of programs is the intention of the programmer. In both cases you have at least one heavy function which is called just once. As far as the VM is concerned, there is no difference whatsoever.

But it's also true that there are sometimes long running functions which are aren't frequently called. In Java, JavaScript, or C# you won't have to worry about that kind of thing. You won't have to break it down in smaller pieces just for the sake of spreading the load across more function calls.

ahoge··on The Dart VM is now 50% faster than V8 on the two Octane benchmarks
Unlike JavaScript, Dart was created with performance (and tooling) in mind. There are a few people involved who worked on several VMs such as HotSpot or V8. JavaScript didn't have that kind of guidance. There are some features in JavaScript which make optimizations very difficult or even next to impossible.

The most obvious ones are probably `eval`, `with` (each property can mean something different with every iteration), and messing around with `arguments` (changing values of that pseudo array also changes the values of the actual named parameters).

You can also change, overwrite, and delete everything. `this` can also refer to something different each time.

Those quirks make JavaScript VMs very complicated and they also result in many surprises. For example, using `delete` can degrade performance quite a bit and adding properties to built-in objects can break some optimization-related heuristics.

Dart just skipped all of that really nasty stuff.

Well, to be fair, they also skipped one of the very useful nasty parts: on-stack replacement (OSR). If there is just one long-running function it won't get optimized (it won't get replaced - right there on the stack - with an optimized version).

Generally, this doesn't matter much, but there are some cases where it's really inconvenient.

It's safe to assume that they will address this once they are done with all optimizations they deem more important. I'd guess it will happen before they hit the big 1.0 (M1 = 0.1-ish).

ahoge··on Bootstrap 2.2.2 is out
Compass (which was built on top of Sass) does sprite sheet generation and cache busting. It's also shipped with a bunch of pre-defined CSS3 mixins.

Sass also allows you to put media queries inside your rule blocks. (In the future, this will be also possible in regular CSS.)

ahoge··on Math Envy and CoffeeScript's Foibles
I assumed your comment would be related to the article, my bad.
← PreviousPage 14 of 16Next →