Modules: stories of future past
This blog is where I post up various half-baked ideas that I have. All PostsCategoriesGitHubTwitterRSS/Atom feedsSelected posts: The borrow checker withinEmpathy in open source: be gentle with each other There is currently some ongoing effort to implement the proposed JavaScript SIMD API in Firefox. The basic idea of the API is to introduce explicit vector value types called float32x4 and int32x4.
概要 Promiseとは非同期処理を上手く扱う為のAPIであり、パターンである。 非同期の処理の完了後に続けて処理を行いたいとき、よくコールバックパターンが使われるが、処理が連続するとコールバック地獄と言われる分かりづらいソースコードになってしまう。 また、複数の非同期処理が完了した時に処理を行うなど、コールバックパターンでは難しい事をスマートにできるのがこのPromiseである。 今まではDOMの方でDOM Promiseとして仕様策定が進められていたり、ライブラリのDeferredが有名だったが、ES2015標準に入ることになり、V8に実装された。 実装されたメソッド Promise.resolve(x) Promise.reject(x) Promise.all( [p1, p2, p3, ......] ) Promise.race( [p1, p2, p3, ......] )
Update 2013-11-22: David Herman has published the slide deck “Status Report: ES6 Modules”. [1] is an introduction to ECMAScript 6 modules and how they can be used in current browsers. In contrast, this blog post explains how future browsers will support them natively. As part of that support, we will get the <module> tag, a better version of the <script> tag. Browsers: asynchronous modules, synchr
es**シリーズの仕様意訳第二回。前回はesprimaでした。今回はestraverse。 estraverse estraverseはASTの巡回コードをお手軽に書けるようにするモジュール。 ASTは子ノードのプロパティ名がまちまちなので、巡回させるコードを書くのが結構手間なんで重宝する。 基本的にesprimaの吐いたASTをestraverse.traverseに喰わせるだけでOK。 ここらへんも本当によくできていて、esprimaとestraverseは疎結合を保っている(AST仕様のみで結びついているといってもよい)。 ではいってみよう。estraverseと、ASTを吐かせるためのesprimaをnpmからとってくる。 npm install esprima npm install estraverse 以下のようにコードを作成。 var esprima = require('
If you know about Either, Maybe and JS generators already just take a look at the code. Javascript ES6 is likely to introduce generators into the language. A number of cool things are enabled by generators' ability to control the flow of a function from outside. I've used them here to build a useful boiler-plate reduction tool similar to the idea of Haskell's Either and Maybe. It's not intended as
Способы применения JavaScript сильно изменились за последнее время. Но сам язык начал меняться только сейчас. Я расскажу вам, что нового нас ожидает в E…
💡 Personal notes about somthing I'm interested in Date.parse(‘1999-07-07’)を実行すると、値は931305600000とUTCのタイムゾーンで解釈されるのに対して、Date.parse(‘1999/07/07’)を実行すると、値は931273200000とJSTのタイムゾーンで解釈される。あ、ローカルの時間がJSTの場合。現時点(Firefox 24、Chrome 31) Date.parseでは引数に与えられた文字列をパースして、ミリ秒の値を値を返してくれます。タイムゾーンの指定がない場合はローカルのタイムゾーンとして解釈される。ECMA-262では、以下のように説明されています(太字は私がつけた)。 15.9.4.2 Date.parse (string) The parse function applies t
We exist to give all people the freedom to belong, to connect with others, to share their passions and be accepted in a safe, trusted environment. We’re the technology and media company behind thousands of online communities and dating sites around the world. Through our portfolio of niche websites, apps and other channels, we help people live their happily ever now and build a better, more incl
JavaScript 1.8.5: New Features ExploredAI-enhanced description The document discusses the new features introduced in JavaScript 1.8.5, highlighting improvements in arrays, object properties, and functions. Key features include methods like trim() for strings, map(), reduce(), and isArray() for arrays, and property descriptors for objects. It also emphasizes the importance of using 'strict mode' an
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く