5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Node.jsの上位互換のDenoビルドするまで(TypeScript+V8処理)

Last updated at Posted at 2018-09-28

denoとは

node.jsの生みの親であるRyan Dahl氏にがNode.js開発においては複数の「ミス」を考慮して開発したTypeScript処理系です。

Node.js における設計ミス By Ryan Dahl - from scratchこちらのブログにどのような「ミス」がありきになる方はこちらの方を参照してみてください。

今回のこの記事はry/denoをビルドする (Node.jsの産みの親が作ったTypeScript+V8処理系)を参考に書かせていただきました。

環境

  • macOS: Mojave version 10.14

※ 今回の説明はmacOSでの説明になります。他のOSでの環境構築に関してはgithubのリポジトリなどを確認しながら行ってください。

Golangの構築

demoはGolangで書かれているので、Golangの環境構築が必要となります。

terminal
$ brew install go
$ go version
  go version go1.11 darwin/amd64

これでinstall自体は完了です。

Goは作業場所として、 $GOPATH を設定する必要があります。
今回は公式の方に従い $HOME/go で作りたいと思います。

terminal
$ export GOPATH=${HOME}/go
$ export PATH=$GOPATH/bin:$PATH

v8worker2をビルドしてみる

基本的には、githubを参照しながら作業の方を進めました。

terminal
# Fetch deps.
$ git clone --recurse-submodules https://github.com/denoland/deno.git
$ cd deno
$ ./tools/setup.py

# Build.
$ ./tools/build.py

ここのどこかでErrorを吐かれた場合は適宜調べながら作業を進めてください。自分の場合rust installしていなくて./tools/setip.pyがつまづきました。

実際に走らせてみる。

terminal
$ ./out/debug/deno tests/002_hello.ts
  Hello World

成功です!

感想

実はtwitterで少し前に自分のTLに回ってきて少し興味があったのですが、リアルが忙しく、今は落ち着いてきたのでぇということでやってみました。

deno自体がかなりプロトタイプレベルなので、これからどんな感じになっていくのかすごい楽しみです。

皆さんもぜひ触ってみてください。

5
3
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
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?