HNHacker News
TopNewBestAskShowJobs

ahoge

1,026 karma · joined December 11, 2011

submissionscomments
ahoge··on Building modular applications with Riot.js, the 1kb MVP library
The semicolons are still randomly used.

The demo application has several scripts after /body. `navi` should be `nav`.

> Pure HTML is cleaner and passes W3C validator.

The demo does not pass the W3C validator.

ahoge··on We switched from an icon font to SVG
You do that inside the SVG. Instead of having a yet another path or a group of paths, you just have that `use` element (which just references some other node).

Basically, it lets you reuse something, but you can transform it and set some styles.

http://kaioa.com/svg/chemicalzen3.svg

http://kaioa.com/svg/chemicalzen3_parts.png

The "master" shape is used to create the outline and it's also used to clip the "interior" layer.

http://kaioa.com/svg/armyofclonesani.svgz

There is just one dude. Then there is a row of clones. And then there are transformed clones of that row. Only the original dude is animated.

Edit: A big benefit of clones is that they are always in sync. If you change the shape of the original, the clones follow suit.

ahoge··on We switched from an icon font to SVG
> As we were just duplicating the same icon multiple times within the same file, it compressed down to the size of just one icon

SVG allows you to create clones with the `use` element. Any style which wasn't set by the original can be set by the clone.

E.g. if you don't set `fill`, the original will be filled with black and the clones can be filled with some other color.

ahoge··on Gap between asm.js and native gets narrower with float32 optimizations
There weren't more than 9 quadrillion tweets though.

    >>> Math.pow(2,53) / Math.pow(10, 9) / 7
    1286742.7506772846
Over a million tweets per person? Certainly not.
ahoge··on Gap between asm.js and native gets narrower with float32 optimizations
Very few applications need "big" (in this case: > 2^53) integers.

So far, I only needed them once. I ported a big int micro benchmark a few months ago. Kinda meta. Not sure if that really counts.

ahoge··on Gap between asm.js and native gets narrower with float32 optimizations
> Integer/float semantics and support for large integers don't work (it seems like they didn't implement them manually, so it just falls back to doubles?)

Integers work fine up to 2^53 (9 quadrillion and some).

There is also a "throw_on_javascript_int_overflow" flag, which you can use during development.

ahoge··on Koa – Next-generation web framework for Node.js
In most environments, writing something like `if (x = 5)` will generate a warning.

E.g. if you use JSHint, you'd get:

"Expected a conditional expression and instead saw an assignment."

Nowadays, there usually isn't any benefit in using yoda conditions.

ahoge··on CSS Variables in Firefox Nightly
They have a watch mode and there are also source maps or debug mode. It's basically as if browsers would support it natively. The workflow is fine, really.
ahoge··on Google employee ports Amiga emulator to Chrome
Ported to Chrome? That editorialized headline is kinda wrong. It's pNaCl. With pNaCl, you can have an Emscripten fallback, if you want.
ahoge··on Why you should use OpenGL and not DirectX
If you use pNaCl, you can have an Emscripten fallback.
ahoge··on Notch, WebGL, Dart, and ramping up quickly
> why do you think he went with Dart?

I'd guess because it offers more structure than JavaScript. You have classes, packages, and you can just `import` things. You also get proper tooling. You can also overload operators, which is kinda nice for games (vector math).

He wrote a lot of Java and AS3. Dart is very similar. Just a bit terser and a bit "scriptier".

ahoge··on CMS Trap
Oh, you.
ahoge··on CMS Trap
> A pretty web interface isn't a must-have requirement.

According to most definitions of "CMS", it is. With static website generators, editing, versioning, publishing, etc is done externally. They aren't systems which encompass all of this. They just punch some content into your templates and write the result to disk. That's all they do.

ahoge··on CMS Trap
Jekyll is a static website generator. It doesn't let you edit and publish content from a central interface. It's not a CMS.
ahoge··on Google is building a Chrome app-based development environment
Yes, Chrome Apps can make use of the Chrome Platform API which allows them to do all kinds of privileged things (if the required permissions were given).

http://developer.chrome.com/apps/api_index.html

So... yea, it's very similar. Both are some sort of web-related runtime which can be used for all kinds of applications thanks to additional APIs which make the environment less restrictive.

ahoge··on Google is building a Chrome app-based development environment
Firefox's addons also only work with Firefox. Thunderbird and Komodo also only work on top of the Mozilla platform. Eclipse and Netbeans needs Java. A bunch of apps need Air.

You can make this work inside XULRunner if you want. You only have to write some library which provides the same API as the chrome_gen package (reading/writing files etc) and then import it instead of chrome_gen or just overwrite the package. Everything else is regular web stuff.

Anyhow, using some apps which use Chrome as runtime doesn't meant that you have to use Chrome as default browser. You only need to have it installed. Just like any other runtime you're using.

ahoge··on Lying Google advertising, or Google uses Adblock in its ads
Do you see any ads if you search for oldest sweet shop near mochi gate lahore? I don't.

I also don't get any if I search for nipplegate, for example.

You see, those ads depend on the used search terms. If no one bids on those words, you won't see any ads.

ahoge··on JavaScript, The Final Frontier
> interpreted languages

Being interpreted is an implementation detail. For example, V8 (Chrome's JS engine) doesn't have an interpreter. It compiles to (quick and dirty) machine code right off the bat. Later, the "hot" parts are compiled to better more optimized machine code.

There are also several C interpreters.

ahoge··on Australis is landing in Firefox Nightly
> the removal of the "thin" address bars/small icon sets

Oh, man. :/

ahoge··on Australis is landing in Firefox Nightly
Looks pretty wasteful. I prefer how it currently looks on my machine:

http://i.imgur.com/PvlTZ3k.png

My tabs can get as small as the pinned ones on the left (which is the default behavior of every other browser).

There used to be a about:config setting for minimum tab width, but one(!) Firefox developer decided to remove it, because:

"Users can override this using userChrome.css if they absolutely want it. I don't think the prefs are worth it."[1]

Now I have to use a custom user chrome CSS file and disable the tab animations to get the same effect.

I really hope this pointless update won't make me jump through a dozen hoops again. I'm tired of it.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=574654

ahoge··on Why I use a 20-year-old IBM Model M keyboard
I prefer flat laptop-like keyboards. They are cheap, quiet, and they also seem to cause the least amount of strain.
ahoge··on What 4chan thinks of HN
It's the only way to add some kind of "inline" links. It's just a side-effect of some arbitrary limitation.
ahoge··on Dart 1.0 Is Out
How many years did it take JavaScript to become a multi-vendor standard?

Let's see... Netscape Navigator 2.0 was shipped with it in September 1995 and ECMA-262 1st Edition was written in June 1997 and finally approved in April 1998.

However, the 1st edition was done entirely by Netscape (by the looks of it). So, this doesn't count as a multi-vendor standard since there wasn't any involvement by any other vendor.

Looks like you're being a bit unreasonable. Dart isn't even shipped yet in one browser and you're already complaining that it isn't a multi-vendor standard yet. Going by JavaScript's timeline, it still has more than 3 years for getting to that point.

ahoge··on Dart 1.0 Is Out
> If someone else did something bad in the past [...]

Earlier you mentioned "far past", but this stuff is fairly recent:

Firefox 2 - October 24, 2006

Firefox 3 - June 17, 2008

Firefox 22 - June 25, 2013

> while it's very possible some were released before being standardized

Nothing of this is in ES5.1.

> they are all being standardized now

Yes, just like Dart.

> For example, WebGL was designed through a standards process, and it is great.

No, that's not how it happened. [1]

Experiment by Mozilla - 2006

Implementations by Mozilla and Opera - 2007

WebGL Working Group - 2009

1.0 spec - 2011

And all of this is based on Canvas which is something Apple made up.

Anyhow, you seem to think that this kind of thing is a problem. It's not. This is how the web works. This is how progress is made.

[1] http://en.wikipedia.org/wiki/WebGL#History

ahoge··on Dart 1.0 Is Out
Yea, Firefox 2.0+ is shipped with support for generators/iterators, array comprehension, let, and destructuring assignment:

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

Firefox 3.0+ added support for expression closures and generator expressions:

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

Firefox 22+ supports fat arrow functions. Just open the console and try it yourself:

  >>> let z = x => x * x;
  undefined
  >>> z(5);
  25
  >>> let y = (a, b) => a * b;
  undefined
  >>> y(2, 3)
  6
None of these features are standardized yet.
ahoge··on Dart 1.0 Is Out
> [Dart] is not an open standard

It will get standardized in the not too distant future. [1]

> Apple dominating the mobile web

Huh? Android's market share is over 80%. iOS got about 13%. [2]

[1] http://www.ecma-international.org/news/Dart%20workshop.htm

[2] http://thenextweb.com/insider/2013/11/12/idc-android-hit-81-...

ahoge··on Dart 1.0 Is Out
The VM already works on Android (x86 and ARM - not sure about MIPS).
ahoge··on Dart Website Relaunch with 1.0 Release
main()=>print('Hello World!');
ahoge··on Dart Website Relaunch with 1.0 Release
>fib(n) => n < 2 ? n : (fib(n - 1) + fib(n - 2));

+ the laziest way to do memoization:

var cache = new Map();

fib (n) => cache.putIfAbsent(n, () => n < 2 ? n : fib(n - 1) + fib(n - 2));

ahoge··on Dart Website Relaunch with 1.0 Release
> enterprises locked in a system

Why would anyone do that? We have a super nice solution for that. It's called "site-specific browser" or SSB.

It's like a browser without address bar, which automatically opens a specific URL on start up.

You can have one per intra-/extranet application and you can update them individually on a as-needed basis.

You get all of the benefits of a fixed platform without any of the downsides. Well, you'll need a little bit more RAM and and a little bit more HDD space, but that really shouldn't be an issue.

← PreviousPage 9 of 16Next →