LoginSignup
6
6

More than 5 years have passed since last update.

Windows で Flow を触ってみる

Last updated at Posted at 2014-11-20

追記: 2014/11/21 19:34
こんなページが出来てました。
http://www.ocamlpro.com/pub/ocpwin/flow-builds/
更にバージョンアップしているようです。


今巷で話題の flow を触ろうと思ったのに Windows 版が無い!と嘆いてたら、こんなコメントが投稿されてた。

Windows 用にビルドしてくれているみたいなので早速試してみる。
まずはファイルをダウンロード
http://www.ocamlpro.com/pub/ocpwin/flow-builds/flow-simple-windows-20141119.zip

zip を解凍すると中身はこんな感じ

.
├── flow32.exe
├── flow64.exe
├── lib
│   ├── bom.js
│   ├── core.js
│   ├── dom.js
│   └── react.js
└── Readme.txt

次に環境変数 FLOWLIB に lib ディレクトリのパスを指定しておく。

Cygwin:

$ export FLOWLIB=c:/cygwin/home/user/flow-simple-windows/lib

Cmd:

$ set FLOWLIB=c:/cygwin/home/user/flow-simple-windows/lib

後は実行するだけ。

とりあえず、以下のサンプルから 01_HelloWorld を試す。
https://github.com/facebook/flow/tree/master/examples

まずは失敗例

hello.js
/* @flow */

function foo(x) {
  return x*10;
}

foo("Hello, world!");
{ 01_HelloWorld }  » ~/flow-simple-windows/flow64.exe single .

C:\Users\hoge\.babun\cygwin\home\hoge\flow-master\examples\01_HelloWorld\./hello.js:7:5,19: string
This type is incompatible with
  C:\Users\hoge\.babun\cygwin\home\hoge\flow-master\examples\01_HelloWorld\./hello.js:4:10,13: number

Found 1 error

次に成功例

hello.js
/* @flow */

function foo(x) {
  return x*10;
}

// This is fine, because we're passing a number now
foo(10);
{ 01_HelloWorld }  » ~/flow-simple-windows/flow64.exe single .

Found 0 errors

ちゃんと動いているっぽい。

興味のある方は試してみては。
※ただし自己責任でお願いします。

元記事: Windows で Flow を触ってみる - 2noの日記

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6