Skip to content
프로젝트

소개

Godzilla는 ES2015 소스 코드를 Go로 변환하는 트랜스파일러이자 런타임입니다.

프로그래밍 언어 및 런타임

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
-2

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Godzilla: Go running JavaScript

Overview

Godzilla is a ES2015 to Go source code transpiler and runtime that is intended to be a near drop-in replacement for Node.js. It compiles ES2015 source code to Go source code which is then compiled to native code. The compiled Go source code is a series of calls to the Godzilla runtime, a Go library serving a similar purpose to Node.js.

Godzilla parses ES2015 source code with the awesome babylon. That means at the moment Node.js is required for compilation. As Godzilla becomes mature, babylon will be compiled to Go source code using Godzilla itself so that the Node.js dependency can be dropped.

Note that Godzilla is at a very early stage and only very few language features are implemented

asciicast

Compiling

Make sure Go and Node.js are installed properly, then run:

$ make

Running

$ echo "console.log('Hello, Godzilla')" | bin/godzilla run
Hello, Godzilla
$ echo "console.log('Hello, Godzilla')" | bin/godzilla build -o hello
$ ./hello
Hello, Godzilla

Performance

There are still lots of works to get Godzilla to a stable state, but this is one preliminary benchmark for a simple script about program startup time:

$ echo "console.log('Hello, Godzilla')" | bin/godzilla build -o hello
$ time ./hello
Hello, Godzilla
./hello  0.00s user 0.00s system 30% cpu 0.013 total

$ echo "console.log('Hello, Godzilla')" > hello.js
$ time node hello.js
Hello, Godzilla
node hello.js  0.07s user 0.03s system 70% cpu 0.137 total

Talks

You can find my GopherCon 2017 lightening talk here.

Related Arts

관련 프로젝트 살펴보기

불러오는 중…